CN103077091B - A kind of management method of masterslave switchover and system - Google Patents

A kind of management method of masterslave switchover and system Download PDF

Info

Publication number
CN103077091B
CN103077091B CN201210592150.7A CN201210592150A CN103077091B CN 103077091 B CN103077091 B CN 103077091B CN 201210592150 A CN201210592150 A CN 201210592150A CN 103077091 B CN103077091 B CN 103077091B
Authority
CN
China
Prior art keywords
disk
main
standby
time threshold
time
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.)
Active
Application number
CN201210592150.7A
Other languages
Chinese (zh)
Other versions
CN103077091A (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.)
Raisecom Technology Co Ltd
Original Assignee
Raisecom Technology Co 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 Raisecom Technology Co Ltd filed Critical Raisecom Technology Co Ltd
Priority to CN201210592150.7A priority Critical patent/CN103077091B/en
Publication of CN103077091A publication Critical patent/CN103077091A/en
Application granted granted Critical
Publication of CN103077091B publication Critical patent/CN103077091B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Washing And Drying Of Tableware (AREA)

Abstract

The invention provides a kind of management method and system of masterslave switchover.Described method, comprising: active and standby first dish each other and the second dish all in place and working properly time, if detect that the second hair updo plays the operation of switching into primary dish from dish for subsequent use as the first dish of primary dish, then control the first dish continuation as primary dish work; Coiling after all as primary dish at the first dish and second, the first dish and second being coiled as carrying out timing the working time of primary dish simultaneously; By first dish and second coil working time and each self-corresponding time threshold compare; If the time threshold not reaching the second dish correspondence working time of the second dish, then controlling the second dish is dish for subsequent use; If the first dish reaches the time threshold of the second dish correspondence, then according to the rule pre-set, one in selecting the first dish and second to coil as dish for subsequent use.

Description

Method and system for managing main/standby switching
Technical Field
The present invention relates to the field of information processing, and in particular, to a method and a system for managing main/standby switching.
Background
The main/standby switching characteristic is used for realizing high reliability of the system. The device supporting the main/standby switching characteristic comprises two single disks, one is a main disk and works in a Master mode; the other is a spare disk and operates in the Slave mode. The standby disk keeps the current configuration consistent with that of the main disk through a synchronization function.
The switching relationship between the main and standby mechanisms in the prior art is shown in table 1,
TABLE 1
The general switching mechanism uses 6 or 4 signal line designs, which are the on-site signals, normal signals, and active/standby state signals of the main/standby disks or the normal signals and the active/standby state signals of the main/standby disks. The simple and easy-to-use main/standby switching mechanism is normal in a normal and stable state, but has certain problems after long-time debugging test and market inspection. The most important point is that when the main disk works normally, the back disk connector is in a state similar to continuous or disconnected for a period of time in the process of inserting or extracting the standby disk, some signal pins are disconnected, and some signal pins are still in a connected state. Although the time is short, the uncertainty of the input and output of the main/standby state signals is caused in the short time, which may cause the system to generate an inappropriate main/standby switch in the short time. The following is illustrated by way of example:
fig. 1 is a schematic diagram showing a comparison between theoretical and actual signals of a state line after a disk a is a spare disk and a disk B is a main disk in the prior art and the disk a is pulled out. Wherein, the master-slave in-place signal: low is in place and high is out of place; main active state signal (ACT signal): high Master (Master) active state; power supply waveform: high is electrified, low is unpowered; selecting main and standby signals of a line card (service card): the high disk is mainly the current system A disk, and the low disk is mainly the current system B disk.
In practice, the pins of the connectors cannot be exactly the same length, there are always errors, and there are slight angular deviations when the tray is inserted and extracted, which can cause problems. In fig. 1, a common case is taken as an example, in which the pin on the a-disc for detecting the bit condition of the B-disc is turned off first, then the ACT signal pin is turned off, and finally the power signal pin is turned off. At this time, because the disk a cannot detect the on-position signal of the disk B, the disk B is mistakenly regarded as not on-position, and thus is in the active state, in the scheme of the prior art, after the disk B receives the signal that the disk a is the master, the disk B turns into the spare disk itself, and after the disk a is completely pulled out, the ACT signal output by the disk a is also disconnected, and at this time, the disk B finds that the disk a becomes the spare disk again, and then the disk B turns into the master disk itself again. Such unplugging of the spare disk would cause the system to switch unnecessarily twice. In this case, the contact jitter of the ACT signal pin is taken as an example, and other jitter at the contact position of the active and standby pins can cause the similar situation, which is not described herein again.
Therefore, how to ensure the stability of the main/standby states without error switching is an urgent technical problem to be solved.
Disclosure of Invention
The invention provides a method and a system for managing main/standby switching, which aim to solve the technical problem of how to avoid unnecessary switching of a main/standby disk.
In order to solve the technical problems, the invention provides the following technical scheme:
a master/slave switching management method includes:
when the first disk and the second disk which are mutually the main disk and the standby disk are in place and work normally, if the first disk which is used as the main disk detects that the second disk initiates the operation of switching from the standby disk to the main disk, the first disk is controlled to continue to work as the main disk;
after the first disk and the second disk are both used as the main disks, timing the running time of the first disk and the second disk which are used as the main disks;
comparing the running time of the first disk and the second disk with the corresponding time threshold value;
if the running time of the second disk does not reach the time threshold value corresponding to the second disk, controlling the second disk to be a spare disk; and if the running time of the second disk reaches the time threshold corresponding to the second disk, selecting one of the first disk and the second disk as a spare disk according to a preset rule.
Preferably, the method also has the following characteristics: selecting one of the first disc and the second disc as a spare disc according to a preset rule, comprising:
if the first disk is still running and the running time does not reach the time threshold value corresponding to the first disk, controlling the second disk to be used as a standby disk;
and if the running time of the first disk reaches the time threshold corresponding to the first disk, controlling the disk reaching the time threshold first as a spare disk under the condition that the time thresholds of the first disk and the second disk are not equal.
Preferably, the method also has the following characteristics: the time threshold values of the first disk and the second disk are both larger than the time determined according to the width of the interference wave when the disks are inserted and pulled.
Preferably, the method also has the following characteristics:
the time threshold of the first disk is greater than the time threshold of the second disk, wherein the difference between the time threshold of the first disk and the time threshold of the second disk is greater than or equal to the sum of one working cycle of the second disk and a detection cycle of the first disk for detecting the active/standby state of the second disk; or,
the time threshold of the first disk is smaller than the time threshold of the second disk, wherein the difference between the time threshold of the second disk and the time threshold of the first disk is greater than or equal to the sum of one working cycle of the first disk and a detection cycle of the second disk for detecting the active/standby state of the first disk.
Preferably, the method also has the following characteristics: the method further comprises the following steps:
and if the second disk serving as the standby disk detects that the first disk starts to switch from the main disk to the standby disk, controlling the second disk to directly start switching from the standby disk to the main disk.
Preferably, the method also has the following characteristics: the in-place state and the active/standby state of the first disk and the second disk are obtained through programmable logic devices configured on the respective disks, wherein each programmable logic device is connected with a state line of each disk through a pin.
Preferably, the method also has the following characteristics: the method further comprises the following steps:
before the second disk initiates the operation of switching from the standby disk to the main disk, recording the main disk before the switching is initiated;
in the process that the first disk and the second disk are both used as the main disk, the recorded disk is used as the main disk to continue the response task;
and when the first disk and the second disk are detected to be mutually active and standby, the main disk is adopted to respond to the processing task.
A master-slave switching management system comprises a first disk and a second disk which are mutually a master disk and a slave disk, and the system also comprises a service card which uses the first disk and the second disk to respond to a service, wherein the service card comprises:
the first control module is used for controlling the first disk to continuously work as the main disk if the first disk serving as the main disk detects that the second disk initiates the operation of switching from the standby disk to the main disk when the first disk and the second disk which are mutually the main disk and the standby disk are in place and work normally;
the timing module is used for timing the running time of the first disk and the second disk as the main disk simultaneously after the first disk and the second disk are both used as the main disk;
the comparison module is connected with the timing module and compares the running time of the first disk and the running time of the second disk with the corresponding time threshold values;
the second control module is connected with the comparison module and used for controlling the second disk to be a standby disk if the running time of the second disk does not reach the time threshold value corresponding to the second disk; and if the running time of the second disk reaches the time threshold corresponding to the second disk, selecting one of the first disk and the second disk as a spare disk according to a preset rule.
Preferably, the system also has the following features: the second control module is used for controlling the second disk to be used as a standby disk if the first disk is still running and the running time does not reach the time threshold value corresponding to the first disk; and if the running time of the first disk reaches the time threshold corresponding to the first disk, controlling the disk reaching the time threshold first as a spare disk under the condition that the time thresholds of the first disk and the second disk are not equal.
Preferably, the system also has the following features: the time threshold values of the first disk and the second disk are both larger than the time determined according to the width of the interference wave when the disks are inserted and pulled.
Preferably, the system also has the following features:
the time threshold of the first disk is greater than the time threshold of the second disk, wherein the difference between the time threshold of the first disk and the time threshold of the second disk is greater than or equal to the sum of one working cycle of the second disk and a detection cycle of the first disk for detecting the active/standby state of the second disk; or,
the time threshold of the first disk is smaller than the time threshold of the second disk, wherein the difference between the time threshold of the second disk and the time threshold of the first disk is greater than or equal to the sum of one working cycle of the first disk and a detection cycle of the second disk for detecting the active/standby state of the first disk.
Preferably, the system also has the following features: the service card further comprises:
and the third control chip is used for controlling the second disk to directly initiate the switching from the standby disk to the main disk if the second disk serving as the standby disk detects that the first disk initiates the switching operation from the main disk to the standby disk.
Preferably, the system also has the following features: further comprising:
and each programmable logic device is connected with the state lines of the first disk and the second disk through pins and is used for acquiring the in-place state and the active/standby state of the first disk and the second disk.
Preferably, the system also has the following features: the service card further comprises:
the recording module is used for recording the main disk before switching is initiated before switching from the standby disk to the main disk is initiated;
the response module is connected with the recording module and used for using the recorded disk as the main disk to continue a response task in the process that the first disk and the second disk are both used as the main disk; and when the first disk and the second disk are detected to be mutually active and standby, adopting the active disk to respond to the processing task.
The invention provides a new switching scheme, which changes the original state with priority as standby into the state with priority as main, so that the main disk can occupy the dominant position in the main-standby switching, and the mutual abdicating situation can not occur, but the collision phenomenon that two disks are simultaneously main can be caused.
In addition, the scheme provided by the invention does not need to limit the type selection of the connector because the state of each disk is acquired through the pin by the programmable logic device, effectively ensures the real-time performance of the main/standby switching (0 time delay under the normal switching condition), does not need to increase more signal lines, and does not belong to the traditional filtering scheme.
Drawings
FIG. 1 is a schematic diagram showing a comparison between theoretical and actual signals of a state line after a disk A is a spare disk and a disk B is a main disk in the prior art and the disk A is pulled out;
fig. 2 is a flowchart illustrating an embodiment of a main/standby switching management method according to the present invention;
FIG. 3 is a schematic diagram of a circuit for acquiring a status line signal according to the present invention;
FIG. 4 is a schematic diagram of the internal logic state switching process of the programmable logic device according to the present invention;
fig. 5 is a schematic structural diagram of an embodiment of a main/standby switching management system provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Fig. 2 is a flowchart illustrating an embodiment of a main/standby switching management method according to the present invention. The embodiment of the method shown in fig. 2 comprises:
step 201, when the first disk and the second disk, which are mutually a master disk and a standby disk, are both in place and work normally, if the first disk, which is used as the master disk, detects that the second disk initiates the operation of switching from the standby disk to the master disk, the first disk is controlled to continue to work as the master disk;
step 202, after the first disk and the second disk are both used as the master disk, timing the running time of the first disk and the second disk used as the master disk;
step 203, comparing the running time of the first disk and the second disk with the corresponding time threshold values;
step 204, if the running time of the second disk does not reach the time threshold corresponding to the second disk, controlling the second disk to be a spare disk; and if the running time of the second disk reaches the time threshold corresponding to the second disk, selecting one of the first disk and the second disk as a spare disk according to a preset rule.
It should be noted that, the condition for triggering the second disk as the primary disk may be that jitter initiated when the second disk is plugged or unplugged causes the second disk to obtain information that the first disk is used as the standby disk, and since the information is wrong, two unnecessary switching operations may be caused, so that when the standby disk initiates switching, the primary disk does not immediately initiate primary/standby switching, so that the system may have a situation where both disks are used as the primary disks; comparing the time of the two disks serving as the main disks with respective time thresholds, if the second disk does not reach the time threshold corresponding to the second disk, indicating that the disk cannot work stably, and controlling the disk which does not reach the time threshold to serve as a standby disk, wherein the two disks in the system are one master disk and one standby disk; if the second disk reaches the time threshold corresponding to the second disk, then only one of the first disk and the second disk is selected as the spare disk, and the system is also one master and one spare.
Wherein, according to a preset rule, selecting one of the first disc and the second disc as a spare disc comprises:
if the first disk is still running and the running time does not reach the time threshold value corresponding to the first disk, controlling the second disk to be used as a standby disk;
and if the running time of the first disk reaches the time threshold corresponding to the first disk, controlling the disk reaching the time threshold first as a spare disk under the condition that the time thresholds of the first disk and the second disk are not equal.
Of course, when both disks reach their respective time thresholds, the disk that was used as the primary before the occurrence of the dual masters can also be selected to continue to be used as the primary to avoid the occurrence of service switching, and of course, one disk can also be randomly controlled to be used as the backup.
Therefore, the invention can be seen that, unlike the switching mechanism in the prior art, which is that when the standby disk tries to become the main disk, the main disk immediately switches, when the standby disk tries to become the main disk, the invention adopts a competition mechanism, that is, the disk detects that the counter disk is always in the main state, and after the counter disk is determined to be in the stable operation state, the disk automatically becomes the standby state, so that the system returns to the normal stable state of one main disk and one standby disk. And if and only after the disk which is tried to be the main disk is determined to be in a stable operation state, whether switching operation is carried out is determined, and the switching accuracy is ensured.
In practical application, if the reason for triggering the standby disk to initiate switching is interference waves generated by jitter initiated during plugging, the signal lines of the state lines of the first disk and the second disk are both in a stable state as long as the interference waves are ended, and the selection of the main disk and the standby disk can be performed according to the processing mode of the prior art, so that the time thresholds of the first disk and the second disk are both greater than the time determined according to the width of the interference waves during plugging and unplugging the disks. Generally, the width of the interference wave when the disk is inserted or extracted is generally in the range of 100 microseconds to several milliseconds, for example, 4 milliseconds is selected.
If the time of the two disks as the main is greater than the respective time threshold, in order to ensure that the system can be stably switched to the running condition of one main disk and one standby disk, the following requirements need to be made on the threshold of the two disks:
the time threshold of the first disk is greater than the time threshold of the second disk, wherein the difference between the time threshold of the first disk and the time threshold of the second disk is the sum of one working cycle of the second disk and a detection cycle of the first disk for detecting the main/standby state of the second disk; or,
the time threshold of the first disk is smaller than the time threshold of the second disk, wherein the difference between the time threshold of the second disk and the time threshold of the first disk is the sum of one working cycle of the first disk and a detection cycle of the second disk for detecting the active/standby state of the first disk.
Through the setting, the respective time thresholds of the two disks in the system are inconsistent, the situation that the stability is insufficient in the mode of randomly selecting or presetting the fixed master disk in the arbitration process of the double master disks can be avoided, the master-slave adjustment in the trigger system is preferably realized, and the stability of the system is ensured.
The same as the prior art, if the first disk as the standby disk detects that the second disk initiates the operation of switching from the main disk to the standby disk, the first disk directly initiates the switching from the standby disk to the main disk.
One handling of the first disc (a disc) and the second disc (B disc) in the two cases described above is illustrated in the following table:
TABLE 2
For other cases, as in the prior art, both disks are in place, but one of them is not working normally, the disk working normally becomes the primary disk, and the disk working abnormally serves as the spare disk. See in particular the following table:
TABLE 3
The sub-cases in table 3 specifically refer to:
if the opposite terminal is the main terminal, judging whether the opposite terminal is the main terminal, if the opposite terminal is the main terminal, the opposite terminal is the standby terminal, otherwise, the opposite terminal is the main terminal;
if the state of the opposite terminal is the main state, whether the work of the opposite terminal is in the stable operation state is judged, when the opposite terminal can work stably, the opposite terminal is standby, otherwise, the opposite terminal continues to be the main state.
The content in table 3 illustrates the switching between the main and standby devices under different conditions, so that it can be seen that, unlike the filtering management in the prior art, the logic determination is performed by acquiring the on-site state information, and thus the real-time performance is strong.
How to quickly acquire the on-site state information, the invention provides a new solution:
the in-place state and the active/standby state of the first disk and the second disk are obtained through programmable logic devices configured on the respective disks, wherein each programmable logic device is connected with a state line of each disk through a pin.
Fig. 3 is a schematic diagram of a circuit for acquiring a status line signal according to the present invention. In fig. 3, the status line for indicating the status information of each disk is connected to the pin of the programmable logic device disposed on each disk, and the programmable logic device obtains each status information without adding additional hardware, and thus the status information of the corresponding disk can be obtained without time delay, and further corresponding processing operation is performed.
In order to avoid unnecessary migration of services using the service cards of the first disk and the second disk between the two disks in the process that the first disk and the second disk are both main in the system, the service cards need to manage the selection of the used main disk. Specifically, the method comprises the following steps:
before the second disk initiates the operation of switching from the standby disk to the main disk, recording the main disk which is used as the standby disk before the second disk initiates the switching;
in the process that the first disk and the second disk are both used as the main disk, the recorded disk is used as the main disk to continue the response task;
and when the first disk and the second disk are detected to be mutually active and standby, adopting the active disk to respond to the processing task.
As can be seen from tables 2 and 3, after the above example (the a disk is the standby disk and the B disk is the primary disk, at this time, the a disk is pulled out) is the primary disk, under the condition that the timeout timer of the dual-master state is not overtime, even if the a disk becomes the primary disk again, a transient conflict occurs, the B disk also stays as the primary disk, and the line card (service card) uses the original primary disk according to the principle of only using valid primary and standby signals, when a conflict occurs, that is, during the period of time of judging whether the disk that is supposed to become the primary disk can normally operate, that is, the last correct state is adopted, so that the line card (service card) also stays that the B disk is the primary disk, which is the same as the theory, and the system is not affected by plugging and pulling out the standby disk. The line card (service card) side logic (i.e., the primary and standby filtering algorithms) is shown in table 4.
TABLE 4
Fig. 4 is a schematic diagram of the internal logic state switching process of the programmable logic device according to the present invention. The contents shown in fig. 4 include:
when the disk is a master disk (state 1), the master disk and the slave disk are in place and normal, if the disk state is changed into the master disk, the master disk does not immediately change into the slave disk, but a double-master state timeout timer in a programmable logic device to which the two disks belong is adopted to simultaneously and respectively start timing the time of the two disks serving as the master disk, if the timing time of the double-master state timeout timer of the master disk comes first, the master disk becomes the slave disk, and the system is stabilized in a state 2; if the time timed by the double-main-state overtime timer of the standby disk is up first, the main state of the main disk is unchanged, the standby disk is changed from the main state to the standby disk, and the system is stabilized to the state 1.
When the disk is a standby disk (state 2), the main disk and the standby disk are in place and normal, if the disk state is changed into the standby disk, the disk can be changed into the main disk immediately at this moment, and the system is stabilized to the state 1 without any delay.
When the disk is the main disk (state 1), the disk is in place but not normal, the opposite disk is in place and normal, the opposite disk becomes the main disk, the local disk immediately becomes the standby disk, and the system is stabilized to the state 2 without any delay.
When the disk is a spare disk (state 2), the disk is in place and normal, the opposite disk is in place and abnormal, the disk becomes a master immediately, the opposite disk becomes a spare immediately, and the system is stabilized to a state 1 without any delay.
When the disk is a standby disk, the opposite disk is not in place, the disk immediately becomes a main disk, and if the disk is in a normal condition, the disk is directly stabilized to a state 1 without any delay; if the jitter is caused by pulling out the disk and the like, the disk enters a state 3, a double-main state occurs, if the timing time of the double-main state timeout timer of the disk arrives first, the disk finally stabilizes and then enters a state 2, if the timing time of the double-main state timeout timer arrives first, the disk finally stabilizes and then enters a state 1, and the line card (service card) uses a main/standby filtering algorithm of a table 4 during the period, so that the service cannot be influenced.
It can be seen from the above that, the embodiment of the method provided by the present invention not only does not need to limit the type selection of the connector, but also effectively ensures the real-time performance of the main/standby switching (0 time delay in the case of normal switching), and does not need to increase more signal lines. The stability of the main/standby state is ensured at any time only by depending on the algorithm, and the whole main/standby switching thoroughly overcomes the problem of randomness when the connector is pulled out by matching with the main/standby state judgment algorithm of the line card (service card), so that the main/standby switching scheme with high real-time performance, strong stability and extremely high anti-interference capability is changed.
Fig. 5 is a schematic structural diagram of an embodiment of a main/standby switching management system provided in the present invention. The embodiment of the system shown in fig. 5 includes a first disk and a second disk that are active and standby, and the system further includes a service card that uses the first disk and the second disk to respond to a service, where the service card includes:
the first control module is used for controlling the first disk to continuously work as the main disk if the first disk serving as the main disk detects that the second disk initiates the operation of switching from the standby disk to the main disk when the first disk and the second disk which are mutually the main disk and the standby disk are in place and work normally;
the timing module is used for timing the running time of the first disk and the second disk as the main disk simultaneously after the first disk and the second disk are both used as the main disk;
the comparison module is connected with the timing module and compares the running time of the first disk and the running time of the second disk with the corresponding time threshold values;
the second control module is connected with the comparison module and used for controlling the second disk to be a standby disk if the running time of the second disk does not reach the time threshold value corresponding to the second disk; and if the running time of the second disk reaches the time threshold corresponding to the second disk, selecting one of the first disk and the second disk as a spare disk according to a preset rule.
The second control module is used for controlling the second disk to serve as a standby disk if the first disk is still running and the running time does not reach the time threshold corresponding to the first disk; and if the running time of the first disk reaches the time threshold corresponding to the first disk, controlling the disk reaching the time threshold first as a spare disk under the condition that the time thresholds of the first disk and the second disk are not equal.
And the time threshold values of the first disk and the second disk are both larger than the time determined according to the width of the interference wave when the disks are inserted and pulled.
The time threshold of the first disk is greater than the time threshold of the second disk, wherein the difference between the time threshold of the first disk and the time threshold of the second disk is greater than or equal to the sum of one working cycle of the second disk and a detection cycle of the first disk for detecting the main/standby state of the second disk; or,
the time threshold of the first disk is smaller than the time threshold of the second disk, wherein the difference between the time threshold of the second disk and the time threshold of the first disk is greater than or equal to the sum of one working cycle of the first disk and a detection cycle of the second disk for detecting the active/standby state of the first disk.
Wherein, the service card further comprises:
and the third control chip is used for controlling the second disk to directly initiate the switching from the standby disk to the main disk if the second disk serving as the standby disk detects that the first disk initiates the switching operation from the main disk to the standby disk.
Wherein the system further comprises:
and each programmable logic device is connected with the state lines of the first disk and the second disk through pins and is used for acquiring the in-place state and the active/standby state of the first disk and the second disk.
Wherein, the service card further comprises:
the recording module is used for recording the main disk before switching is initiated before switching from the standby disk to the main disk is initiated;
the response module is connected with the recording module and used for using the recorded disk as the main disk to continue a response task in the process that the first disk and the second disk are both used as the main disk; and when the first disk and the second disk are detected to be mutually active and standby, adopting the active disk to respond to the processing task.
Therefore, it can be seen that, unlike the switching mechanism in the prior art, when the standby disk tries to become the primary disk, the primary disk immediately switches, and when the standby disk tries to become the primary disk, a contention mechanism is adopted, that is, the disk detects that the counter disk is always in the primary state, and after determining that the standby disk is in the stable operation state, the disk automatically becomes the standby state, so that the system returns to the normal stable state of one master and one standby. And if and only after the disk which is tried to be the main disk is determined to be in a stable operation state, whether switching operation is carried out is determined, and the switching accuracy is ensured.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (14)

1. A method for managing main/standby switching is characterized by comprising the following steps:
when the first disk and the second disk which are mutually the main disk and the standby disk are in place and work normally, if the first disk which is used as the main disk detects that the second disk initiates the operation of switching from the standby disk to the main disk, the first disk is controlled to continue to work as the main disk;
before the second disk initiates the operation of switching from the standby disk to the main disk, recording the main disk before the switching is initiated;
in the process that the first disk and the second disk are both used as the main disk, the recorded disk is used as the main disk to continue the response task;
after the first disk and the second disk are both used as the main disks, timing the running time of the first disk and the second disk which are used as the main disks;
comparing the running time of the first disk and the second disk with the corresponding time threshold value;
if the running time of the second disk does not reach the time threshold value corresponding to the second disk, controlling the second disk to be a spare disk; and if the running time of the second disk reaches the time threshold corresponding to the second disk, selecting one of the first disk and the second disk as a spare disk according to a preset rule.
2. The method of claim 1, wherein selecting one of the first disc and the second disc as a spare disc according to a preset rule comprises:
if the first disk is still running and the running time does not reach the time threshold value corresponding to the first disk, controlling the second disk to be used as a standby disk;
and if the running time of the first disk reaches the time threshold corresponding to the first disk, controlling the disk reaching the time threshold first as a spare disk under the condition that the time thresholds of the first disk and the second disk are not equal.
3. The method of claim 1, wherein the time threshold for each of the first disk and the second disk is greater than a time determined based on a width of the interference wave when the disk is inserted or extracted.
4. A method according to any one of claims 1 to 3, wherein:
the time threshold of the first disk is greater than the time threshold of the second disk, wherein the difference between the time threshold of the first disk and the time threshold of the second disk is greater than or equal to the sum of one working cycle of the second disk and a detection cycle of the first disk for detecting the active/standby state of the second disk; or,
the time threshold of the first disk is smaller than the time threshold of the second disk, wherein the difference between the time threshold of the second disk and the time threshold of the first disk is greater than or equal to the sum of one working cycle of the first disk and a detection cycle of the second disk for detecting the active/standby state of the first disk.
5. The method of claim 1, further comprising:
and if the second disk serving as the standby disk detects that the first disk starts to switch from the main disk to the standby disk, controlling the second disk to directly start switching from the standby disk to the main disk.
6. The method of claim 1, wherein the on-bit state and the active-standby state of the first disk and the second disk are obtained through programmable logic devices configured on the respective disks, wherein each programmable logic device is connected to a status line of the respective disk through a pin.
7. The method of claim 1, further comprising:
and when the first disk and the second disk are detected to be mutually active and standby, the main disk is adopted to respond to the processing task.
8. A master-slave switching management system includes a first disk and a second disk which are mutually master-slave, and is characterized in that the system also includes a service card which uses the first disk and the second disk to respond to service, wherein the service card includes:
the first control module is used for controlling the first disk to continuously work as the main disk if the first disk serving as the main disk detects that the second disk initiates the operation of switching from the standby disk to the main disk when the first disk and the second disk which are mutually the main disk and the standby disk are in place and work normally;
the timing module is used for timing the running time of the first disk and the second disk as the main disk simultaneously after the first disk and the second disk are both used as the main disk;
the comparison module is connected with the timing module and compares the running time of the first disk and the running time of the second disk with the corresponding time threshold values;
the second control module is connected with the comparison module and used for controlling the second disk to be a standby disk if the running time of the second disk does not reach the time threshold value corresponding to the second disk; if the running time of the second disk reaches the time threshold corresponding to the second disk, selecting one of the first disk and the second disk as a spare disk according to a preset rule;
the recording module is used for recording the main disk before switching is initiated before switching from the standby disk to the main disk is initiated;
and the response module is connected with the recording module and used for using the recorded disk as the main disk to continue the response task in the process that the first disk and the second disk are both used as the main disk.
9. The system of claim 8, wherein:
the second control module is used for controlling the second disk to be used as a standby disk if the first disk is still running and the running time does not reach the time threshold value corresponding to the first disk; and if the running time of the first disk reaches the time threshold corresponding to the first disk, controlling the disk reaching the time threshold first as a spare disk under the condition that the time thresholds of the first disk and the second disk are not equal.
10. The system of claim 8, wherein the time threshold for each of the first disk and the second disk is greater than the time determined based on the width of the interference wave when the disk is inserted or extracted.
11. The system according to any one of claims 8 to 10, wherein:
the time threshold of the first disk is greater than the time threshold of the second disk, wherein the difference between the time threshold of the first disk and the time threshold of the second disk is greater than or equal to the sum of one working cycle of the second disk and a detection cycle of the first disk for detecting the active/standby state of the second disk; or,
the time threshold of the first disk is smaller than the time threshold of the second disk, wherein the difference between the time threshold of the second disk and the time threshold of the first disk is greater than or equal to the sum of one working cycle of the first disk and a detection cycle of the second disk for detecting the active/standby state of the first disk.
12. The system of claim 8, wherein the service card further comprises:
and the third control chip is used for controlling the second disk to directly initiate the switching from the standby disk to the main disk if the second disk serving as the standby disk detects that the first disk initiates the switching operation from the main disk to the standby disk.
13. The system of claim 8, further comprising:
and each programmable logic device is connected with the state lines of the first disk and the second disk through pins and is used for acquiring the in-place state and the active/standby state of the first disk and the second disk.
14. The system of claim 8,
and the response module is further used for responding to the processing task by adopting the main disk after detecting that the first disk and the second disk are mutually active and standby.
CN201210592150.7A 2012-12-28 2012-12-28 A kind of management method of masterslave switchover and system Active CN103077091B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210592150.7A CN103077091B (en) 2012-12-28 2012-12-28 A kind of management method of masterslave switchover and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210592150.7A CN103077091B (en) 2012-12-28 2012-12-28 A kind of management method of masterslave switchover and system

Publications (2)

Publication Number Publication Date
CN103077091A CN103077091A (en) 2013-05-01
CN103077091B true CN103077091B (en) 2015-09-23

Family

ID=48153625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210592150.7A Active CN103077091B (en) 2012-12-28 2012-12-28 A kind of management method of masterslave switchover and system

Country Status (1)

Country Link
CN (1) CN103077091B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6409812B2 (en) * 2016-04-01 2018-10-24 横河電機株式会社 Redundancy apparatus, redundancy system, and redundancy method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2762737B1 (en) * 1997-04-24 1999-06-11 Alsthom Cge Alcatel METHOD FOR CHANGING SOFTWARE VERSION IN A COMPUTER SYSTEM COMPRISING MULTIPLE STATIONS, AND COMPUTER SYSTEM FOR IMPLEMENTING SAID METHOD
CN1251419C (en) * 2002-05-30 2006-04-12 华为技术有限公司 Method for realization of fast rearranging main spared device in communication devices
CN100539509C (en) * 2003-10-16 2009-09-09 华为技术有限公司 Masterslave switchover implementation method towards high-end switch
CN100490343C (en) * 2004-07-13 2009-05-20 华为技术有限公司 A method and device for realizing switching between main and backup units in communication equipment
CN101247213A (en) * 2007-02-16 2008-08-20 华为技术有限公司 Method and system for master/standby rearrangement

Also Published As

Publication number Publication date
CN103077091A (en) 2013-05-01

Similar Documents

Publication Publication Date Title
EP3674906B1 (en) Connector, nvme storage device and computer device
CN102073562B (en) Hardware-based main/standby switch arbitration method
RU2526028C1 (en) Method of detecting battery removal
CN109491487B (en) Multifunctional power supply sequencer and monitor chip
WO2014071765A1 (en) Single board hot-plug detecting method and device
WO2011100306A2 (en) Determination of physical connectivity status of devices based on electrical measurement
CN109217922B (en) Method and device for reporting loss alarm of received signal by optical module
US10298413B2 (en) Device and method for automatic network detection and formation
CN212541329U (en) Dual-redundancy computer equipment based on domestic Loongson platform
CN103916226A (en) Redundant backup method based on embedded equipment
CN103077091B (en) A kind of management method of masterslave switchover and system
US9218029B2 (en) Method and system for resetting a SoC
CN107947123B (en) ACDC switching power supply protection circuit and ACDC switching power supply device
CN113179170A (en) Method and device for processing abnormity of power receiving end equipment, power supply end equipment and medium
CN112199232A (en) Fuse starting address identification fault-tolerant method
CN102591407A (en) Main board
CN105100344A (en) Hot plug processing method for user recognition module card, and mobile terminal
US11570022B2 (en) Electrical device that accesses a mobile telephony network in an alternative operating mode
CN113054973B (en) Control method and circuit for startup and shutdown of glucometer
CN101834748A (en) Method and device for main and standby competition
CN110995336B (en) OLP transmission link switching method and device, storage medium and OLP
CN103378902B (en) The main/standby switching method of OLT system and OLT system
CN103001789A (en) Clock switching method and clock switching device
CN108323217A (en) Connector, NVMe storage devices and computer equipment
CN220528465U (en) Embedded controller of liquid cooling cabinet and liquid cooling cabinet

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant