CN113625540A - Dual-computer hot standby control method and device and dual-computer hot standby system - Google Patents
Dual-computer hot standby control method and device and dual-computer hot standby system Download PDFInfo
- Publication number
- CN113625540A CN113625540A CN202110814048.6A CN202110814048A CN113625540A CN 113625540 A CN113625540 A CN 113625540A CN 202110814048 A CN202110814048 A CN 202110814048A CN 113625540 A CN113625540 A CN 113625540A
- Authority
- CN
- China
- Prior art keywords
- state
- hot
- dual
- standby
- equipment
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 230000006854 communication Effects 0.000 claims abstract description 82
- 238000004891 communication Methods 0.000 claims abstract description 82
- 238000004590 computer program Methods 0.000 claims description 12
- 230000009977 dual effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007175 bidirectional communication Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000593 degrading effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B9/00—Safety arrangements
- G05B9/02—Safety arrangements electric
- G05B9/03—Safety arrangements electric with multiple-channel loop, i.e. redundant control systems
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Hardware Redundancy (AREA)
Abstract
The invention provides a dual-computer hot-standby control method, a dual-computer hot-standby control device and a dual-computer hot-standby system, wherein the hot-standby state of first equipment and the hot-standby state of second equipment in the dual-computer hot-standby system are determined firstly; and then when the hot standby state of the first equipment is a standby state, the hot standby state of the second equipment is a host state and the first equipment detects that the communication connection on all communication channels between the first equipment and the second equipment is interrupted, switching the hot standby state of the first equipment into the host state. Because the first device and the second device are in communication connection through the plurality of communication channels, the standby machine is considered to be in a host fault when all the communication channels are interrupted in communication with the host, and is upgraded to the host, so that the phenomenon of double masters in the double-machine hot-standby system can be effectively avoided on the premise of not introducing third-party arbitration equipment, the control cost of the double-machine hot-standby system is saved, and the failure risk of the double-machine hot-standby system is reduced.
Description
Technical Field
The invention relates to the technical field of computer control, in particular to a dual-computer hot standby control method and device and a dual-computer hot standby system.
Background
The dual-computer hot-standby technology is a technology for improving the availability of key equipment, and a dual-computer hot-standby system generally comprises two identical devices which run simultaneously, wherein one of the devices is a host and the other device is a standby, and the host is in communication connection with the standby. The host machine and the standby machine receive the same input data, perform the same logic processing and generate the same output information, but only the host machine actually outputs the output information, and the standby machine does not really output the output information. When the host computer is in failure, the host computer is degraded and stops outputting, and the original standby computer is upgraded to the host computer and starts outputting. Because the standby machine and the host machine run synchronously, the main-standby switching can be completed in a very short time, and can be completed in a control cycle of the dual-machine hot-standby system generally, so that the dual-machine hot-standby system is enabled to be seamlessly switched externally, and the availability of the dual-machine hot-standby system is effectively improved.
However, when the communication between the host and the standby in the dual-host hot-standby system is interrupted, a dual-host phenomenon occurs, i.e., the host and the standby both consider that the other side has a failure and consider that the host should be upgraded to the host output control. In the prior art, the phenomenon of double masters is generally avoided through third-party arbitration equipment, namely, the standby machine needs to be approved by the third-party arbitration equipment when being upgraded to a host machine, and the third-party arbitration equipment ensures that the double masters cannot occur. The method relies on a third party arbitration device, and has high requirements on the reliability, the availability and the safety of the third party arbitration device. Moreover, when the third party arbitration device fails, the dual-computer hot-standby system fails.
Disclosure of Invention
The invention provides a dual-computer hot standby control method, a dual-computer hot standby control device and a dual-computer hot standby system, which are used for solving the defects in the prior art.
The invention provides a dual-computer hot standby control method, which comprises the following steps:
determining a hot standby state of first equipment and a hot standby state of second equipment in a dual-computer hot standby system, wherein the first equipment is in communication connection with the second equipment in the dual-computer hot standby system through a plurality of communication channels;
and if the hot standby state of the first device is a standby state, the hot standby state of the second device is a host state, and the first device detects that communication connections on all communication channels between the first device and the second device are interrupted, the first device switches the hot standby state of the local device into the host state.
According to the dual-computer hot-standby control method provided by the present invention, the switching of the hot-standby state of the first device to the host state by the first device includes:
acquiring a plurality of first health values corresponding to the first equipment and a plurality of second health values corresponding to the second equipment, wherein the first health values and the second health values are in one-to-one correspondence;
for any first health value, if the any first health value is greater than or equal to the corresponding second health value, the first device switches the hot standby state of the local device to the host state.
According to the dual-computer hot standby control method provided by the invention, a target first health value exists in all first health values corresponding to the first device, and the difference between the target first health value and a corresponding target second health value is larger than a preset threshold value.
According to the dual-computer hot standby control method provided by the invention, a reverse switch is also connected between the first device and the second device;
the first device switches the hot standby state of the local device into a host state, and the method further comprises the following steps:
receiving an application request instruction for main-standby switching or an inverse switch instruction corresponding to the inverse switch;
and based on the reverse switching instruction or the application request instruction, the first device switches the hot standby state of the local device into the host state.
According to the dual-computer hot-standby control method provided by the present invention, the determining the first device and the second device in the dual-computer hot-standby system further includes:
and if the first equipment switches the hot standby state of the local machine from the host machine state to the off-line state, the duration of the off-line state is greater than or equal to a first preset duration, and the hot standby state of the second equipment is not the host machine state or the host machine preparation state, the first equipment switches the hot standby state of the local machine to the host machine preparation state.
According to the dual-computer hot-standby control method provided by the present invention, the first device switches the hot-standby state of the local computer to the host-ready state, and then the method further includes:
and if the duration of the hot standby state of the first device is greater than or equal to a second preset duration and the hot standby state of the second device is not the host preparation state, switching the hot standby state of the first device to the host state.
The invention also provides a dual-computer hot standby control device, which comprises:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining the hot standby state of first equipment and the hot standby state of second equipment in a dual-computer hot standby system, and the first equipment is in communication connection with the second equipment in the dual-computer hot standby system through a plurality of communication channels;
and the switching module is used for switching the hot standby state of the local machine to the host machine state by the first equipment if the hot standby state of the first equipment is the standby machine state and the hot standby state of the second equipment is the host machine state and the first equipment detects that the communication connection on all communication channels between the first equipment and the second equipment is interrupted.
The invention also provides a dual-computer hot standby system, which comprises: the device comprises a first device and a second device, wherein the first device and the second device are connected through a plurality of communication channels;
the dual-computer hot standby control device is configured in both the first device and the second device.
The invention further provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps of any one of the dual-computer hot-standby control methods.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the dual hot-standby control method as described in any of the above.
The invention provides a dual-computer hot-standby control method, a dual-computer hot-standby control device and a dual-computer hot-standby system.A hot-standby state of first equipment and a hot-standby state of second equipment in the dual-computer hot-standby system are firstly determined, and the first equipment is in communication connection with the second equipment in the dual-computer hot-standby system through a plurality of communication channels; and then when the hot standby state of the first device is a standby state, the hot standby state of the second device is a host state, and the first device detects that communication connections on all communication channels between the first device and the second device are interrupted, the hot standby state of the first device is switched to the host state. Because the first device and the second device are in communication connection through the plurality of communication channels, the standby machine is considered to be in a host fault when all the communication channels are interrupted in communication with the host, and is upgraded to the host, so that the phenomenon of double masters in the double-machine hot-standby system can be effectively avoided on the premise of not introducing third-party arbitration equipment, the control cost of the double-machine hot-standby system is saved, and the failure risk of the double-machine hot-standby system is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a dual-computer hot-standby control method provided by the present invention;
fig. 2 is a schematic diagram illustrating a hot standby state switching of a first device in a dual-device hot standby system according to the present invention;
fig. 3 is a schematic structural diagram of a dual-computer hot-standby control device provided in the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
When the communication between the host and the standby in the dual-host hot standby system is interrupted, a dual-host phenomenon occurs, that is, the host and the standby both consider that the other side has a fault and consider that the host should be upgraded to host output control. In the prior art, the phenomenon of double masters is generally avoided through third-party arbitration equipment, namely, the standby machine needs to be approved by the third-party arbitration equipment when being upgraded to a host machine, and the third-party arbitration equipment ensures that the double masters cannot occur. The method relies on a third party arbitration device, and has high requirements on the reliability, the availability and the safety of the third party arbitration device. Moreover, when the third party arbitration device fails, the dual-computer hot-standby system fails. Therefore, the embodiment of the invention provides a dual-computer hot standby control method.
Fig. 1 is a schematic flow chart of a dual-computer hot-standby control method provided in an embodiment of the present invention, as shown in fig. 1, the method includes:
s1, determining a hot standby state of a first device and a hot standby state of a second device in a dual-computer hot standby system, wherein the first device is in communication connection with the second device in the dual-computer hot standby system through a plurality of communication channels;
s2, if the hot standby state of the first device is a standby state, the hot standby state of the second device is a host state, and the first device detects that the communication connections on all the communication channels between the first device and the second device are interrupted, the first device switches the hot standby state of the local device to the host state.
Optionally, in the dual-server hot-standby control method provided in the embodiment of the present invention, the execution main body is a first device in the dual-server hot-standby system, and the first device may be any device in the dual-server hot-standby system. The dual-computer hot standby system comprises a second device besides the first device. The main-standby switching without depending on the third-party arbitration device can be realized through the first device. In the embodiment of the invention, the first device and the second device are in communication connection through a plurality of independent communication channels, and the first device and the second device can continuously perform bidirectional communication on the plurality of communication channels at the same time. The number of communication channels may be set as needed, and may be set to 3 or more, for example.
First, step S1 is executed. The first device determines the hot standby state of the first device (i.e., the local device) and the hot standby state of the second device (i.e., the peer device). The hot standby state is used for representing the state of the equipment, and may include a downtime state, an offline state, a host state, a standby state and a host standby state. The downtime state refers to a state in which the equipment has a first type of fault and needs to wait for manual intervention, and the first type of fault may be an intolerable fault. The offline state refers to a state where the device has a second type of failure or the dual-computer hot-standby system is initially powered on and waiting to enter another available state, and the second type of failure may be a tolerable failure. The host state refers to a state in which the host normally operates and control information is externally output. The standby state refers to a state in which the device is working normally, synchronized with the device in the host state, and can take over the device in the host state to work at any time. In the embodiment of the present invention, a device in a standby state may be referred to as a standby, and a device in a host state may be referred to as a host. The host ready state refers to that the device recovers from the offline state and does not have a device in the host state in the current dual-host hot-standby system, and the device is ready to be called a device in the host state.
In the embodiment of the invention, the first device can directly determine the hot standby state of the local computer, and the first device and the second device are in communication connection through a plurality of communication channels, so that the first device can acquire the hot standby state of the local computer in a channel communication mode.
Then, step S2 is executed, and the first device determines whether the hot standby state of the first device is the standby state, and determines whether the hot standby state of the second device is the host state. If the hot standby state of the local machine is the standby state, the local machine is indicated as the standby machine, and if the hot standby state of the opposite machine is the host state, the opposite machine is indicated as the host. When the local machine is a standby machine and the opposite machine is a host machine, whether the communication connection on all communication channels between the local machine and the opposite machine is interrupted is further judged. Because the probability of simultaneous interruption of communication connections on a plurality of independent communication channels is almost zero, if the local computer detects that the communication connections are interrupted on all the communication channels, the local computer is considered to have a fault and cannot be used as a host computer to output control information, and the local computer needs to stop working and be used as the host computer to output the control information. At this time, the first device automatically switches the hot standby state of the first device to the host state, that is, outputs control information by using the first device as a host.
The dual-computer hot-standby control method provided in the embodiment of the present invention first determines a hot-standby state of a first device and a hot-standby state of a second device in a dual-computer hot-standby system, where the first device and the second device in the dual-computer hot-standby system are in communication connection through a plurality of communication channels; and then when the hot standby state of the first equipment is a standby state, the hot standby state of the second equipment is a host state and the first equipment detects that the communication connection on all communication channels between the first equipment and the second equipment is interrupted, switching the hot standby state of the first equipment into the host state. Because the first device and the second device are in communication connection through the plurality of communication channels, the standby machine is considered to be in a host fault when all the communication channels are interrupted in communication with the host, and is upgraded to the host, so that the phenomenon of double masters in the double-machine hot-standby system can be effectively avoided on the premise of not introducing third-party arbitration equipment, the control cost of the double-machine hot-standby system is saved, and the failure risk of the double-machine hot-standby system is reduced.
Since one dual-host hot-standby system usually controls a plurality of controlled objects at the same time, it becomes very difficult to determine whether to perform the active-standby switching when different faults exist in the host and the standby, respectively. The existing dual-computer hot standby system generally determines whether to perform the primary-standby switching or not according to the health degrees of the host computer and the standby computer, namely, the health degrees of the host computer and the standby computer are respectively calculated, and the primary-standby switching is performed when the health degree of part of the standby computer is obviously superior to the health degree corresponding to the host computer. The method can also make other originally available controlled objects become unavailable while improving the availability of part of the controlled objects, is not beneficial to the overall control of the dual-computer hot-standby system on all the controlled objects, and reduces the availability of the dual-computer hot-standby system.
Therefore, on the basis of the foregoing embodiment, in the dual-computer hot-standby control method provided in the embodiment of the present invention, the switching, by the first device, the hot-standby state of the local computer to the host state includes:
acquiring a plurality of first health values corresponding to the first equipment and a plurality of second health values corresponding to the second equipment, wherein the first health values and the second health values are in one-to-one correspondence;
for any first health value, if the any first health value is greater than or equal to the corresponding second health value, the first device switches the hot standby state of the local device to the host state.
Optionally, in this embodiment of the present invention, when the first device switches the hot standby state of the local device to the host state, first a plurality of first health values corresponding to the first device and a plurality of second health values of the second device may be determined. The first device and the second device are the same and each may include a plurality of substructures, for example, the substructures may be independent information acquisition components in a dual-computer hot standby system, and a failure of the components may cause a failure of a specific function. The first device and the second device can both control a plurality of controlled objects, for example, the control of a train by a signal system. Each substructure corresponds to a health value, and each controlled object also corresponds to a health value. In the embodiment of the present invention, the health value corresponding to the first device is recorded as a first health value, and the health value corresponding to the second device is recorded as a second health value. The first health values and the second health values are equal in number and correspond to each other one by one. In this embodiment of the present invention, the number of the first health values may be equal to the sum of the number of the substructures included in the first device and the number of the controlled objects controlled by the first device, and the number of the second health values may be equal to the sum of the number of the substructures included in the second device and the number of the controlled objects controlled by the second device.
Then, for each first health value, whether the first health value is greater than or equal to a corresponding second health value is judged, if all the first health values are greater than or equal to the corresponding second health values, the overall performance of the first device is superior to that of the second device, and at the moment, the first device switches the hot standby state of the local device into the host state, so that the host in the dual-computer hot standby system is always the device with the optimal overall performance, the performance of the dual-computer hot standby system is improved, the availability of part of controlled objects is improved, and simultaneously other available controlled objects are still available, so that the main-standby switching does not generate adverse effects on the dual-computer hot standby system, and the overall control of the dual-computer hot standby system on all the controlled objects is realized.
On the basis of the foregoing embodiment, in the dual-computer hot standby control method provided in the embodiment of the present invention, a target first health value exists in all first health values corresponding to the first device, and a difference between the target first health value and a corresponding target second health value is greater than a preset threshold.
Optionally, in the embodiment of the present invention, on the basis of obtaining a plurality of first health values corresponding to the first device and a plurality of second health values corresponding to the second device, a target first health value needs to exist in all first health values corresponding to the first device in order to switch the hot standby state of the first device to the host state, and a difference between the target first health value and the corresponding target second health value is greater than a preset threshold. The preset threshold may be set as required, for example, may be set to a larger value to ensure that the target first health value is obviously greater than the target second health value, so as to limit the frequency of the active/standby switching, and prevent the problem of unstable performance of the dual-computer hot-standby system caused by frequent active/standby switching.
On the basis of the above embodiment, in the dual-computer hot standby control method provided in the embodiment of the present invention, a reverse switch is further connected between the first device and the second device;
the first device switches the hot standby state of the local device into a host state, and the method further comprises the following steps:
receiving an application request instruction for main-standby switching or an inverse switch instruction corresponding to the inverse switch;
and based on the reverse switching instruction or the application request instruction, the first device switches the hot standby state of the local device into the host state.
Optionally, in the embodiment of the present invention, an inverse switch may be connected between the first device and the second device, and the active-standby forced switching may be implemented by the inverse switch. For example, if the hot standby state of the second device is the host state, the reverse switch points to the second device, and if the reverse switch points to the first device manually and forcibly, a reverse switch instruction corresponding to the reverse switch is automatically generated when the reverse switch points to the first device manually and forcibly, and according to the reverse switch instruction, the first device switches the hot standby state of the local device to the host state, so that the main-standby forced switching is realized.
If the first device receives an application request instruction for active-standby switching, the hot standby state of the local device can be switched to the host state through the application request instruction, so that the active-standby forced switching is realized. The application request instruction for switching between the master device and the slave device may be manually input to the first device, or may be transmitted to the first device through a remote application program.
In the embodiment of the invention, the first device switches the hot standby state of the local machine to the host state by receiving the application request instruction for switching the main machine and the standby machine or receiving the reverse switch instruction corresponding to the reverse switch connected between the first device and the second device, so that the personalized main machine and standby machine forced switching can be realized, and the main machine and standby machine switching function based on the reverse switch and the main machine and standby machine switching function based on the application request can be conveniently added to the dual-machine hot standby system.
On the basis of the foregoing embodiment, the dual-computer hot-standby control method provided in the embodiment of the present invention, where the determining the first device and the second device in the dual-computer hot-standby system, then further includes:
and if the first equipment switches the hot standby state of the local equipment from the host state to the off-line state, the duration of the off-line state is greater than or equal to a first preset duration, and the hot standby state of the second equipment is not the host state or the host preparation state, switching the hot standby state of the first equipment to the host preparation state.
Optionally, in this embodiment of the present invention, after determining the first device and the second device in the dual-computer hot standby system, if the first device detects that the hot standby state of the local computer is switched from the host state to the offline state, and the duration of the offline state is greater than or equal to a first preset duration, and the hot standby state of the second device is not the host state or the host ready state, the first device switches the hot standby state of the local computer to the host ready state. The first preset time period may be set as needed, for example, to 1s, 2s, etc.
In the embodiment of the invention, the host preparation state is configured for the first equipment, so that the conflict problem caused by directly switching the hot standby state of the local equipment to the host state by the first equipment in the offline state is avoided.
On the basis of the foregoing embodiment, in the dual-host hot-standby control method provided in the embodiment of the present invention, the first device switches the hot-standby state of the local device to the host ready state, and then the method further includes:
and if the duration of the hot standby state of the first device is greater than or equal to a second preset duration and the hot standby state of the second device is not the host preparation state, switching the hot standby state of the first device to the host state by the first device.
Optionally, in this embodiment of the present invention, when the first device detects that the local hot standby state is the host ready state, and the duration of the host ready state is greater than or equal to a second preset duration, and the hot standby state of the second device is not the host ready state, the first device switches the local hot standby state to the host state. The second preset time period may be set as needed, for example, to 1s, 2s, etc.
In the embodiment of the invention, when the hot standby state of the first device is the host standby state, and the duration of the state is greater than or equal to the second preset duration and the hot standby state of the second device is not the host standby state, the first device switches the hot standby state of the local device into the host state, so that the condition of switching from the host standby state to the host state is provided, and the problem of collision caused by directly switching the first device in the offline state into the host state is avoided.
On the basis of the foregoing embodiment, fig. 2 is a schematic diagram illustrating a hot standby state switching of the first device according to an embodiment of the present invention. As shown in fig. 2, the hot standby state of the first device includes a down state, an offline state, a host state, a standby state, and a host ready state. The first device is in a host state: when the condition 1 is met, the first equipment switches the hot standby state of the local machine into a down state; when the conditions 2 and 11 are met, the first equipment switches the hot standby state of the local machine to an offline state; when conditions 2, 3 and 11 are satisfied, the first device switches the hot standby state of the first device to the host standby state. The first device is in a host ready state: when the condition 1 is met, the first equipment switches the hot standby state of the local machine into a down state; when the conditions 2, 6 and 7 are met, the first equipment switches the hot standby state of the local machine to an offline state; and when the condition 10 is met, the first equipment switches the hot standby state of the first equipment into the host state. The first device is in a standby state: when the conditions 4 and 5 are met, the first equipment switches the hot standby state of the local machine into a host machine state; when the conditions 2 and 9 are met, the first equipment switches the hot standby state of the local machine to an offline state; and when the condition 1 is met, the first equipment switches the hot standby state of the local equipment into the down state. The first device is in an offline state: and when the condition 8 is met, the first equipment switches the hot standby state of the first equipment into the standby state. Among them are:
condition 1: a first type of fault occurs in the machine;
condition 2: the machine has a second type of fault;
condition 3: the hot standby state of the local machine is an off-line state, the hot standby state of the local machine is not a host machine state or a host machine preparation state, and the duration of the off-line state of the local machine reaches a first preset duration;
condition 4: degrading the initiative;
condition 5: all communication between the local machine and the opposite machine is interrupted;
condition 6: the hot standby state of the machine is a host state;
condition 7: switching the machine request to a host preparation state;
condition 8: the synchronization of the local machine and the host is successful;
condition 9: the local computer and the host computer lose synchronization due to the inconsistency of input and output;
condition 10: the hot standby state of the local machine is a host preparation state, the hot standby state of the local machine is not the host preparation state, and the duration of the host preparation state of the local machine reaches a second preset duration;
condition 11: after the health values are compared, the main-standby switching is required.
As shown in fig. 3, on the basis of the above embodiment, an embodiment of the present invention provides a dual-computer hot-standby control apparatus, including: a determination module 31 and a switching module 32.
A determining module 31, configured to determine a hot-standby state of a first device and a hot-standby state of a second device in a dual-device hot-standby system, where the first device and the second device in the dual-device hot-standby system are in communication connection through multiple communication channels;
a switching module 32, configured to switch the hot standby state of the local device to the host state by the first device if the hot standby state of the first device is the standby state, the hot standby state of the second device is the host state, and the first device detects that communication connections on all communication channels between the first device and the second device are all interrupted.
On the basis of the foregoing embodiment, in the dual-computer hot-standby control apparatus provided in the embodiment of the present invention, the switching module is configured to:
acquiring a plurality of first health values corresponding to the first equipment and a plurality of second health values corresponding to the second equipment, wherein the first health values and the second health values are in one-to-one correspondence;
for any first health value, if the any first health value is greater than or equal to the corresponding second health value, the first device switches the hot standby state of the local device to the host state.
On the basis of the foregoing embodiment, in the dual-computer hot standby control apparatus provided in the embodiment of the present invention, a target first health value exists in all first health values corresponding to the first device, and a difference between the target first health value and a corresponding target second health value is greater than a preset threshold.
On the basis of the above embodiment, in the dual-computer hot standby control device provided in the embodiment of the present invention, a reverse switch is further connected between the first device and the second device;
the switching module is further configured to:
receiving an application request instruction for main-standby switching or an inverse switch instruction corresponding to the inverse switch;
and based on the reverse switching instruction or the application request instruction, the first device switches the hot standby state of the local device into the host state.
On the basis of the foregoing embodiment, in the dual-computer hot-standby control apparatus provided in the embodiment of the present invention, the switching module is further configured to:
and if the first equipment switches the hot standby state of the local machine from the host machine state to the off-line state, the duration of the off-line state is greater than or equal to a first preset duration, and the hot standby state of the second equipment is not the host machine state or the host machine preparation state, the first equipment switches the hot standby state of the local machine to the host machine preparation state.
On the basis of the foregoing embodiment, in the dual-computer hot-standby control apparatus provided in the embodiment of the present invention, the switching module is further configured to:
and if the duration of the hot standby state of the first device is greater than or equal to a second preset duration and the hot standby state of the second device is not the host preparation state, switching the hot standby state of the first device to the host state.
Specifically, the dual-computer hot-standby control apparatus provided in the embodiment of the present invention may be configured in the first device, and the functions of the modules in the dual-computer hot-standby control apparatus correspond to the operation flows of the steps in the foregoing method embodiments one to one, and the implementation effects are also consistent.
On the basis of the foregoing embodiments, an embodiment of the present invention provides a dual-computer hot standby system, including: the device comprises a first device and a second device, wherein the first device and the second device are connected through a plurality of communication channels; the first device and the second device are both provided with the dual-computer hot-standby control device to realize dual-computer hot-standby control.
Fig. 4 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 4: a processor (processor)410, a communication Interface 420, a memory (memory)430 and a communication bus 440, wherein the processor 410, the communication Interface 420 and the memory 430 are communicated with each other via the communication bus 440. The processor 410 may call logic instructions in the memory 430 to execute the dual-computer hot-standby control method provided by the above embodiments, where the method includes: determining a hot standby state of first equipment and a hot standby state of second equipment in a dual-computer hot standby system, wherein the first equipment is in communication connection with the second equipment in the dual-computer hot standby system through a plurality of communication channels; and if the hot standby state of the first device is a standby state, the hot standby state of the second device is a host state, and the first device detects that communication connections on all communication channels between the first device and the second device are interrupted, the first device switches the hot standby state of the local device into the host state.
In addition, the logic instructions in the memory 430 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention further provides a computer program product, where the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, where the computer program includes program instructions, and when the program instructions are executed by a computer, the computer is capable of executing the dual-computer hot-standby control method provided in the foregoing embodiments, where the method includes: determining a hot standby state of first equipment and a hot standby state of second equipment in a dual-computer hot standby system, wherein the first equipment is in communication connection with the second equipment in the dual-computer hot standby system through a plurality of communication channels; and if the hot standby state of the first device is a standby state, the hot standby state of the second device is a host state, and the first device detects that communication connections on all communication channels between the first device and the second device are interrupted, the first device switches the hot standby state of the local device into the host state.
In another aspect, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented by a processor to execute the dual-computer hot-standby control method provided in the foregoing embodiments, and the method includes: determining a hot standby state of first equipment and a hot standby state of second equipment in a dual-computer hot standby system, wherein the first equipment is in communication connection with the second equipment in the dual-computer hot standby system through a plurality of communication channels; and if the hot standby state of the first device is a standby state, the hot standby state of the second device is a host state, and the first device detects that communication connections on all communication channels between the first device and the second device are interrupted, the first device switches the hot standby state of the local device into the host state.
The above-described embodiments of the apparatus are merely illustrative, and the 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 modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A dual-computer hot standby control method is characterized by comprising the following steps:
determining a hot standby state of first equipment and a hot standby state of second equipment in a dual-computer hot standby system, wherein the first equipment is in communication connection with the second equipment in the dual-computer hot standby system through a plurality of communication channels;
and if the hot standby state of the first device is a standby state, the hot standby state of the second device is a host state, and the first device detects that communication connections on all communication channels between the first device and the second device are interrupted, the first device switches the hot standby state of the local device into the host state.
2. The dual-computer hot-standby control method according to claim 1, wherein the switching the hot-standby state of the first device to the host state by the first device includes:
acquiring a plurality of first health values corresponding to the first equipment and a plurality of second health values corresponding to the second equipment, wherein the first health values and the second health values are in one-to-one correspondence;
for any first health value, if the any first health value is greater than or equal to the corresponding second health value, the first device switches the hot standby state of the local device to the host state.
3. The dual-computer hot-standby control method according to claim 2, wherein a target first health value exists in all the first health values corresponding to the first device, and a difference between the target first health value and the corresponding target second health value is greater than a preset threshold.
4. The dual-computer hot-standby control method according to claim 1, wherein a reverse switch is further connected between the first device and the second device;
the first device switches the hot standby state of the local device into a host state, and the method further comprises the following steps:
receiving an application request instruction for main-standby switching or an inverse switch instruction corresponding to the inverse switch;
and based on the reverse switching instruction or the application request instruction, the first device switches the hot standby state of the local device into the host state.
5. The dual-computer hot-standby control method according to any one of claims 1 to 4, wherein the determining the first device and the second device in the dual-computer hot-standby system further includes:
and if the first equipment switches the hot standby state of the local machine from the host machine state to the off-line state, the duration of the off-line state is greater than or equal to a first preset duration, and the hot standby state of the second equipment is not the host machine state or the host machine preparation state, the first equipment switches the hot standby state of the local machine to the host machine preparation state.
6. The dual-computer hot-standby control method according to claim 5, wherein the first device switches the local hot-standby state to a host-ready state, and then further comprising:
and if the duration of the hot standby state of the first device is greater than or equal to a second preset duration and the hot standby state of the second device is not the host preparation state, switching the hot standby state of the first device to the host state.
7. A dual-computer hot standby control device is characterized by comprising:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining the hot standby state of first equipment and the hot standby state of second equipment in a dual-computer hot standby system, and the first equipment is in communication connection with the second equipment in the dual-computer hot standby system through a plurality of communication channels;
and the switching module is used for switching the hot standby state of the local machine to the host machine state by the first equipment if the hot standby state of the first equipment is the standby machine state and the hot standby state of the second equipment is the host machine state and the first equipment detects that the communication connection on all communication channels between the first equipment and the second equipment is interrupted.
8. A dual-computer hot standby system is characterized by comprising: the device comprises a first device and a second device, wherein the first device and the second device are connected through a plurality of communication channels;
the dual-computer hot-standby control device according to claim 7 is configured in both the first device and the second device.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the dual hot-standby control method according to any one of claims 1 to 6 when executing the program.
10. A non-transitory computer readable storage medium, having a computer program stored thereon, wherein the computer program, when being executed by a processor, implements the steps of the dual hot-standby control method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110814048.6A CN113625540B (en) | 2021-07-19 | 2021-07-19 | Dual-machine hot standby control method and device and dual-machine hot standby system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110814048.6A CN113625540B (en) | 2021-07-19 | 2021-07-19 | Dual-machine hot standby control method and device and dual-machine hot standby system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113625540A true CN113625540A (en) | 2021-11-09 |
CN113625540B CN113625540B (en) | 2024-08-23 |
Family
ID=78380135
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110814048.6A Active CN113625540B (en) | 2021-07-19 | 2021-07-19 | Dual-machine hot standby control method and device and dual-machine hot standby system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113625540B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115016246A (en) * | 2022-08-04 | 2022-09-06 | 深圳核心医疗科技有限公司 | Switching control method, switching control circuit, electronic device, and storage medium |
CN115296983A (en) * | 2022-08-03 | 2022-11-04 | 青岛海信微联信号有限公司 | Equipment management method and device, electronic equipment and storage medium |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN203027276U (en) * | 2012-12-10 | 2013-06-26 | 北京交控科技有限公司 | Dual-machine hot standby platform |
CN105487413A (en) * | 2015-11-24 | 2016-04-13 | 北京交控科技股份有限公司 | Main/standby control system and main/standby switching method of urban railway transit |
CN106254097A (en) * | 2016-07-20 | 2016-12-21 | 浙江众合科技股份有限公司 | A kind of ATS system two-shipper arbitration system judged based on third party and method |
CN106656617A (en) * | 2016-12-29 | 2017-05-10 | 杭州迪普科技股份有限公司 | Master-slave switching method and device |
CN107634855A (en) * | 2017-09-12 | 2018-01-26 | 天津津航计算技术研究所 | A kind of double hot standby method of embedded system |
WO2018166308A1 (en) * | 2017-03-13 | 2018-09-20 | 中兴通讯股份有限公司 | Distributed nat dual-system hot backup traffic switching system and method |
CN109117323A (en) * | 2018-08-31 | 2019-01-01 | 中国电子科技集团公司第二十研究所 | A kind of main/standby switching method in Dual-Computer Hot-Standby System |
CN109507866A (en) * | 2018-12-07 | 2019-03-22 | 天津津航计算技术研究所 | A kind of double-machine redundancy system and method based on network address drift technology |
CN109753387A (en) * | 2018-01-24 | 2019-05-14 | 比亚迪股份有限公司 | The double hot standby method and system of rail traffic multimedia system |
WO2020155055A1 (en) * | 2019-01-31 | 2020-08-06 | 华为技术有限公司 | Method for reducing power consumption and electronic device |
CN112130448A (en) * | 2020-09-25 | 2020-12-25 | 北京交大思诺科技股份有限公司 | Method for switching between main and standby machines |
CN112198788A (en) * | 2020-09-16 | 2021-01-08 | 中国铁道科学研究院集团有限公司通信信号研究所 | Method for realizing dual-computer hot standby system based on third state |
WO2021035867A1 (en) * | 2019-08-27 | 2021-03-04 | 北京东土科技股份有限公司 | Redundancy control method for main and standby controllers |
-
2021
- 2021-07-19 CN CN202110814048.6A patent/CN113625540B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN203027276U (en) * | 2012-12-10 | 2013-06-26 | 北京交控科技有限公司 | Dual-machine hot standby platform |
CN105487413A (en) * | 2015-11-24 | 2016-04-13 | 北京交控科技股份有限公司 | Main/standby control system and main/standby switching method of urban railway transit |
CN106254097A (en) * | 2016-07-20 | 2016-12-21 | 浙江众合科技股份有限公司 | A kind of ATS system two-shipper arbitration system judged based on third party and method |
CN106656617A (en) * | 2016-12-29 | 2017-05-10 | 杭州迪普科技股份有限公司 | Master-slave switching method and device |
WO2018166308A1 (en) * | 2017-03-13 | 2018-09-20 | 中兴通讯股份有限公司 | Distributed nat dual-system hot backup traffic switching system and method |
CN107634855A (en) * | 2017-09-12 | 2018-01-26 | 天津津航计算技术研究所 | A kind of double hot standby method of embedded system |
CN109753387A (en) * | 2018-01-24 | 2019-05-14 | 比亚迪股份有限公司 | The double hot standby method and system of rail traffic multimedia system |
CN109117323A (en) * | 2018-08-31 | 2019-01-01 | 中国电子科技集团公司第二十研究所 | A kind of main/standby switching method in Dual-Computer Hot-Standby System |
CN109507866A (en) * | 2018-12-07 | 2019-03-22 | 天津津航计算技术研究所 | A kind of double-machine redundancy system and method based on network address drift technology |
WO2020155055A1 (en) * | 2019-01-31 | 2020-08-06 | 华为技术有限公司 | Method for reducing power consumption and electronic device |
WO2021035867A1 (en) * | 2019-08-27 | 2021-03-04 | 北京东土科技股份有限公司 | Redundancy control method for main and standby controllers |
CN112198788A (en) * | 2020-09-16 | 2021-01-08 | 中国铁道科学研究院集团有限公司通信信号研究所 | Method for realizing dual-computer hot standby system based on third state |
CN112130448A (en) * | 2020-09-25 | 2020-12-25 | 北京交大思诺科技股份有限公司 | Method for switching between main and standby machines |
Non-Patent Citations (1)
Title |
---|
罗悦;陶然;赵明;李正天;: "双冗余热备份技术的综合控制设备设计与实现", 现代防御技术, no. 05, 17 October 2018 (2018-10-17) * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115296983A (en) * | 2022-08-03 | 2022-11-04 | 青岛海信微联信号有限公司 | Equipment management method and device, electronic equipment and storage medium |
CN115016246A (en) * | 2022-08-04 | 2022-09-06 | 深圳核心医疗科技有限公司 | Switching control method, switching control circuit, electronic device, and storage medium |
CN115016246B (en) * | 2022-08-04 | 2022-12-02 | 深圳核心医疗科技有限公司 | Switching control method, switching control circuit, electronic device, and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113625540B (en) | 2024-08-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220075698A1 (en) | Method and Apparatus for Redundancy in Active-Active Cluster System | |
CN111385107B (en) | Main/standby switching processing method and device for server | |
CN102882704B (en) | Link protection method in the soft reboot escalation process of a kind of ISSU and equipment | |
CN113625540A (en) | Dual-computer hot standby control method and device and dual-computer hot standby system | |
CN108009239B (en) | Database access method and system | |
CN107025152B (en) | Data synchronization method of double-redundancy hot backup equipment based on task level | |
CN114355760A (en) | Main control station and hot standby redundancy control method thereof | |
CN114297296B (en) | Main and standby switching system of server for broadcasting | |
CN116699964A (en) | Redundant operation method and system for industrial process controller | |
CN101557307B (en) | Dispatch automation system application state management method | |
CN110351122B (en) | Disaster recovery method, device, system and electronic equipment | |
CN111930573A (en) | Task-level dual-computer hot standby system and method based on management platform | |
CN114528242B (en) | Double-system synchronization method, device, equipment and medium for computer platform | |
EP4307631A1 (en) | User access processing method and related device | |
CN111891192B (en) | Train overspeed protection equipment, control method and dual-machine hot standby system | |
JP5176914B2 (en) | Transmission device and system switching method for redundant configuration unit | |
CN111181766B (en) | Redundant FC network system and method for realizing dynamic configuration of switch | |
CN104601350A (en) | Automatic disaster-tolerant switching method and device | |
CN102790814B (en) | A kind of Media Access Control Address defining method, relevant apparatus and system | |
RU2684348C1 (en) | Method, system and apparatus for treating two control unit trains | |
CN111475440A (en) | Communication control method and device based on asynchronous transmission protocol and electronic equipment | |
CN115981879B (en) | Data synchronization method, device and equipment of redundant structure and storage medium | |
CN105512116A (en) | Data synchronization method and device | |
CN118331026A (en) | Dual-computer redundancy communication method and system | |
CN116827761B (en) | Dual-machine hot standby switching method, system, equipment and 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 |