The invention discloses a method for selecting a master device in multi-peer communication, which comprises the following steps: A, setting itself as a slave mode after broadcasting the device is powered on and recording the system time as the on-line time T1; B, monitoring the heartbeat packet on the network and timing it, if the master heartbeat packet is monitored within 3 times of T1 time, it will be maintained. The status continues to monitor the heartbeat packet on the network, and if it is not monitored to indicate that there is no master device in the network, the election process is started. Through the invention, a master control device can be selected as a management interface in the communication of multi-peer nodes, and the master control device can be re-elected when the network environment changes, such as the master control or slave device is off-line, restart, etc. It is guaranteed that only one master device exists in the network at any time. In the multi node network communication, the management function of the network is retained while the networking cost is reduced.
【技术实现步骤摘要】
一种多对等节点通信中主控设备选举方法
本专利技术涉及通信
,具体是一种多对等节点通信中主控设备选举方法。
技术介绍
在多节点通信中,出于管理的需要,通信节点中需要有一台设备承担用户管理接口及与其他通信设备对话的职能。这个设备通常也被叫做主控设备。常用的做法是在布设网络时就指定一台设备做主控设备,它可以收集其他设备的信息后做一个统一接口供用户管理查看或者和其他通信设备通信。但是这种做法有以下几种缺点:1、设备生产的时候要按照两种产品进行生产,生产管理成本较高。2、组网时候布设需要区分不同设备,增加施工维护复杂度。3、当原来的主控设备出故障或掉线时,整个通信网络出于瘫痪状态,通信系统的稳定性很低。其典型的场景是在电力线通信中,其组网方式为网络入口处布设一个通信节点,在用户端按照需求布设一个或者多个节点用于用户数据接入。入口处的通信节点也叫做主干节点。电力线主干节点因为布设在家庭网络入口处,靠近家庭网关或者前端的路由器,家庭网关和路由器本身通常都具备WiFi功能,如果主干节点设备也具备WiFi功能,就可能和家庭网关或路由器的WiFi互相冲突干扰。基于以上原因以及成 ...
【技术保护点】
1.一种多对等节点通信中主控设备选举方法,其特征在于,包含以下步骤:A、广播本设备上电后将自己置为从模式并记录系统时间作为上线时间T1;B、监控网络上的心跳包并计时,假如在3倍的T1时间内有监控到主控心跳包就保持状态继续监控网络上的心跳包,假如没有监控到说明现网没有主控设备在,则启动选举过程。
【技术特征摘要】
1.一种多对等节点通信中主控设备选举方法,其特征在于,包含以下步骤:A、广播本设备上电后将自己置为从模式并记录系统时间作为上线时间T1;B、监控网络上的心跳包并计时,假如在3倍的T1时间内有监控到主控心跳包就保持状态继续监控网络上的心跳包,假如没有监控到说明现网没有主控设备在,则启动选举过...
【专利技术属性】
技术研发人员:吴林,严晓谊,文剑清,胡安文,严晓冬,熊初星,秦兴,
申请(专利权)人:深圳市海亿康科技有限公司,
类型:发明
国别省市:广东,44
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。