CN-121978883-A - Master-slave switching method and system for dual-redundancy relay board
Abstract
The invention provides a master-slave switching method and a system of a dual-redundancy relay board, wherein the method comprises the steps of providing two relay boards which are redundant to each other, wherein the relay boards are respectively connected with a programmable logic controller and a panel controller, one relay board is used as a main board, and the other relay board is used as a slave board; when the main board receives the heartbeat signal or the master signal of the slave board, the main board switches itself to the slave board; or when the slave board does not receive the heartbeat signal and the robbery master signal of the master board, determining whether to send the robbery master signal according to the communication state with the programmable logic controller or the panel controller so as to switch the slave board to the master board. After one relay board fails, the other relay board can be quickly connected, so that the safety of system operation is greatly ensured.
Inventors
- QI YANYAN
- MA QIAN
- LIU XIANZHEN
- LIU RENBING
- TANG DALIANG
- TIAN BO
- XU YANGFEI
- Qu ai
Assignees
- 重庆川仪自动化股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251231
Claims (10)
- 1. The master-slave switching method of the dual-redundancy relay board is characterized by comprising the following steps of: Providing two relay boards which are redundant with each other, wherein the relay boards are respectively connected with a programmable logic controller and a panel controller, one relay board is used as a main board, and the other relay board is used as a slave board; when the main board receives the heartbeat signal or the main robbery signal of the slave board, the main board is switched to the slave board, or when at least one path of communication connection between the main board and the programmable logic controller and the panel controller is normal and the weight of the main board is lower than that of the slave board, the main board is switched to the slave board; when the slave board does not receive the heartbeat signal and the preemption signal of the main board, determining whether to send the preemption signal according to the communication state with the programmable logic controller or the panel controller so as to switch the slave board to the main board.
- 2. The method according to claim 1, wherein the two relay boards are configured to have different priorities, when neither relay board receives the heartbeat signal of the other party, the relay board with the higher priority is used as a master board, the relay board with the lower priority is used as a slave board, when one relay board receives the heartbeat signal of the other party, the relay board is switched to the slave board, the party sending the heartbeat signal is used as the master board, and the weight of each relay board is extracted and stored in the preset storage space.
- 3. The method for switching between the master and the slave of the dual redundancy relay boards according to claim 2, wherein extracting the weight of each relay board comprises: The method comprises the steps of acquiring a weight of a relay board with a lower priority through a panel controller and assigning the weight to a first register address, acquiring the weight of the relay board with the higher priority through the panel controller and assigning the weight to a second register address, acquiring the weight of the relay board with the higher priority through a programmable logic controller and assigning the weight to a third register address, acquiring the weight of the relay board with the lower priority through the programmable logic controller and assigning the weight to a fourth register address; When the communication between each relay board and the panel controller is normal and the communication between each relay board and at least one path of the programmable logic controller is normal, judging that the weight stored in a first register address or a second register address is nonzero, assigning the weight of the first register address and the weight of the second register address to corresponding redundancy weight judgment variables; And when the communication between each register board and the panel controller and the communication between each register board and the programmable logic controller are abnormal, the weights of the third register address and the fourth register address are assigned to the corresponding redundancy weight judgment variables so as to determine the weight of the master-slave board based on the corresponding redundancy weight judgment variables.
- 4. The master-slave switching method of the dual-redundancy relay board according to claim 2, wherein the master-robbery signals comprise a fast master-robbery signal and a slow master-robbery signal, and the slave board transmits the fast master-robbery signal to the main board when the heartbeat signal of the main board is received and the slave board is communicated normally with the panel controller and the slave board weight is higher than the main board; and when the main board receives the slow robbery main signal and the communication between the main board and the panel controller is disconnected, the main board is switched to the slave board.
- 5. The method for switching between the master board and the slave board according to claim 2, wherein when the heartbeat signal of the master board is not received and the preemptive signal of the master board is not received, if at least one path of communication between the slave board and the panel controller and between the slave board and the programmable logic controller is normal and the weight of the slave board is higher than that of the master board, the slave board is set as the master board.
- 6. The method for switching between the master board and the slave board according to claim 4, wherein when at least one path of communication connection between the master board and the programmable logic controller and between the master board and the panel controller is normal and the weight of the master board is equal to that of the slave board, determining whether to switch to the slave board according to the priority of the relay board corresponding to the master board.
- 7. The method for switching between the master and the slave of the dual redundancy relay boards according to claim 4, wherein when the weights of the slave board and the master board are equal, whether to send the slow-robbery master signal or the fast-robbery master signal is determined according to the priority of the relay board corresponding to the slave board.
- 8. The method for switching between the master and the slave of the dual redundancy relay boards according to claim 5, wherein when the weights of the slave board and the master are equal, it is determined whether to switch the slave board to the master according to the priority of the relay board corresponding to the slave board.
- 9. A system for performing the dual redundancy relay board master-slave switching method of any one of claims 1-8, comprising: two relay boards which are redundant with each other; The programmable logic controller is respectively connected with the two relay boards; the panel controller is respectively connected with the two relay boards; The two relay boards have the function of mutually sending heartbeat signals and main robbery signals, and switch the master board and the slave board based on the communication state with the panel controller and/or the programmable logic controller.
- 10. The system according to claim 9, further comprising a storage unit configured to store weights of the two relay boards, wherein the weights are acquired by the programmable logic controller and the panel controller, respectively, so that the weights stored in the storage unit are called as a switching determination condition when the two relay boards perform a master-slave switching.
Description
Master-slave switching method and system for dual-redundancy relay board Technical Field The invention relates to the field of rail transit control, in particular to a master-slave switching method and a master-slave switching system for a dual-redundancy relay board. Background With the continuous development of industrial automation control systems, the reliability and stability of the system become key indexes. In the field of industrial control, relay boards are used as an important component in control systems, and the stability of the relay boards directly affects the operation safety of the whole system. In order to improve the reliability of the system, redundancy techniques are widely used in industrial control systems. The existing redundancy switching scheme has the defects that on one hand, most of redundancy switching schemes mainly aim at redundancy switching methods based on a Linux system core board, rely on Ethernet bus communication, have no hardware signal access, are complex in switching method and have insufficient stability and reliability, and on the other hand, the prior art lacks redundancy switching schemes aiming at relay board characteristics, and particularly a master-slave switching mechanism is imperfect when the redundancy switching schemes are cooperated with a programmable logic controller and a panel controller. In addition, the redundant switching scheme in the prior art generally only considers the state of a single communication path, and fails to comprehensively consider the influence of the state of multiple communication paths on the system stability, so that misjudgment and wrong switching can occur in a complex industrial environment. Disclosure of Invention In view of the problems existing in the prior art, the invention provides a master-slave switching method and a master-slave switching system for a dual-redundancy relay board, which mainly solve the technical problems that the existing redundancy switching scheme is mainly based on a linux system core board, depends on Ethernet bus communication, lacks hardware signal access, is complex in switching method and is insufficient in stability and reliability, and realize the technical effects of simultaneously realizing dual guarantee of depending on hard wire signals and bus communication and improving the safety and reliability of the system. In order to achieve the above and other objects, the present invention adopts the following technical scheme. The invention provides a master-slave switching method of a dual-redundancy relay board, which comprises the following steps: Providing two relay boards which are redundant with each other, wherein the relay boards are respectively connected with a programmable logic controller and a panel controller, one relay board is used as a main board, and the other relay board is used as a slave board; when the main board receives the heartbeat signal or the main robbery signal of the slave board, the main board is switched to the slave board, or when at least one path of communication connection between the main board and the programmable logic controller and the panel controller is normal and the weight of the main board is lower than that of the slave board, the main board is switched to the slave board; when the slave board does not receive the heartbeat signal and the preemption signal of the main board, determining whether to send the preemption signal according to the communication state with the programmable logic controller or the panel controller so as to switch the slave board to the main board. In an embodiment of the invention, the two relay boards are configured to have different priorities, when neither relay board receives the heartbeat signal of the other party, the relay board with the higher priority is used as a main board, the relay board with the lower priority is used as a slave board, when one relay board receives the heartbeat signal of the other party, the relay board is switched to the slave board, one party sending the heartbeat signal is used as the main board, and the weight of each relay board is extracted and stored in a preset storage space. In an embodiment of the present invention, extracting weights of the relay boards includes: The method comprises the steps of acquiring a weight of a relay board with a lower priority through a panel controller and assigning the weight to a first register address, acquiring the weight of the relay board with the higher priority through the panel controller and assigning the weight to a second register address, acquiring the weight of the relay board with the higher priority through a programmable logic controller and assigning the weight to a third register address, acquiring the weight of the relay board with the lower priority through the programmable logic controller and assigning the weight to a fourth register address; When the communication between each relay board and the panel controller is normal