Dual-computer hot standby control method and device and dual-computer hot standby system

文档序号:225319 发布日期:2021-11-09 浏览:2次 中文

阅读说明:本技术 双机热备控制方法、装置及双机热备系统 (Dual-computer hot standby control method and device and dual-computer hot standby system ) 是由 罗鑫 张世强 于 2021-07-19 设计创作,主要内容包括:本发明提供一种双机热备控制方法、装置及双机热备系统,首先确定双机热备系统中第一设备的热备状态以及第二设备的热备状态;然后当第一设备的热备状态为备机状态、第二设备的热备状态为主机状态且第一设备检测到与第二设备之间的所有通信通道上的通信连接均发生中断时,第一设备的热备状态切换为主机状态。由于在第一设备和第二设备之间通过多个通信通道进行通信连接,使备机在所有通信通道均与主机通信中断时才认为主机故障,并升级为主机,可以在不引入第三方仲裁设备的前提下,有效避免双机热备系统中双主现象的出现,节约双机热备控制成本,降低双机热备系统的失效风险。(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.)

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.

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.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种用于片上检测的控制系统及控制方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!