Summary of the invention
The objective of the invention is shortcoming, the apparatus and method that realize high availability (HA) in a kind of communication system are provided, the HA of hardware and software is managed and coordinates, realize the high HA requirement of telecommunication apparatus at above-mentioned prior art.
The invention provides the device of realizing high availability (HA) in a kind of communication system, comprising:
The device of object platform (HA-OP), the platform that is used for using with described communication system carries out data interaction, wherein, comprise interrupt interface device and exception-triggered device, the interrupt interface device is used for handling the interrupt requests of the platform that described communication system uses, and the exception-triggered device is used to handle the exception-triggered signal;
Application oriented device (HA-OA) is used to monitor the operation of local task or thread; Or be used to monitor the operation of opposite end task or thread, or be used to carry out heartbeat detection;
HA judgment device (HA-ARB) comprises the platform decision making device, the exception-triggered signal that the device of the described object platform that is used for making a strategic decision can not be handled; With the assignment decisions device, according to described application oriented Device Testing result, decision is switched or is restarted.
Alternatively, the device of described object platform also comprises:
Checkout gear is used to detect the hardware resource of local terminal and opposite end;
Management devices is used for the competitive resource between the management node, obtains the affiliated relation of competitive resource, the state information of decision object platform part, and wherein, the affiliated relation of competitive resource can change by the control at upper-layer protocol;
Wherein, described HA judgment device is handled the information of described management devices and checkout gear.
Preferably, described management devices comprises:
The device of management WatchDog Timer;
The device of the driver of management slave board I/O;
The device of the state (variate-value) of management present node;
Described checkout gear comprises: the sub-device that detects CPU, fan and power module, Ethernet card and serial ports, parallel port and SCSI (small computer system interface) interface.
Alternatively, described application oriented device comprises:
Judgment means, whether whether the operation that is used to judge local and opposite end task or thread deadlock, wherein, comprises dispensing device, go wrong by transmission information judgement thread or task;
The heartbeat detection device is used to detect the state of the HA-OA of opposite end, when finding that the opposite end heartbeat is lost, to described HA judgment device report;
Transmitting device; Connect described judgment means and described heartbeat detection device, be used for carrying out alternately with described HA judgment device.
Preferably, described HA judgment device also comprises:
Tape deck is used to write down the operating state of node, the state of platform, the state of node task or thread;
Processing unit is used for determining the decision-making of described HA according to the information of described recording device records and by the information after mutual with the device of described object platform and described application oriented device.
The present invention also provides a kind of method that realizes high availability in the communication system (HA), it is characterized in that, comprises step:
Determine the state of at least two HA-OA, wherein, one is main usefulness, and other is standby;
The master carries out heartbeat detection with the secondary node of holding HA-OA to application on this node and opposite end;
HA-ARB judges according to testing result whether successful whether described application can restart and restart;
If can restart and success method ends;
If cannot restart or restart unsuccessful, HA-OA switches to HA-ARB request.
If HA-ARB returns and can switch to HA-OA, switch; Cannot switch method ends if return.
Alternatively, described main step of the secondary node of application on this node and opposite end being carried out heartbeat detection with end HA-OA; Comprise:
If lose the heartbeat detection of some application, HA-OA need restart or switch to the HA-ARB inquiry;
If lost the heartbeat of the secondary node HA-OA of opposite end, write down this state, and report to HA-ARB.
Preferably, described step of carrying out heartbeat detection comprises does not receive that heartbeat replys for three times continuously, is judged as and loses heartbeat detection.
Alternatively, the described step of switching comprises: HA-OA uses switching to the HA-ARB notice, starts a timer simultaneously;
Reply if receive at timer that the switching of application is finished at interval, perhaps timer expiry, notice HA-ARB switches.
Preferably, the step of the state of described at least two HA-OA of determining also comprises initialization described HA system or the described HA of the negotiation initialization system of setting;
Wherein, the step of the described HA of described setting initialization system comprises: read the set information of pre-stored, set main with HA and standby HA;
The step of the described HA of described negotiation initialization system comprises:
Judge a HA-OA who obtains system's control among described at least two HA-OA, setting the described HA-OA that obtains control is that the master uses HA-OA, and notifying other HA-OA is standby HA-OA.
Alternatively, the step obtained the HA-OA of system control of among described at least two HA-OA of described judgement comprises:
That of described at least two HA-OA of judgement at first powers up, and setting the HA-OA that at first powers up is main usefulness, and other is standby; Or
Judge system bus by that control among described at least two HA-OA, the HA-OA that sets described acquisition control is main usefulness, and other is standby;
If neither one HA-OA control system bus or at first power up, HA-OA of all HA-OA communication acknowledgements is main usefulness, and other is standby.
Preferably, HA-OA of described all HA-OA communication acknowledgements is main usefulness step comprises: determine main using according to setting priority; Or the size of the random number that produces according to all HA-OA is determined main using.
Alternatively, the step that HA-OA of described all HA-OA communication acknowledgements is main usefulness comprises: any among described at least two HA-OA sent control or the controlled request of requiring, if do not receive the refuse information of other HA-OA in the given time, confirm that this HA-OA leads usefulness or standby.
Preferably, the step of the state of described definite at least two HA-OA is carried out by HA-ARB, wherein, also comprises step: the state of described HA-ARB notice HA-OA present node.
Alternatively, the described step of judging whether described application can restart comprises, when local application and trouble, local platform fault or local node fault, HA-ARB sends can not restart message, when local and normal operation of peer node or peer node fault, HA-ARB is according to preestablishing, and transmission can maybe cannot be restarted message;
Described method also comprises step: when HA-OA report application is unusual, if local platform fault enters local the application and the platform malfunction, if node normally moves, enter local application and trouble state; If the peer node fault enters peer node and local malfunction;
Comprise if described HA-ARB returns the step that can switch to HA-OA judge whether peer node is normal,, can switch if normal; Described method also comprises step, after switching, changes the state of system, if can not switch, and the report fault.
The invention provides the hardware redundancy resource; The data consistent during with the software administration redundancy backup and the solution of state consistency can realize the HA requirement of telecommunication system.
Embodiment
Understand and realization the present invention the existing embodiments of the invention of describing in conjunction with the accompanying drawings for the ease of persons skilled in the art.
At the high requirement of telecommunication apparatus to the HA management system, the HA management devices of embodiments of the invention and method solve the realization in the HA management of the system that the HA characteristic is required high (adopting hardware and software to realize high availability jointly).
Fig. 1 is the principle schematic of HA device in system in the embodiments of the invention.There are two nodes in the system of embodiments of the invention, are operated under the 2N redundant mode.In different system, there are different hardware platforms and operating system.And the software of HA may operate on the different operating system and hardware platform through after the less modification.In the embodiments of the invention, in the application of RNC (radio network controller), adopt CPCI (Compact PCI) platform ZT5083 (this is the CPCI HA platform that INTEL Corp. produces), adopt VxWorks 5.4 (this is the embedded OS of WIND RIVER company) in CPCI platform operations system.
The HA management system is between application program and hardware platform.Its major function is that the HA on management this node and the peer node hardware and software realizes, makes the work that two nodes can be harmonious, and and the HA management system of the opposite end HA that consults to finish whole system realize.
In this embodiment, monitoring and the isolation of hardware redundancy backup, hardware fault have been realized.Software can be monitored the running status of local task or thread, and the task or the thread of opposite end are monitored, and finds software fault and reports and handle (isolate, recover), and a result who handles is reported to peer node.
There are two nodes in the system, are operated under the 2N redundant mode.In different system, there are different hardware platforms and operating system.HA software may operate in the different operations through after the less modification.In the application of RNC (radio network controller), adopt CPCI (Compact PCI) platform ZT5083 (the CPCI HA platform of INTEL Corp.), adopt VxWorks 5.4 (embedded OS of WIND RIVER company) in CPCI platform operations system.
Under 2N in an embodiment of the present invention (1+1 backup) the redundancy of effort pattern, the state of node has two kinds: Active (main using) and Standby (standby).Wherein, main node with end 10 states has the control to competitive resource, and normal function outwards is provided; The node of standby end 20 is generally main to be to keep and main state and the data sync of using between the node, prepares when the master breaks down with node, takes over main position with node.
Main hardware configuration with end 10 and standby end 20 is identical, therefore, only describes main with end 10 here.Wherein, hardware (HW) interacts by operating system (OS) and HA, and hardware (HW) and HA also can direct interactions, are used for application layer (Application) then.The master is undertaken mutual and control with end 10 and standby end 20 by the heartbeat line.
On the CPCI platform, main with hold 10 and two CPU board of standby end 20 control of cpci bus has just been determined later in system power-up, therefore the main usefulness/stand-by state of node can only decide according to the control to bus, and the master is with holding 10 controls that obtained bus when promptly powering up.And in the dual systems that two stand-alone workstations constitute, there is not similar competitive resource, therefore the state of node needs according to the state of appointment in advance or consult to decide (in the dual systems that two stand-alone workstations constitute, the disk system of sharing and the communication for service circuit externally is provided is competitive resource, but the ownership of competitive resource is determined that by node state the node state of this moment mainly determines by specifying in advance and consulting acting in conjunction).Comprehensive these situations, the initialized setting of node state can have three kinds of methods: preestablish, compete or consult.At first can inquire about the init state that the affiliated relation that whether has competitive resource and competitive resource decides node during node initializing.If there is not competitive resource, node can inquire about whether there is predefined state, if there is predefined state, just decides the state of node according to predefined state.If there is no predefined state, perhaps predefined state exists conflict, the setting of then holding consultation.
In embodiments of the invention 1, adopt competition to set: it is closely related that the hardware environment that realizes with HA is set in competition, there is competitive resource between two nodes in the system at this moment, and, just can be clear and definite after the initial affiliated pass of this competitive resource ties up to system power-up: be that node has obtained competitive resource.Hardware platform should guarantee not exist the conflict of node state.At the CPCI platform, in CPCI, there is competitive resource (cpci bus).Have function among the BSP (plate level support package), the affiliated relation of competitive resource can be inquired about or change to HA software by these functions.
In embodiments of the invention 2, adopt and preestablish: in the HA software, have the state of the clear and definite defining node of variable.After HA software obtains this state, need and other node is confirmed, if there is conflict, the method for then setting through consultation solution.If node does not exist in addition, then itself be made as the main state of using.
Consult to set: if node state does not preestablish and compete setting, perhaps predefined state exists conflict, the setting of just holding consultation.Need between the node to consult main and standby relation by a kind of communication mode.
The assignment procedure of node state is as follows:
After step a, the system start-up, in CPCI, call the function that BSP provides, judge the control of present node cpci bus, the node state that obtains control is main using, the node state that does not have control is standby, and the node state initialization finishes, and jumps to steps d; In the binode system, skip this step.
Step b, read the node state of the regulation of variable in the HA software, if node state is not set then jumps to step c; Otherwise communicate the state of confirming node with the opposite end, if the opposite end does not exist, oneself then is set is main usefulness, and state is provided with end, redirect road steps d.Otherwise, if the existence conflict, and the state of opposite end is clear and definite (node at first starts, only may be main with), and therefore, it is standby that this node can only be set, and setting completed for state, jumps to steps d.If the other side's state indeterminate (starting simultaneously) just jumps to step c and holds consultation definite.If state does not conflict, setting completed for state, jumps to steps d.
Step c, negotiation are set: and the opposite end communicates the state of consulting to determine node.If peer node does not exist, oneself then is set is main usefulness, and state is provided with end, redirect road steps d.If peer node exists and state clear and definite (node at first starts, and only may be main using), therefore, it is standby that this node can only be set, and setting completed for state, jumps to steps d.Otherwise hold consultation according to strategy.Consulting tactical has a variety of, and for example, both sides respectively produce a random number, and what random number was big is exactly main usefulness, and little is exactly standby.
Steps d, end.
The flow chart of the state when Fig. 2 shows the node initializing of the system that comprises the HA device of Fig. 1.
In step 10, the HA management system begins initialization,
Then in step 11, if judge whether to exist competitive resource to have competitive resource, to step 12; If there is no competitive resource arrives step 14;
In step 12, the function of calling platform HA judges that the control of current competitive resource belongs to that node.In step 13, according to the result of step 12, the node state that obtains competitive resource is main usefulness, and the node state that does not obtain competitive resource is standby.Initialization finishes.
In step 14, judge whether the state of this end node is set, if set, to step 15; If do not set, to step 21.
In step 15, communicate by letter with peer node, in step 16, judge according to result of communication whether peer node exists, if peer node exists, to step 17; If peer node does not exist, to step 20; In step 17, whether inquiry peer node state is clear and definite, if state is clear and definite, and to step 18, if indeterminate, to step 1, would be the beginning of step 21; In step 18, whether the state of judgement and peer node exists conflict, if there is conflict, to step 19; If there is no conflict, initialization finishes.In step 19, the state that this end node is set is the opposite state of peer node, and initialization finishes.
In step 20, because peer node does not exist, the state that this end node is set is main usefulness, and initialization finishes.
In step 21, judge whether peer node exists, if exist, to step 22; If there is no arrive step 25.In step 22, judge whether the state of peer node is clear and definite, if the state of peer node is clear and definite, to step 23; If the state of peer node is indeterminate, to step 24.In step 23, the state that this end node is set is the opposite state of peer node, and initialization finishes.
In step 24, according to the state of certain strategy and the definite node of peer node negotiation.Initialization finishes.
In step 25, because peer node does not exist, the state that this end node is set is main usefulness, and initialization finishes.
Fig. 3 is HA device theory diagram more specifically in system in the embodiment of the invention of Fig. 1.HA comprises three parts: application oriented part (HA-OA), the part of object platform (HA-OP) and HA judgement part (HA-ARB).
The part of object platform (HA-OP): frame 33 or frame 33 ' in Fig. 3, different along with the difference of platform, generally, mainly finish by various interruptions and exception-triggered not as independent task or process operation.Under the situation that operating system allows, take over the various aborted in the platform running as much as possible.If these abnormal operation systems can not handle, HA-OP (part of object platform) (frame 33 or frame 33 ' among Fig. 3) reports this incident to HA-ARB (HA adjudicates part), is made a strategic decision by HA-ARB (frame 32 or frame 32 ' among Fig. 3).These may comprise unusually except that zero, disable instruction, abnormal operations such as alignment of data (needing the support of operating system).Carry out the detection of the hardware resource of two-shipper, the competitive resource between the management node, the affiliated relation of acquisition competitive resource, the state information of decision object platform part under the control of high layer software, can change this affiliated relation.
1, there is competitive resource, and obtained the control of competitive resource.
In the CPCI system, competitive resource comprises: to the control (to the acquisition and the release of core bus) of cpci bus.
2, there is competitive resource, but do not obtain the control of competitive resource.
In the CPCI system, competitive resource comprises: to the control (to the acquisition and the release of core bus) of cpci bus
3, there is not competitive resource.
In the dual systems that two work stations constitute, there is not competitive resource.
4, the state of platform resource (normal or fault).
In the CPCI system, the platform resource that should report or check (non-competing resource) has:
A) Watchdog timer (WatchDog Timer) is overtime
B) Driver of slave board I/O
C) state of present node (variate-value)
D) peer node does not exist: the CPCI system uses the monitoring of hot swap (hot plug) standard.
E) fan and power module whether normal (CPCI system)
F) whether cpu temperature is unusual
G) whether the monitoring Ethernet card is unusual
H) whether monitoring serial ports, parallel port and SCSI (small computer system interface) interface is normal
I) the Hot swap of monitoring I/O plate.(CPCI system)
Application-oriented part (HA-OA): (frame 31 or frame 31 ' among Fig. 3) has following function generally as a separate threads or task run:
1, the operation of monitoring local task or thread deadlock (Deadlock Detection is specifically finished by HA-OA) whether, and to HA-ARB (frame 32 or frame 32 ' among the figure) report, determine whether switching by HA-ARB (frame 32 or frame 32 ' among the figure), perhaps restart this application, strategy needs to tell HA-ARB (frame 32 or frame 32 ' among the figure) by application in advance.Detect by sending the mode of message, judge whether thread or task go wrong.In addition, according to the concrete condition of the program of using, between each task of balance or the thread to the difference of response time of detecting.
2, whether monitoring opposite end task or thread be normal, writes down each corresponding thread or task status of opposite end report, and report to HA-ARB.Make a strategic decision by HA-ARB.
3, heartbeat detection: because HA-OA as independently task or thread operation, therefore needs by the heartbeat mode state of monitoring the other side HA-OA.When finding that the opposite end heartbeat is lost, report this incident to HA-ARB, make a strategic decision by HA-ARB.
Fig. 4 has described the main workflow diagram with end HA-OA among Fig. 3.
In step 41, HA-OA begins to carry out.
In step 42, main with the application of end HA-OA on this node and the secondary node transmission heartbeat detection of opposite end.
In step 43, if lose the heartbeat detection (continuous 3 times do not receive heartbeat reply) of some application.
In step 44, HA-OA inquires to HA-ARB whether this application can restart.If can restart, to step 45; If cannot restart, to step 46.
In step 45, judge whether successfully to restart task, if success finishes.
In step 46, it is unusual that HA-OA writes down this application, and report that to HA-ARB this is unusual.
In step 47, HA-OA switches to the HA-ARB request.If HA-ARB returns and can switch to HA-OA, to step 48, cannot switch if return, finish.
In step 48, notice is used and is switched, and starts a timer.
In step 49, receive at timer that the switching of application is finished at interval and reply that perhaps timer expiry is to step 410.
In step 410, notice HA-ARB switches.
In step 411, if lost the heartbeat (continuous 3 times do not receive heartbeat reply) of opposite end HA-OA.
In step 412, think opposite end HA-OA fault or do not exist.
In step 413, record opposite end HA-OA fault or do not exist.And report that to HA-ARB this is unusual.
Fig. 5 is the workflow diagram of the standby end HA-OA among Fig. 3.
In step 51, HA-OA begins to carry out.
In step 52, the application of standby end HA-OA on this node and the secondary node transmission heartbeat detection of opposite end.
In step 53, if lose the heartbeat detection (continuous 3 times do not receive heartbeat reply) of some application.
In step 54, HA-OA inquires to HA-ARB whether this application can restart.If can restart, to step 55; If cannot restart, to step 56.
In step 55, judge whether successfully to restart task, if success finishes.
In step 56, it is unusual that HA-OA writes down this application, and report that to HA-ARB this is unusual.
In step 57, if lost the heartbeat (continuous 3 times do not receive heartbeat reply) of opposite end HA-OA.
In step 58, think opposite end HA-OA fault or do not exist.
In step 59, record opposite end HA-OA fault or do not exist.And report that to HA-ARB this is unusual.
In step 510, notice is used and is switched, and starts a timer.
In step 511, receive at timer that the switching of application is finished at interval and reply that perhaps timer expiry is to step 510.
In step 512, notice HA-ARB switches.
HA judgement part (HA-ARB): (frame 32 or frame 32 ' among the figure) also is as independently a thread or a task run.
Fig. 6 is the workflow diagram of the HA judgement part (HA-ARB) among Fig. 3.
In step 61, HA-ARB brings into operation.
In step 62, the initialization procedure that HA-ARB calls the HA management system obtains current node state, and detailed process is referring to the implementation of Fig. 2 and Fig. 2
In step 63, HA is the state notifying HA-OA. of present node,
In step 64, HA-ARB determines whether switching according to the information of HA-OA and HA-OP.
With state FSM (cable status machine) method whether the HA-ARB decision switches is described below in conjunction with table 1.
The FSM (finite state machine) of table 1:HA-ARB work
Annotate :-: the stateless variation/: do not expect incident, stateless changes.
HA judgement part (HA-ARB) has following function:
1, the operating state of record node (main using/standby) (from initialization procedure); whether the state of record platform (has faulty resource; and divide rank record to faulty resource) from HA-OP (frame 33 or frame 33 ' among Fig. 3); the state of minute book node and peer node task or thread (whether operation irregularity or deadlock; and fault is carried out the branch rank writes down), from the HA-OA (frame 31 or frame 31 ' among the figure) of this node and the HA-ARB (frame 2 or frame 2 ' among Fig. 3) of opposite end.
2, provide certain algorithm, with the HA-ARB (frame 32 or frame 32 ' among Fig. 3) of opposite end together, HA information to HA-OA (frame 31 or frame 31 ' among Fig. 3) and HA-OP (frame 33 or frame 33 ' among Fig. 3) report is carried out integrated treatment, and the corresponding decision-making of decision.
3, failure modes
Critical (seriously) fault: switch immediately.
Major (important) fault: need switch isolated fault, but can use synchronously.
Minor (small) fault: sustainable fault, can not switch.
Wherein, concrete decision strategy and algorithm are described to describe in detail in the handoff procedure hereinafter.
4, decision heartbeat message and detection, transmission method.
Handoff procedure
● use the handoff request that (non-HA management system) initiated
Use the switching command of initiating and be transmitted to HA-OA, be transmitted to HA-ARB, whether can switch,, then return the reason that to switch if can not switch by the HA-ARB decision by HA-OA by task or thread.Allow to use the state of forcibly changing node simultaneously, after promptly HA-ARB receives switching command, skip over the switching judging strategy, directly switch.
Main with end task or thread discovery internal fault, at first itself carries out fault recovery, if do not recover, then notify HA-OA, be transmitted to HA-ARB by HA-OA, whether the HA-ARB decision is restarted or is switched, and HA-ARB upgrades the task or the thread state of standby end record simultaneously to the HA-ARB of standby end report.Standby end task or thread discovery internal fault are handled equally, and just, standby end does not carry out handoff procedure.
In the process that mistake is recovered,, should at first select to restart the task or the thread that break down if task or thread allow.HA-is according to the state (state that comprises application) of present node and the operation of another node, and whether decision allows to switch.If can switch, then at first send to switch prepare message to each task or thread, set timer, if receive at interval at timer and to reply, perhaps timer expiry, according to different situations, handle:
If there is no competitive resource, then HA-OA and the other side consult new state.
If there is competitive resource, then call HA-OP, obtain or the release competitive resource.
No matter whether switching is successful, to each task or the new node state of thread report.If switch is because task or thread by what ask to initiate, are then replied.
● the handoff request that the HA management system is initiated
1, HA-OA finds local task or thread deadlock or unusual
Use state if node is in the master, HA-OA reports this incident to HA-ARB, and HA-ARB selects to restart or switch according to predefined strategy; If node is in stand-by state, the process that then do not switch, other processing is identical.
Switch if desired, then the process of Qie Huaning is identical with the processing of the handoff request of application (non-HA management system) initiation.
2, HA-ARB receives the HA-OP Trouble Report
According to the rank of fault, whether decision switches, and switches if desired, and then handoff procedure is identical with the processing of the handoff request of application (non-HA management system) initiation.
HA_OP reports HA_ARB by detecting with the fault of finding, is sent the request of switching by HA_ARB.
When HA-OP detects hardware, when operating system breaks down, notifies HA_ARB, consider the complexity of applicable cases, these faults need be classified according to the different faults type, and different faults is taked different processing.
Some fault, HA-OP can take corresponding action, and normal node initiatively obtains competitive resource, and at this moment, variation has taken place to the state of HA-ARB report competitive resource in HA-OP, and HA-ARB judges new state.
Some fault, HA-OP just detects, and whether switches to new state by the HA-ARB decision.If HA-ARB determines to switch, then at first send notice to each task or thread and prepare to switch by HA-OA, start timer, at timer expiry or all receive reply after and the other side consult new state.
No matter the sort of method after new state decision, if change, is then reported to task or thread, so that task or thread carry out different processing according to new state.
HA-OP exists fault and normal condition, should notify HA-ARB as much as possible, so that HA-ARB when making a strategic decision, can access the information about platform.
3, HA-OA receives the notice of the affiliated relationship change of HA-ARB competitive resource
According to competitive resource, judge current state, send notice to task or thread then.
4, heartbeat inspecting
Whether the HA operation that heartbeat inspecting is used for monitoring two nodes is normal.
If, main monitor standby end with end and lose heartbeat, then think the HA fault of standby end, record trouble takes place, and reports fault to webmaster.If main monitor the heartbeat of standby end HA-OA again with HA-OA, then think fault recovery, remove failure logging.
If standby end monitors the master and loses heartbeat with end, then think main with the HA fault of holding, HA-ARB forces to switch, call HA-OP and obtain competitive resource (if desired), make it become main usefulness, the while is to the notice of each task or the change of thread transmit status.At this moment if mistake then should make standby end carry out transition between states according to named policer.
Though described the present invention by embodiment, those of ordinary skills know, the present invention has many distortion and variation and do not break away from spirit of the present invention, wish that appended claim comprises these distortion and variation and do not break away from spirit of the present invention.