CN110647426A - Dual-computer hot backup method, device and system and computer storage medium - Google Patents

Dual-computer hot backup method, device and system and computer storage medium Download PDF

Info

Publication number
CN110647426A
CN110647426A CN201810680677.2A CN201810680677A CN110647426A CN 110647426 A CN110647426 A CN 110647426A CN 201810680677 A CN201810680677 A CN 201810680677A CN 110647426 A CN110647426 A CN 110647426A
Authority
CN
China
Prior art keywords
state
computer
determining
hot
standby
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
Application number
CN201810680677.2A
Other languages
Chinese (zh)
Other versions
CN110647426B (en
Inventor
刘苏
苏孟豪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Loongson Technology Corp Ltd
Original Assignee
Loongson Technology Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Loongson Technology Corp Ltd filed Critical Loongson Technology Corp Ltd
Priority to CN201810680677.2A priority Critical patent/CN110647426B/en
Publication of CN110647426A publication Critical patent/CN110647426A/en
Application granted granted Critical
Publication of CN110647426B publication Critical patent/CN110647426B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/1629Error detection by comparing the output of redundant processing systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a double-computer hot backup method, a device, a system and a computer storage medium, relating to the technical field of double-computer hot backup, wherein the method is suitable for a double-computer hot backup system, the system comprises two computers, each computer is provided with a hot backup device, and for each hot backup device, the method comprises the following steps: detecting a level signal of a first input pin of the computer, determining the output state of a first output pin of the computer according to the level signal of the first input pin, and determining the state of the computer according to the output state of the first output pin. That is, the dual-computer hot-backup system of this embodiment is a symmetric system, and when a problem occurs in the hot-backup device in one of the computers, the hot-backup device in the other computer can accurately determine the host and the standby computer in the system, thereby improving the reliability of the dual-computer hot-backup system.

Description

Dual-computer hot backup method, device and system and computer storage medium
Technical Field
The present invention relates to the field of dual-computer technologies, and in particular, to a dual-computer hot backup method, apparatus, system, and computer storage medium.
Background
In the application fields of aerospace, industrial control and the like with higher reliability requirements, a CPU (Central processing Unit) or a host often uses a scheme of multi-computer backup to improve the reliability of the whole system, such as dual-computer backup.
The existing dual-computer hot backup system comprises: the system comprises a host machine, a standby machine and an arbitration switching circuit; the host machine and the standby machine are in information interaction with the arbitration switching circuit; the arbitration switching circuit adopts a CPLD (Complex programmable logic Device) control unit to monitor the heartbeat signal and the fault alarm signal of the main machine and the standby machine, judge the working states of the main machine and the standby machine and control the switching of the main machine and the standby machine. The dual-computer hot backup system in the technology takes a CPLD as a core, monitors the working states of two main boards in the dual-computer system in real time through a watchdog, and realizes reliable automatic switching between the dual computers by judging the working states of the dual computers.
However, in the prior art, the arbitration switching circuit has no backup node in the system, and if the arbitration switching circuit makes a mistake, the whole system cannot work, and the purpose of improving the reliability cannot be achieved.
Disclosure of Invention
The embodiment of the invention provides a dual-computer hot backup method, a device and a system and a computer storage medium, which are used for solving the problem of low reliability of the existing dual-computer hot backup system.
In a first aspect, an embodiment of the present invention provides a dual-computer hot backup method, where the method is applicable to a dual-computer hot backup system, where the system includes two computers, each of the computers is provided with a hot backup device, each of the hot backup devices is connected to a first input pin and a first output pin of the corresponding computer, the first input pin of each computer is connected to a first output pin of another computer to form two connection lines, one connection line is pulled up to a power supply, and the other connection line is pulled down to ground, and for each hot backup device, the method includes:
detecting a level signal of a first input pin of a computer;
determining the output of the first output pin of the computer according to the level signal of the first input pin Status of state
And determining the state of the computer according to the output state of the first output pin.
In a possible implementation manner of the first aspect, the determining the state of the computer according to the output state of the first output pin includes:
if the output state of the first output pin is low level, determining that the computer is a host;
if the output state of the first output pin is a turning state, determining that the computer is a standby computer;
and if the output state of the first output pin is high level, determining that the computer has an error.
In another possible implementation manner of the first aspect, before the detecting the level signal of the first input pin of the computer, the method further includes:
detecting an initial level signal of a first input pin of the affiliated computer, determining that the initial state of the affiliated computer is a host computer when the first input pin is pulled up, and determining that the initial state of the affiliated computer is a standby computer when the first input pin is pulled down.
In another possible implementation manner of the first aspect, the determining an output state of the first output pin of the computer according to the level signal of the first input pin specifically includes:
determining the current state of the hot backup device according to the level signal of the first input pin;
and determining the output state of the first output pin of the computer according to the current state of the hot backup device.
In another possible implementation manner of the first aspect, the determining a current state of the hot standby apparatus according to the level signal of the first input pin specifically includes:
determining an initial state of the hot backup device according to an initial level signal of the first input pin and an initial output signal of the first output pin;
and determining the current state of the hot backup device according to the initial state of the hot backup device and the current level signal of the first input pin.
In another possible implementation manner of the first aspect, the determining an initial state of the hot standby apparatus according to the initial level signal of the first input pin and the initial output signal of the first output pin includes:
judging whether the initial level signal of the first input pin is clock pulse or high level and whether the initial output signal of the first output pin is low level;
if so, determining that the initial state of the hot backup device is a host state;
if not, determining that the initial state of the hot backup device is a standby state.
In another possible implementation manner of the first aspect, when the initial state of the hot-backup apparatus is a host state, the determining the current state of the hot-backup apparatus according to the initial state of the hot-backup apparatus and the current level signal of the first input pin specifically includes:
receiving a watchdog message and a self-checking result of the computer;
and determining the current state of the hot backup device according to the watchdog message, the current level signal of the first input pin and the self-checking result.
In another possible implementation manner of the first aspect, the determining a current state of the hot backup apparatus according to the watchdog message, the current level signal of the first input pin, and the self-test result specifically includes:
when the watchdog message is received, determining that the current state of the hot backup device is switched into a host error waiting state from the host state;
judging whether the self-checking result passes or not in the host error waiting state;
if the self-checking result is that the current level signal of the first input pin is a high level, determining that the current state of the hot backup device is switched from the host error waiting state to the host state;
and if the self-checking result is that the current level signal of the first input pin is a low level, determining that the current state of the hot backup device is switched into a standby state from the host error waiting state.
In another possible implementation manner of the first aspect, after determining whether the self-test result passes or not in the host error waiting state, the method further includes:
when the self-checking result is judged to be failed, determining that the current state of the hot backup device is switched into an error state from the host error waiting state;
judging whether a watchdog reset message is received or not in the error state;
if so, determining that the current state of the hot backup device is switched into an error waiting state from the error state;
judging whether the second self-checking result of the computer passes or not in the error waiting state;
if so, determining that the current state of the hot backup device is switched from the error waiting state to a host error waiting state, and if not, determining that the current state of the hot backup device is switched from the error waiting state to the error state.
In another possible implementation manner of the first aspect, when the state of the hot backup apparatus is a standby state, the determining the current state of the hot backup apparatus according to the initial state of the hot backup apparatus and the current level signal of the first input pin specifically includes:
receiving a control message sent by the affiliated computer;
and determining the current state of the hot standby device according to the control message and the current level signal of the first input pin, wherein the control message is used for indicating whether the computer takes over the bus.
In another possible implementation manner of the first aspect, the determining a current state of the hot backup apparatus according to the control message and the current level signal of the first input pin specifically includes:
when the current level signal of the first input pin is high level, determining that the current state of the hot standby device is switched from the standby state to a standby preparation state;
in the standby state, judging whether the control message indicates the computer to take over the bus;
if yes, determining that the current state of the hot backup device is switched to the host state from the standby state;
if not, determining that the current state of the hot backup device is switched to the standby state from the standby preparation state.
In another possible implementation manner of the first aspect, the method further includes:
in the standby machine preparation state or the standby machine state, when an error message or a watchdog reset message sent by the computer is received, determining that the current state of the hot backup device is switched into an error waiting state from the standby machine preparation state or the standby machine state;
judging whether the self-checking result of the computer passes or not in the error waiting state;
if so, determining that the current state of the hot backup device is switched from the error waiting state to the state before the error waiting state, and if not, determining that the current state of the hot backup device is switched from the error waiting state to the error state.
In another possible implementation manner of the first aspect, the method further includes:
when both computers have errors and the hot backup device is in the error state, the hot backup device is controlled by the computer to be in the error state and to be transferred to the host state from the error state.
In another possible implementation manner of the first aspect, the determining an output state of the first output pin of the computer according to the current state of the hot backup apparatus specifically includes:
when the current state of the hot backup device is in a standby state, determining that the output state of the first output pin is a turning state; when the current state of the hot backup device is in a host state or a standby take-over waiting state, determining that the output state of the first output pin is a low level; when the current state of the hot backup device is in a host error waiting state, an error state or an error waiting state, determining that the output state of the first output pin is a high level; and when the current state of the hot backup device is in an idle state or a sampling state, determining that the output state of the first output pin is high resistance.
In a second aspect, an embodiment of the present invention provides a hot standby apparatus, where each computer is provided with a hot standby apparatus, each hot standby apparatus is connected to a first input pin and a first output pin of the corresponding computer, the first input pin of each computer is connected to a first output pin of another computer to form two connection lines, one connection line is connected to a power supply by pulling up, and the other connection line is connected to a ground by pulling down, and each hot standby apparatus includes:
the detection module is used for detecting a level signal of a first input pin of the computer;
the pin state determining module is used for determining the output state of a first output pin of the computer according to the level signal of the first input pin;
and the computer state determining module is used for determining the state of the computer according to the output state of the first output pin.
In a possible implementation manner of the second aspect, the computer state determining module is specifically configured to determine that the computer is a host if the output state of the first output pin is a low level; if the output state of the first output pin is a turning state, determining that the computer is a standby computer; and if the output state of the first output pin is high level, determining that the computer has an error.
In another possible implementation manner of the second aspect, the apparatus further includes:
the detection module is used for detecting an initial level signal of a first input pin of the computer;
the computer state determining module is configured to determine that the initial state of the computer is the host when the first input pin is pulled up, and determine that the initial state of the computer is the standby when the first input pin is pulled down.
In another possible implementation manner of the second aspect, the pin status determining module includes:
the first determining module is used for determining the current state of the hot backup device according to the level signal of the first input pin;
and the second determining module is used for determining the output state of the first output pin of the computer according to the current state of the hot backup device.
In another possible implementation manner of the second aspect, the first determining module includes:
the first determining submodule is used for determining the initial state of the hot backup device according to the initial level signal of the first input pin and the initial output signal of the first output pin;
and the second determining submodule is used for determining the current state of the hot backup device according to the initial state of the hot backup device and the current level signal of the first input pin.
In another possible implementation manner of the second aspect, the first determining sub-module includes:
a first determining unit, configured to determine whether an initial level signal of the first input pin is a clock pulse or a high level, and whether an initial output signal of the first output pin is a low level;
an initial state determining unit, configured to determine that an initial state of the hot standby device is a host state if the first determining unit determines that the initial level signal of the first input pin is a clock pulse or a high level and the initial output signal of the first output pin is a low level; and if the first judging unit judges that the initial level signal of the first input pin is not clock pulse or high level and/or the initial output signal of the first output pin is not low level, determining that the initial state of the hot backup device is a standby state.
In another possible implementation manner of the second aspect, when the initial state of the hot backup apparatus is the host state, the second determining sub-module includes:
the receiving unit is used for receiving the watchdog message and the self-checking result of the computer;
and the state determining unit is used for determining the current state of the hot backup device according to the watchdog message, the current level signal of the first input pin and the self-checking result.
In another possible implementation manner of the second aspect, the second determining sub-module further includes a second judging unit;
the state determining unit is specifically configured to determine that the current state of the hot backup apparatus is switched from the host state to a host error waiting state when the watchdog message is received;
the second judging unit is configured to judge whether the self-test result passes or not in the host error waiting state;
the state determining unit is further specifically configured to determine that the current state of the hot backup apparatus is changed from the host error waiting state to the host state if the self-checking result is that the current state signal of the first input pin is a high level; and if the self-checking result is that the current level signal of the first input pin is a low level, determining that the current state of the hot backup device is switched into a standby state from the host error waiting state.
In another possible implementation manner of the second aspect, the state determining unit is further specifically configured to determine that the current state of the hot backup apparatus is changed from the host error waiting state to an error state when the self-checking result is judged to be failed;
the second judging unit is further configured to judge whether a watchdog reset message is received in the error state;
the state determining unit is further specifically configured to determine that the current state of the hot backup apparatus is changed from the error state to an error waiting state if the second determining unit determines that a watchdog reset message is received;
the second judging unit is further configured to judge whether the second self-test result of the computer passes or not in the error waiting state;
the state determining unit is further specifically configured to determine that the current state of the hot backup apparatus is changed from the error waiting state to a host error waiting state if the second determining unit determines that the second self-checking result of the corresponding computer passes, and determine that the current state of the hot backup apparatus is changed from the error waiting state to an error state if the second determining unit determines that the second self-checking result of the corresponding computer fails.
In another possible implementation manner of the second aspect, when the state of the hot backup apparatus is a standby state:
the receiving unit is also used for receiving the control message sent by the computer;
and the state determining unit is used for determining the current state of the hot backup device according to the control message and the current level signal of the first input pin, wherein the control message is used for indicating whether the computer takes over the bus.
In another possible implementation manner of the second aspect, the state determining unit is further specifically configured to determine that the current state of the hot backup apparatus is changed from the standby state to a standby preparation state when the current level signal of the first input pin is a high level;
the second judging unit is further configured to judge whether the control message indicates the computer to take over the bus in the standby state;
the state determining unit is further specifically configured to determine that the current state of the hot backup apparatus is switched from the standby state to the host state if the second determining unit determines that the control message indicates that the computer takes over the bus; and if the second judging unit judges that the control message indicates that the computer does not take over the bus, determining that the current state of the hot backup device is switched from the standby state to the standby state.
In another possible implementation manner of the second aspect, the state determining unit is further specifically configured to determine, in the standby state or in the standby state, that the current state of the hot backup apparatus is shifted to an error waiting state from the standby state or the standby state when an error message or a watchdog reset message sent by the computer is received;
the second judging unit is further configured to judge whether the self-test result of the computer passes through the error waiting state;
the state determining unit is further specifically configured to determine, if the second determining unit determines that the self-test result of the corresponding computer passes, that the current state of the hot backup apparatus is changed from the error waiting state to a state before the error waiting state, and determine, if the second determining unit determines that the self-test result of the corresponding computer does not pass, that the current state of the hot backup apparatus is changed from the error waiting state to an error state.
In another possible implementation manner of the second aspect, the state determining unit is further specifically configured to, when both computers have errors and the hot backup apparatus is in the error state, the hot backup apparatus transitions from the error state to the host state under the control of the belonging computer.
In another possible implementation manner of the second aspect, the second determining module is specifically configured to determine that the output state of the first output pin is an inverted state when the current state of the hot backup apparatus is in a standby state; when the current state of the hot backup device is in a host state or a standby take-over waiting state, determining that the output state of the first output pin is a low level; when the current state of the hot backup device is in a host error waiting state, an error state or an error waiting state, determining that the output state of the first output pin is a high level; and when the current state of the hot backup device is in an idle state or a sampling state, determining that the output state of the first output pin is high resistance.
In a third aspect, an embodiment of the present invention provides a dual computer hot standby system, where each computer is provided with a hot standby device as described in the second aspect, each hot standby device is connected to a first input pin and a first output pin of the corresponding computer, the first input pin of each computer is connected to a first output pin of another computer to form two connection lines, one connection line is connected to a power supply by pulling up, and the other connection line is connected to ground by pulling down.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium, where a computer program is stored in the storage medium, and the computer program, when executed, implements the dual-computer hot backup method according to the first aspect.
The embodiment of the invention provides a dual-computer hot backup method, a dual-computer hot backup device, a dual-computer hot backup system and a computer storage medium, wherein the dual-computer hot backup method, the dual-computer hot backup device and the computer storage medium comprise two computers, each computer is provided with a hot backup device, each hot backup device is connected with a first input pin and a first output pin of the corresponding computer, the first input pin of each computer is connected with a first output pin of the other computer to form two connecting lines, one connecting line is connected with a power supply in a pulling mode, the other connecting line is connected with the ground in a pulling mode, the hot backup device detects a level signal of the first input pin of the corresponding computer according to the level signal of the first input pin, the output state of the first output pin of the corresponding computer is determined according to the output state of the first output pin, and the state of the corresponding computer is determined according to the output state of. That is, the dual-computer hot-standby system of this embodiment is a symmetric system, and the hot-standby devices in the two computers of the system can determine the states of the computers according to the output states of the first output pins of the computers, so that when a problem occurs in the hot-standby device in one of the computers, the hot-standby device in the other computer can accurately determine the host and the standby in the system, thereby improving the reliability of the dual-computer hot-standby system.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings 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 only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of a dual-machine backup system according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a dual-computer hot backup method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a dual-computer hot backup method according to a second embodiment of the present invention;
fig. 4 is a schematic flowchart of a dual-computer hot backup method according to a third embodiment of the present invention;
fig. 5 is a schematic flowchart of determining an initial state of the hot backup apparatus according to a third embodiment of the present invention;
fig. 6 is a schematic diagram illustrating state transition of a state machine when the hot standby apparatus is the state machine according to the third embodiment of the present invention;
fig. 7 is a schematic flowchart of a dual-computer hot backup method according to a fourth embodiment of the present invention;
fig. 8 is a schematic flowchart of a dual-computer hot backup method according to a fifth embodiment of the present invention;
fig. 9 is a timing diagram illustrating a host computer error backup take-over in the dual-computer hot backup method according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a hot standby device according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a hot backup apparatus according to a second embodiment of the present invention;
fig. 12 is a schematic structural diagram of a hot backup apparatus according to a third embodiment of the present invention;
fig. 13 is a schematic structural diagram of a hot standby device according to a fourth embodiment of the present invention;
fig. 14 is a schematic structural diagram of a hot backup apparatus according to a fifth embodiment of the present invention;
fig. 15 is a schematic structural diagram of a hot backup apparatus according to a sixth embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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.
Fig. 1 is a schematic diagram of a dual-machine backup system according to an embodiment of the present invention. Referring to fig. 1, the dual-computer hot-standby system includes two computers, which are a first computer and a second computer, respectively, wherein a first input pin of the first computer is connected to a first output pin of the second computer, and a first output pin of the first computer is connected to a first input pin of the second computer. In the application, the first computer and the second computer are symmetrically arranged, that is, the hot backup devices are arranged in both the first computer and the second computer, and when the hot backup device in one computer fails, the hot backup device in the other computer can normally work, so that the working reliability of the dual-computer hot backup system is ensured.
The technical means shown in the present application will be described in detail below with reference to specific examples. It should be noted that the following embodiments may be combined with each other, and the same or similar contents are not repeatedly described in different embodiments.
Fig. 2 is a flowchart illustrating a dual-computer hot backup method according to an embodiment of the present invention. Referring to fig. 2, the method of the present embodiment may include:
s201, detecting a level signal of a first input pin of the computer.
The hot backup device of the embodiment of the invention is realized by hardware, achieves the independence of a software state, and can be a state machine or other chips with detection and data processing functions.
As shown in fig. 1, the hot standby device in the first computer is connected to the first input pin and the first output pin of the first computer, and the hot standby device in the second computer is connected to the first input pin and the first output pin of the second computer. The first input pin may be any idle input pin of the computer, and the first output pin may be any idle output pin of the computer.
In the dual-computer hot-backup system shown in fig. 1, the process of implementing dual-computer hot-backup by the hot-backup device in the first computer and the hot-backup device in the second computer is the same, and for convenience of explanation, the hot-backup device in one computer is taken as an example for explanation, and the hot-backup device in the other computer may be referred to.
Compared with cold backup, hot backup is characterized in that a backup CPU or a host is in a working state when being used as a backup. The hot backup can timely acquire states mutually, and when the host computer has an error, the standby computer can take over the state timely.
Based on the above advantages of the hot backup, when the hot backup apparatus of this embodiment implements dual-computer hot backup, the hot backup apparatus first detects a level signal of a first input pin of the computer to which the hot backup apparatus belongs, where the level signal of the first input pin may be a high level, a low level, or an inverted state.
S202, determining the output state of the first output pin of the computer according to the level signal of the first input pin.
The output state of the first output pin of the computer comprises three types: low, high and flipped states.
S203, determining the state of the computer according to the output state of the first output pin.
Specifically, the output state of the first output pin corresponds to different states of the corresponding computer, for example, when the output state of the first output pin is a low level, the state of the corresponding computer is a standby computer, when the output state of the first output pin is an inverted state, the state of the corresponding computer is a host computer, and when the output state of the first output pin is a high level, the state of the corresponding computer is an error.
In a possible implementation manner of this embodiment, the step S203 of determining the state of the computer according to the output state of the first output pin may be:
if the output state of the first output pin is low level, determining that the computer is a host;
if the output state of the first output pin is a turning state, determining that the computer is a standby computer;
and if the output state of the first output pin is high level, determining that the computer has an error.
In this embodiment, as shown in fig. 1, the states of the level signals output from the connection lines of the two computers include three types: low, high and flipped states. Wherein, the low level indicates that the first output pin is the host and is taking over the external bus; the high level indicates that the first output pin exporter is in an error state; the flip state indicates that the first output pin is a standby device and the state is normal.
Based on this, the hot standby apparatus of the present embodiment determines the output state of the first output pin of the belonging computer according to the level signal of the first input pin of the belonging computer. And when the output state of the first output pin is a low level, determining that the computer is a host and the opposite end computer is a standby. When the output state of the first output pin is a flip state (i.e., a flip from a low level to a high level, or a flip from a high level to a low level), it is determined that the computer is a standby computer at the moment, and the opposite-end computer is a host computer.
That is, in this embodiment, the output state of the first output pin of the affiliated computer can be determined according to the level signal of the first input pin of the affiliated computer, and then it is determined whether the affiliated computer is the host or the standby computer at this time according to the output state of the first output pin of the affiliated computer, so that in the dual-computer hot-standby system, the host and the standby computer are accurately determined, and reliable operation of the dual-computer hot-standby system is ensured.
The external bus outputs of the host and the standby machine can be directly connected together, the hot backup device controls the bus output to enable, only the current host can control the bus output, and the corresponding pin of the standby machine is in a high-impedance state.
Optionally, the method for determining the output state of the first output pin of the computer according to the level signal of the first input pin by the hot backup apparatus may be that the hot backup apparatus determines the output state of the first output pin according to the level signal of the first input pin, the watchdog signal, and the self-test result of the computer. For example, when the hot backup apparatus receives a watchdog signal, the self-test result of the corresponding computer is passed, and the hot backup apparatus detects that the level signal of the first input pin is at a high level, it may be determined that the output state of the first output pin of the corresponding computer is at a low level.
Optionally, the hot standby apparatus may determine the output state of the first output pin of the corresponding computer according to the level signal of the first input pin, and the hot standby apparatus may determine the output state of the first output pin according to the level signal of the first input pin and a control message of the corresponding computer. For example, when the level signal of the first input pin detected by the hot backup apparatus is high level and the received control message of the belonging computer indicates that the belonging computer takes over the host, it may be determined that the output state of the first output pin of the belonging computer is low level.
It should be noted that, in this embodiment, a specific method for determining the output state of the first output pin of the belonging computer by the hot backup apparatus according to the level signal of the first input pin of the belonging computer is not limited, and is determined according to the actual situation.
In this embodiment, the hot standby device can determine the output state of the first output pin through the level signal of the first input pin, and then quickly determine whether the computer is a host or a standby computer, and the whole process is simple and quick.
The dual-computer hot backup method provided by the embodiment of the invention is suitable for a dual-computer hot backup system, the system comprises two computers, each computer is provided with a hot backup device, each hot backup device is connected with a first input pin and a first output pin of the corresponding computer, the first input pin of each computer is connected with a first output pin of the other computer to form two connecting lines, one connecting line is pulled up to a power supply, the other connecting line is pulled down to be grounded, the hot backup device detects a level signal of the first input pin of the corresponding computer according to the level signal of the first input pin, determines the output state of the first output pin of the corresponding computer, and determines the state of the corresponding computer according to the output state of the first output pin. That is, the dual-computer hot-standby system of this embodiment is a symmetric system, and the hot-standby devices in the two computers of the system can determine the states of the computers according to the output states of the first output pins of the computers, so that when a problem occurs in the hot-standby device in one of the computers, the hot-standby device in the other computer can accurately determine the host and the standby in the system, thereby improving the reliability of the dual-computer hot-standby system.
In a feasible implementation manner of the embodiment of the present invention, before the hot backup apparatus detects the level signal of the first input pin of the computer (i.e. before S201 in fig. 2), the method of this embodiment further includes:
s200, detecting an initial level signal of a first input pin of the computer, determining that the initial state of the computer is a host when the first input pin is pulled up, and determining that the initial state of the computer is a standby when the first input pin is pulled down.
As shown in FIG. 1, two computers are interconnected and the initial state of the two computers can be determined by pulling up and pulling down the wires between the two computers, respectively. Specifically, the initial state of one of the computers is determined to be the host computer by pulling up the first input pin of the computer. The initial state of the computer can be determined as a standby computer by pulling down the first input pin of another computer. For example, as shown in fig. 1, a first input pin of a first computer is connected in series with a resistor to pull up to a power voltage, and a first input pin of a second computer is connected in series with a resistor to pull down to ground, at this time, the first computer is a host computer and the second computer is a standby computer.
That is, in this embodiment, the initial state of the computer is determined by pulling down and pulling down the first input pin, and compared with the existing dual-computer hot backup system, the method of this embodiment is simple, has low complexity, and can improve the response speed of the system, for the single computer determines the host computer by the complicated master/standby right preemption mechanism.
Fig. 3 is a schematic flow chart of a dual-computer hot-standby method according to a second embodiment of the present invention, where on the basis of the second embodiment, the present embodiment relates to a specific process of determining, by a hot-standby device, an output state of a first output pin of the computer to which the hot-standby device belongs according to a level signal of the first input pin. As shown in fig. 3, the step S202 may specifically include:
s301, determining the current state of the hot backup device according to the level signal of the first input pin.
The state of the hot backup device may include: at least one of an idle state, a sampling state, a host state, a standby state, a host error wait state, a standby takeover wait state, an error state, and an error wait state.
In this embodiment, when the hot-standby apparatus is powered on or reset, the hot-standby module may determine the current state of the hot-standby apparatus according to a level signal of the first input pin of the computer and a signal of the first output pin of the computer, for example, may determine that the current state of the hot-standby apparatus is a host state or a standby state.
Optionally, the hot backup apparatus may further determine the current state of the hot backup apparatus according to the level signal of the first input pin, the watchdog message, the self-test result of the computer to which the hot backup apparatus belongs, and the like, for example, may determine that the current state of the hot backup apparatus is a host state, a host error waiting state, a standby state, an error state, or the like.
Optionally, the hot backup apparatus may further determine the current state of the hot backup apparatus according to the level signal of the first input pin, the watchdog message, the self-checking result of the affiliated computer, the control message of the affiliated computer, and the like, for example, it may be determined that the current state of the hot backup apparatus is a host state, a host error waiting state, a standby takeover waiting state, an error state, and the like.
The control message of the computer is the control message sent by the CPU in the computer.
It should be noted that, in the embodiment shown in fig. 4, a detailed description is given to a specific process of determining the current state of the hot standby apparatus according to the level signal of the first input pin by the hot standby apparatus, and a description thereof is omitted here.
S302, determining the output state of the first output pin of the computer according to the current state of the hot backup device.
Based on the above description, when the state of the hot backup apparatus is at least one of an idle state, a sampling state, a host state, a standby state, a host error waiting state, a standby takeover waiting state, an error state, and an error waiting state, the hot backup apparatus may determine the output state of the first output pin of the computer to which the hot backup apparatus belongs according to the current state of the hot backup apparatus.
For example, when the hot standby device is currently in the standby state, the output state of the first output pin is determined to be the flip state.
When the state machine is currently in the host state or the standby takeover waiting state, it may be determined that the output state of the first output pin is a low level.
The output state of the first output pin may be determined to be high when the state machine is currently in a host error wait state, an error state, or an error wait state.
The output state of the first output pin may be determined to be a high resistance when the state machine is currently in an idle state or a sampling state.
In the dual-computer hot backup method provided by the embodiment of the invention, the hot backup device firstly determines the current state of the hot backup device according to the level signal of the first input pin of the computer to which the hot backup device belongs, and then determines the output state of the first output pin of the computer to which the hot backup device belongs according to the current state of the hot backup device, so that different states of the first output pin of the computer to which the hot backup device belongs are accurately determined according to different states of the hot backup device, and accurate reference is provided for subsequently determining the state of the computer to which the hot backup device belongs according to different states of the first output pin of the computer to which the hot backup device belongs.
Fig. 4 is a schematic flow chart of a dual-computer hot-standby method according to a third embodiment of the present invention, where on the basis of the third embodiment, this embodiment relates to a specific process of determining, by a hot-standby device, a current state of the hot-standby device according to a level signal of the first input pin. As shown in fig. 4, the S302 may specifically include:
s401, determining an initial state of the hot backup device according to the initial level signal of the first input pin and the initial output signal of the first output pin.
In this embodiment, an initial state of the hot-standby device is first determined, and then, a current state of the hot-standby device is determined according to the initial state of the hot-standby device and a current circuit signal of the first input pin.
Specifically, the hot backup device obtains an initial level signal of a first input pin of the computer and an initial output signal of a first output pin of the computer, and determines an initial state of the hot backup device according to the initial level signal of the first input pin and the initial output signal of the first output pin. For example, when the initial level signal of the first input pin is high level and the initial output signal of the first output pin is low level, it is determined that the initial state of the hot standby device is the host (or the standby); or, when the initial level signal of the first input pin is a low level and the initial output signal of the first output pin is a low level, determining that the initial state of the hot standby device is the host (or the standby); or, when the initial level signal of the first input pin is low level and the initial output signal of the first output pin is high level, it is determined that the initial state of the hot standby device is the host (or the standby).
In this embodiment, the process of determining the initial state of the hot backup apparatus according to the initial level signal of the first input pin and the initial output signal of the first output pin is not limited, and is specifically set according to actual needs.
In a possible implementation manner of this embodiment, as shown in fig. 5, the S401 may include:
s401a, determine whether the initial level signal of the first input pin is a clock pulse or a high level, and whether the initial input of the first output pin is a low level.
S401b, if yes, the initial state of the hot backup device is determined to be the host state.
S401c, if not, determining that the initial state of the hot backup device is the standby state.
Specifically, in this embodiment, when the hot standby apparatus determines that the initial level signal of the first input pin of the corresponding computer is a clock pulse or a high level, and the initial input of the first output pin of the corresponding computer is a low level, it may be determined that the initial state of the hot standby state is the host state. When the hot backup device determines that the initial level signal of the first input pin of the computer is not a clock pulse or a high level, and/or the initial input of the first output pin of the computer is not a low level, it may determine that the initial state of the hot backup state is a standby state.
In an example, the present embodiment is described by taking the hot backup apparatus as a state machine, where the state of the state machine is the state of the hot backup apparatus.
Wherein, the state machine comprises the following states and the meanings thereof:
IDLE: reset and state machine entered state upon error
SAMPLE: under the state, the state of entering the host or the standby state is determined according to the level signal of the first input pin
MASTER: host state, take over bus.
BACKUP: and the standby state is used for detecting the level signal of the first input pin and performing cyclic error detection or communication with the host.
M _ WAIT: and the host computer is in an error waiting state and waits for the completion of resetting and self-checking.
B _ WAIT: the standby machine takes over the waiting state, waits for the standby software to finish the preparation work and takes over the bus.
ERROR: and in an error state, waiting for the trigger of the watchdog, and entering an E _ WAIT state after the trigger.
E _ WAIT: and an ERROR waiting state, namely waiting for the reset and self-check to be completed, and returning to an ERROR state if an ERROR still occurs.
Fig. 6 is a schematic diagram illustrating state transition of a state machine when the hot standby apparatus is the state machine according to the third embodiment of the present invention. As shown in fig. 6, this embodiment may specifically be:
SAMPLE→MASTER
when the state machine is powered on or a reset button of the state machine is pressed, the state machine is transferred from the IDLE state to the SAMPLE state. Then, the state machine detects the initial potential signals of the first input pin and the first output pin of the computer, and when the initial level signal of the first input pin is a clock pulse or is at a high level and the initial output level signal of the first output pin of the computer is at a low level, the initial state of the state machine is converted into a MASTER state.
At this time, it is described that the peer computer is in a standby state, or that both computers are in an error state, but the initial state of the corresponding computer is the host.
SAMPLE→BACKUP
The state machine detects initial potential signals of a first input pin and a first output pin of the computer, and when the initial level signal of the first input pin is not at a clock pulse or a high level and/or the initial output of the first output pin of the computer is at a high level, the initial state of the state machine can be determined to be a BACKUP state.
At this time, it means that the opposite computer is in the host state and takes over the bus, or that both computers are in the error state and the initial state of the computer is the standby computer.
The above conversion conditions SAMPLE → MASTER and SAMPLE → BACKUP can quickly determine the MASTER/BACKUP status of the computer when a computer in the dual-computer hot BACKUP is suddenly reset.
S402, determining the current state of the hot backup device according to the initial state of the hot backup device and the current level signal of the first input pin.
According to the steps, the initial state of the hot backup device can be determined, and then the current state of the hot backup device is determined according to the initial state of the hot backup device and the current level signal of the first input pin of the computer to which the hot backup device belongs.
For example, when the initial state of the hot-standby device is the host and the current level signal of the first input pin of the computer to which the hot-standby device belongs is high, it may be determined that the current state of the hot-standby device is the host. Or, when the initial state of the hot backup apparatus is the host and the current level signal of the first input pin of the computer to which the hot backup apparatus belongs is at a low level, it may be determined that the current state of the hot backup apparatus is the host. Or, when the initial state of the hot-backup apparatus is the host and the current level signal of the first input pin of the computer to which the hot-backup apparatus belongs is the flip, it may be determined that the current state of the hot-backup apparatus is the host. The present embodiment does not limit the specific manner of determining the current state of the hot-standby device according to the initial state of the hot-standby device and the current level signal of the first input pin.
In this embodiment, the initial state of the hot backup apparatus is determined according to the initial level signal of the first input pin and the initial output signal of the first output pin, and the current state of the hot backup apparatus is determined according to the initial state of the hot backup apparatus and the current level signal of the first input pin, so that the current state of the hot backup apparatus is accurately determined.
Fig. 7 is a schematic flowchart of a dual-computer hot-standby method according to a fourth embodiment of the present invention, and based on the foregoing embodiments, a specific process of determining a current state of a hot-standby device according to an initial state and a current level signal of a first input pin when the initial state of the hot-standby device is a host state according to the present embodiment. As shown in fig. 7, the S402 may specifically include:
s501, receiving a watchdog message and a self-checking result of the computer.
S502, determining the current state of the hot backup device according to the watchdog message, the current level signal of the first input pin and the self-checking result.
Specifically, when the initial state of the hot-backup apparatus is the host state, it is described that the initial state of the computer to which the hot-backup apparatus belongs is the host. At this time, when the affiliated computer has an error, the watchdog in the affiliated computer triggers, and the affiliated computer is forcibly reset. At this time, in order to avoid the influence on the system, the hot standby device needs to determine the current state according to the current level signal of the first input pin of the corresponding computer and the self-test result of the corresponding computer.
In a possible implementation manner of this embodiment, the step S502 may specifically include the following steps:
s502a, determining that the current state of the hot backup apparatus is changed from the host state to a host error waiting state when receiving the watchdog message.
S502b, in the host error waiting state, determining whether the self-test result passes.
When the self-test result passes, the following steps of S502c or S502d are performed, and when the self-test result does not pass, the following steps of S502e to S502g are performed.
S502c, if the self-checking result is "pass" and the current level signal of the first input pin is "high", determining that the current state of the hot-standby apparatus is changed from the host error waiting state to the host state.
As shown with continued reference to figure 6,
Figure BDA0001710257550000191
when the watchdog is triggered, the hot backup device is converted from the MASTER state to the M _ WAIT state. At this point, the computer finds itself in error, and releases control by watchdog triggering.
And then, the hot backup device enters an M _ WAIT state, the affiliated computer completes reset and self-check, and if the self-check result is that the self-check passes and the current level signal of the first input pin of the affiliated computer is high level (namely, the opposite-end computer makes an error), the current state of the hot backup device is converted back to the MASTER state from the M _ WAIT state.
S502d, if the self-checking result is "pass" and the current level signal of the first input pin is low, determining that the current state of the hot-standby device is changed from the host error waiting state to the standby state.
Continuing with FIG. 6, M _ WAIT → BACKUP
Specifically, the hot-standby device completes reset and self-test in the M _ WAIT state, and if the self-test result is passed and the current level signal of the first input pin of the corresponding computer is at low level (i.e., the opposite-end computer is the host at this time and has taken over the bus), the current state of the hot-standby device is changed from the M _ WAIT state back to the BACKUP state.
S502e, when the self-checking result is judged to be failed, determining that the current state of the hot backup apparatus is changed from the host error waiting state to an error state.
S502f, in the error state, determining whether a watchdog reset message is received.
If so, go to S502g, otherwise, go to S502 q.
S502, 502g, determining that the current state of the hot backup device is transferred from the error state to an error waiting state.
S502h, in the error waiting state, judging whether the second self-test result of the computer passes or not.
If so, go to S502p, otherwise, go to S502 q.
S502p, it is determined that the current state of the hot-backup apparatus is changed from the error waiting state to the host error waiting state.
And S502, 502q, determining the current state of the hot backup device to be an error state.
As shown with continued reference to figure 6,
Figure BDA0001710257550000201
specifically, in the M _ WAIT state, the belonging computer completes reset and self-check, and if the self-check of the belonging computer fails, the hot backup device is switched from the M _ WAIT state to the ERROR state to WAIT for the watchdog reset message of the belonging computer.
In the ERROR state, if the belonging computer completes resetting again, the hot backup device is switched to the E _ WAIT state to WAIT for the self-checking of the belonging computer again, and if the self-checking result is passed, the hot backup device returns to the M _ WAIT state from the E _ WAIT state. And if the self-checking result is not passed, the hot backup device returns to the ERROR state from the E _ WAIT state.
According to the dual-computer hot backup method provided by the embodiment of the invention, if the initial state of the hot backup device is the host, the conversion of the hot backup device between different states can be realized by detecting the current level signal of the first input pin of the computer and matching with the watchdog message and the self-checking result, so that the corresponding states of the hot backup device under different conditions can be accurately determined.
Fig. 8 is a schematic flowchart of a dual-computer hot-standby method according to a fifth embodiment of the present invention, and based on the foregoing embodiments, a specific process of determining a current state of a hot-standby device according to an initial state and a current level signal of a first input pin when the initial state of the hot-standby device is a standby state according to the present embodiment. As shown in fig. 8, the S402 may specifically include:
s601, receiving a control message sent by the affiliated computer, wherein the control message is used for indicating whether the affiliated computer takes over a bus or not.
S602, determining the current state of the hot backup device according to the control message and the current level signal of the first input pin.
Specifically, when the initial state of the hot backup device is the standby state, it indicates that the computer is initially used as the standby. At this time, the hot backup device monitors the current level signal of the first input pin in real time, and when the current level signal of the first input pin of the corresponding computer is at a high level (that is, when the corresponding computer has an error), in order to ensure normal operation of the system, when the corresponding computer has an error as a host, the corresponding computer should be switched from the standby computer to the host when conditions allow. Then, the hot-standby device determines the current state of the hot-standby device by determining the control message sent by the corresponding computer, for example, when the control message indicates that the corresponding computer can take over the bus, the hot-standby device goes into the host state.
In a possible implementation manner of this embodiment, the step S602 may specifically include the following steps:
s602a, when the current level signal of the first input pin is at a high level, determining that the current state of the hot standby apparatus is changed from the standby state to a standby ready state.
S602b, in the standby state, determining whether the control message indicates that the computer takes over the bus.
If so, go to S602d, otherwise, go to S602 c.
S602c, determining that the current state of the hot backup apparatus is changed from the standby state to the standby state.
As shown with continued reference to figure 6,
Figure BDA0001710257550000211
when the hot BACKUP device monitors that the current level signal of the first input pin of the computer is high level (namely, the opposite-end computer makes an error) in the BACKUP state, the current state of the hot BACKUP device is changed into the B _ WAIT state from the BACKUP state.
When the computer is switched from the standby computer to the host computer, the computer needs to be switched under the control of a CPU in the computer.
The control message sent by the computer is sent by the CPU of the computer.
Specifically, when the host computer is in the B _ WAIT state, the hot backup apparatus determines whether a control message sent by the CPU of the host computer indicates the host computer to take over the bus (i.e., the host computer may be the host computer). And if the control message indicates that the computer to which the control message belongs cannot take over the bus or indicates that the opposite computer takes over the bus, returning the current state of the hot BACKUP module from the B _ WAIT state to the BACKUP state.
S602d, determining that the current state of the hot backup apparatus is changed from the standby state to the host state.
Continuing with FIG. 6, B _ WAIT → MASTER
Due to the delay of the first input pin status detection, the hardware may not be able to complete the correct synchronization. Therefore, when the CPU indicates the computer to take over the bus, the state of the first input pin can be confirmed for many times, and the dual computers are prevented from being converted into the MASTER state at the same time. And when the current level signal of the first input pin is confirmed to be high for multiple times, the CPU indicates the computer to take over the bus, and the hot backup device is converted into the MASTER from the B _ WAIT state.
Optionally, when the CPU determines that the current level signals of the first input pin are not all high level for multiple times, and the CPU instructs the computer to not take over or cannot take over the bus, the CPU sends a back-up command and gives an error command when an error occurs.
S602e, in the standby state, when receiving an error message or a watchdog reset message sent by the computer, determining that the current state of the hot backup apparatus is changed from the standby state or the standby state to an error waiting state.
S602f, in the error waiting state, judging whether the self-test result of the computer passes or not.
If so, go to S602g, otherwise, go to S602 h.
S602g, determining that the current state of the hot backup apparatus is changed from the error waiting state to the standby state.
S602h, determining that the current state of the hot backup apparatus transits from the error waiting state to an error state.
As shown with continued reference to figure 6,
Figure BDA0001710257550000221
specifically, in the B _ WAIT state, when the control message sent by the CPU is an error command indicating that the computer to which the CPU belongs has an error, or the control message sent by the CPU indicates that the computer to which the CPU belongs receives a watchdog reset message, the hot backup apparatus transitions from the B _ WAIT state to the E _ WAIT state.
And then, in the E _ WAIT state, the belonging computer completes self-checking, and if the self-checking result of the belonging computer is passed, the hot backup device returns to the B _ WAIT state from the E _ WAIT state. And if the self-test result of the computer fails, the hot backup device returns to the ERROR state from the E _ WAIT state.
In a possible implementation manner of this embodiment, S603 to S605 describe a transition process of the hot backup apparatus from the standby state to the error state.
S603, in the standby state, when an error message or the watchdog reset message sent by the computer is received, determining that the current state of the hot backup device is switched from the standby state to an error waiting state.
S604, judging whether the self-checking result of the computer passes or not in the error waiting state.
And S605, if yes, determining that the current state of the hot backup device is switched into the standby machine state from the error waiting state, and if not, determining that the current state of the hot backup device returns to the error state from the error waiting state.
As shown with continued reference to figure 6,
Figure BDA0001710257550000231
specifically, in the BACKUP state, when the control message sent by the CPU is an error command indicating that the computer to which the CPU belongs has an error, or the control message sent by the CPU indicates that a watchdog reset message is received, the hot BACKUP apparatus transitions from the BACKUP state to the E _ WAIT state.
Then, in the E _ WAIT state, the belonging computer completes the self-test, and if the self-test result of the belonging computer is passed, the hot BACKUP device returns to the BACKUP state from the E _ WAIT state. And if the self-test result of the computer fails, the hot backup device returns to the ERROR state from the E _ WAIT state.
In a possible implementation manner of this embodiment, the method of this embodiment further includes:
s600, when both the two computers have errors and the hot backup device is in an error state, the hot backup device is switched into the host state from the error state under the control of the CUP.
Continuing with FIG. 6, MASTER ← ERROR
Specifically, when both the two computers make an error and the hot backup device is in an error state, the system lacks a host, and at the moment, the cpu in the belonging computer controls the hot backup device to forcibly return to the MASTER state from the current error state, so that normal operation of the dual-computer hot backup system is realized under the extreme error condition.
Fig. 9 is a diagram illustrating an example of a timing sequence for host computer faulty standby computer to take over in the dual-computer hot backup method according to the embodiment of the present invention, in fig. 9, a thick line indicates that the host computer or the standby computer is driven, a thin line indicates a value obtained by pulling down from the outside, and a gray line indicates a bus to take over.
According to the dual-computer hot backup method provided by the embodiment of the invention, when the initial state of the hot backup device is the standby state, the conversion of the hot backup device between different states is realized by detecting the current level signal of the first input pin of the computer and matching with the CPU command input, the watchdog state input and the self-checking result input, so that the corresponding states of the hot backup device under different conditions are accurately determined. Meanwhile, when both computers have errors and the hot backup device is in an error state, the hot backup device is forcibly switched into a host state under the control of the CUP, so that the normal operation of the dual-computer hot backup system can be ensured under the condition of extreme errors, and the reliability of the dual-computer hot backup system is further improved.
Fig. 10 is a schematic structural diagram of a hot standby device according to an embodiment of the present invention. The hot-standby device is suitable for the dual-computer hot-standby system shown in fig. 1, please refer to fig. 10, in which the hot-standby device 100 in each computer includes:
the detection module 110 is configured to detect a level signal of a first input pin of a computer;
a pin status determining module 120, configured to determine an output status of a first output pin of the computer according to the level signal of the first input pin;
and a computer state determining module 130, configured to determine a state of the computer according to the output state of the first output pin.
Alternatively, the hot backup apparatus 100 of the present embodiment may be a state machine.
The hot backup device provided by the embodiment of the present invention can execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
In a possible implementation manner of this embodiment, the computer state determining module 130 is specifically configured to determine that the computer is a host if the output state of the first output pin is a low level; if the output state of the first output pin is a turning state, determining that the computer is a standby computer; and if the output state of the first output pin is high level, determining that the computer has an error.
In another possible implementation manner of this embodiment, the detecting module is configured to detect an initial level signal of a first input pin of the computer;
the computer state determining module 130 is configured to determine that the initial state of the affiliated computer is the host when the first input pin is pulled up, and determine that the initial state of the affiliated computer is the standby when the first input pin is pulled down.
Fig. 11 is a schematic structural diagram of a hot backup device according to a second embodiment of the present invention. On the basis of the above embodiments, the pin status determining module 120 of this embodiment includes:
a first determining module 121, configured to determine a current state of the hot backup apparatus according to a level signal of the first input pin;
the second determining module 122 is configured to determine an output state of the first output pin of the computer according to the current state of the hot backup apparatus.
The hot backup device provided by the embodiment of the present invention can execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Fig. 12 is a schematic structural diagram of a hot backup device according to a third embodiment of the present invention. On the basis of the foregoing embodiment, the first determining module 121 of this embodiment includes:
a first determining submodule 123, configured to determine an initial state of the hot standby apparatus according to an initial level signal of the first input pin and an initial output signal of the first output pin;
the second determining submodule 124 is configured to determine a current state of the hot-standby apparatus according to the initial state of the hot-standby apparatus and the current level signal of the first input pin.
The hot backup device provided by the embodiment of the present invention can execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Fig. 13 is a schematic structural diagram of a hot standby device according to a fourth embodiment of the present invention. On the basis of the above embodiment, the first determining sub-module 123 of this embodiment includes:
a first determining unit 125, configured to determine whether an initial level signal of the first input pin is a clock pulse or a high level, and whether an initial output signal of the first output pin is a low level;
an initial state determining unit 126, configured to determine that the initial state of the hot standby device is a host state if the first determining unit 125 determines that the initial level signal of the first input pin is a clock pulse or a high level and the initial output signal of the first output pin is a low level; if the first determining unit 125 determines that the initial level signal of the first input pin is not a clock pulse or a high level, and/or the initial output signal of the first output pin is not a low level, it is determined that the initial state of the hot standby apparatus is a standby state.
The hot backup device provided by the embodiment of the present invention can execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Fig. 14 is a schematic structural diagram of a hot backup device according to a fifth embodiment of the present invention. On the basis of the foregoing embodiment, when the initial state of the hot backup apparatus is the host state in this embodiment, the second determining sub-module 124 includes:
a receiving unit 127, configured to receive a watchdog message and a self-checking result of the belonging computer;
a state determining unit 128, configured to determine a current state of the hot backup apparatus according to the watchdog message, the current level signal of the first input pin, and the self-test result.
The hot backup device provided by the embodiment of the present invention can execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Fig. 15 is a schematic structural diagram of a hot backup apparatus according to a sixth embodiment of the present invention. On the basis of the above embodiment, the second determining submodule 124 of the present embodiment further includes a second judging unit 129;
the state determining unit 128 is specifically configured to determine that the current state of the hot backup apparatus is changed from the host state to a host error waiting state when the watchdog message is received;
the second determining unit 129 is configured to determine whether the self-test result passes or not in the host error waiting state;
the state determining unit 128 is further specifically configured to determine that the current state of the hot backup apparatus is changed from the host error waiting state to the host state if the self-test result is that the current level signal of the first input pin is a high level; and if the self-checking result is that the current level signal of the first input pin is a low level, determining that the current state of the hot backup device is switched into a standby state from the host error waiting state.
In a possible implementation manner of this embodiment, the state determining unit 128 is further specifically configured to determine that the current state of the hot backup apparatus is changed from the host error waiting state to an error state when the self-checking result is judged to be failed;
the second determining unit 129 is further configured to determine whether a watchdog reset message is received in the error state;
the state determining unit 128 is further specifically configured to determine that the current state of the hot backup apparatus is changed from the error state to an error waiting state if the second determining unit 129 determines that a watchdog reset message is received;
the second determining unit 129 is further configured to determine whether the second self-test result of the computer passes through the error waiting state;
the state determining unit 128 is further specifically configured to determine that the current state of the hot-standby apparatus is changed from the error waiting state to the host error waiting state if the second determining unit 129 determines that the result of the second self-test of the belonging computer is passed, and determine that the current state of the hot-standby apparatus is changed from the error waiting state to the error state if the second determining unit 129 determines that the result of the second self-test of the belonging computer is not passed.
In another possible implementation manner of this embodiment, when the state of the hot backup apparatus is a standby state:
the receiving unit 127 is further configured to receive a control message sent by the affiliated computer;
the state determining unit 128 is further configured to determine a current state of the hot-standby apparatus according to the control message and a current level signal of the first input pin, where the control message is used to indicate whether the belonging computer takes over a bus.
In another possible implementation manner of this embodiment, the state determining unit 128 is further specifically configured to determine that the current state of the hot standby apparatus is changed from the standby state to the standby preparation state when the current level signal of the first input pin is at a high level;
the second determining unit 129 is further configured to determine, in the standby state, whether the control message indicates that the computer takes over the bus;
the state determining unit 128 is further specifically configured to determine that the current state of the hot backup apparatus is changed from the standby state to the host state if the second determining unit 129 determines that the control message indicates that the computer takes over the bus; if the second determining unit 129 determines that the control message indicates that the computer does not take over the bus, it is determined that the current state of the hot backup apparatus is changed from the standby state to the standby state.
In another possible implementation manner of this embodiment, the state determining unit 128 is further specifically configured to determine, in the standby state or in the standby state, that the current state of the hot backup apparatus is switched to an error waiting state from the standby state or the standby state when an error message or a watchdog reset message sent by the computer is received;
the second determining unit 129 is further configured to determine whether the self-test result of the computer passes through in the error waiting state;
the state determining unit 128 is further specifically configured to determine that the current state of the hot-standby apparatus is changed from the error waiting state to the state before the error waiting state if the second determining unit 129 determines that the self-test result of the corresponding computer passes, and determine that the current state of the hot-standby apparatus is changed from the error waiting state to the error state if the second determining unit 129 determines that the self-test result of the corresponding computer does not pass.
In another possible implementation manner of this embodiment, the state determining unit 128 is further specifically configured to, when both computers have errors and the hot backup apparatus is in the error state, the hot backup apparatus, under the control of the belonging computer, transition from the error state to the host state.
In another possible implementation manner of this embodiment, the second determining module 122 is specifically configured to determine that the output state of the first output pin is an inverted state when the current state of the hot backup apparatus is in a standby state; when the current state of the hot backup device is in a host state or a standby take-over waiting state, determining that the output state of the first output pin is a low level; when the current state of the hot backup device is in a host error waiting state, an error state or an error waiting state, determining that the output state of the first output pin is a high level; and when the current state of the hot backup device is in an idle state or a sampling state, determining that the output state of the first output pin is high resistance.
Fig. 1 is a schematic structural diagram of a dual-computer hot backup system according to an embodiment of the present invention. As shown in fig. 1, the dual-computer hot standby system includes two computers, each of the computers is provided with the hot standby device, each of the hot standby devices is connected to a first input pin and a first output pin of the corresponding computer, the first input pin of each of the computers is connected to a first output pin of another computer to form two connecting lines, one of the connecting lines is connected to a power supply by pulling up, the other connecting line is connected to a ground by pulling down, and each of the hot standby devices.
Further, when at least a part of functions of the dual-computer hot-backup method in the embodiment of the present invention are implemented by software, an embodiment of the present invention further provides a computer storage medium, where the computer storage medium is used to store computer software instructions for the dual-computer hot-backup, and when the computer storage medium runs on a computer, the computer can execute various possible dual-computer hot-backup methods in the embodiment of the method. The processes or functions described in accordance with the embodiments of the present invention may be generated in whole or in part when the computer-executable instructions are loaded and executed on a computer. The computer instructions may be stored on a computer storage medium or transmitted from one computer storage medium to another via wireless (e.g., cellular, infrared, short-range wireless, microwave, etc.) to another website site, computer, server, or data center. The computer storage media may be any available media that can be accessed by a computer or a data storage device, such as a server, data center, etc., that incorporates one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD), among others.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (17)

1. A dual-computer hot backup method is characterized in that the method is suitable for a dual-computer hot backup system, the system comprises two computers, each computer is provided with a hot backup device, each hot backup device is connected with a first input pin and a first output pin of the corresponding computer, the first input pin of each computer is connected with a first output pin of the other computer to form two connecting lines, one connecting line is pulled up to a power supply, the other connecting line is pulled down to be grounded, and for each hot backup device, the method comprises the following steps:
detecting a level signal of a first input pin of a computer;
determining the output state of a first output pin of the computer according to the level signal of the first input pin;
and determining the state of the computer according to the output state of the first output pin.
2. The method of claim 1, wherein determining the state of the computer according to the output state of the first output pin comprises:
if the output state of the first output pin is low level, determining that the computer is a host;
if the output state of the first output pin is a turning state, determining that the computer is a standby computer;
and if the output state of the first output pin is high level, determining that the computer has an error.
3. The method of claim 1, wherein before detecting the level signal at the first input pin of the computer, the method further comprises:
detecting an initial level signal of a first input pin of the affiliated computer, determining that the initial state of the affiliated computer is a host computer when the first input pin is pulled up, and determining that the initial state of the affiliated computer is a standby computer when the first input pin is pulled down.
4. The method according to any one of claims 1 to 3, wherein the determining the output state of the first output pin of the corresponding computer according to the level signal of the first input pin specifically comprises:
determining the current state of the hot backup device according to the level signal of the first input pin;
and determining the output state of the first output pin of the computer according to the current state of the hot backup device.
5. The method according to claim 4, wherein determining the current state of the hot standby device according to the level signal of the first input pin comprises:
determining an initial state of the hot backup device according to an initial level signal of the first input pin and an initial output signal of the first output pin;
and determining the current state of the hot backup device according to the initial state of the hot backup device and the current level signal of the first input pin.
6. The method of claim 5, wherein determining the initial state of the hot-standby apparatus according to the initial level signal of the first input pin and the initial output signal of the first output pin comprises:
judging whether the initial level signal of the first input pin is clock pulse or high level and whether the initial output signal of the first output pin is low level;
if so, determining that the initial state of the hot backup device is a host state;
if not, determining that the initial state of the hot backup device is a standby state.
7. The method according to claim 6, wherein when the initial state of the hot-standby device is the host state, the determining the current state of the hot-standby device according to the initial state of the hot-standby device and the current level signal of the first input pin specifically comprises:
receiving a watchdog message and a self-checking result of the computer;
and determining the current state of the hot backup device according to the watchdog message, the current level signal of the first input pin and the self-checking result.
8. The method according to claim 7, wherein the determining the current state of the hot backup apparatus according to the watchdog message, the current level signal of the first input pin, and the self-test result specifically comprises:
when the watchdog message is received, determining that the current state of the hot backup device is switched into a host error waiting state from the host state;
judging whether the self-checking result passes or not in the host error waiting state;
if the self-checking result is that the current level signal of the first input pin is a high level, determining that the current state of the hot backup device is switched from the host error waiting state to the host state;
and if the self-checking result is that the current level signal of the first input pin is a low level, determining that the current state of the hot backup device is switched into a standby state from the host error waiting state.
9. The method of claim 8, wherein after determining whether the self-test result passes in the host error wait state, the method further comprises:
when the self-checking result is judged to be failed, determining that the current state of the hot backup device is switched into an error state from the host error waiting state;
judging whether a watchdog reset message is received or not in the error state;
if so, determining that the current state of the hot backup device is switched into an error waiting state from the error state;
judging whether the second self-checking result of the computer passes or not in the error waiting state;
if so, determining that the current state of the hot backup device is switched from the error waiting state to a host error waiting state, and if not, determining that the current state of the hot backup device is switched from the error waiting state to the error state.
10. The method according to claim 6, wherein when the state of the hot-standby apparatus is a standby state, the determining the current state of the hot-standby apparatus according to the initial state of the hot-standby apparatus and the current level signal of the first input pin specifically comprises:
receiving a control message sent by the affiliated computer;
and determining the current state of the hot standby device according to the control message and the current level signal of the first input pin, wherein the control message is used for indicating whether the computer takes over the bus.
11. The method according to claim 9, wherein determining the current state of the hot standby device according to the control message and the current level signal of the first input pin comprises:
when the current level signal of the first input pin is high level, determining that the current state of the hot standby device is switched from the standby state to a standby preparation state;
in the standby state, judging whether the control message indicates the computer to take over the bus;
if yes, determining that the current state of the hot backup device is switched to the host state from the standby state;
if not, determining that the current state of the hot backup device is switched to the standby state from the standby preparation state.
12. The method of claim 11, further comprising:
in the standby machine preparation state or the standby machine state, when an error message or a watchdog reset message sent by the computer is received, determining that the current state of the hot backup device is switched into an error waiting state from the standby machine preparation state or the standby machine state;
judging whether the self-checking result of the computer passes or not in the error waiting state;
if so, determining that the current state of the hot backup device is switched from the error waiting state to the state before the error waiting state, and if not, determining that the current state of the hot backup device is switched from the error waiting state to the error state.
13. The method of claim 12, further comprising:
when both computers have errors and the hot backup device is in the error state, the hot backup device is controlled by the computer to be in the error state and to be transferred to the host state from the error state.
14. The method according to any one of claims 4 to 13, wherein the determining the output state of the first output pin of the corresponding computer according to the current state of the hot-standby device specifically includes:
when the current state of the hot backup device is in a standby state, determining that the output state of the first output pin is a turning state; when the current state of the hot backup device is in a host state or a standby take-over waiting state, determining that the output state of the first output pin is a low level; when the current state of the hot backup device is in a host error waiting state, an error state or an error waiting state, determining that the output state of the first output pin is a high level; and when the current state of the hot backup device is in an idle state or a sampling state, determining that the output state of the first output pin is high resistance.
15. A hot backup device is characterized in that the device is suitable for a dual-computer hot backup system, the system comprises two computers, each computer is provided with a hot backup device, each hot backup device is connected with a first input pin and a first output pin of the corresponding computer, the first input pin of each computer is connected with a first output pin of the other computer to form two connecting lines, one connecting line is connected with a power supply in an upward pulling mode, the other connecting line is connected with a ground in a downward pulling mode, and each hot backup device comprises:
the detection module is used for detecting a level signal of a first input pin of the computer;
the pin state determining module is used for determining the output state of a first output pin of the computer according to the level signal of the first input pin;
and the computer state determining module is used for determining the state of the computer according to the output state of the first output pin.
16. A dual computer hot standby system, comprising two computers, each of which is provided with the hot standby device of claim 15, wherein each of the hot standby devices is connected to the first input pin and the first output pin of the corresponding computer, the first input pin of each computer is connected to the first output pin of the other computer to form two connecting wires, one connecting wire is pulled up to a power supply, and the other connecting wire is pulled down to ground.
17. A computer storage medium, characterized in that the storage medium stores therein a computer program, which when executed implements the dual-computer hot-backup method according to any one of claims 1 to 14.
CN201810680677.2A 2018-06-27 2018-06-27 Dual-computer hot backup method, device and system and computer storage medium Active CN110647426B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810680677.2A CN110647426B (en) 2018-06-27 2018-06-27 Dual-computer hot backup method, device and system and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810680677.2A CN110647426B (en) 2018-06-27 2018-06-27 Dual-computer hot backup method, device and system and computer storage medium

Publications (2)

Publication Number Publication Date
CN110647426A true CN110647426A (en) 2020-01-03
CN110647426B CN110647426B (en) 2023-04-11

Family

ID=68988716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810680677.2A Active CN110647426B (en) 2018-06-27 2018-06-27 Dual-computer hot backup method, device and system and computer storage medium

Country Status (1)

Country Link
CN (1) CN110647426B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080209110A1 (en) * 2007-02-22 2008-08-28 Mosaid Technologies Incorporated Apparatus and method of page program operation for memory devices with mirror back-up of data
CN101281483A (en) * 2008-05-12 2008-10-08 北京邮电大学 Double-machine redundant tolerant system and redundant switching method thereof
CN101968756A (en) * 2010-09-29 2011-02-09 航天东方红卫星有限公司 Satellite-borne computer autonomously computer switching system based on field programmable gata array (FPGA)
US20120226367A1 (en) * 2009-09-02 2012-09-06 Abb Research Ltd Redundant control for a process control system
CN103631178A (en) * 2013-11-04 2014-03-12 中国航天科技集团公司第九研究院第七七一研究所 Double-unit backup redundancy control device
CN104111881A (en) * 2014-07-25 2014-10-22 中国航天科工集团第二研究院七〇六所 Arbitration device for double computer redundancy hot backup computer
CN104679610A (en) * 2015-02-11 2015-06-03 东莞前沿技术研究院 Management method and device for computer system
CN106776468A (en) * 2016-12-23 2017-05-31 山东航天电子技术研究所 A kind of dual redundant reconfigurable satellite-borne computer system based on cpci bus

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080209110A1 (en) * 2007-02-22 2008-08-28 Mosaid Technologies Incorporated Apparatus and method of page program operation for memory devices with mirror back-up of data
CN101281483A (en) * 2008-05-12 2008-10-08 北京邮电大学 Double-machine redundant tolerant system and redundant switching method thereof
US20120226367A1 (en) * 2009-09-02 2012-09-06 Abb Research Ltd Redundant control for a process control system
CN101968756A (en) * 2010-09-29 2011-02-09 航天东方红卫星有限公司 Satellite-borne computer autonomously computer switching system based on field programmable gata array (FPGA)
CN103631178A (en) * 2013-11-04 2014-03-12 中国航天科技集团公司第九研究院第七七一研究所 Double-unit backup redundancy control device
CN104111881A (en) * 2014-07-25 2014-10-22 中国航天科工集团第二研究院七〇六所 Arbitration device for double computer redundancy hot backup computer
CN104679610A (en) * 2015-02-11 2015-06-03 东莞前沿技术研究院 Management method and device for computer system
CN106776468A (en) * 2016-12-23 2017-05-31 山东航天电子技术研究所 A kind of dual redundant reconfigurable satellite-borne computer system based on cpci bus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈玉坤等: "具备重构能力的三模冗余器载计算机研究", 《计算机测量与控制》 *

Also Published As

Publication number Publication date
CN110647426B (en) 2023-04-11

Similar Documents

Publication Publication Date Title
CN107347018B (en) Three-redundancy 1553B bus dynamic switching method
US20160092320A1 (en) Electronic fault detection unit
KR101558687B1 (en) Serial communication test device, system including the same and method thereof
CN107077409B (en) Method and apparatus for multi-interface debugging in an electronic system
US20090177866A1 (en) System and method for functionally redundant computing system having a configurable delay between logically synchronized processors
CN104899111B (en) A kind of method and system for handling home gateway system Kernel Panic
CN110413456B (en) Triple redundant data step-by-step voting system and method
US7930165B2 (en) Procedure and device for emulating a programmable unit providing system integrity control
CN104598341B (en) For determining the method and system of the location of fault between interconnection/controller
CN104050061A (en) Multi-main-control-panel redundant backup system based on PCIe bus
CN104850475B (en) A kind of test method and device of equipment
CN103425553A (en) Duplicated hot-standby system and method for detecting faults of duplicated hot-standby system
US7568138B2 (en) Method to prevent firmware defects from disturbing logic clocks to improve system reliability
CN106796541B (en) Data processing apparatus
US11442831B2 (en) Method, apparatus, device and system for capturing trace of NVME hard disc
CN110647426B (en) Dual-computer hot backup method, device and system and computer storage medium
CN212541329U (en) Dual-redundancy computer equipment based on domestic Loongson platform
US11094392B2 (en) Testing of fault detection circuit
US8880956B2 (en) Facilitating processing in a communications environment using stop signaling
WO2019129196A1 (en) Fault-tolerant control method, system and device for electric motor controller, and storage medium
US11953550B2 (en) Server JTAG component adaptive interconnection system and method
TWI501593B (en) Switch test apparatus and test apparatus thereof
CN100472504C (en) Redundancy control device and method of central interface disc
CN111277820A (en) Failure detection method and device for camera system and detection and recovery method
RU120256U1 (en) THREE-CHANNEL FAULT-RESISTANT SYSTEM ON CONFIGURABLE PROCESSORS WITH EXTERNAL AND INTRICRYSTAL RESERVATION

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100095 Building 2, Longxin Industrial Park, Zhongguancun environmental protection technology demonstration park, Haidian District, Beijing

Applicant after: Loongson Zhongke Technology Co.,Ltd.

Address before: 100095 Building 2, Longxin Industrial Park, Zhongguancun environmental protection technology demonstration park, Haidian District, Beijing

Applicant before: LOONGSON TECHNOLOGY Corp.,Ltd.

GR01 Patent grant
GR01 Patent grant