CN113193997B - Redundant equipment configuration method and device, redundant system and redundant equipment - Google Patents

Redundant equipment configuration method and device, redundant system and redundant equipment Download PDF

Info

Publication number
CN113193997B
CN113193997B CN202110463043.3A CN202110463043A CN113193997B CN 113193997 B CN113193997 B CN 113193997B CN 202110463043 A CN202110463043 A CN 202110463043A CN 113193997 B CN113193997 B CN 113193997B
Authority
CN
China
Prior art keywords
redundant
master
mark
data
theme
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.)
Active
Application number
CN202110463043.3A
Other languages
Chinese (zh)
Other versions
CN113193997A (en
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.)
Hefei Yirui Communication Technology Co Ltd
Original Assignee
Hefei Yirui Communication 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 Hefei Yirui Communication Technology Co Ltd filed Critical Hefei Yirui Communication Technology Co Ltd
Priority to CN202110463043.3A priority Critical patent/CN113193997B/en
Publication of CN113193997A publication Critical patent/CN113193997A/en
Application granted granted Critical
Publication of CN113193997B publication Critical patent/CN113193997B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/0836Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability to enhance reliability, e.g. reduce downtime
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

The application provides a redundant equipment configuration method, a redundant equipment configuration device, a redundant system and redundant equipment. The method comprises the following steps: receiving theme data forwarded by a server; wherein the theme data comprises first theme data and second theme data; the first redundant equipment subscribes a first theme for detecting the communication condition of the first redundant equipment and a second theme for detecting the communication condition of the second redundant equipment in advance; based on the subject data, a master-slave relationship between itself and the second redundant device is determined. In the application, the server is introduced into the redundant system, so that the first redundant device determines the communication conditions of the first redundant device and the second redundant device of the same redundant group by acquiring the theme data corresponding to the pre-subscribed theme from the server, and further completes the determination of the master-slave relationship between the first redundant device and the second redundant device, thereby solving the problems that the two redundant devices in the traditional redundant system are directly connected in communication, and when any one redundant device connecting line is disconnected, the two main devices can appear.

Description

Redundant equipment configuration method and device, redundant system and redundant equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for configuring redundant devices, a redundant system, and a redundant device.
Background
For fields such as oil and gas pipelines, mines, high-speed rails and the like with high requirements on system safety and stability, redundancy design is generally carried out on core control equipment, so that the system has high anti-interference capability.
In the existing equipment redundancy system, two redundant equipment are directly connected through a switching device for communication, as shown in fig. 1, a redundant equipment A1 and a redundant equipment A2 are connected to the switching device through lines, so that the two redundant equipment transmit data between each other. After any connecting line in the two redundant devices is disconnected, the two redundant devices are disconnected, at the moment, the two redundant devices can set the redundant devices as main devices, and then the whole redundant system is enabled to have two main devices, and the normal work of the redundant system is influenced. In addition, when IP (Internet Protocol) addresses of two redundant devices are changed or multiple groups of redundant devices are connected to the switching device, if the IP addresses are changed, the redundant devices and IP addresses of the redundant groups need to be determined, which is cumbersome.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for configuring redundant devices, a redundant system, and a redundant device, so as to solve the problem that "when any one of the connection lines of two redundant devices is disconnected, two main devices may appear, and when an IP address of the redundant device changes, the IP address needs to be reconfigured, and the process is too complicated".
The invention is realized in the following way:
in a first aspect, an embodiment of the present application provides a redundant device configuration method, which is applied to a first redundant device in a redundant system, where the redundant system further includes a server and a second redundant device; the first redundant device and the second redundant device are both in communication connection with the server, the first redundant device and the second redundant device are a group of devices which are redundant to each other, and the method comprises the following steps: receiving theme data forwarded by the server; wherein the theme data comprises first theme data and second theme data; the first redundant equipment subscribes a first theme for detecting the communication condition of the first redundant equipment and a second theme for detecting the communication condition of the second redundant equipment in advance; the first theme data corresponds to the first theme, and the second theme data corresponds to the second theme; the first subject data is published by the first redundant device; the second subject data is published by the second redundant device; determining a master-slave relationship between itself and the second redundant device based on the subject data.
In the embodiment of the application, the server is introduced into the redundant system, so that the first redundant device determines the communication status of the first redundant device and the second redundant device of the same redundancy group by acquiring the theme data corresponding to the pre-subscribed theme from the server, and further completes the determination of the master-slave relationship between the first redundant device and the second redundant device. By the method, the stability and the expansibility of the redundant system are improved, and the configuration flow is simplified.
With reference to the technical solution provided by the first aspect, in some possible implementation manners, the data content of the theme data includes a random number, a first flag, a heartbeat signal, and a master-slave flag; the random number is used for determining a master-slave relationship, and is a number randomly generated when the theme data is issued; the first flag characterizes whether the first redundant device and the second redundant device have confirmed a master-slave relationship through the random number; when the first mark is a first mark, the first redundant device and the second redundant device are represented to not confirm the master-slave relationship through the random number, and when the first mark is a second mark, the first redundant device and the second redundant device are represented to confirm the master-slave relationship through the random number; when the first marks of the first theme data and the second theme data are the first marks, determining a master-slave relationship through the random number; the heartbeat signal is used for detecting whether the equipment of the server or the opposite-end equipment which are redundant with each other normally operates or not through the server; the master-slave mark is a master mark or a slave mark; the main mark represents that the corresponding redundant equipment is the main equipment, and the slave mark represents that the corresponding redundant equipment is the slave equipment; when the theme data is issued for the first time, the master-slave marks of the theme data are the slave marks.
In the embodiment of the application, the subject data includes a random number used for determining a master-slave relationship, a first flag representing whether the first redundant device and the second redundant device have confirmed the master-slave relationship through the random number, a heartbeat signal used for detecting the operating condition of the device, and a master-slave flag, so that when the first redundant device receives the first subject data and the second subject data, the master-slave relationship with the second redundant device can be determined according to the data content in the subject data.
With reference to the technical solution provided by the first aspect, in some possible implementation manners, when the first redundant device receives the subject data forwarded by the server for the first time, and the first subject data and the second subject data both include normal heartbeat signals, and a first flag in the second subject data is a first flag, the determining, based on the subject data, a master-slave relationship between itself and the second redundant device includes: comparing the numerical value of the random number in the first theme data with the numerical value of the random number in the second theme data; when the numerical value of the random number in the first theme data is larger than the numerical value of the random number in the second theme data, updating the master-slave mark as the master mark and updating the first mark as the second mark when the first theme data and the third theme data are issued next time; a third topic corresponding to the third topic data is a topic which is subscribed by the second redundant device in advance and used for detecting the communication condition of the first redundant device; when the value of the random number in the first theme data is smaller than the value of the random number in the second theme data, updating the master-slave flag to be the slave flag and updating the first flag to be the second flag when the first theme data and the third theme data are issued next time.
In the embodiment of the application, the subject data includes a random number which can be used for determining the master-slave relationship, the first marks of the first redundant device and the second redundant device are both the first mark and the master-slave mark is the slave mark when the subject data is issued for the first time, so that when the first redundant device receives the first subject data and the second subject data includes the first mark and the slave mark, the master-slave relationship can be determined through the random number, and after the master-slave relationship is determined, the first mark and the master-slave mark are updated, so that the master-slave relationship does not need to be determined repeatedly through the random number when the devices are normal in the following process, and the stability and reliability of the whole system are prevented from being affected.
With reference to the technical solution provided by the first aspect, in some possible implementation manners, when the first redundant device does not receive the theme data forwarded by the server for the first time, the determining, based on the theme data, a master-slave relationship between the first redundant device and the second redundant device includes: judging whether the first theme data and the second theme data comprise normal heartbeat signals or not; when the first theme data and the second theme data both comprise normal heartbeat signals, the master-slave relationship between the first theme data and the second redundant equipment is not updated; when the first theme data comprises abnormal heartbeat signals and the second theme data comprises normal heartbeat signals, updating the master-slave mark into the slave mark when the first theme data and the third theme data are issued next time; when the first subject data comprises a normal heartbeat signal and the second subject data comprises an abnormal heartbeat signal, updating the master-slave mark as the master mark when the first subject data and the third subject data are issued next time; when the first theme data and the second theme data both include abnormal heartbeat signals, the master-slave flag is updated to be the slave flag when the first theme data and the third theme data are issued next time.
In the embodiment of the application, after the master-slave relationship is determined between the first redundant device and the second redundant device for the first time, the operation states of the first redundant device and the second redundant device are determined according to the heartbeat signal in the received subject data, and whether the master-slave relationship is updated is determined. Through the mode, the problem that when a connecting line of any one redundant device is disconnected, two main devices can appear in the traditional direct communication connection between two redundant devices in the redundant system can be effectively solved. And the mode is convenient for grasping the communication state of each part of equipment in the whole redundant system.
With reference to the technical solution provided by the first aspect, in some possible implementation manners, when the first redundant device is reconnected after an exception occurs, the master-slave flag is the slave flag, and the first flag is the first identifier in the first subject data issued by the first redundant device for the first time; correspondingly, the method further comprises the following steps: receiving the theme data forwarded by the server for the first time after reconnection; determining a master-slave relationship between itself and the second redundant device based on the subject data.
In this embodiment of the application, since the first redundant device is abnormal, it can be known from the foregoing manner that the second redundant device is the master device, and the second redundant device determines the master-slave relationship through the random number, at this time, the first flag in the theme data issued by the second redundant device is the second flag, and the master-slave flag is the master flag. Although the topic data issued by the first redundant device is marked as the first identifier for the first time, the master-slave relationship between the first redundant device and the second redundant device is not determined based on the random number again, and the devices continue to operate according to the current master-slave relationship. And when the first redundant device issues the subject data next time, the first mark is updated to the second mark again. By the method, the redundant equipment recovered from the abnormity can be prevented from being directly used as the main equipment, and the stability of the system is prevented from being influenced.
With reference to the technical solution provided by the first aspect, in some possible implementation manners, the server is an MQTT server.
In a second aspect, an embodiment of the present application provides a redundant device configuration apparatus, which is applied to a first redundant device in a redundant system, where the redundant system further includes a server and a second redundant device; the first redundant device and the second redundant device are both in communication connection with the server, the first redundant device and the second redundant device are a group of devices which are redundant with each other, and the apparatus includes: the receiving module is used for receiving the theme data forwarded by the server; wherein the theme data comprises first theme data and second theme data; the first redundant equipment subscribes a first theme for detecting the communication condition of the first redundant equipment and a second theme for detecting the communication condition of the second redundant equipment in advance; the first theme data corresponds to the first theme, and the second theme data corresponds to the second theme; the first subject data is published by the first redundant device; the second subject data is published by the second redundant device; and the determining module is used for determining the master-slave relationship between the determining module and the second redundant equipment based on the theme data.
In a third aspect, an embodiment of the present application provides a redundancy system, including a server, a first redundancy device, and a second redundancy device; the first redundant equipment and the second redundant equipment are a group of equipment which are redundant with each other; the server is connected with the first redundant equipment and the second redundant equipment through switching equipment; the first redundant equipment is used for receiving the theme data forwarded by the server; wherein the theme data comprises first theme data and second theme data; the first redundant equipment subscribes a first theme for detecting the communication condition of the first redundant equipment and a second theme for detecting the communication condition of the second redundant equipment in advance; the first subject data is published by the first redundant device; the second subject data is published by the second redundant device; and determining a master-slave relationship between itself and the second redundant device based on the subject data.
With reference to the technical solution provided by the third aspect, in some possible implementations, the redundancy system further includes a third redundancy device and a fourth redundancy device; the third redundant equipment and the fourth redundant equipment are a group of equipment which are redundant with each other; the server is connected with the third redundant device and the fourth redundant device through the switching device.
In a fourth aspect, an embodiment of the present application provides a redundant device, including: a processor and a memory, the processor and the memory connected; the memory is used for storing programs; the processor is configured to invoke a program stored in the memory to perform a method as provided in the above-described first aspect embodiment and/or in combination with some possible implementations of the above-described first aspect embodiment.
In a fifth aspect, embodiments of the present application provide a storage medium having stored thereon a computer program, which, when executed by a processor, performs a method as provided in the embodiments of the first aspect described above and/or in connection with some possible implementations of the embodiments of the first aspect described above.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic diagram of a redundancy system in the prior art.
Fig. 2 is a schematic structural diagram of a redundancy system according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a redundant device according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of another redundancy system according to an embodiment of the present application.
Fig. 5 is a flowchart illustrating steps of a method for configuring a redundant device according to an embodiment of the present disclosure.
Fig. 6 is a flowchart illustrating steps of another redundant device configuration method according to an embodiment of the present application.
Fig. 7 is a block diagram of a redundant device configuration apparatus according to an embodiment of the present application.
Icon: 10-redundant systems; 101-a server; 102-a first redundant device; 103-a second redundant device; 104-a switching device; 105-a third redundant device; 106-a fourth redundant device; 20-redundant devices; 201-a processor; 202-a memory; 30-redundant device configuration means; 301-a receiving module; 302-determination module.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
In view of the problems that in the existing redundancy system, when any one of the connection lines of two redundancy devices is disconnected, two main devices appear, and when the IP address of the redundancy device changes, the IP address needs to be reconfigured again, which is a tedious process, the present inventors have studied and searched, and propose the following embodiments to solve the above problems.
Referring to fig. 2, a redundancy system 10 is provided according to an embodiment of the present application. The system comprises: a server 101, a first redundant device 102, and a second redundant device 103.
The first redundant device 102 and the second redundant device 103 are a group of devices that are redundant to each other. In a redundant system 10, one of the devices redundant with each other is a master device mainly used for service processing, and the other is a slave device as a backup. When the master device in the redundant system 10 is abnormal, the slave device is switched to the master device for service processing.
The first redundant device 102 and the second redundant device 103 are both communicatively coupled to the server 101. That is, in the embodiment of the present application, the server 101 is used to determine the master-slave relationship between the first redundant device 102 and the second redundant device 103.
Referring to fig. 3, a schematic structural diagram of a redundant device 20 applying a redundant device configuration method according to an embodiment of the present disclosure is shown. In the embodiment of the present application, the redundant Device 20 may be, but is not limited to, a Personal Computer (PC), a smart phone, a tablet PC, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and the like. Structurally, the redundant device 20 may include a processor 201 and a memory 202.
The processor 201 and the memory 202 are electrically connected, directly or indirectly, to enable data transmission or interaction, for example, the components may be electrically connected to each other via one or more communication buses or signal lines. The redundant device configuration means includes at least one software module that may be stored in the memory 202 in the form of software or Firmware (Firmware) or solidified in an Operating System (OS) of the redundant device 20. The processor 201 is configured to execute executable modules stored in the memory 202, such as software functional modules and computer programs included in the redundant device configuration apparatus, so as to implement the redundant device configuration method. The processor 201 may execute the computer program upon receiving the execution instruction.
The processor 201 may be an integrated circuit chip having signal processing capabilities. The Processor 201 may also be a general-purpose Processor, for example, a Central Processing Unit (CPU), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a discrete gate or transistor logic device, or a discrete hardware component, which can implement or execute the methods, steps, and logic blocks disclosed in the embodiments of the present Application. Further, a general purpose processor may be a microprocessor or any conventional processor or the like.
The Memory 202 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), and an electrically Erasable Programmable Read-Only Memory (EEPROM). The memory 202 is used for storing a program, and the processor 201 executes the program after receiving the execution instruction.
It should be understood that the configuration shown in fig. 3 is merely illustrative, and that the redundant device 20 provided in the embodiments of the present application may have fewer or more components than those shown in fig. 3, or may have a different configuration than that shown in fig. 3. Further, the components shown in fig. 3 may be implemented by software, hardware, or a combination thereof. Both the first redundant device 102 and the second redundant device 103 described above may employ the structure shown in fig. 3.
Referring to fig. 2, in the embodiment of the present application, the server 101 is connected to the first redundant device 102 and the second redundant device 103 through the switch device 104. The switching device 104 may be a network device such as a switch, router, etc. In other embodiments, the server 101 may also implement the connection with the first redundant device 102 and the second redundant device 103 through other connection manners. That is, the redundancy system 10 described above may be applied to a local area network as well as a wide area network. Correspondingly, the server 101 may be an MQTT (Message queue Telemetry Transport) server, or may also be a TCP (Transmission Control Protocol) server, which is not limited in this application.
Optionally, referring to fig. 4, the redundancy system 10 further includes a third redundancy device 105 and a fourth redundancy device 106.
The third redundant device 105 and the fourth redundant device 106 are a group of devices that are redundant to each other. A third redundant device 105 and a fourth redundant device 106 are also communicatively coupled to the server 101. In the embodiment of the present application, the determination of the master-slave relationship between the third redundant device 105 and the fourth redundant device 106 is implemented by the server 101.
It will be appreciated that more groups of devices that are redundant of each other may be included in the same redundant system 10. For example, one redundant system 10 may further include three sets of devices redundant to each other and four sets of devices redundant to each other, which is not limited in the present application.
Referring to fig. 5, fig. 5 is a flowchart illustrating steps of a redundancy device configuration method according to an embodiment of the present application, where the method is applied to the redundancy device 20 shown in fig. 3. It should be noted that, the redundant device configuration method provided in the embodiment of the present application is not limited by the order shown in fig. 5 and the following description, and for convenience of description, the redundant device configuration method is performed by using a first redundant device, and the method includes: step S101-step S102.
Step S101: and receiving the theme data forwarded by the server.
Wherein the theme data includes first theme data and second theme data. The first redundant equipment subscribes a first theme for detecting the communication condition of the first redundant equipment and a second theme for detecting the communication condition of the second redundant equipment in advance; the first theme data corresponds to a first theme, and the second theme data corresponds to a second theme; the first subject data is issued by a first redundant device; the second subject data is published by the second redundant device.
It should be noted that, the first redundant device may subscribe two topics (topic) to the server in advance, where the first topic is topicDeviceA1MACSelf, and the first topic is used to detect a communication status of the first redundant device itself, where A1 in the first topic is an identifier of the first redundant device. The second topic is topicDeviceA2MACOther, and the second topic is used to detect the communication condition of the second redundant device. Wherein A2 in the second topic is an identification of the second redundant device.
Correspondingly, the second redundant device also subscribes to two topics (topic) including a third topic and a fourth topic from the server in advance. The third topic is topicDeviceA1mac other, and the third topic is used for detecting the communication condition of the first redundant device. A1 in the third theme is an identification of the first redundant device. The fourth topic is topicDeviceA2MACSelf, and the fourth topic is used for detecting the communication condition of the second redundant device, where A2 in the fourth topic is an identifier of the second redundant device.
The first topic "topicDeviceA1MACSelf" and the third topic "topicDeviceA1MACOther" are both issued to the server by the first redundant device; the fourth topic "topicDeviceA2MACSelf" and the second topic "topicDeviceA2MACOther" are both issued to the server by the second redundant device. And the server forwards the received theme so that the redundant equipment subscribed with the corresponding theme can receive the theme data corresponding to the theme.
Step S102: based on the subject data, a master-slave relationship between itself and the second redundant device is determined.
And finally, the first redundant equipment determines the master-slave relationship between the first redundant equipment and the second redundant equipment according to the subscribed theme data.
It can be seen that, in the embodiment of the present application, a server is introduced into a redundancy system, so that a first redundancy device determines communication statuses of itself and a second redundancy device of a redundancy group in the same place by obtaining theme data corresponding to a pre-subscribed theme from the server, and further completes determination of a master-slave relationship between itself and the second redundancy device, thereby solving a problem of direct communication connection between two redundancy devices in a conventional redundancy system, and when a connection line of any one redundancy device is disconnected, the problem of two master devices does not occur, and meanwhile, when an IP address of any one redundancy device changes, information does not need to be reconfigured, and only the theme needs to be subscribed and published according to a current manner. By the method, the stability and the expansibility of the redundant system are improved, and the configuration flow is simplified.
The specific data content in the subject data is explained below.
In one embodiment, the data content of the subject data includes a random number (random), a first flag (firstFlag), a heartbeat signal (lifeSign), and a master-slave flag (leader flag). That is, the data contents of the first theme data and the second theme data each include: random number, first flag, heartbeat signal, and master-slave flag.
The data format of the theme data may be: first flag + heartbeat signal + random number + master slave flag.
Specifically, the random number is used for determining a master-slave relationship, and the random number is a number randomly generated when the theme data is issued. For example, when the first redundant device issues the topic data corresponding to the first topic "topicDeviceA1MACSelf", a random number is randomly generated.
The first flag characterizes whether the first redundant device and the second redundant device have confirmed a master-slave relationship by a random number. When the first mark is the second mark, the first redundant equipment and the second redundant equipment are represented to confirm the master-slave relationship through the random number; when the first marks of the first theme data and the second theme data are both the first marks, the master-slave relationship needs to be determined through a random number.
It should be noted that, when the first redundant device is powered on for the first time or recovers from an abnormality, the first redundant device defaults that the master-slave relationship is not confirmed by the random number, and at this time, the first marks in the theme data issued by the first redundant device are the first marks. And after the master-slave relationship between the first redundant equipment and the second redundant equipment is confirmed by the random number, the first redundant equipment updates the first mark to the second mark when the theme data is issued next time. And when the master-slave relationship is confirmed subsequently, when the first marks of the first subject data and the second subject data received by the first redundant equipment are the first marks, the master-slave relationship is determined through the random number.
In the embodiment of the present application, the first flag is true, and the second flag is false. That is, when the master-slave relationship is not confirmed by the random number between the first redundant device and the second redundant device, the first flag is true in the distributed subject data. Correspondingly, when the first redundant device is powered on for the first time or recovered from the abnormality, the first redundant device defaults that the master-slave relationship is not confirmed by the random number, and the first mark in the theme data issued by the first redundant device is true. Of course, in other embodiments, the first identifier and the second identifier may also be other characters, such as the first identifier is NO and the second identifier is YES, which is not limited in this application.
The heartbeat signal is used for detecting whether self equipment or opposite-end equipment which are redundant with each other normally operate through the server. It should be noted that whether the operation is normal here includes whether the device is in a normal operation state and whether the communication between the device and the server is normal. For example, when the first redundant device receives that the heartbeat signal in the first theme data is normal, it indicates that normal communication between the first redundant device and the server and the first redundant device is currently in a normal operating state at this time, and when the first redundant device receives that the heartbeat signal in the second theme data is abnormal, it indicates that communication between the second redundant device and the server is abnormal at this time or the second redundant device is not in a normal operating state at this time.
Whether the heartbeat signal is normal or not can be determined through the interval and jump of the heartbeat signal.
The master-slave mark is a master mark or a slave mark. The main mark represents that the corresponding redundant equipment is the main equipment, and the slave mark represents that the corresponding redundant equipment is the slave equipment; when the theme data is released for the first time, the master-slave marks of the theme data are slave marks. That is, when the first redundant device is powered on for the first time or recovers from an exception, the master-slave flag in the subject data issued by the first redundant device is the slave flag.
In summary, in the embodiment of the present application, the subject data includes a random number that can be used to determine a master-slave relationship, a first flag that represents whether the first redundant device and the second redundant device have confirmed the master-slave relationship through the random number, a heartbeat signal that is used to detect an operation status of the device, and a master-slave flag, so that when the first redundant device receives the first subject data and the second subject data, the master-slave relationship between the first redundant device and the second redundant device can be determined according to data content in the subject data.
In other implementations, the subject data may further include more or less data content, for example, the subject data may not include a first flag, and the first redundant device determines the master-slave relationship by using a random number each time the subject data is received. Accordingly, different data formats may be set according to different communication protocols. This application is not intended to be limiting.
How to determine the master-slave relationship by the topic data will be specifically described below.
When the first redundant device receives the subject data forwarded by the server for the first time, the first subject data and the second subject data both include normal heartbeat signals, and the first flag in the second subject data is the first flag, step S102 determines, based on the subject data, a master-slave relationship between itself and the second redundant device, including: comparing the numerical value of the random number in the first theme data with the numerical value of the random number in the second theme data; when the numerical value of the random number in the first theme data is larger than the numerical value of the random number in the second theme data, updating the master-slave mark into the master mark and updating the first mark into the second mark when the first theme data and the third theme data are issued next time; when the numerical value of the random number in the first theme data is smaller than the numerical value of the random number in the second theme data, the master-slave mark is updated to be the slave mark and the first mark is updated to be the second mark when the first theme data and the third theme data are issued next time.
The third theme corresponding to the third theme data is a theme which is pre-subscribed by the second redundant device and used for detecting the communication status of the first redundant device.
It should be noted that the above procedure is a case of determining the master-slave relationship between the first redundant device and the second redundant device for the first time. When the two redundant devices are initially powered on and connected to the server, the master-slave marks in the theme data issued by the two redundant devices are both slave marks, and the first marks in the theme data issued by the two redundant devices are both first marks, and at this time, the master-slave relationship between the two redundant devices needs to be determined according to the sizes of random numbers corresponding to the two subscribed themes.
Take the first flag as true and the second flag as false as an example. And when the numerical value of the random number in the first theme data is larger than the numerical value of the random number in the second theme data, determining that the first redundant equipment is the main equipment, updating the main mark and the slave mark into the main mark when the first redundant equipment issues the theme data next time, and updating the first mark into false. Similarly, the second redundant device updates the master-slave flag to the slave flag and updates the first flag to false when the subject data is issued next time. It should be noted that, as long as the master-slave relationship between the first redundant device and the second redundant device has been determined by the random number, the first flag is updated to false whether the first redundant device or the second redundant device is the master.
It can be seen that, since the subject data includes the random number that can be used to determine the master-slave relationship, the first flags of the first redundant device and the second redundant device are both the first identifier and the master-slave flags are both the slave flags when the first redundant device issues the subject data for the first time, when the first redundant device receives the first subject data and the second subject data both include the first identifier and the slave flags, the master-slave relationship can be determined by the random number, and after the master-slave relationship is determined, the first flag and the master-slave flags are updated, so that the master-slave relationship does not need to be determined repeatedly by the random number when the devices are normal in the following, and the influence on the stability and reliability of the entire system is avoided.
When the first redundant device does not receive the subject data forwarded by the server for the first time, step S102 determines, based on the subject data, a master-slave relationship between itself and the second redundant device, including: judging whether the first theme data and the second theme data comprise normal heartbeat signals or not; when the first theme data and the second theme data both comprise normal heartbeat signals, the master-slave relationship between the first theme data and the second redundant equipment is not updated; when the first theme data comprises an abnormal heartbeat signal and the second theme data comprises a normal heartbeat signal, updating the master-slave mark into the slave mark when the first theme data and the third theme data are issued next time; when the first subject data comprises a normal heartbeat signal and the second subject data comprises an abnormal heartbeat signal, updating the master-slave mark as the master mark when the first subject data and the third subject data are issued next time; and when the first theme data and the second theme data both comprise abnormal heartbeat signals, updating the master-slave mark into the slave mark when the first theme data and the third theme data are issued next time.
The above process is a case where the master-slave relationship is not determined for the first time between the first redundant device and the second redundant device. That is, during the operation of the entire redundant system, the first redundant device and the second redundant device will periodically issue the subject data. In the process, the first redundant device and the second redundant device may be disconnected from the server or abnormal in signal connection, and the master-slave relationship between the first redundant device and the second redundant device is re-determined according to the heartbeat signal.
Specifically, when the first subject data and the second subject data received by the first redundant device both include normal heartbeat signals, it indicates that normal communications are both established between the first redundant device and the server and between the second redundant device and the server, and the entire redundant system is operating normally, and at this time, the master-slave relationship between the first redundant device and the second redundant device is not updated. That is, when the host is the master device, the master-slave flag is still set as the master flag in the next issued theme data; when the slave device is the slave device, the master-slave flag is still set as the slave flag in the theme data issued next time.
When the first subject data received by the first redundant device includes an abnormal heartbeat signal and the second subject data includes a normal heartbeat signal, it indicates that the communication between the first redundant device and the server is abnormal or the first redundant device is not in a normal operating state, and the first redundant device needs to be set as a slave device. That is, when the host is the master device, the master-slave flag is changed to the slave flag in the next issued theme data; and when the device is a slave device, the master-slave mark is not changed in the next issued theme data, and the master-slave mark is still set as the slave mark.
When the first subject data received by the first redundant device includes a normal heartbeat signal and the second subject data includes an abnormal heartbeat signal, it indicates that the communication between the second redundant device and the server is abnormal or the second redundant device is not in a normal operating state, and at this time, the first redundant device needs to be set as a master device. That is, when the host is a master device, the master-slave flag is still set as the master flag without changing the master-slave flag in the next distributed theme data. When the device is a slave device, the master-slave mark is changed into the master mark in the next issued theme data.
In addition, when the first subject data and the second subject data received by the first redundant device both include abnormal heartbeat signals, it is indicated that abnormality occurs between the second redundant device and the server and between the second redundant device and the server, and at this time, the master-slave flag is updated to the slave flag in the subject data issued next time. That is, when the device itself is the master device, the master-slave flag is changed to the slave flag in the next issued theme data; and when the device is a slave device, the master-slave mark is not changed in the next issued theme data, and the master-slave mark is still set as the slave mark.
Therefore, after the master-slave relationship is determined between the first redundant device and the second redundant device for the first time, the operation conditions of the first redundant device and the second redundant device can be determined according to the heartbeat signal in the received subject data, and whether the master-slave relationship is updated or not can be further determined. Through the mode, the problem that when a connecting line of any one redundant device is disconnected, two main devices can appear in the traditional direct communication connection between two redundant devices in the redundant system can be effectively solved. And the mode is convenient for grasping the communication state of each part of equipment in the whole redundant system.
When the first redundant equipment is reconnected after abnormality occurs, the master-slave mark is a slave mark and the first mark is a first mark in first theme data issued by the first redundant equipment for the first time. At the moment, the first redundant equipment receives the theme data forwarded by the server for the first time after the first redundant equipment is reconnected; and determining a master-slave relationship between itself and the second redundant device based on the subject data.
The above process is a situation when the first redundant device is powered on and reconnected after the first redundant device is abnormal. Since the first redundant device is abnormal, it can be known from the foregoing steps that the second redundant device is the master device, and the second redundant device determines that the master-slave relationship has been determined by the random number, the first mark in the subject data issued by the second redundant device is the second mark, and the master-slave mark is the master mark. Although the topic data issued by the first redundant device is marked as the first identifier for the first time, the master-slave relationship between the first redundant device and the second redundant device is not determined based on the random number again, and the devices continue to operate according to the current master-slave relationship. And when the first redundant device issues the theme data next time, the first mark is updated to the second mark again. By the method, the problem that the stability of the system is influenced because the redundant equipment recovered from the abnormity is directly used as the main equipment can be avoided.
Specifically, the update logic of the first flag of the first redundant device may refer to table one, where the first flag is true and the second flag is false.
Watch 1
Figure BDA0003040759220000161
Figure BDA0003040759220000171
It should be noted that, in the first table, the serial number (1) is for the case that the first redundant device and the second redundant device are both connected for the first time, and at this time, the first flag is true, and after the master-slave relationship is determined by a random number, the first flag is subsequently set to false.
The sequence number (2) is for the case that the first redundant device is powered on and reconnected, and the second redundant device is a master device, at this time, the first flag of the first redundant device is true, and the first flag of the second redundant device is false, at this time, since the second redundant device is a master device, and the first redundant device is defaulted to be a slave device when powered on, the master-slave relationship does not need to be re-determined, but the first flag of the subsequent first redundant device is set to be false.
The sequence number (3) is that the second redundant device is powered on to be reconnected, the first redundant device is a master device, the first mark of the first redundant device is false at this time, the first mark of the second redundant device is true, at this time, since the first redundant device is the master device and the second redundant device is powered on, the master-slave relationship does not need to be determined again, and the first mark of the first redundant device is not changed subsequently.
The condition aimed at by the sequence number (4) is that the first redundant equipment and the second redundant equipment are both in normal power-on connection, and at the moment, the first mark is not changed.
The above is a description of how to determine the master-slave relationship by the topic data in different situations. In order to better understand the above process, a specific example is described below, please refer to fig. 6, and still take the implementation process of the first redundant device as an example. First, a first redundant device is powered on, a random number can be generated when the first redundant device is powered on, the first redundant device defaults to be a slave device when the first redundant device is powered on, then the first redundant device is connected to a server to subscribe a theme, and the subscribed theme comprises topicdeviceA1MACSelf and topicdeviceA2MACOther. Two topics are then published, topicDeviceA1MACSelf and topicDeviceA1MACOther, respectively. And after the two themes are released, receiving theme data forwarded by the server.
In the first case, if a normal heartbeat signal is received, it is determined whether a normal heartbeat signal of an opposite terminal (i.e., a second redundant device) is received, and if a normal heartbeat signal of the opposite terminal is received, it is determined whether a first connection is performed, specifically, it is determined whether two first markers are both first markers, and if both first markers are both first markers, a master-slave relationship is determined according to the size of a random number. When the random number of the self is larger than that of the opposite terminal, the self is set as the main equipment, and the corresponding opposite terminal is the slave equipment. When the random number of the self is smaller than that of the opposite terminal, the self is set as the slave equipment, and the corresponding opposite terminal is the main equipment.
In the second case, if the normal heartbeat signal is received, but the normal heartbeat signal of the opposite terminal is not received, the device is set as the master device, if the device is the master device before, the processing is not performed at this time, if the device is the slave device before, the device is updated as the master device at this time, and correspondingly, the opposite terminal is the slave device.
In the third case, if the normal heartbeat signal of the self is not received, whether the normal heartbeat signal of the opposite terminal is received is judged, if the normal heartbeat signal of the opposite terminal is received, the self is set as a slave device, if the normal heartbeat signal of the opposite terminal is received, the slave device does not perform processing, if the normal heartbeat signal of the opposite terminal is the slave device, if the normal heartbeat signal of the opposite terminal is the master device, the self is updated to be the slave device, and if the normal heartbeat signal of the opposite terminal is the master device.
In the fourth situation, if the normal heartbeat signal of the self is not received and the normal heartbeat signal of the opposite terminal is not received, the self is set as the slave device, if the self is the slave device before, the processing is not carried out at the moment, if the self is the master device before, the self is updated to be the slave device at the moment, and correspondingly, the opposite terminal is the master device.
And after each condition is judged, the theme is released again to execute the judging process again.
The above is an example of the method for configuring the redundant device by using the first redundant device, and it can be understood that the execution process of the second redundant device is the same as that of the first redundant device, and repeated description is omitted to avoid redundancy. Correspondingly, when the redundant system further includes a third redundant device and a fourth redundant device, the executed processes can refer to the foregoing embodiments, which are not described in detail herein.
Referring to fig. 7, based on the same inventive concept, an embodiment of the present application further provides a redundant device configuration apparatus 30, including: a receiving module 301 and a determining module 302.
A receiving module 301, configured to receive the theme data forwarded by the server; wherein the theme data comprises first theme data and second theme data; the first redundant equipment subscribes a first theme for detecting the communication condition of the first redundant equipment and a second theme for detecting the communication condition of the second redundant equipment in advance; the first theme data corresponds to the first theme, and the second theme data corresponds to the second theme; the first subject data is published by the first redundant device; the second subject data is published by the second redundant device.
A determining module 302, configured to determine a master-slave relationship between itself and the second redundant device based on the subject data.
Optionally, when the first redundant device receives the subject data forwarded by the server for the first time, the first subject data and the second subject data both include normal heartbeat signals, and the first flag in the second subject data is the first identifier, the determining module 302 is specifically configured to compare the numerical values of the random number in the first subject data and the random number in the second subject data; when the numerical value of the random number in the first theme data is larger than the numerical value of the random number in the second theme data, updating the master-slave mark as the master mark and updating the first mark as the second mark when the first theme data and the third theme data are issued next time; a third topic corresponding to the third topic data is a topic which is subscribed by the second redundant device in advance and used for detecting the communication condition of the first redundant device; when the value of the random number in the first theme data is smaller than the value of the random number in the second theme data, updating the master-slave flag to be the slave flag and updating the first flag to be the second flag when the first theme data and the third theme data are issued next time.
Optionally, when the first redundant device does not receive the theme data forwarded by the server for the first time, the determining module 302 is further specifically configured to determine whether the first theme data and the second theme data include a normal heartbeat signal; when the first theme data and the second theme data both comprise normal heartbeat signals, the master-slave relationship between the first theme data and the second redundant equipment is not updated; when the first subject data comprises an abnormal heartbeat signal and the second subject data comprises a normal heartbeat signal, updating the master-slave mark to be the slave mark when the first subject data and the third subject data are issued next time; when the first theme data comprises a normal heartbeat signal and the second theme data comprises an abnormal heartbeat signal, updating the master-slave mark into the master mark when the first theme data and the third theme data are issued next time; when the first theme data and the second theme data both include abnormal heartbeat signals, the master-slave flag is updated to be the slave flag when the first theme data and the third theme data are issued next time.
Optionally, when the first redundant device is reconnected after an abnormality occurs, the master-slave flag is the slave flag in the first subject data issued by the first redundant device for the first time, and when the first flag is the first flag, the receiving module 301 is further configured to receive the subject data forwarded by the server for the first time after the first redundant device is reconnected. Correspondingly, the determining module 302 is further configured to determine a master-slave relationship between itself and the second redundant device based on the subject data.
It should be noted that, as those skilled in the art can clearly understand, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Based on the same inventive concept, embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the computer program performs the methods provided in the above embodiments.
The storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (8)

1. A redundant equipment configuration method is characterized in that the method is applied to first redundant equipment in a redundant system, and the redundant system also comprises a server and second redundant equipment; the first redundant device and the second redundant device are both in communication connection with the server, and the first redundant device and the second redundant device are a group of devices which are redundant to each other, and the method comprises the following steps:
receiving theme data forwarded by the server; wherein the theme data comprises first theme data and second theme data; the first redundant equipment subscribes a first theme for detecting the communication condition of the first redundant equipment and a second theme for detecting the communication condition of the second redundant equipment in advance; the first theme data corresponds to the first theme, and the second theme data corresponds to the second theme; the first subject data is published by the first redundant device; the second subject data is published by the second redundant device;
determining a master-slave relationship between itself and the second redundant device based on the subject data;
the data content of the theme data comprises a random number, a first mark, a heartbeat signal and a master mark and a slave mark;
the random number is used for determining a master-slave relationship, and the random number is a number randomly generated when the theme data is issued;
the first flag characterizes whether the first redundant device and the second redundant device have confirmed a master-slave relationship through the random number; when the first mark is a second mark, the first redundant device and the second redundant device are characterized to pass the random number to confirm the master-slave relationship; when the first marks of the first theme data and the second theme data are the first marks, determining a master-slave relationship through the random number;
the heartbeat signal is used for detecting whether the equipment of the server or the opposite-end equipment which are redundant with each other normally operates or not through the server;
the master-slave mark is a master mark or a slave mark; the main mark represents that the corresponding redundant equipment is the main equipment, and the slave mark represents that the corresponding redundant equipment is the slave equipment; when the theme data is issued for the first time, the master-slave marks of the theme data are the slave marks;
when the first redundant equipment is reconnected after abnormality occurs, the master-slave mark is the slave mark in the first theme data issued by the first redundant equipment for the first time, and the first mark is the first mark;
correspondingly, the method further comprises the following steps:
receiving the theme data forwarded by the server for the first time after the server is reconnected;
determining a master-slave relationship between itself and the second redundant device based on the subject data.
2. The method for configuring redundant devices according to claim 1, wherein when the first redundant device receives the subject data forwarded by the server for the first time, the first subject data and the second subject data both include normal heartbeat signals, and a first flag in the second subject data is a first flag, the determining, based on the subject data, a master-slave relationship between itself and the second redundant device includes:
comparing the numerical value of the random number in the first theme data with the numerical value of the random number in the second theme data;
when the numerical value of the random number in the first theme data is larger than the numerical value of the random number in the second theme data, updating the master-slave mark into the master mark and updating the first mark into the second mark when the first theme data and the third theme data are issued next time; a third topic corresponding to the third topic data is a topic which is subscribed by the second redundant device in advance and used for detecting the communication condition of the first redundant device;
when the value of the random number in the first theme data is smaller than the value of the random number in the second theme data, updating the master-slave flag to be the slave flag and updating the first flag to be the second flag when the first theme data and the third theme data are issued next time.
3. The method according to claim 2, wherein when the first redundant device does not receive the subject data forwarded by the server for the first time, the determining, based on the subject data, a master-slave relationship between itself and the second redundant device includes:
judging whether the first theme data and the second theme data comprise normal heartbeat signals or not;
when the first theme data and the second theme data both comprise normal heartbeat signals, the master-slave relationship between the first theme data and the second redundant equipment is not updated;
when the first subject data comprises an abnormal heartbeat signal and the second subject data comprises a normal heartbeat signal, updating the master-slave mark to be the slave mark when the first subject data and the third subject data are issued next time;
when the first subject data comprises a normal heartbeat signal and the second subject data comprises an abnormal heartbeat signal, updating the master-slave mark as the master mark when the first subject data and the third subject data are issued next time;
when the first theme data and the second theme data both comprise abnormal heartbeat signals, updating the master-slave mark to be the slave mark when the first theme data and the third theme data are issued next time.
4. The method of claim 1, wherein the server is an MQTT server.
5. A redundant device configuration device is characterized in that the redundant device configuration device is applied to a first redundant device in a redundant system, and the redundant system also comprises a server and a second redundant device; the first redundant device and the second redundant device are both in communication connection with the server, the first redundant device and the second redundant device are a group of devices which are redundant with each other, and the apparatus includes:
the receiving module is used for receiving the theme data forwarded by the server; wherein the theme data comprises first theme data and second theme data; the first redundant equipment subscribes a first theme for detecting the communication condition of the first redundant equipment and a second theme for detecting the communication condition of the second redundant equipment in advance; the first theme data corresponds to the first theme, and the second theme data corresponds to the second theme; the first subject data is published by the first redundant device; the second subject data is published by the second redundant device;
a determining module, configured to determine a master-slave relationship between itself and the second redundant device based on the subject data;
the data content of the theme data comprises a random number, a first mark, a heartbeat signal and a master mark and a slave mark; the random number is used for determining a master-slave relationship, and is a number randomly generated when the theme data is issued; the first flag characterizes whether the first redundant device and the second redundant device have confirmed a master-slave relationship through the random number; when the first mark is a first mark, the first redundant device and the second redundant device are represented to not confirm the master-slave relationship through the random number, and when the first mark is a second mark, the first redundant device and the second redundant device are represented to confirm the master-slave relationship through the random number; when the first marks of the first theme data and the second theme data are the first marks, determining a master-slave relationship through the random number; the heartbeat signal is used for detecting whether the equipment of the server or the opposite-end equipment which are redundant with each other normally operates or not through the server; the master-slave mark is a master mark or a slave mark; the redundant equipment corresponding to the main mark characterization is main equipment, and the redundant equipment corresponding to the slave mark characterization is slave equipment; when the theme data is issued for the first time, the master-slave marks of the theme data are the slave marks;
and when the first redundant device is reconnected after abnormality occurs, the master-slave mark is the slave mark in the first subject data issued by the first redundant device for the first time, and when the first mark is the first mark, the receiving module is further configured to receive the subject data forwarded by the server for the first time after the first redundant device is reconnected, and the determining module is further configured to determine the master-slave relationship between the first redundant device and the second redundant device based on the subject data.
6. A redundant system is characterized by comprising a server, a first redundant device and a second redundant device; the first redundant equipment and the second redundant equipment are a group of equipment which are redundant with each other;
the server is connected with the first redundant equipment and the second redundant equipment through switching equipment;
the first redundant equipment is used for receiving the theme data forwarded by the server; wherein the theme data comprises first theme data and second theme data; the first redundant equipment subscribes a first theme for detecting the communication condition of the first redundant equipment and a second theme for detecting the communication condition of the second redundant equipment in advance; the first theme data corresponds to the first theme, and the second theme data corresponds to the second theme; the first subject data is published by the first redundant device; the second subject data is published by the second redundant device; determining a master-slave relationship between the second redundant equipment and the second redundant equipment based on the theme data;
the data content of the theme data comprises a random number, a first mark, a heartbeat signal and a master mark and a slave mark; the random number is used for determining a master-slave relationship, and is a number randomly generated when the theme data is issued; the first flag characterizes whether the first redundant device and the second redundant device have confirmed a master-slave relationship through the random number; when the first mark is a first mark, the first redundant device and the second redundant device are represented to not confirm the master-slave relationship through the random number, and when the first mark is a second mark, the first redundant device and the second redundant device are represented to confirm the master-slave relationship through the random number; when the first marks of the first theme data and the second theme data are the first marks, determining a master-slave relationship through the random number; the heartbeat signal is used for detecting whether the equipment of the server or the opposite-end equipment which are redundant with each other normally operates or not through the server; the master-slave mark is a master mark or a slave mark; the redundant equipment corresponding to the main mark characterization is main equipment, and the redundant equipment corresponding to the slave mark characterization is slave equipment; when the theme data is issued for the first time, the master-slave marks of the theme data are the slave marks;
when the first redundant device is reconnected after abnormality occurs, the master-slave mark is the slave mark in the first theme data issued by the first redundant device for the first time, and when the first mark is the first mark, the first redundant device is further used for receiving the theme data forwarded by the server for the first time after the first redundant device is reconnected; determining a master-slave relationship between itself and the second redundant device based on the subject data.
7. The redundancy system of claim 6, further comprising a third redundancy device and a fourth redundancy device; the third redundant equipment and the fourth redundant equipment are a group of equipment which are redundant with each other;
the server is connected with the third redundant device and the fourth redundant device through the switching device.
8. A redundant device, comprising: a processor and a memory, the processor and the memory connected;
the memory is used for storing programs;
the processor is configured to execute a program stored in the memory to perform the method of any of claims 1-4.
CN202110463043.3A 2021-04-27 2021-04-27 Redundant equipment configuration method and device, redundant system and redundant equipment Active CN113193997B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110463043.3A CN113193997B (en) 2021-04-27 2021-04-27 Redundant equipment configuration method and device, redundant system and redundant equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110463043.3A CN113193997B (en) 2021-04-27 2021-04-27 Redundant equipment configuration method and device, redundant system and redundant equipment

Publications (2)

Publication Number Publication Date
CN113193997A CN113193997A (en) 2021-07-30
CN113193997B true CN113193997B (en) 2023-04-07

Family

ID=76979791

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110463043.3A Active CN113193997B (en) 2021-04-27 2021-04-27 Redundant equipment configuration method and device, redundant system and redundant equipment

Country Status (1)

Country Link
CN (1) CN113193997B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599055A (en) * 2009-07-24 2009-12-09 原亮 Built-in isomerization CPU array system based on mutual pass bus
CN104079442A (en) * 2014-07-28 2014-10-01 南车株洲电力机车研究所有限公司 Real-time Ethernet based redundancy control device, as well as device redundancy system and method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6192397B1 (en) * 1996-06-20 2001-02-20 Nortel Networks Limited Method for establishing a master-slave relationship in a peer-to-peer network
CN1787319A (en) * 2005-10-26 2006-06-14 许继集团有限公司 Self-adaption method for defining protection state of circuit two sides
CN102868560B (en) * 2012-09-28 2015-01-14 南京恩瑞特实业有限公司 System and method for realizing hot standby of servers
CN109507866A (en) * 2018-12-07 2019-03-22 天津津航计算技术研究所 A kind of double-machine redundancy system and method based on network address drift technology

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599055A (en) * 2009-07-24 2009-12-09 原亮 Built-in isomerization CPU array system based on mutual pass bus
CN104079442A (en) * 2014-07-28 2014-10-01 南车株洲电力机车研究所有限公司 Real-time Ethernet based redundancy control device, as well as device redundancy system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Zynq平台的工业控制器双机冗余方案及应用;吴波等;《工业控制计算机》(第10期);全文 *

Also Published As

Publication number Publication date
CN113193997A (en) 2021-07-30

Similar Documents

Publication Publication Date Title
US8467303B2 (en) Method and apparatus for preventing network conflict
US8904055B2 (en) Switching control device and switching control method
CN107070731B (en) Master-slave arbitration method and system
CN111147567A (en) Service calling method, device, equipment and medium
CN112463702B (en) CPLD I2C channel address allocation method and system of cascade backplane
CN111399879A (en) Firmware upgrading system and method of CP L D
CN115550291B (en) Switch reset system and method, storage medium, and electronic device
CN111585835B (en) Control method and device for out-of-band management system and storage medium
CN112636987B (en) Cross-chain gateway determination method and system for block chain and terminal equipment
CN113193997B (en) Redundant equipment configuration method and device, redundant system and redundant equipment
CN109995597B (en) Network equipment fault processing method and device
JP2002032324A (en) System for controlling pci bus device connection
CN109428821B (en) Server, method for managing routing of mutual backup device and storage medium
US9491132B2 (en) System and method for providing push service for reducing network loads
US20230334155A1 (en) Data center security control module and control method thereof
CN113412480A (en) Mounting processing method and device, electronic equipment and computer readable storage medium
US20100229041A1 (en) Device and method for expediting feedback on changes of connection status of monitioring equipments
CN115098342A (en) System log collection method, system, terminal and storage medium
CN114189471A (en) Cross-device link aggregation group main/standby configuration method, system, terminal and storage medium
CN112350856A (en) Distributed service sign-off method and equipment
CN112783535A (en) Firmware upgrading method, embedded device and storage medium
CN112217718A (en) Service processing method, device, equipment and storage medium
CN109783136B (en) Configuration updating method, device, equipment and storage medium
CN116886463B (en) Cascade communication method, device, equipment and medium
CN110046120B (en) Data processing method, device and system based on IIC protocol and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant