Movatterモバイル変換


[0]ホーム

URL:


CN105471619A - Network node devices and master-slave configuration method and system thereof - Google Patents

Network node devices and master-slave configuration method and system thereof
Download PDF

Info

Publication number
CN105471619A
CN105471619ACN201510481518.6ACN201510481518ACN105471619ACN 105471619 ACN105471619 ACN 105471619ACN 201510481518 ACN201510481518 ACN 201510481518ACN 105471619 ACN105471619 ACN 105471619A
Authority
CN
China
Prior art keywords
configuration
master
slave
information
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510481518.6A
Other languages
Chinese (zh)
Inventor
李鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Opzoon Technology Co Ltd
Original Assignee
Opzoon Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Opzoon Technology Co LtdfiledCriticalOpzoon Technology Co Ltd
Priority to CN201510481518.6ApriorityCriticalpatent/CN105471619A/en
Publication of CN105471619ApublicationCriticalpatent/CN105471619A/en
Pendinglegal-statusCriticalCurrent

Links

Landscapes

Abstract

The invention discloses a network node device and a master-slave configuration method and system thereof. The method comprises the steps that: one device is started and sends configuration information thereof to another device; the device receives information sent by another device in a preset time; if the device does not receive the information sent by another device in the preset time, then the device is configured as a master device and sends a configuration success information to another device; if the device receives the configuration success information sent by another device in the preset time, then the device is configured as a slave device; and if the device receives configuration information sent by another device in the preset time, then master-slave configuration is carried out according to the configuration information of the device. By adopting the above method, the master and slave devices are determined, and the tedious calculation and judgment of a complex algorithm adopted for unidirectional competition are reduced; in addition, the method is simple and easy, the loss or abnormity probability of important data of the system is greatly reduced, the maintenance workload and difficulty are lowered.

Description

Translated fromChinese
网络节点设备及其主从配置方法和系统Network node device and its master-slave configuration method and system

技术领域technical field

本发明涉及网络安全技术领域,特别涉及一种网络节点设备及其主从配置方法和系统。The invention relates to the technical field of network security, in particular to a network node device and a master-slave configuration method and system thereof.

背景技术Background technique

随着网络应用的复杂化,一些网络的关键节点承载了大量的业务。如果这些关键的网络节点出现问题,那么可能会导致与其连接的各个节点的业务无法正常进行。为了保证网络节点的高可靠性,通常的做法是使用双机设备,即在一个节点同时配置两套网络设备,其中一个是主设备,另外一个是从设备。当主设备出现问题时,可以切换到从设备,由从设备代替主设备进行网络通信,而不会导致业务的中断,从而提供了一种保证网络可靠性的方法。由于接入的两台设备在软件和硬件上是完全一样的,因此必须要有个方法来确定,哪台设备是主设备,哪台设备是从设备。With the complexity of network applications, some key nodes of the network carry a large number of services. If there is a problem with these key network nodes, the business of each node connected to it may not be able to proceed normally. In order to ensure the high reliability of network nodes, the usual practice is to use dual-machine devices, that is, to configure two sets of network devices on one node at the same time, one of which is the master device and the other is the slave device. When there is a problem with the master device, it can be switched to the slave device, and the slave device replaces the master device for network communication without causing service interruption, thus providing a method to ensure network reliability. Since the two connected devices are exactly the same in software and hardware, there must be a way to determine which device is the master device and which device is the slave device.

现有技术中,通常是通过设备间的交互通信解决来决定设备是主设备还是从设备,在两台设备的启动过程中,两台设备通过复杂的协议,通过复杂的算法最终区分出主从关系,或者通过连续更换设备等频繁操作,效率很低,实现起来比较复杂,同时也增加了系统重要数据丢失或者异常的概率,增加了维护的工作量和难度。In the prior art, it is usually determined whether the device is the master device or the slave device through the interactive communication between the devices. During the startup process of the two devices, the two devices finally distinguish the master device from the master device through a complex protocol and a complex algorithm. relationship, or through frequent operations such as continuous replacement of equipment, the efficiency is very low, and it is more complicated to implement. At the same time, it also increases the probability of important system data loss or abnormality, and increases the workload and difficulty of maintenance.

发明内容Contents of the invention

有鉴于此,本发明的目的是提供一种网络节点设备及其主从配置方法和系统,此方法不需要复杂的算法就可以快速的确定设备的主备状态,简单易行,减少了系统繁重的计算判断,极大减小了系统重要数据丢失或者异常的概率,减轻了维护的工作量和难度。In view of this, the object of the present invention is to provide a network node device and its master-slave configuration method and system. This method can quickly determine the master-slave state of the device without complicated algorithms, is simple and easy, and reduces the system's heavy load. The calculation and judgment of the system greatly reduce the probability of important data loss or abnormality in the system, and reduce the workload and difficulty of maintenance.

根据本发明的一个方面,提供了一种网络节点设备的主从配置方法,所述设备预先设置为主设备或从设备,所述方法包括以下步骤:According to one aspect of the present invention, a master-slave configuration method of a network node device is provided, the device is preset as a master device or a slave device, and the method includes the following steps:

步骤S10,某设备启动并向另一设备发送其配置信息;Step S10, a device starts up and sends its configuration information to another device;

步骤S11,设备在预定时间内接收另一设备发送的信息;Step S11, the device receives information sent by another device within a predetermined time;

步骤S12,如果设备在预定时间内未接收到另一设备发送的信息,则该设备配置为主设备,并向另一设备发送出配置成功信息;Step S12, if the device does not receive the information sent by another device within a predetermined time, the device is configured as a master device and sends configuration success information to another device;

步骤S13,如果设备在预定时间内接收到另一设备发送的配置成功信息,则配置为从设备;Step S13, if the device receives configuration success information sent by another device within a predetermined time, it is configured as a slave device;

步骤S14,如果设备在预定时间内接收到另一设备发送的配置信息,则根据该设备的配置信息进行主从配置。Step S14, if the device receives the configuration information sent by another device within a predetermined time, perform master-slave configuration according to the configuration information of the device.

上述方案中,预先设置为主设备的配置信息为“我的配置是主设备”,预先设置为从设备的配置信息为“我的配置是从设备”,成功配置为主设备的配置成功信息为“我是主设备”,成功配置为从设备的配置成功信息为“我是从设备”。In the above scheme, the preset configuration information of the master device is "My configuration is the master device", the preset configuration information of the slave device is "My configuration is the slave device", and the configuration success information of the successful master device is "I am the master device", the successful configuration information of the successful configuration as the slave device is "I am the slave device".

上述方案中,所述步骤S10中,所述设备通过以太网报文的方式向另一设备发送自身的配置信息;In the above scheme, in the step S10, the device sends its own configuration information to another device through an Ethernet packet;

其中,所述以太网报文使用的是二层以太网报文,报文格式为“目的地址+源地址+长度”和/或“类型+数据”。Wherein, the Ethernet message uses a Layer 2 Ethernet message, and the message format is "destination address+source address+length" and/or "type+data".

上述方案中,所述步骤S12还包括:如果所述设备在成功配置为主设备后没有收到另一设备成为从设备的配置成功信息,则所述设备就持续发送该设备配置为主设备的配置成功信息。In the above solution, the step S12 further includes: if the device does not receive configuration success information that another device becomes a slave device after being successfully configured as a master device, then the device will continue to send the message that the device is configured as a master device. Configuration success information.

上述方案中,所述步骤S13还包括:所述设备配置为从设备后,向另一设备发送该设备配置为从设备的配置成功信息。In the above solution, the step S13 further includes: after the device is configured as a slave device, sending configuration success information indicating that the device is configured as a slave device to another device.

上述方案中,所述步骤S14中根据该设备的配置信息进行主从配置,具体包括如下步骤:In the above scheme, in the step S14, the master-slave configuration is performed according to the configuration information of the device, which specifically includes the following steps:

步骤S141,设备在预定时间内接收到另一设备发送的配置信息;Step S141, the device receives configuration information sent by another device within a predetermined time;

步骤S142,本设备和另一设备根据各自预先设置的配置信息进行主从配置;Step S142, the device and the other device perform master-slave configuration according to their respective preset configuration information;

步骤S143,本设备和另一设备相互发送配置成功信息。In step S143, the device and the other device send configuration success information to each other.

根据本发明的另一个方面,提供了一种网络节点设备,所述设备包括:发送模块、接收模块、配置模块;其中,According to another aspect of the present invention, a network node device is provided, and the device includes: a sending module, a receiving module, and a configuration module; wherein,

所述发送模块用于接收所述配置模块的指令以向外部设备发送信息所;The sending module is used to receive instructions from the configuration module to send information to external devices;

所述接收模块用于接收外部设备发送的信息并发送给所述配置模块;The receiving module is used to receive the information sent by the external device and send it to the configuration module;

所述配置模块连接到所述发送模块和所述接收模块,用于配置设备的主从配置状态并向发送模块发出指令。The configuration module is connected to the sending module and the receiving module, and is used for configuring the master-slave configuration state of the device and sending instructions to the sending module.

上述方案中,所述设备还包括预置模块,所述预置模块用于在所述设备启动前,将主设备的配置信息预先设置为“我的配置是主设备”,将从设备的配置信息预先设置为“我的配置是从设备”。In the above solution, the device further includes a preset module, and the preset module is used to preset the configuration information of the master device as "my configuration is the master device" before starting the device, and set the configuration information of the slave device to The information is pre-set to "My configuration is a slave device".

上述方案中,所述配置模块进一步用于:In the above scheme, the configuration module is further used for:

如果所述配置模块在预定时间内未从所述接收模块接收到另一设备发送的信息,则将该设备配置为主设备,并通过所述发送模块向另一设备发送出配置成功信息;If the configuration module does not receive the information sent by another device from the receiving module within a predetermined time, configure the device as a master device, and send configuration success information to another device through the sending module;

如果所述配置模块在预定时间内从所述接收模块接收到另一设备发送的配置成功信息,则将该设备配置为从设备,并通过所述发送模块向另一设备发送出配置成功信息;If the configuration module receives configuration success information sent by another device from the receiving module within a predetermined time, configure the device as a slave device, and send configuration success information to another device through the sending module;

如果所述配置模块在预定时间内从所述接收模块接收到另一设备发送的配置信息,则根据本设备的配置信息,将本设备配置为主设备或从设备,并通过所述发送模块向另一设备发送出配置成功信息。If the configuration module receives the configuration information sent by another device from the receiving module within a predetermined time, according to the configuration information of the device, configure the device as a master device or a slave device, and send the configuration information to the device through the sending module The other device sends out a successful configuration message.

根据本发明的再一个方面,还提供了一种网络节点设备的主从配置系统,所述系统至少包括两个如上所述的网络节点设备。According to still another aspect of the present invention, a master-slave configuration system of network node devices is also provided, and the system includes at least two network node devices as described above.

本发明所提供的网络节点设备的主从配置方法,不需要复杂的算法就可以快速的确定设备的主备状态,包括如下步骤:某设备启动并向另一设备发送其配置信息;设备在预定时间内接收另一设备发送的信息;如果设备在预定时间内未接收到另一设备发送的信息,则该设备配置为主设备,并向另一设备发送出配置成功信息;如果设备在预定时间内接收到另一设备发送的配置成功信息,则配置为从设备;如果设备在预定时间内接收到另一设备发送的配置信息,则根据该设备的配置信息进行主从配置。通过上述方法确认出主从设备,减少了单向竞争所采取复杂算法的繁琐计算判断,简单易行,极大减小了系统重要数据丢失或者异常的概率,减轻了设备维护的工作量和难度。The master-slave configuration method of the network node device provided by the present invention can quickly determine the master-slave state of the device without complex algorithms, including the following steps: a device starts and sends its configuration information to another device; Receive the information sent by another device within a predetermined time; if the device does not receive the information sent by another device within the predetermined time, the device will be configured as the master device and send configuration success information to the other device; if the device within the predetermined time If the device receives the configuration success information sent by another device within a predetermined time, it will be configured as a slave device; if the device receives the configuration information sent by another device within a predetermined time, it will perform master-slave configuration according to the configuration information of the device. The master-slave device is confirmed by the above method, which reduces the tedious calculation and judgment of complex algorithms adopted in one-way competition. It is simple and easy to implement, which greatly reduces the probability of important data loss or abnormality in the system, and reduces the workload and difficulty of equipment maintenance. .

附图说明Description of drawings

图1显示了本发明优选实施例的网络节点设备的主从配置方法流程图;Fig. 1 has shown the master-slave configuration method flowchart of the network node equipment of preferred embodiment of the present invention;

图2显示了图1中步骤S14的子流程图;Fig. 2 has shown the sub-flow chart of step S14 in Fig. 1;

图3显示本发明优选实施例的网络节点设备的内部结构示意图。Fig. 3 shows a schematic diagram of the internal structure of a network node device in a preferred embodiment of the present invention.

具体实施方式detailed description

为使本发明的目的、技术方案和优点更加清楚,下面结合附图对本发明作进一步的详细说明。应该理解,这些描述只是示例性的,而并非要限制本发明的范围。此外,在以下说明中,省略了对公知结构和技术的描述,以避免不必要地混淆本发明的概念。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. It should be understood that these descriptions are exemplary only, and are not intended to limit the scope of the present invention. Also, in the following description, descriptions of well-known structures and techniques are omitted to avoid unnecessarily obscuring the concept of the present invention.

图1显示了本发明优选实施例的网络节点设备的主从配置方法的流程图。Fig. 1 shows a flowchart of a master-slave configuration method of a network node device in a preferred embodiment of the present invention.

如图1所示,本实施例的网络节点设备的主从配置方法,用于对网络节点中预先配置为主设备和从设备的两台网络设备进行主从设备的配置,这里,主设备的配置信息预先设置为主设备,从设备的配置信息预先设置为从设备,所述方法包括如下步骤:As shown in Figure 1, the master-slave configuration method of the network node device in this embodiment is used to configure the master-slave device for two network devices in the network node that are pre-configured as a master device and a slave device. Here, the master device The configuration information is preset as the master device, and the configuration information of the slave device is preset as the slave device, and the method includes the following steps:

步骤S10,某设备启动并向另一设备发送其配置信息。In step S10, a certain device starts up and sends its configuration information to another device.

配置信息表示该设备预先配置的主从配置信息。例如,主设备发出的配置信息是“我的配置是主设备”,从设备发出的配置信息是“我的配置是从设备”。这里所体现的是两台设备的信息交互,信息的交互可以通过以太网报文的方式发送自身的配置信息;其中,所述以太网报文可以使用二层以太网报文,报文格式为“目的地址+源地址+长度”和/或“类型+数据”。The configuration information represents the pre-configured master-slave configuration information of the device. For example, the configuration information sent by the master device is "my configuration is the master device", and the configuration information sent by the slave device is "my configuration is the slave device". What is reflected here is the information exchange between two devices, and the information exchange can send its own configuration information through the Ethernet message; wherein, the Ethernet message can use a layer 2 Ethernet message, and the message format is "Destination Address + Source Address + Length" and/or "Type + Data".

步骤S11,设备在预定时间内接收另一设备发送的信息。In step S11, the device receives information sent by another device within a predetermined time.

设备启动并向另一设备发送其配置信息后,不会立即配置为主设备并接入网络运行,而是先等待预定时间,在该预定时间内接收另一设备发送的信息,并根据信息的接收情况来执行相应的步骤。该预定时间可以根据需要进行设定,例如设定为1秒钟。After the device starts and sends its configuration information to another device, it will not be configured as the master device immediately and connected to the network to run, but wait for a predetermined time, receive the information sent by another device within the predetermined time, and according to the information Receive the situation to perform the corresponding steps. The predetermined time can be set as required, for example, set to 1 second.

步骤S12,如果设备在预定时间内未接收到另一设备发送的信息,则该设备配置为主设备,并向另一设备发送出配置成功信息。Step S12, if the device does not receive the information sent by another device within a predetermined time, the device is configured as a master device, and sends configuration success information to the other device.

如果本端设备在预定时间(例如等待一秒钟)内没有收到另一设备发送过来的配置信息,则表示本端设备首先启动并配置为主设备,接入网络运行,并向另一设备发送该设备配置为主设备的配置成功信息,如果没有收到对端成为从设备的确认消息,那么本端就持续发送该设备配置为主设备的配置成功信息,即不间断的每隔预定时间(例如1毫秒)发送配置成功信息。这里,配置成功信息表示该设备作为主设备成功启动后的配置信息,通常表述为“我是主设备”。If the local device does not receive the configuration information sent by another device within a predetermined time (for example, waiting for one second), it means that the local device is first started and configured as the master device, connected to the network to run, and sends another device Send the configuration success information that the device is configured as the master device. If the confirmation message that the peer end becomes the slave device is not received, the local end will continue to send the configuration success information that the device is configured as the master device, that is, every predetermined time without interruption (for example, 1 millisecond) to send configuration success information. Here, the configuration success information indicates the configuration information after the device is successfully started as the master device, and is usually expressed as "I am the master device".

步骤S13,如果设备在预定时间内接收到另一设备发送的配置成功信息,则配置为从设备。如果另一设备已经成为主设备,那么就会收到该另一设备发送的配置为主设备的配置成功信息,本端设备收到该信息,表示另一设备已经在先启动并配置为主设备运行了。此时,按照时间优先原则,本端设备会配置为从设备,并向另一设备发送配置为从设备的配置成功信息进行确认,并成为从设备。例如,如果主设备启动后在预定时间内收到了从设备发出的配置成功信息“我是主设备”,由于先启动的从设备已经成功配置为主设备,此时由于结果已经确定,因此即使是其预先配置为“从”,那么实际上也是主设备。这时,该主设备会改变配置为从设备,并向另一设备发送“我是从设备”的配置成功信息进行确认,并成为从设备。Step S13, if the device receives configuration success information sent by another device within a predetermined time, it is configured as a slave device. If another device has become the master device, it will receive the successful configuration information sent by the other device to be configured as the master device. The local device receives this information, indicating that the other device has been started first and configured as the master device. It works. At this time, according to the principle of time priority, the local device will be configured as a slave device, and send a configuration success message to the other device to confirm that it is configured as a slave device, and become a slave device. For example, if the master device receives the configuration success message "I am the master device" from the slave device within a predetermined time after startup, since the slave device started first has been successfully configured as the master device, the result has been determined at this time, so even the It is pre-configured as a "slave", so it is actually a master device. At this time, the master device will change the configuration to be a slave device, and send a configuration success message of "I am a slave device" to another device for confirmation, and become a slave device.

步骤S14,如果设备在预定时间内接收到另一设备发送的配置信息,则根据该设备的配置信息进行主从配置。Step S14, if the device receives the configuration information sent by another device within a predetermined time, perform master-slave configuration according to the configuration information of the device.

上述步骤中,所述发送配置信息、发送配置成功信息及确认信息,均可以通过以太网报文的方式进行发送,其中,所述以太网报文使用的是二层的以太网报文,报文格式为“目的地址+源地址+长度”和/或“类型+数据”。In the above steps, the sending configuration information, the sending configuration success information and the confirmation information can all be sent in the form of Ethernet messages, wherein the Ethernet messages use a layer-2 Ethernet message, and the message The text format is "destination address + source address + length" and/or "type + data".

图2显示了图1中步骤S14的子流程图。FIG. 2 shows a sub-flow chart of step S14 in FIG. 1 .

如图2所示,图1中所示的步骤S14具体包括如下步骤:As shown in Figure 2, step S14 shown in Figure 1 specifically includes the following steps:

步骤S141,设备在预定时间内接收到另一设备发送的配置信息。Step S141, the device receives configuration information sent by another device within a predetermined time.

如果设备在预定时间内接收到另一设备发送的配置信息,则表示对端设备还没有成功配置为主设备。此时,对端设备也会收到本端设备发出的配置信息,即双方都收到了对端的配置信息。这种情况下,表示两台设备在同时竞争成为主设备。If the device receives the configuration information sent by another device within the predetermined time, it means that the peer device has not been successfully configured as the master device. At this time, the peer device will also receive the configuration information sent by the local device, that is, both parties have received the configuration information of the peer. In this case, it means that two devices are competing to become the master device at the same time.

步骤S142,本设备和另一设备根据各自预先设置的配置信息进行主从配置。In step S142, the device and the other device perform master-slave configuration according to their preset configuration information.

本步骤中,根据预先设置的主从配置信息来配置主设备和从设备,预先配置为主设备的设备成功配置为主设备,预先配置为从设备的设备相应的配置为从设备。In this step, the master device and the slave device are configured according to the pre-set master-slave configuration information. The device pre-configured as the master device is successfully configured as the master device, and the device pre-configured as the slave device is correspondingly configured as the slave device.

例如,如果本端设备的配置信息为“我的配置是主设备”,则配置为主设备,并向另一设备(对端设备)发出“我是主设备”的配置成功信息。另一方面,对端设备的配置信息相应的为“我的配置是从设备”,则该对端设备根据其预设的配置信息配置为从设备,并向本端设备发出“我是从设备”的配置成功信息。For example, if the configuration information of the local device is "my configuration is the master device", configure it as the master device, and send a configuration success message of "I am the master device" to the other device (peer device). On the other hand, if the configuration information of the peer device is correspondingly "My configuration is a slave device", then the peer device is configured as a slave device according to its preset configuration information, and sends "I am a slave device" to the local device. " configuration success message.

本步骤中,可以根据预先设置的主从配置信息来配置主设备和从设备。也即,预先配置为主设备的设备会成功配置为主设备,接入网络运行,而预先配置为从设备的设备会相应的配置为从设备,仅仅热机备用。这里,可以在两台设备启动前,预先设置两台设备的主从配置信息,其中一台设备预先设置为主设备,另一台设备预先设置为从设备。In this step, the master device and the slave device may be configured according to preset master-slave configuration information. That is to say, the device that is pre-configured as the master device will be successfully configured as the master device and connected to the network to run, while the device that is pre-configured as the slave device will be correspondingly configured as the slave device, and it will only be hot-started for standby. Here, before the two devices are started, the master-slave configuration information of the two devices can be preset, one of the devices is preset as the master device, and the other device is preset as the slave device.

步骤S143,本设备和另一设备相互发送配置成功信息。In step S143, the device and the other device send configuration success information to each other.

主设备发送该设备配置为主设备的配置成功信息给对端,并成为主设备;对端收到消息后,发送该设备配置为从设备的配置成功信息进行确认,并成为从设备。The master device sends the configuration success information that the device is configured as a master device to the peer end, and becomes the master device; after receiving the message, the peer end sends a configuration success message that the device is configured as a slave device for confirmation, and becomes a slave device.

在成功配置一个设备配置是主,一个设备配置是从后,配置为主的设备发送该设备配置为主设备的配置成功信息给对端,如发送“我是主设备”给对端,并成为主设备;对端收到消息后,也就是此时配置为从的设备,该设备配置为从设备的配置成功信息进行确认,如发送“我是从设备”进行确认,并成为从设备。After successfully configuring a device as the master and a device as the slave, the device configured as the master sends the successful configuration information of the device as the master to the peer, such as sending "I am the master" to the peer, and becomes Master device; after the peer end receives the message, that is, the device configured as a slave device at this time, the device is configured as a slave device to confirm the configuration success information, such as sending "I am a slave device" to confirm and become a slave device.

本实施例通过对设备进行预配置的方式快速的解决主从关系的确定问题,具体的:两台设备都有预配置,一台预配置为主设备,一台预配置为从设备。两台设备启动时,由于概率原因,若两台设备启动时间不一致,导致后起来的设备在开始主备竞争时,先启动的设备已经是主设备,此时由于结果已经确定,因此,如果先启动的是预配置为从设备的设备,也会被确定为主设备,也就是说,即使是预配置为从设备,那么实际上也可能是主设备。若两台设备同时启动,则交互预配置的主备信息,这样就可以快速的判断出主从关系。简单来说,如果已经竞争出主从关系,那么就保持现状,如果没有竞争出,那么一切以预配置为准。This embodiment quickly solves the problem of determining the master-slave relationship by pre-configuring the devices. Specifically, two devices are pre-configured, one is pre-configured as the master device, and the other is pre-configured as the slave device. When two devices are started, due to probability reasons, if the start time of the two devices is inconsistent, when the device that starts up later starts the master-standby competition, the device that starts first is already the master device. At this time, the result has been determined, so if the first A device that is pre-configured as a slave device that is started will also be determined as a master device, that is, even if it is pre-configured as a slave device, it may actually be a master device. If the two devices start at the same time, they will exchange pre-configured master and backup information, so that the master-slave relationship can be quickly judged. To put it simply, if the master-slave relationship has been competed for, then keep the status quo; if not, then everything is subject to pre-configuration.

本实施例通过两台设备双向通信告知的方式确认出主从设备,减少了单向竞争所采取复杂算法的繁琐计算判断,简单易行,极大减小了系统重要数据丢失或者异常的概率,减轻了维护的工作量和难度。In this embodiment, the master-slave device is confirmed through two-way communication notification between two devices, which reduces the cumbersome calculation and judgment of complex algorithms adopted in one-way competition, is simple and easy to implement, and greatly reduces the probability of important data loss or abnormality in the system. The workload and difficulty of maintenance are reduced.

本发明还提供了一种网络节点设备。The invention also provides a network node device.

图3所示为本发明优选实施例的网络节点设备的内部结构示意图。Fig. 3 is a schematic diagram of the internal structure of a network node device in a preferred embodiment of the present invention.

如图3所示,本实施例所述的网络节点设备,所述设备包括发送模块11、接收模块12、配置模块13,所述模块功能具体描述如下:As shown in FIG. 3, the network node device described in this embodiment includes a sending module 11, a receiving module 12, and a configuration module 13. The functions of the modules are specifically described as follows:

发送模块11用于接收配置模块13的指令以向外部设备发送信息。例如,设备启动并向另一设备发送其配置信息,以及在设备成功配置完成后,向另一个设备发送配置成功信息。The sending module 11 is used to receive instructions from the configuration module 13 to send information to external devices. For example, a device starts up and sends its configuration information to another device, and after the device is successfully configured, sends a configuration success message to another device.

接收模块12用于接收外部设备发送的信息并发送给配置模块13。例如,设备启动后在预定时间内接收另一设备发送的信息,包括另一个设备发出的配置信息或配置成功信息。The receiving module 12 is used to receive the information sent by the external device and send it to the configuration module 13 . For example, after the device is started, it receives information sent by another device within a predetermined time, including configuration information or configuration success information sent by another device.

配置模块13连接到所述发送模块11和接收模块,用于配置设备的主从配置状态并向发送模块发出指令。所述配置模块13预先设置了配置信息,例如“我的配置是主设备”或“我的配置是从设备”。The configuration module 13 is connected to the sending module 11 and the receiving module, and is used for configuring the master-slave configuration state of the device and sending instructions to the sending module. The configuration module 13 presets configuration information, such as "my configuration is a master device" or "my configuration is a slave device".

具体的,在设备启动时,配置模块13向发送模块11发出指令以向另一设备发送其配置信息。在设备成功配置完成后,配置模块13向发送模块11发出指令,向另一个设备发送配置成功信息。Specifically, when the device is started, the configuration module 13 sends an instruction to the sending module 11 to send its configuration information to another device. After the device is successfully configured, the configuration module 13 sends an instruction to the sending module 11 to send configuration success information to another device.

另一方面,设备启动后,如果配置模块13在预定时间内未从接收模块12接收到另一设备发送的信息,则配置模块13将该设备配置为主设备,并通过发送模块11向另一设备发送出配置成功信息。On the other hand, after the device starts, if the configuration module 13 does not receive the information sent by another device within a predetermined time, the configuration module 13 configures the device as a master device, and transmits information to another device through the sending module 11. The device sends a successful configuration message.

如果配置模块13在预定时间内从接收模块12接收到另一设备发送的配置成功信息,则配置模块13将该设备配置为从设备,并通过发送模块11向另一设备发送出配置成功信息。If the configuration module 13 receives configuration success information sent by another device from the receiving module 12 within a predetermined time, the configuration module 13 configures the device as a slave device, and sends configuration success information to another device through the sending module 11 .

如果配置模块13在预定时间内从接收模块12接收到另一设备发送的配置信息,则根据本设备的配置信息,将本设备配置为主设备或从设备,并通过发送模块11向另一设备发送出配置成功信息。If the configuration module 13 receives configuration information sent by another device from the receiving module 12 within a predetermined time, according to the configuration information of the device, the device is configured as a master device or a slave device, and sends a message to another device through the sending module 11. Send out configuration success message.

以上所述的配置信息的发送、配置成功信息的发送以及确认信息的发送,均可以通过以太网报文的方式发送自身的配置信息;其中,所述以太网报文使用的是二层的以太网报文,报文格式为“目的地址+源地址+长度”和/或“类型+数据”。The sending of the above-mentioned configuration information, the sending of the configuration success information and the sending of the confirmation information can all send their own configuration information in the form of Ethernet packets; Network message, the message format is "destination address + source address + length" and/or "type + data".

本实施例的网络节点设备,通过设置相应模块完成与另一个设备间的双向通信告知,确认所述设备是主设备还是从设备,减少了单向竞争所采取复杂算法的繁琐计算判断,简单易行,极大减小了系统重要数据丢失或者异常的概率,减轻了设备维护的工作量和难度。The network node device in this embodiment completes the two-way communication notification with another device by setting the corresponding module, and confirms whether the device is a master device or a slave device, which reduces the cumbersome calculation and judgment of complex algorithms used in one-way competition, and is simple and easy. It works, which greatly reduces the probability of important data loss or abnormality in the system, and reduces the workload and difficulty of equipment maintenance.

本发明还提供一种网络节点设备的主从配置系统的优选实施例,本实施例的网络节点设备的主从配置系统至少包括两个图3所示的网络节点设备,所述设备内部的模块与图3所示相同,其中,一个设备的发送模块与另一个设备的接收模块连,两个设备在初始阶段的地位、所含模块及模块的作用均相同,在此不再赘述。两个设备构成一个主从设备系统,完成主从设备的配置,当配置完成时,其中一个设备配置为主设备,另一个设备配置为从设备。The present invention also provides a preferred embodiment of a master-slave configuration system for network node devices. The master-slave configuration system for network node devices in this embodiment includes at least two network node devices as shown in FIG. 3 , and the modules inside the devices It is the same as that shown in Figure 3, where the sending module of one device is connected to the receiving module of the other device, and the positions, modules and functions of the two devices at the initial stage are the same, and will not be repeated here. Two devices constitute a master-slave system, and the configuration of the master-slave device is completed. When the configuration is completed, one device is configured as the master device, and the other device is configured as the slave device.

本实施例的网络节点主从设备的配置系统,通过两个设备设置双向通信告知的方式确认所述设备是主设备还是从设备,减少了单向竞争所采取复杂算法的繁琐计算判断,简单易行,极大减小了系统重要数据丢失或者异常的概率,减轻了设备维护的工作量和难度。The network node master-slave device configuration system of this embodiment confirms whether the device is a master device or a slave device by setting two-way communication notification between the two devices, which reduces the cumbersome calculation and judgment of complex algorithms used in one-way competition, and is simple and easy. It works, which greatly reduces the probability of important data loss or abnormality in the system, and reduces the workload and difficulty of equipment maintenance.

应当理解的是,本发明的上述具体实施方式仅仅用于示例性说明或解释本发明的原理,而不构成对本发明的限制。因此,在不偏离本发明的精神和范围的情况下所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。此外,本发明所附权利要求旨在涵盖落入所附权利要求范围和边界、或者这种范围和边界的等同形式内的全部变化和修改例。It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principle of the present invention, and not to limit the present invention. Therefore, any modification, equivalent replacement, improvement, etc. made without departing from the spirit and scope of the present invention shall fall within the protection scope of the present invention. Furthermore, it is intended that the appended claims of the present invention embrace all changes and modifications that come within the scope and metesques of the appended claims, or equivalents of such scope and metes and bounds.

Claims (10)

CN201510481518.6A2015-08-032015-08-03Network node devices and master-slave configuration method and system thereofPendingCN105471619A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201510481518.6ACN105471619A (en)2015-08-032015-08-03Network node devices and master-slave configuration method and system thereof

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201510481518.6ACN105471619A (en)2015-08-032015-08-03Network node devices and master-slave configuration method and system thereof

Publications (1)

Publication NumberPublication Date
CN105471619Atrue CN105471619A (en)2016-04-06

Family

ID=55608933

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201510481518.6APendingCN105471619A (en)2015-08-032015-08-03Network node devices and master-slave configuration method and system thereof

Country Status (1)

CountryLink
CN (1)CN105471619A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107426050A (en)*2017-06-222017-12-01普联技术有限公司Data relay transmission system and its construction method and wireless relay apparatus
CN109408297A (en)*2018-10-302019-03-01北京东土军悦科技有限公司A kind of method, apparatus of main and standby competition, equipment and storage medium
CN114363111A (en)*2022-03-212022-04-15深圳市高斯宝电气技术有限公司Method for determining parallel operation master-slave relationship of communication power supply equipment based on CAN protocol

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101132310A (en)*2007-09-072008-02-27华为技术有限公司 A kind of OMU equipment and the method for realizing OMU active-standby dual-machine
CN102684929A (en)*2012-06-062012-09-19广东威创视讯科技股份有限公司Dual-computer hot redundancy back-up method and dual-computer hot redundancy back-up system
CN103346903A (en)*2013-06-202013-10-09北京捷成世纪科技股份有限公司Dual-machine backup method and device
CN103731294A (en)*2013-03-282014-04-16深圳市金溢科技有限公司Method, device and system for two-machine hot-standby communication

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101132310A (en)*2007-09-072008-02-27华为技术有限公司 A kind of OMU equipment and the method for realizing OMU active-standby dual-machine
CN102684929A (en)*2012-06-062012-09-19广东威创视讯科技股份有限公司Dual-computer hot redundancy back-up method and dual-computer hot redundancy back-up system
CN103731294A (en)*2013-03-282014-04-16深圳市金溢科技有限公司Method, device and system for two-machine hot-standby communication
CN103346903A (en)*2013-06-202013-10-09北京捷成世纪科技股份有限公司Dual-machine backup method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107426050A (en)*2017-06-222017-12-01普联技术有限公司Data relay transmission system and its construction method and wireless relay apparatus
CN107426050B (en)*2017-06-222020-06-09普联技术有限公司Data relay transmission system, construction method thereof and wireless relay equipment
CN109408297A (en)*2018-10-302019-03-01北京东土军悦科技有限公司A kind of method, apparatus of main and standby competition, equipment and storage medium
CN114363111A (en)*2022-03-212022-04-15深圳市高斯宝电气技术有限公司Method for determining parallel operation master-slave relationship of communication power supply equipment based on CAN protocol

Similar Documents

PublicationPublication DateTitle
CN100568854C (en) A method and interface board for maintaining neighbor relationship
US8379645B2 (en)Link data transmission method, node and system
WO2011057540A1 (en)Method, device and system for updating ring network topology information
CN106789638B (en) A method and network device for processing routing
CN107465613B (en)Link aggregation interface communication state switching method and device
WO2017000832A1 (en)Mac address synchronization method, device and system
CN101924676B (en)Consultation method of control word ability and pseudowire establishing equipment
CN106937351A (en)A kind of session implementation method and core network element
WO2014187241A1 (en)Method and wireless device for controlling disconnection of a wireless device in a wi-fi direct group of a wireless network
CN105471619A (en)Network node devices and master-slave configuration method and system thereof
EP2621133A1 (en)Method and system for implementing pw control bit capability negotiation
CN103812769B (en)TRILL network construction method, node and system
CN106411574B (en)Management control method and device
US11095514B2 (en)System and method for propagating anima network objective changes
WO2015003420A1 (en)Resource deployment method for cloud computing environment
CN109995541B (en) A kind of multicast data sending method and node device
CN111835551A (en) Method and apparatus for operating network components and monitoring entities in a communications infrastructure
CN101800700B (en)LSP pre-deleting method based on MPLS and device
CN102104529B (en)Method and equipment for realizing message transmission in provider bridge transfer (PBT) network
WO2017162172A1 (en)Method and device for adjusting restart-recovery time
CN103763170B (en)Looped network protecting method and device
CN103414646B (en)A kind of multicast service negotiation method and device
JP5304359B2 (en) COMMUNICATION CONTROL DEVICE, DATA SYNCHRONIZATION METHOD, AND DATA SYNCHRONIZATION PROGRAM
CN101764737B (en)Route aging method, device and router based on border gateway protocol
WO2016082572A1 (en)Method and apparatus for sending notification information

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
WD01Invention patent application deemed withdrawn after publication
WD01Invention patent application deemed withdrawn after publication

Application publication date:20160406


[8]ページ先頭

©2009-2025 Movatter.jp