Summary of the invention
In view of this, the invention provides a kind of many activating detection methods and equipment, can improve MAD testing mechanism, improve the stability of network.
For solving the problems of the technologies described above, technical scheme of the present invention is achieved in that
A kind of many activating detection methods, be applied in pile system, the arbitrary stack equipment in described pile system, in the time of main equipment as described pile system, the running status that records described pile system is initial condition NOT_SPLIT, and is synchronized to other stack equipments in described pile system, while perceiving described pile system division, the running status of the pile system after the division at self current place is updated to the state SPLIT_PRE_MASTER that comprises the main equipment of described pile system before division, and the running status of current record is synchronized to other stack equipments in self current place pile system, when as described pile system from equipment time, receive running status NOT_SPLIT the record of the synchronous pile system of the main equipment of described pile system, while perceiving described pile system division, determine the main equipment that whether has described pile system before division in the pile system after the division at self current place, if, the running status of self current place pile system is updated to SPLIT_PRE_MASTER, otherwise, the running status of self current place pile system is updated to the state SPLIT_PRE_SLAVE that does not comprise the main equipment of pile system before division, and the running status of self current record is synchronized to other stack equipments in self current place pile system, described method comprises:
Described arbitrary stack equipment, as the main equipment of self current place pile system, while the pile system of other activation being detected, if the running status of the current place of self record pile system is NOT_SPLIT, is carried out normal MAD flow process by MAD mechanism; If the running status of the current place of self record pile system is SPLIT_PRE_MASTER, maintain the normal work of self current place pile system; If the running status of the current place of self record pile system is SPLIT_PRE_SLAVE, make self current place pile system enter recovery state.
A kind of equipment, is applied in pile system, and described equipment comprises: record cell, perception unit, detecting unit and processing unit;
Described record cell, for when self place equipment is during as the main equipment of described pile system, the running status that records described pile system is initial condition NOT_SPLIT, and is synchronized to other stack equipments in described pile system; When described perception unit perceives pile system when division, the running status of record is updated to the state SPLIT_PRE_MASTER that comprises the main equipment of described pile system before division, and is synchronized to other equipment in self current place pile system; When self place equipment as described pile system from equipment, receive running status NOT_SPLIT the record of the synchronous pile system of the main equipment of described pile system; Described perception unit perceives pile system when division, has the main equipment of described pile system before division if determine in self current place pile system, the running status of self current place pile system is updated to SPLIT_PRE_MASTER; In self current place pile system, there is not the main equipment of described pile system before division if determine, the running status of self current place pile system is updated to the state SPLIT_PRE_SLAVE that does not comprise the main equipment of pile system before division; And the running status of self current record is synchronized to other stack equipments in self current place pile system;
Described perception unit, divides for perception pile system;
Described detecting unit, for when self place equipment is during as the main equipment of current place pile system, detects the pile system of other activation by MAD mechanism;
Described processing unit, in the time that described detecting unit detects the pile system of other activation by MAD mechanism, if the running status of the current place of described recording unit records self place equipment pile system is NOT_SPLIT, carries out normal MAD flow process; If the running status of the current place of described recording unit records self place equipment pile system is SPLIT_PRE_MASTER, maintain the normal work of self the current place of place equipment pile system; If the running status of the current place of described recording unit records self place equipment pile system is SPLIT_PRE_SLAVE, make self the current place of place equipment pile system enter recovery state.
In sum, in the present invention by pile system each stack equipment when the different running status being upgraded to the running status of the pile system of self record, in the time that the main equipment of pile system detects the pile system of other activation by MAD mechanism, carry out different disposal according to the running status of the pile system of self record, the main equipment that ensures the front pile system of division maintains state of activation always, can improve MAD testing mechanism, improve the stability of network.
Embodiment
For making object of the present invention, technical scheme and advantage clearer, referring to the accompanying drawing embodiment that develops simultaneously, scheme of the present invention is described in further detail.
A kind of many activating detection methods are proposed in the embodiment of the present invention, be applied in pile system, arbitrary stack equipment in this pile system, in the time of main equipment as this pile system, the running status that records this pile system is initial condition (NOT_SPLIT), and is synchronized to other stack equipments in this pile system; While perceiving described pile system division, the running status of the pile system after the division at self current place is updated to the state (SPLIT_PRE_MASTER) that comprises the main equipment of described pile system before division, and the running status of current record is synchronized to other stack equipments in self current place pile system; When as described pile system from equipment time, receive running status NOT_SPLIT the record of the synchronous pile system of the main equipment of described pile system; While perceiving described pile system division, determine the main equipment that whether has described pile system before division in the pile system after the division at self current place, if, the running status of self current place pile system is updated to SPLIT_PRE_MASTER, otherwise, the running status of self current place pile system is updated to (state that does not comprise the main equipment of pile system before division) SPLIT_PRE_SLAVE; And the running status of self current record is synchronized to other stack equipments in self current place pile system.
A pile system is initially set up, while electing main equipment, now the running status of this pile system at self place is recorded as NOT_SPLIT by main equipment, this pile system normally moves, there is not division, this running status of record was synchronized to other equipment in this pile system simultaneously.
Pile system splits into two parts or more parts, but the pile system after division all can be classified as two classes, one class is the succession to former pile system, the main equipment of such pile system does not change, concerning it loss be part from equipment, such is inherited running status of pile system and is recorded as SPLIT_PRE_MASTER; An other class is newly-generated pile system, for newly-generated pile system, its original main equipment has left this newly-generated pile system, no matter whether its former main equipment joins this newly-generated pile system again, and newly-generated pile system need select a new main equipment to manage this newly-generated pile system now; The running status of such newly-generated pile system is recorded as SPLIT_PRE_SLAVE.
Above-mentionedly determine in self current place pile system, whether to exist the method for the main equipment of described pile system before division to be:
Described arbitrary stack equipment is deleted from the topological list of self place pile system divide the stack equipment that divides away because of pile system, according to the main equipment that whether has main equipment identity to determine whether to exist in self current place pile system described pile system before division in the identity of the stack equipment of deleting.
Referring to Fig. 3, Fig. 3 is pile system splitted construction schematic diagram in the specific embodiment of the invention.In Fig. 3, before division, pile system is made up of stack equipment 301, stack equipment 302 and stack equipment 303.As seen from Figure 3, the link fracture between stack equipment 302 and stack equipment 303, and because this pile system is that chain type is stacking, therefore, stack equipment 302 and stack equipment 303 all perceive pile system division.Taking stack equipment 302 as example, if stack equipment 302 is the main equipment of the front pile system of division,, in the time that pile system is set up, the running status of the pile system before division is recorded as to NOT_SPLIT, and is synchronized to stack equipment 301 and stack equipment 302; In the time that stack equipment 302 perceives pile system division, owing to himself being the main equipment of former pile system, and the stack equipment 303 dividing away for division before pile system from equipment, therefore stack equipment 303 is deleted from the topology table of pile system, there is not main equipment identity in the identity of the stack equipment of deleting, therefore after record division, the running status of the pile system at self current place is SPLIT_PRE_MASTER, and the running status of record is synchronized to stack equipment 301.
Before stack equipment 302 is for division pile system from equipment time, the running status that receives the synchronous current pile system of the main equipment of pile system is NOT_SPLIT, in this running status of local record.In the time that stack equipment 302 perceives pile system division, delete from the topological list of pile system dividing the stack equipment 303, if stack equipment 303 is the main equipment of the front pile system of division, in the identity of the stack equipment of deleting, there is main equipment identity, the running status of current record is updated to SPLIT_PRE_SLAVE; If stack equipment 303 for division before pile system from equipment, in the identity of the stack equipment of deleting, there is not main equipment identity, the running status of current record is updated to SPLIT_PRE_MASTER by stack equipment 302; And the running status of the pile system after upgrading is synchronized to stack equipment 301, stack equipment 301 receives the running status of this synchronous rear pile system that upgrades self record.
Referring to Fig. 4, Fig. 4 is many activating detection methods schematic flow sheet in the embodiment of the present invention.Concrete steps are as follows:
Step 401, arbitrary stack equipment is as the main equipment of self current place pile system, while the pile system of other activation being detected by MAD mechanism.
Step 402, if the running status of the current place of self record pile system is NOT_SPLIT, carries out normal MAD flow process, process ends.
In this step, carry out normal MAD flow process, refer to that comparison Active ID decision self place pile system maintains normal work, still enter recovery state, with existing realization, repeat no more here.
Step 403, if the running status of the current place of self record pile system is SPLIT_PRE_MASTER, maintains the normal work of self current place pile system, process ends.
The normal work that maintains self current place pile system in this step refers to that equipment maintains Active state, and MAD testing mechanism reenters initial condition, again starts to detect.
Step 404, if the running status of the current place of self record pile system is SPLIT_PRE_SLAVE, makes self current place pile system enter recovery state.
Self the current place pile system of making in this step enters recovery state, and the pile system that enters recovery state will be closed other all functional areas beyond reserved port.
While the running status of self current place pile system being updated to SPLIT_PRE_SLAVE in the specific embodiment of the invention, described method further comprises: the main equipment ID of described pile system before record division, and be synchronized to other stack equipments in self place pile system and make described other stack equipments record the main equipment ID of described pile system before described division.Other stack equipments receive the ID of synchronous main equipment, carry out record in this locality.
If the running status of the current place of self record pile system is after SPLIT_PRE_SLAVE in step 404, described making before self current place pile system enters recovery state, described method further comprises: the main equipment ID that determines described pile system before the division of self record with described in other main equipment ID that activate pile systems of detecting whether identical, if so, described in execution, make self current place pile system enter recovery state; Otherwise, the initial condition that enters MAD.
If main equipment ID is identical, explanation is that pile system divides the pile system that other activation detected causing; If main equipment ID difference, wrong MAD message has been received in explanation, reenters the initial condition of MAD, restarts to detect.
Arbitrary stack equipment as self current pile system from equipment time, the method further comprises:
Described arbitrary stack equipment receives carrying out after the notice of mandatory masterslave switchover of main equipment transmission, if perceiving main equipment leaves, the running status of self current place pile system is updated to main equipment swap status (MASTER_SWITCH), otherwise, maintain the running status of self current place pile system.Main equipment in pile system is if carry out normal masterslave switchover, as according to the main equipment of pile system that needed reboot of safeguarding.Its adjacent stack equipment can be prenoticed and mandatory masterslave switchover will be carried out.What receive this notice maintains the running status of the current pile system of self record from equipment, leaves until it perceives main equipment, and the running status of self record is updated to MASTER_SWITCH.
Described arbitrary stack equipment is as the main equipment in self current place pile system, and the pile system running status of self record is SPLIT_PRE_SLAVE, time, the method further comprises: the pile system of other activation do not detected by MAD mechanism within default detection time time, compulsory execution main equipment is surveyed, if detect other main equipments, carry out MAD normal flow; Otherwise, determine before division the main equipment of the described pile system machine of delaying, the running status of self current place pile system is updated to MASTER_SWITCH, and the running status of the pile system after upgrading is synchronized to other stack equipments in self current place pile system.
Described arbitrary stack equipment is as the main equipment of self current place pile system, and the running status of the pile system of self record is while being MASTER_SWITCH, and described method further comprises:
Complete masterslave switchover if perceive self place pile system, the running status of pile system described in self current place is updated to NOT_SPLIT, and be synchronized to other stack equipments in self current place pile system.
In Fig. 3, suppose the main equipment that stack equipment 303 is pile system, when stack equipment 303, the electricity went off, now can to perceive identity be that the stack equipment 303 of main equipment has left pile system to stack equipment 302, and the running status of the stack equipment of record is updated to SPLIT_PRE_SLAVE by stack equipment 302.And after electing main equipment, detect by MAD mechanism, but the not existence of multi-Active so detecting, MAD enters initial condition.
General, if there are multiple Active on network, can be in a short period of time by MAD mechanism, as 100sm finds the other side, if in this time window, do not detect other and activate pile systems, the Master that can tentatively the judge former pile system machine of having delayed, start the forced detection process to former main equipment: by MAD link, send fast the probe messages of some; The other side receives after probe messages, responds immediately response message.In certain cycle, such as the Hello of 3 times is overtime, can not receive response message, determine the former main equipment machine of having delayed.The running status of upgrading the pile system of current record is MASTER_SWITCH; Exist if forced detection result is main equipment, illustrate that MAD efficiency has problem, continue MAD flow process and detection process.
If when stack equipment 302 is elected as the main equipment of the current pile system that comprises stack equipment 301 and stack equipment 302, perceiving pile system masterslave switchover completes, the running status of the pile system of self record is updated to NOT_SPLIT, and be synchronized to stack equipment 301 make its upgrade local record.
Based on same inventive concept, the present invention also proposes a kind of equipment, is applied in pile system.Referring to Fig. 5, Fig. 5 is the structural representation that is applied to the stack equipment in pile system in the specific embodiment of the invention.This equipment comprises: record cell 501, perception unit 502, detecting unit 503 and processing unit 504.
Record cell 501, for when self place equipment is during as the main equipment of described pile system, the running status that records described pile system is initial condition NOT_SPLIT, and is synchronized to other stack equipments in described pile system; When perception unit 502 perceives pile system when division, the running status of record is updated to the state SPLIT_PRE_MASTER that comprises the main equipment of described pile system before division, and is synchronized to other equipment in self current place pile system; When self place equipment as described pile system from equipment, receive running status NOT_SPLIT the record of the synchronous pile system of the main equipment of described pile system; Perception unit 502 perceives pile system when division, has the main equipment of described pile system before division if determine in self current place pile system, the running status of self current place pile system is updated to SPLIT_PRE_MASTER; In self current place pile system, there is not the main equipment of described pile system before division if determine, the running status of self current place pile system is updated to the state SPLIT_PRE_SLAVE that does not comprise the main equipment of pile system before division; And the running status of self current record is synchronized to other stack equipments in self current place pile system.
Perception unit 502, divides for perception pile system.
Detecting unit 503, for when self place equipment is during as the main equipment of current place pile system, detects the pile system of other activation by MAD mechanism.
Processing unit 504, in the time that detecting unit 503 detects the pile system of other activation by MAD mechanism, is NOT_SPLIT if record cell 501 records the running status of self the current place of place equipment pile system, carries out normal MAD flow process; If it is SPLIT_PRE_MASTER that record cell 501 records the running status of self the current place of place equipment pile system, maintain the normal work of self the current place of place equipment pile system; If it is SPLIT_PRE_SLAVE that record cell 501 records the running status of self the current place of place equipment pile system, make self the current place of place equipment pile system enter recovery state.
Preferably,
Record cell 501, while being further used for the running status of self the current place of place equipment pile system to be updated to SPLIT_PRE_SLAVE, the main equipment ID of described pile system before record division, and other stack equipments that are synchronized in self the current place of place equipment pile system make described other stack equipments record described main equipment ID.
Processing unit 504, when the running status that record cell 501 records self the current place of place equipment pile system if be further used for is SPLIT_PRE_SLAVE, the main equipment ID that determines record cell 501 current records with described in other main equipment ID that activate pile systems of detecting whether identical, if so, described in execution, make self the current place of place equipment pile system enter recovery state; Otherwise, the initial condition that enters MAD.
Preferably,
Record cell 501, is further used for storing the topological list of self equipment place, place pile system; In the time that perception unit 502 perceives pile system division, delete from the topological list of self place pile system divide the stack equipment that divides away because of pile system, according to the main equipment that whether has main equipment identity to determine whether to exist in self current place pile system described pile system before division in the identity of the stack equipment of deleting.
Preferably, this equipment further comprises: receiving element 505.
Receiving element 505, be further used for when self place equipment as current place pile system from equipment time, receive main equipment send will carry out the notice of mandatory masterslave switchover.
Perception unit 502, be further used for when self place equipment as current place pile system from equipment time, the leaving of perception main equipment.
Record cell 501, be further used for receiving carrying out after the notice of mandatory masterslave switchover of main equipment transmission when receiving element 505, if perception unit 502 perceives main equipment and leaves, the running status of self the current place of place equipment pile system is updated to MASTER_SWITCH, otherwise, maintain the running status of self the current place of place equipment pile system.
Preferably, this equipment further comprises: probe unit 506.
Probe unit 506, be used for when self place equipment is as the main equipment of current place pile system, when the pile system running status that record cell 501 records is SPLIT_PRE_SLAVE, and when detecting unit 503 does not detect the pile system of other activation by MAD mechanism within default detection time, compulsory execution main equipment is surveyed, and makes processing unit 504 carry out MAD normal flow if detect other main equipments; Otherwise, the main equipment of determining self equipment place, the place pile system machine of delaying.
Record cell 501, be further used in the time that probe unit 506 determines that the main equipment of self equipment place, place pile system is delayed machine, the running status of record is updated to MASTER_SWITCH, and the running status after upgrading is synchronized to other stack equipments in self the current place of place equipment pile system.
Preferably,
Perception unit 502, is further used for the current place of equipment, perception self place pile system and whether completes masterslave switchover;
Record cell 501, be further used for self place equipment main equipment as current place pile system, and when the running status that records current place pile system is MASTER_SWITCH, if perception unit 502 perceives self place pile system and completes masterslave switchover, the running status of self current place pile system is updated to NOT_SPLIT, and is synchronized to other stack equipments in self equipment place, place pile system.
The unit of above-described embodiment can be integrated in one, and also can separate deployment; Can merge into a unit, also can further split into multiple subelements.
In sum, in the specific embodiment of the invention by each stack equipment according to self place pile system in different running statuses upgrade the running status of the pile system of self record, in the time that the main equipment of pile system detects the pile system of other activation by MAD mechanism, carry out different disposal according to the running status of the pile system of self record, the main equipment that ensures the front pile system of division maintains state of activation always, can improve MAD testing mechanism, the stability that improves network, has ensured seamlessly transitting of flow.
In the specific embodiment of the invention, be updated to MASTER_SWITCH by carrying out the delay running status of pile system of machine of the pile system of mandatory masterslave switchover and main equipment simultaneously, in the time that masterslave switchover completes, the running status of pile system is updated to NOT_SPLIT, avoid the section time network concussion existing in masterslave switchover process completely, with the various sequence problems that may occur, keep to greatest extent the stability of network.
The above, be only preferred embodiment of the present invention, is not intended to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any amendment of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.