Hot standby control method and related device
By receiving the synchronization data of the main control device in the backup control device and modifying the serial number, the problem of low takeover efficiency during main and standby switching is solved, and the system can quickly recover and stable operation when the main control is abnormal.
Patent Information
- Application Number
- CN202510255859.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-05-23
AI Technical Summary
In the prior art, the takeover efficiency is low during main and standby switching, resulting in the system being unable to quickly resume normal operation when the main control is abnormal.
By receiving and storing the first synchronization data of the main control device when the backup control device is in standby state, and modifying its serial number when the main control device is abnormal to simulate the master identity, quickly take over control of the controlled device.
It realizes the quick takeover of the control function when the main control device is abnormal, ensures the system's operation continuity, stability and reliability, and avoids the identification chaos caused by the controlled equipment due to the main and standby switching.
Smart Images

Figure CN120029035A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of hot standby technology, and in particular to a hot standby control method and related devices. Background Art
[0002] In the fields of industrial automation and the Internet of Things, control devices are usually used to uniformly control one or more controlled devices so that one or more controlled devices can perform specific steps as required. Therefore, the stability of the control device is one of the important factors affecting the normal operation of the industrial automation system or the Internet of Things system.
[0003] In order to improve the system stability of industrial automation systems and / or Internet of Things systems, the prior art proposes a master-slave control solution. When the main control device fails due to equipment failure, communication failure, etc., the backup control device can take over the control function of the main control device and control the controlled devices in the system, thereby ensuring that the system can operate normally when the main control device is abnormal.
[0004] However, the inventors have found through research that the prior art has the problem of low takeover efficiency during active / standby switching. Summary of the invention
[0005] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect of low takeover efficiency in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a hot standby control method, which is applied to a standby control device, and the method includes:
[0007] When the standby control device is in a standby state, receiving and storing first synchronization data; wherein the first synchronization data is control data generated when the main control device is in a normal operating state;
[0008] In response to a switching instruction issued by the server when the server detects that the main control device is in an abnormal operating state, the serial number of the standby control device is modified to the master control serial number, and the standby state is switched to the takeover state; wherein the master control serial number is the serial number configured by the main control device;
[0009] When the standby control device is in the takeover state, a first control instruction is issued to the controlled device based on the master control serial number and the first synchronization data.
[0010] In some embodiments, the method further comprises:
[0011] When it is determined that the main control device switches from the abnormal operating state to the normal operating state, the serial number of the backup control device is modified to a backup control serial number, and the takeover state is switched to the standby state; wherein the backup control serial number is different from the main control serial number.
[0012] In some embodiments, the method further comprises:
[0013] When the standby control device is in the takeover state, recording second synchronization data; wherein the second synchronization data is control data generated when the standby control device is in the takeover state;
[0014] When it is determined that the master control device switches from the abnormal operation state to the normal operation state, the second synchronization data is sent to the master control device, so that the master control device issues a second control instruction to the controlled device based on the second synchronization data.
[0015] In some embodiments, the method further comprises:
[0016] When the standby control device is in the takeover state, recording second synchronization data; wherein the second synchronization data is control data generated when the standby control device is in the takeover state;
[0017] An incremental synchronization mechanism is adopted to synchronize the second synchronization data to the server in real time, so that the server sends the second synchronization data to the main control device when it is determined that the main control device switches from the abnormal operation state to the normal operation state.
[0018] In some embodiments, the first synchronization data is obtained by the main control device synchronizing to the backup control device in real time using an incremental synchronization mechanism;
[0019] and / or
[0020] The first synchronization data includes first communication data between the master control device and the controlled device, and second communication data between the master control device and the server.
[0021] In some embodiments, the sending a first control instruction to the controlled device based on the master control serial number and the first synchronization data includes:
[0022] Determine the target communication protocol; the target communication protocol is Ethernet protocol or RS485 protocol;
[0023] Based on the master control serial number and the first synchronization data, the first control instruction is issued to the controlled device using the target communication protocol.
[0024] In a second aspect, an embodiment of the present application provides a hot standby control device, which is applied to a standby control device, and the device includes:
[0025] A first synchronization data receiving module is used to receive and store first synchronization data when the standby control device is in a standby state; wherein the first synchronization data is control data generated when the main control device is in a normal operating state;
[0026] A first serial number modification module, configured to modify the serial number of the standby control device to the master serial number in response to a switching instruction issued by the server when the server detects that the master control device is in an abnormal operating state, and switch from the standby state to the takeover state; wherein the master serial number is the serial number configured by the master control device;
[0027] The takeover module is used to send a first control instruction to the controlled device based on the master control serial number and the first synchronization data when the standby control device is in the takeover state.
[0028] In a third aspect, an embodiment of the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the hot standby control method applied to a standby control device as described in any of the above embodiments.
[0029] In a fourth aspect, an embodiment of the present application provides a backup control device, the backup control device comprising: one or more processors, and a memory;
[0030] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the hot standby control method applied to a standby control device described in any of the above embodiments are executed.
[0031] In a fifth aspect, an embodiment of the present application provides a hot standby control system, including:
[0032] A main control device, configured to send first synchronization data when the main control device is in a normal operating state;
[0033] The server is used to detect the operating state of the main control device and send a switching instruction when it is detected that the main control device is in an abnormal operating state;
[0034] The backup control device described in any of the above embodiments is used to receive and store the first synchronization data when the backup control device is in a standby state; it is also used to modify the serial number of the backup control device to a master control serial number in response to the switching instruction, and switch from the standby state to a takeover state, and when the backup control device is in the takeover state, based on the master control serial number and the first synchronization data, issue a first control instruction to the controlled device; wherein the master control serial number is the serial number configured by the master control device.
[0035] In a hot standby control method and related apparatus provided in some embodiments of the present application, when the standby control device is in a standby state, it can receive control data generated by the main control device in a normal operating state, so as to ensure that the standby control device, as a backup of the main control device, is ready to take over at any time. In the case where the main control device is in an abnormal operating state, the standby control device can automatically modify the serial number of the device to the serial number configured by the main control device, so as to simulate the master identity to quickly control the controlled device. Through the data synchronization mechanism and the serial number modification mechanism, the standby control device can quickly take over the control function of the main control device when it is abnormal, and there is no need to reconfigure the controlled device, thereby avoiding the problem of identification confusion of the controlled device due to the switching of the main and standby control devices, thereby ensuring the continuity, stability and reliability of the system operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0037] Figure 1 A system schematic diagram of a hot standby control system in one embodiment;
[0038] Figure 2 A schematic diagram of a hot standby control method in one embodiment;
[0039] Figure 3 is a schematic structural diagram of a hot standby control device in one embodiment;
[0040] Figure 4 The figure is a diagram of the internal structure of a backup control device in one embodiment. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] In some embodiments, the present application provides a hot standby control system, which can be used to control at least one controlled device so that each controlled device performs a specific step. It can be understood that the number of controlled devices and the device type of each controlled device and other information can be determined according to actual conditions, and the present application does not impose specific restrictions on this. For ease of explanation, some embodiments of the present application are described by taking the controlled device as a sub-control device as an example, and the number of sub-control devices is 3.
[0043] like Figure 1 As shown, the hot standby control system may include a main control device, a backup control device and a server. The main control device and the backup control device may be implemented by any device with communication and control functions, and the device type of the main control device and the device type of the backup control device may be the same or different, and this application does not impose specific restrictions on this. The server may be used for device status monitoring and data transmission.
[0044] Specifically, the main control device is the main control node of the hot standby control system. When the main control device is in normal operation, the main control device can communicate with the server and each controlled device respectively, so that the hot standby control system can control each controlled device through the main control device. The standby control device is a backup device of the main control device, which is used to take over the control function of the main control device when the main control device is abnormal, so that each controlled device can operate under the control of the standby control device.
[0045] The following describes a hot standby control method applied to a standby control device.
[0046] In some embodiments, the present application provides a hot standby control method that can be applied to Figure 1 Alternative controls as shown. Figure 2 As shown, the method may include the following steps:
[0047] S202: When the backup control device is in a standby state, receive and store first synchronization data.
[0048] The standby state may be a state in which the backup control device does not take over control. When the backup control device is in the standby state, the backup control device will not control the controlled device. For example, when the main control device is in a normal operating state, the backup control device may be in the standby state to avoid interference from the backup control device when the main control device is in normal operation.
[0049] The first synchronization data refers to the control data generated when the main control device is in normal operation. It can be understood that the first synchronization data may include one or more types of data, which is not specifically limited in this application, and only needs to be the control data generated when the main control device is in normal operation.
[0050] In some examples, the first synchronization data may include first communication data and second communication data. The first communication data refers to the communication data between the main control device and the controlled device, including but not limited to the control instructions issued by the main control device to the controlled device, and the status information returned by the controlled device to the main control device. The second communication data refers to the communication data between the main control device and the server, including but not limited to the device status information reported by the main control device to the server, the heartbeat information between the server and the main control device, and the information sent by the server to the main control device. In this way, it can be ensured that the backup control device can obtain complete and comprehensive synchronization data, further improving the efficiency of subsequent takeover.
[0051] In this step, the backup control device can receive the first synchronization data sent by the main control device when it is in standby mode, and store and record the received first synchronization data. It can be understood that the backup control device can use any method to achieve the reception and storage of the first synchronization data. In some examples, the backup control device can run an independent monitoring service, and can receive the first synchronization data sent by the main control device through a message queue. In other examples, the backup control device can maintain an independent database, and store the received first synchronization data in the independent database. In some other examples, the backup control device can receive the first synchronization data through the BEST OVER MQTT (Message Queuing TelemetryTransport) protocol.
[0052] In some examples, in order to reduce the communication delay between the main control device and the backup control device and further improve the takeover efficiency of the backup control device, the main control device may use an incremental synchronization mechanism to synchronize data. That is, the first synchronization data is obtained by the main control device using the incremental synchronization mechanism to synchronize to the backup control device in real time.
[0053] In some examples, when the main control device is in normal operation, the backup control device may not communicate with the server and only receive the first synchronization data sent by the main control device, so as to avoid interference of the backup control device when the main control device is in normal operation.
[0054] S204: In response to the switching instruction issued by the server when the server detects that the main control device is in an abnormal operation state, the serial number of the backup control device is modified to the main control serial number, and the standby state is switched to the takeover state.
[0055] The switching instruction is used to instruct the backup control device to switch to the takeover state, so that the backup control device takes over the control function of the main control device. The main control serial number is the serial number configured for the main control device.
[0056] In this step, the server may monitor the operating state of the main control device to monitor whether the main control device is in a normal operating state. Exemplarily, the server may monitor the main control device through a heartbeat packet detection mechanism to confirm whether the main control device has failed. In this example, if the main control device has not responded to the heartbeat packet for a certain period of time, the server may determine that the main control device is in an abnormal operating state. It is understood that the aforementioned duration can be pre-set according to actual conditions, for example, it can be 5 seconds to 10 seconds.
[0057] When the server determines that the main control device is in an abnormal operating state, it sends a switching instruction to the backup control device to instruct the backup control device to switch to the takeover state and take over the functions of the main control device. When the backup control device receives the switching instruction, it can modify the serial number of the device to the serial number of the main control device (i.e., the master serial number), and use the master serial number to establish communication with the server and the controlled device respectively. In this way, the backup control device can simulate the identity of the main control device at the server and the controlled device to take over the functions of the main control device.
[0058] For example, if the serial number of the main control device is configured as SN123, the backup control device may modify its own serial number from SN124 to SN123 upon receiving the switching instruction sent by the server to simulate the main control device.
[0059] In some examples, the master control serial number may be pre-stored in a storage device of the backup control device and may be modified through program logic.
[0060] S206: When the standby control device is in a takeover state, a first control instruction is issued to the controlled device based on the master control sequence number and the first synchronization data.
[0061] The first control instruction refers to a control instruction issued by the backup control device.
[0062] In this step, when the backup control device is in a takeover state, the serial number of the backup control device is configured as the main control serial number. Therefore, the backup control device can simulate the identity of the main control device based on the main control serial number and the first synchronization data and issue a first control instruction to the controlled device to continue to control the controlled device to execute specific steps when the main control device is in an abnormal operating state.
[0063] In the present application, when the backup control device is in standby mode, it can receive control data generated by the main control device in normal operation to ensure that the backup control device, as a backup of the main control device, is ready to take over at any time. When the main control device is in an abnormal operation state, the backup control device can automatically modify the serial number of this device to the serial number configured by the main control device, so as to simulate the master identity and quickly control the controlled device. Through the data synchronization mechanism and the serial number modification mechanism, the backup control device can quickly take over the control function of the main control device when it is abnormal, and there is no need to reconfigure the controlled device, thereby avoiding the problem of identification confusion of the controlled device due to the switching of the main and backup control devices, thereby ensuring the continuity, stability and reliability of the system operation.
[0064] In some embodiments, the hot standby control method of the present application may further include the following steps:
[0065] When it is determined that the main control device switches from an abnormal operating state to a normal operating state, the serial number of the backup control device is modified to a backup control serial number, and the takeover state is switched to a standby state; wherein the backup control serial number is different from the main control serial number.
[0066] In this embodiment, the backup control device can determine whether the main control device has recovered from an abnormal operation state to a normal operation state when it is in a takeover state. For example, when the backup control device receives a recovery instruction sent by the main control device or the server, it can determine that the main control device has recovered to a normal operation state.
[0067] If the main control device recovers from an abnormal operating state to a normal operating state, the main control device needs to take over the control function of the system again. In this case, the backup control device can exit the takeover state and enter the standby state to avoid interference from the backup control device when the main control device is operating normally. Specifically, the backup control device can exit the takeover by changing its own serial number from the main control serial number to the backup control serial number. Since the backup control serial number is different from the main control serial number, if the serial number of the backup control device is configured as the backup control serial number, the backup control device cannot simulate the identity of the main control device at the server and the controlled device, thereby disconnecting the control of the controlled device by the backup control device.
[0068] In some embodiments, the hot standby control method of the present application may further include the following steps:
[0069] Step A1: when the standby control device is in a takeover state, record the second synchronization data; wherein the second synchronization data is the control data generated when the standby control device is in a takeover state;
[0070] Step A2: when it is determined that the master control device switches from an abnormal operation state to a normal operation state, second synchronization data is sent to the master control device, so that the master control device sends a second control instruction to the controlled device based on the second synchronization data.
[0071] The second synchronization data refers to the control data generated by the backup control device in the takeover state, which may include one or more types of data, which is not specifically limited in this application. The second control instruction refers to the control instruction issued by the main control device to the controlled device.
[0072] In some examples, the second synchronization data may include third communication data and fourth communication data. The third communication data refers to the communication data between the backup control device and the controlled device, including but not limited to the control instructions issued by the backup control device to the controlled device, and the status information returned by the controlled device to the backup control device. The fourth communication data refers to the communication data between the backup control device and the server, including but not limited to the device status information reported by the backup control device to the server, the heartbeat information between the server and the backup control device, and the information issued by the server to the backup control device.
[0073] In this embodiment, when the backup control device is in the takeover state, it can record the control data it generates and obtain the second synchronization data. When the backup control device determines that the main control device has resumed normal operation, it can send the second synchronization data to the main control device to achieve synchronization of the control data. In this way, the main control device can quickly take over the control according to the second synchronization data to ensure the operation continuity, stability and reliability of the controlled device.
[0074] In some embodiments, the hot standby control method of the present application may further include the following steps:
[0075] Step B1: when the standby control device is in a takeover state, record the second synchronization data; wherein the second synchronization data is the control data generated when the standby control device is in a takeover state;
[0076] Step B2: using an incremental synchronization mechanism to synchronize the second synchronization data to the server in real time, so that the server sends the second synchronization data to the main control device when determining that the main control device switches from an abnormal operation state to a normal operation state.
[0077] In this embodiment, the relevant description of the second synchronization data can be found above, and this application will not repeat it here. In some cases, considering that the backup control device may have equipment failure in the takeover state, or the backup control device has high requirements for communication efficiency, the backup control device can adopt an incremental synchronization mechanism to first synchronize the second synchronization data to the server, and then synchronize the data to the main control device through the server. In this way, the communication delay caused by the synchronization of the second synchronization data can be reduced, and the operation continuity, stability and reliability of the controlled device can be further ensured.
[0078] In some embodiments, issuing a first control instruction to a controlled device based on the master control sequence number and the first synchronization data may include:
[0079] Step C1: Determine the target communication protocol; the target communication protocol is Ethernet protocol or RS485 protocol;
[0080] Step C2: Based on the master control serial number and the first synchronization data, a first control instruction is issued to the controlled device using a target communication protocol.
[0081] In this embodiment, the standby control device can support multiple communication protocols to meet the needs of different controlled devices. In the process of issuing the first control instruction to the controlled device, the standby control device can first determine the communication protocol to be used, that is, the target communication protocol. When the target communication protocol is determined, the standby control device can issue the first control instruction based on the target communication protocol. Among them, the target communication protocol can be an Ethernet protocol (such as BEST OVER WEBSOCKET) or an RS485 protocol.
[0082] In some cases, the server uses the serial number as the unique device identification. Therefore, after the backup control device modifies its serial number, it is necessary to reinitialize the communication module of the backup control device. After initialization, the backup control device can enable the communication service of the controlled device. If the target communication protocol is the RS485 protocol, it can be switched directly; if the target communication protocol is the Ethernet protocol, the controlled device can automatically switch the address of the backup control device to complete the automatic switching.
[0083] In some embodiments, in order to improve communication security, the backup control device may also use an encryption mechanism to encrypt the first control instruction, and send the encrypted ciphertext data to the controlled device.
[0084] The hot standby control device provided in an embodiment of the present application is described below. The hot standby control device described below and the hot standby control method described above can refer to each other.
[0085] In some embodiments, Figure 3As shown, the present application provides a hot standby control device 300 applied to a standby control device, and the device 300 may include:
[0086] The first synchronization data receiving module 302 is used to receive and store first synchronization data when the standby control device is in a standby state; wherein the first synchronization data is control data generated when the main control device is in a normal operating state;
[0087] The first serial number modification module 304 is used to modify the serial number of the standby control device to the master serial number in response to the switching instruction issued by the server when the server detects that the master control device is in an abnormal operation state, and switch from the standby state to the takeover state; wherein the master serial number is the serial number configured by the master control device;
[0088] The takeover module 306 is configured to send a first control instruction to the controlled device based on the master control sequence number and the first synchronization data when the standby control device is in the takeover state.
[0089] In some embodiments, the hot standby control device 300 of the present application may further include:
[0090] The second serial number modification module is used to modify the serial number of the backup control device to a backup control serial number and switch from the takeover state to the standby state when it is determined that the main control device has switched from the abnormal operating state to the normal operating state; wherein the backup control serial number is different from the main control serial number.
[0091] In some embodiments, the hot standby control device 300 of the present application may further include:
[0092] A first synchronization data recording module, used for recording second synchronization data when the standby control device is in the takeover state; wherein the second synchronization data is control data generated when the standby control device is in the takeover state;
[0093] The first synchronization data sending module is used to send the second synchronization data to the main control device when it is determined that the main control device switches from the abnormal operating state to the normal operating state, so that the main control device sends a second control instruction to the controlled device based on the second synchronization data.
[0094] In some embodiments, the hot standby control device 300 of the present application may further include:
[0095] A second synchronization data recording module, used for recording second synchronization data when the standby control device is in the takeover state; wherein the second synchronization data is control data generated when the standby control device is in the takeover state;
[0096] The second synchronization data sending module is used to adopt an incremental synchronization mechanism to synchronize the second synchronization data to the server in real time, so that the server sends the second synchronization data to the main control device when it is determined that the main control device switches from the abnormal operating state to the normal operating state.
[0097] In some embodiments, the first synchronization data is obtained by the main control device synchronizing to the backup control device in real time using an incremental synchronization mechanism;
[0098] and / or
[0099] The first synchronization data includes first communication data between the master control device and the controlled device, and second communication data between the master control device and the server.
[0100] In some embodiments, the takeover module 306 of the present application may include:
[0101] A protocol determination unit, used to determine a target communication protocol; the target communication protocol is an Ethernet protocol or an RS485 protocol;
[0102] A control instruction issuing unit is used to issue the first control instruction to the controlled device using the target communication protocol based on the master control serial number and the first synchronization data.
[0103] In some embodiments, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the hot standby control method applied to a standby control device in any embodiment.
[0104] In some embodiments, the present application also provides a backup control device, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the hot standby control method applied to the backup control device in any embodiment.
[0105] Indicatively, Figure 4 This is a schematic diagram of the internal structure of a backup control device provided in an embodiment of the present application. Figure 4The standby control device 900 includes a processing component 902, which further includes one or more processors, and a memory resource represented by a memory 901, for storing instructions executable by the processing component 902, such as an application. The application stored in the memory 901 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 902 is configured to execute instructions to perform the steps of the method described in any of the above embodiments.
[0106] The standby control device 900 may further include a power supply component 903 configured to perform power management of the standby control device 900, a wired or wireless network interface 904 configured to connect the standby control device 900 to a network, and an input / output (I / O) interface 905. The standby control device 900 may operate based on an operating system stored in the memory 901, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.
[0107] Those skilled in the art will understand that the internal structure of the backup control device shown in the present application is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the backup control device to which the scheme of the present application is applied. The specific backup control device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0108] In some embodiments, see Figure 1 The present application provides a hot standby control system, including: a main control device, a server, and a standby control device as described in any of the above embodiments. For the relevant description of the main control device, the standby control device, and the server, please refer to the description of the above embodiments, which will not be repeated here.
[0109] The main control device can be used to send first synchronization data to the backup control device when the main control device is in normal operation. The server can be used to detect the operating status of the main control device, and send a switching instruction to the backup control device when it is detected that the main control device is in an abnormal operating state. The backup control device is used to receive and store the first synchronization data when it is in a standby state. The backup control device is also used to modify the serial number of the backup control device to the main control serial number in response to the switching instruction, and switch from the standby state to the takeover state, and when the backup control device is in the takeover state, send the first control instruction to the controlled device based on the main control serial number and the first synchronization data. The main control serial number is the serial number configured for the main control device.
[0110] Specifically, when the main control device is in normal operation, it can communicate with the controlled device to achieve data communication and control between the main control device and the controlled device. In addition, the main control device can also synchronize the control data it generates to the backup control device in real time to ensure that the backup control device has the ability to take over at any time.
[0111] In some examples, the master control device can generate first synchronization data using an incremental synchronization mechanism according to a preset synchronization cycle, and send the first synchronization data to the backup control device through an efficient transmission protocol to achieve synchronization of control data in the master and backup control devices, so that the backup control device has the ability to take over at any time. In other examples, the master control device can be connected to the controlled device via an Ethernet protocol or an RS485 protocol.
[0112] When the main control device is in normal operation, the server can communicate with the main control device to receive status information and data reported by the main control device. Further, in some examples, the server and the main control device can communicate via the BEST OVER MQTT protocol, and the server can monitor the operating status of the main control device via the aforementioned protocol and the heartbeat packet monitoring mechanism.
[0113] The server may detect the operating state of the main control device. If it is determined that the main control device is currently in an abnormal operating state, the server may send a switching instruction to the backup control device to instruct the backup control device to take over the control function.
[0114] When the backup control device receives the switching instruction, it can change its own serial number from the backup control serial number to the master control serial number, and establish a communication connection with the server and the controlled device through the master control serial number, so that it can simulate the identity of the master control device at the server and the controlled device to continue control. In some examples, the backup control device can communicate with the server through the BESTOVER MQTT protocol and report the status information and data generated during the takeover to the server.
[0115] During the takeover of the backup control device, the backup control device and / or the server may detect the operating status of the main control device to determine whether the main control device has switched from an abnormal operating state to a normal operating state. If it is detected that the main control device has returned to normal, the backup control device may modify its own serial number from the main control serial number to the backup control serial number to exit the takeover state. The main control device may synchronize the control data generated during the takeover of the backup control device and retake over all communications.
[0116] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, "one", "one", "said", "the" and "it" may also include plural forms, unless the context clearly indicates another way. A plurality refers to at least two cases, such as 2, 3, 5 or 8, etc. "And / or" includes any and all combinations of the relevant listed items.
[0117] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
[0118] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A hot standby control method, characterized in that: Applied to a backup control device, the method comprises: When the standby control device is in a standby state, receiving and storing first synchronization data; wherein the first synchronization data is control data generated when the main control device is in a normal operating state; In response to a switching instruction issued by the server when the server detects that the main control device is in an abnormal operating state, the serial number of the standby control device is modified to the master control serial number, and the standby state is switched to the takeover state; wherein the master control serial number is the serial number configured by the main control device; When the standby control device is in the takeover state, a first control instruction is issued to the controlled device based on the master control sequence number and the first synchronization data.
2. The method according to claim 1, characterized in that: The method further comprises: When it is determined that the main control device switches from the abnormal operating state to the normal operating state, the serial number of the backup control device is modified to a backup control serial number, and the takeover state is switched to the standby state; wherein the backup control serial number is different from the main control serial number.
3. The method according to claim 2, characterized in that The method further comprises: When the standby control device is in the takeover state, recording second synchronization data; wherein the second synchronization data is control data generated when the standby control device is in the takeover state; When it is determined that the master control device switches from the abnormal operation state to the normal operation state, the second synchronization data is sent to the master control device, so that the master control device issues a second control instruction to the controlled device based on the second synchronization data.
4. The method according to claim 2, characterized in that: The method further comprises: When the standby control device is in the takeover state, recording second synchronization data; wherein the second synchronization data is control data generated when the standby control device is in the takeover state; An incremental synchronization mechanism is adopted to synchronize the second synchronization data to the server in real time, so that the server sends the second synchronization data to the main control device when it is determined that the main control device switches from the abnormal operation state to the normal operation state.
5. The method according to any one of claims 1 to 4, characterized in that: The first synchronization data is obtained by the main control device synchronizing to the backup control device in real time using an incremental synchronization mechanism; and / or The first synchronization data includes first communication data between the master control device and the controlled device, and second communication data between the master control device and the server.
6. The method according to any one of claims 1 to 4, characterized in that: The sending a first control instruction to the controlled device based on the master control sequence number and the first synchronization data includes: Determine the target communication protocol; the target communication protocol is Ethernet protocol or RS485 protocol; Based on the master control serial number and the first synchronization data, the first control instruction is issued to the controlled device using the target communication protocol.
7. A hot standby control device, characterized in that: Applied to a backup control device, the device comprises: A first synchronization data receiving module is used to receive and store first synchronization data when the standby control device is in a standby state; wherein the first synchronization data is control data generated when the main control device is in a normal operating state; A first serial number modification module, configured to modify the serial number of the standby control device to the master serial number in response to a switching instruction issued by the server when the server detects that the master control device is in an abnormal operating state, and switch from the standby state to the takeover state; wherein the master serial number is the serial number configured by the master control device; The takeover module is used to send a first control instruction to the controlled device based on the master control serial number and the first synchronization data when the standby control device is in the takeover state.
8. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the hot standby control method according to any one of claims 1 to 6.
9. A backup control device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the hot standby control method according to any one of claims 1 to 6 are performed.
10. A hot standby control system, characterized in that: include: A main control device, configured to send first synchronization data when the main control device is in a normal operating state; The server is used to detect the operating state of the main control device and send a switching instruction when it is detected that the main control device is in an abnormal operating state; The backup control device according to claim 9 is used to receive and store the first synchronization data when the backup control device is in a standby state; and is also used to modify the serial number of the backup control device to a master serial number in response to the switching instruction, and switch from the standby state to a takeover state, and when the backup control device is in the takeover state, based on the master serial number and the first synchronization data, send a first control instruction to the controlled device; wherein, The master control serial number is a serial number configured by the master control device.