Background technology
The dual network communication system is applied to the Automation of Electric Systems communication based on Ethernet based on the ethernet communication technology.Mechanism by utilizing ethernet communication reliability height, speed is fast, data volume is big characteristics and information to send on has initiatively realized continual real time communication.This implementation method is to be used for based on the dual network redundancy of Ethernet standbyly, both can be used for substation level equipment, can be used for the wall embedded device again, to realize that network boom is standby and to take over seamlessly.
At present, the implementation of common network switching mainly contains:
1, communication network is divided into major network, be equipped with two network segments of net, one of them network segment is a major network, another network segment is to be equipped with net.Network just often, the network information is only transmitted by the current operation network segment, when major network broke down, network supervisor switched to another network segment with whole network, application program also begins to receive the network information of this network segment.The advantage that this network switches is that principle is simple, realizes also simple; Shortcoming is that the overall network switching need expend many time, and in the time period of switching, the network information might be lost from network failure.
2, communication network is divided into major network, be equipped with two network segments of net, one of them network segment is a major network, another network segment is to be equipped with net, hypervisor determines according to the network condition of each network node which network segment this node uses.Network just often, the network information of each node is only transmitted by the current operation network segment of this node, when the network connection of certain network node is broken down, network supervisor switches to another network segment with this network node, and application program also begins to receive the network information of this network segment of this network node.The advantage that this network switches is because only save switching time at malfunctioning node, realizes simple relatively; Shortcoming be from network failure in the time period of switching, the network information still has and may lose.
3, communication network is divided into major network, be equipped with two network segments of net, one of them network segment is a major network, another network segment is to be equipped with net, hypervisor determines according to the network condition of each network node which network segment this node uses.Network just often, the network information is transmitted simultaneously by two network segments of each node, after the network information arrived receiving terminal, receiving terminal all receive the identical network information when two network segments, just decision network information is effective; When the network connection of certain network node was broken down, network supervisor switched to another network segment with this network node, and notification application only need receive the network information of a network segment simultaneously.The advantage that this network switches is because only save switching time, the information reliability height at malfunctioning node; But, in the time period of switching, also be difficult to the assurance network information and can not lose from network failure.
Summary of the invention
In order to overcome the problems referred to above that exist in the existing network handoff technique, the invention provides a kind ofly when network failure, realize that network switches and the implementation method based on the dual network communication system of Ethernet of uninterrupted network service.
The principle of this implementation method is: communication network is divided into major network, is equipped with two network segments of net, and one of them network segment is major network A, and another network segment is to net B fully, and hypervisor determines according to the network condition of each network node which network segment this node uses.Information is according to real-time and non real-time requirement, be divided into polling message and initiatively go up carry information, polling message mainly is that conversion is little or not have the timing Query Information of variation, and initiatively going up carry information mainly is bigger displacement information or the out-of-limit information of variation that need upgrade at once; Network just often, polling message only transmits by the current operation segment A of network node, initiatively goes up two segment A and the B of carry information by each node and transmits simultaneously, the network information that any network segment receives all is judged to be effective information.After the network information arrived receiving terminal, polling message was directly handled, and initiatively went up carry information and then decided according to the time stamp in the information whether this information is up-to-date information, if up-to-date information is just upgraded immediately, just abandoned this information if not up-to-date information; When the network connection of certain network node was broken down, network supervisor switched to another network segment B with this network node, and polling message transmits by the network segment B after switching, and initiatively goes up carry information because be that two segment As and B send, so can not lose.After the switching, being connected of disconnection and this network node fault network segment initiatively gone up carry information and only carried out sending from network segment B; Through one section delay time, reconnect the fault network segment of this network node, if fault is got rid of then successful connection.After reconnecting successfully, initiatively go up carry information and send simultaneously from two segment As and B again.
The advantage that this network switches is because only save switching time, the information reliability height at malfunctioning node; Simultaneously, guarantee network between transfer period data can not lose.
The essential characteristic of this method for switching network is:
1, information initiatively goes up carry information and transmits simultaneously at two network segments according to polling message with initiatively go up carry information and classify.
2, have time stamp in the network information, and judge according to time stamp whether the network information was upgraded.If upgraded, just abandon this message; Otherwise, just upgrade this message.
3, the network switching is a unit with the network node, only carries out network at malfunctioning node and switches.
4, in the network switching process, because carry information send simultaneously from two network segments in the active of transmission variable quantity, so information can not lost.
Embodiment
The part such as diagnosis, network switching mode, network recovery that comprises network information transfer mode, network failure state based on the implementation method of the dual network communication system of Ethernet.
1) network information transfer mode
Network information transfer mode has two kinds: send in poll and the active.Polling message generally is regularly to carry out, and does not have characteristics of real time; Initiatively go up the data that carry information generally only send variation.In the present invention, two kinds of modes of intelligence transmission all will be used, and polling mode is used for regularly calling data, because data volume is bigger, are only undertaken by the current operation network segment.And the data of giving data to be used to transmit variation initiatively, this part data is carried out simultaneously at two network segments, and when one of them network segment broke down, information can be passed through the continual transmission of another network segment like this.
2) diagnosis of network failure state
Detecting network failure is to carry out the prerequisite that network switches, and therefore judges that quickly and accurately network failure is very important.In order to guarantee that method for switching network is general, the mode that the present invention has adopted procotol and network management to combine is judged the malfunction of network.Mode 1, the procotol of standard can be judged the running status of network, and the proactive notification application program, application program utilizes these return informations to judge network failure; Mode 2, network supervisor utilization send polling order and whether judge successfully whether the current operation network segment is available, if it is unsuccessful to send polling order, accumulative total sends the frequency of failure, reach restrictive condition when sending the frequency of failure, judge that then fault has appearred in this network segment.Two kinds of modes of judging network failure respectively have shortcoming, mode 1 is relevant with procotol, when physical fault takes place when, judge that the time ratio mode 2 of network failure is long, mode 2 is irrelevant with procotol, when non-physical fault takes place when, the time ratio mode 1 of judging network failure is long, so among the present invention, dual mode combines, any mode is judged network failure, all judges network failure has taken place.
3) network switching mode
The assurance of network information transfer mode has been arranged, and the network switching mode can be very flexible.The mode that the present invention adopts is that the operation network segment with this network node switches to the standby network segment immediately, and disconnects the fault network segment of this network node after detecting certain network segment fault of certain network node, and the maintenance information that is connected with this of releasing network connection resource.
4) network recovery
A critical function of network supervisor is to carry out network recovery automatically, definition recovery time according to configuration file, network supervisor can regularly be attempted connecting the fault network segment, because this subprogram is used independently thread, therefore can't block the operation of other programs.When network supervisor detects successful connection, then safeguard the information of this connection automatically, and the initial work of being correlated with again.In addition, normal even fault network recovers, can not switch back this network segment at once yet, because two relations that the network segment is an equality, which network segment is that the current operation network segment is for using without any influence.
Content is described and corresponding function
Fig. 1 a and Fig. 1 b shown network from normally to the handoff procedure schematic diagram of fault, Fig. 1 a is that network is when normally moving, when Fig. 1 b is network failure.Shown in Fig. 1 a and Fig. 1 b, wherein represent initiatively to go up carry information to upward arrow, arrow is represented querying command downwards; When network normally moved, the A network segment was represented the current operation network segment, transmitted polling message and initiatively went up carry information, and the B network segment only transmits and initiatively goes up carry information; During network failure, the B network segment is represented the current operation network segment, transmits polling message and initiatively goes up carry information, and the A network segment disconnects.
According to the present invention, communication network is divided into major network, is equipped with two network segments of net, one of them network segment is major network A, and another network segment is to net B fully, and hypervisor determines according to the network condition of each network node which network segment this node uses.Information is according to real-time and non real-time requirement, be divided into polling message and initiatively go up carry information, polling message mainly is that conversion is little or not have the timing Query Information of variation, and initiatively going up carry information mainly is bigger displacement information or the out-of-limit information of variation that need upgrade at once; Network just often, polling message only transmits by the current operation segment A of network node, initiatively goes up two segment A and the B of carry information by each node and transmits simultaneously, the network information that any network segment receives all is judged to be effective information.After the network information arrived receiving terminal, polling message was directly handled, and initiatively went up carry information and then decided according to the time stamp in the information whether this information is up-to-date information, if up-to-date information is just upgraded immediately, just abandoned this information if not up-to-date information; When the network connection of certain network node was broken down, network supervisor switched to another network segment B with this network node, and polling message transmits by the network segment B after switching, and initiatively goes up carry information because be that two segment As and B send, so can not lose.After the switching, being connected of disconnection and this network node fault network segment initiatively gone up carry information and only carried out sending from network segment B; Through one section delay time, reconnect the fault network segment of this network node, if fault is got rid of then successful connection.After reconnecting successfully, initiatively go up carry information and send simultaneously from two segment As and B again.
1. the transmission of polling order
As shown in Figure 2, the timed sending polling order, polling order only sends from the current operation network segment, utilizes the return state that sends to judge whether network is normal simultaneously.
Each step function among Fig. 2 is explained as follows:
S01-sends polling order from the current operation network segment.The current operation network segment of requester network node sends polling order from this network segment to network node.
S02-judges whether to send successfully.This step need judge whether according to the actual conditions of procotol to send successfully.
S03-accumulative total sends the frequency of failure.With the network node is unit, comes to add up respectively the transmission frequency of failure of each network node according to the situation of each network node.
S04-empties the transmission frequency of failure.After polling order sends successfully, illustrate that network condition is good, therefore can empty the network failure number of times.
S05-judges whether that the frequency of failure is out-of-limit.Judging whether that the frequency of failure is out-of-limit, generally is to decide according to network condition.
S06-decision network fault.In case it is out-of-limit to send the frequency of failure, fault occurred with regard to decision network, but has not handled.
2. polling order replys
As shown in Figure 3,, organize data, and reply from the network segment of receiving polling order according to polling order.
Each step function among Fig. 3 is explained as follows:
S01-judges whether to receive polling order.
S02-send on need judging whether initiatively.Poll send on replying and need judging whether to have at that time initiatively, if send on having initiatively, needs to send at once initiatively to go up carry information.
S03-sends poll to the network that receives polling order and replys.If initiatively do not go up carry information at that time, just can be at once send poll and reply according to the content of polling order.
3. initiatively go up the transmission of carry information
As shown in Figure 4, initiatively go up carry information and include only generation displacement or out-of-limit data, so, the reliably transmission timely owing to needing of these information is simultaneously from two network segments transmissions.
Each step function among Fig. 4 is explained as follows:
S01-send on need judging whether initiatively.
S02-sends simultaneously to two network segments and initiatively goes up carry information.In order to guarantee that initiatively going up carry information does not lose, need send simultaneously to two network segments and initiatively go up carry information.
4. the reception of polling message
As shown in Figure 5, because polling message is lower than the priority that initiatively goes up carry information, therefore can directly upgrade.
Each step function among Fig. 5 is explained as follows:
S01-judges whether to receive that poll replys.
S02-upgrades the poll response message.If receive the poll response message, just can upgrade the information of receiving as required.
5. initiatively go up the reception of carry information
Therefore as shown in Figure 6, initiatively going up carry information has two parts of identical information, need judge according to the time stamp of information, if do not repeat, then upgrade immediately, otherwise, abandon the information of repetition.
Each step function among Fig. 6 is explained as follows:
S01-judges whether to receive and initiatively goes up carry information.
S02-judges whether information exists.Because initiatively going up carry information is to send simultaneously from two network segments, therefore need to judge whether information was upgraded, in order to avoid repeat more new data.
S03-upgrades and initiatively goes up carry information.Do not upgrade if initiatively go up carry information, and so just needed to upgrade and initiatively go up carry information.
6. network switches
As shown in Figure 7, according to the network failure situation, handover network, and be responsible for removing Internet resources.
Each step function among Fig. 7 is explained as follows:
S01-judges whether network failure.Judge the method for network failure, referring to the explanation of Fig. 1.
S02-switches to standby net with current operational network.In case network failure appears in certain network node, just need the operational network of this network node is switched to standby net.
S03-disconnects network and connects releasing network resources and maintenance information.After having switched network, need to disconnect the network that has broken down, and relevant Internet resources and maintenance information discharged.
7. network recovery
As shown in Figure 8, network recovery is in order to realize the self-regeneration to temporary network failure, and does not influence the normal operation of system.
Each step function among Fig. 8 is explained as follows:
S01-judges whether timing.Reconnect network and generally need wait for a period of time, wait for and how long deciding by application program.
S02-attempts connecting the fault network segment.If timing arrives, just can attempt connecting the fault network segment.
S03-judges whether successful connection.
S04-maintaining network information, the line correlation initialization of going forward side by side.If successful connection connects the informational needs that returns so and safeguards, and uses for other relative programs.