Summary of the invention
The embodiment of the present invention provides method, the System and Network node of Network Synchronization, has realized the mutual protection between a plurality of outside reference time sources.For achieving the above object, the embodiment of the present invention is by the following technical solutions:
On the one hand, the embodiment of the present invention provides a kind of method of Network Synchronization, comprising:
Network node obtains local time information, according to described local time information configuration CO parameter attribute; Obtain the outside reference time source information of introducing, according to described outside reference time source information configuration standard time source attribute;
When network node detects when existing the outside reference time source to lose efficacy, according to source attribute of described standard time, choose optimum time source from the outside reference time source of the normal operation introduced and time source that network internal can be obtained; According to described optimal time source and described CO parameter attribute, determine the state of each port.
On the one hand, the embodiment of the present invention provides a kind of network node, comprising:
The local zone time configuration module is used for obtaining local time information, according to described local time information configuration CO parameter attribute;
Outside reference time source configuration module is used for obtaining the outside reference time source information of introducing, according to described outside reference time source information configuration standard time source attribute;
Module is chosen in the optimal time source, be used for when detecting when having the inefficacy of outside reference time source, according to the standard time source attribute of described outside reference time source configuration module configuration, choose optimum time source from the outside reference time source of the normal operation introduced and time source that network internal can be obtained;
The port status determination module is used for choosing optimal time source that module chooses and the CO parameter attribute of described local zone time configuration module configuration according to described optimal time source, determines the state of each port.
On the other hand, the embodiment of the present invention provides a kind of system of Network Synchronization, comprising: a plurality of outside reference time sources and a plurality of network node; Wherein,
Described outside reference time source is used for providing reference time information to described network node;
Described network node is used for obtaining local time information, according to described local time information configuration CO parameter attribute; Obtain the outside reference time source information of introducing, according to described outside reference time source information configuration standard time source attribute; When detecting when existing the outside reference time source to lose efficacy, according to source attribute of described standard time, choose optimum time source from the outside reference time source of the normal operation introduced and described intrasystem other network node; And according to described optimal time source and described CO parameter attribute, determine the state of each port.
The technical scheme that the embodiment of the present invention provides, by configuration CO parameter attribute and standard time source attribute, when a certain outside reference time source lost efficacy, according to the various attributes that configure, obtain the optimal time source from the outside reference time source of normal operation and the network internal time source that can obtain, and then determine the state of each port; The embodiment of the present invention can realize when a certain outside reference time source lost efficacy, and coupled network node can auto switching obtains the operating time to other outside reference time source, thereby has realized the mutual protection of a plurality of outside reference time sources.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Based on the embodiment in the present invention, those of ordinary skills belong to the scope of protection of the invention not making all other embodiment that obtain under the creative work prerequisite.
As shown in Figure 1, the method for a kind of Network Synchronization that the embodiment of the present invention provides, the method is implemented by network node, comprising:
101, obtain local time information, according to described local time information configuration CO parameter attribute.
The temporal information that described local time information provides for the crystal oscillating circuit of network node inside, described CO parameter attribute is the attribute list that is arranged in network node, comprising: the ID of the priority of local zone time, the temporal quality of local zone time, local zone time.When the priority of local zone time has when a plurality of, described CO parameter attribute specifically comprises: the priority 1 of local zone time, the priority 2 of local zone time.Should be pointed out that the priority 1 of described local zone time in embodiments of the present invention, the priority 2 of local zone time are only as an example, other priority can be arranged yet in other embodiment of the present invention, the present invention does not do any restriction to this.
102, obtain the outside reference time source information of introducing, according to described outside reference time source information configuration standard time source attribute.
The outside reference time source of described introducing is the outside reference time source that network node connects.Source attribute of described standard time refers to according to the regulation set attribute of standard agreement for source setup time, and it is arranged at the attribute list in network node.For example, described standard time source attribute can be the parameter according to the required setting in source setup time of IEEE1588V2 agreement defined.Source attribute of described standard time comprises: the temporal information of the temporal quality of the priority of outside reference time source, outside reference time source, the ID of outside reference time source, outside reference time source arrive before the present networks node the network node number, a upper network node of present networks node of process send the port id of the temporal information of outside reference time source.When the priority of outside reference time source has when a plurality of, source attribute of described standard time specifically comprises: the priority 2 of the priority 1 of outside reference time source, outside reference time source.Should be noted that, the priority 2 of the priority 1 of described outside reference time source, outside reference time source is only as an example in embodiments of the present invention, other priority can be arranged in other embodiment of the present invention, the present invention does not do any restriction to this yet.
For a network node, may be connected with one or more outside reference time sources, all need configuration standard time source attribute in network node for each outside reference time source.
103, when detecting when existing the outside reference time source to lose efficacy, according to source attribute of described standard time, choose optimum time source from the outside reference time source of the normal operation introduced and time source that network internal can be obtained.
Because other node of network internal has operating time information, can transmit by the mode of message operating time information, so other node of network internal can be considered as the time source that network internal can be obtained.
When certain the outside reference time source that connection detected when node lost efficacy, choose optimum time source from the outside reference time source of other normal operation of introducing and time source that network internal can be obtained; Can judge the quality of time source between port by the principle that the BMC algorithm is determined, its specific implementation principle simply is described below:
Suppose a network node, two port A and B are arranged, connecting respectively time source by A and B, described time source comprises outside reference time source and other node of network internal, the time source that is connected as A and B is that different outside reference time sources is when arriving described network node through different paths, be that A is unequal with the corresponding outside reference time source of the time source ID that B is connected, as shown in Figure 2, judge in accordance with the following methods the quality in A and B institute connect hours source:
At first relatively A and B connect the value of the priority 1 of outside reference time source; If A>B judges that the time source of B port is better than A; If A<B judges that the time source of A port is better than B; If A=B, further relatively A and B connect the value of the temporal quality of outside reference time source;
If A>B judges that the time source of B port is better than A; If A<B judges that the time source of A port is better than B; If A=B, further relatively A and B connect the value of the priority 2 of outside reference time source;
If A>B judges that the time source of B port is better than A; If A<B judges that the time source of A port is better than B; If A=B, the further corresponding outside reference time source of the time source ID that connected of A and B relatively;
The time source that is connected due to A and B is that different outside reference time sources arrives described network node through different paths, therefore, described outside reference time source ID is inevitable unequal, if A>B, the time source that judges the B port is better than A, if A<B judges that the time source of A port is better than B.
The time source that is connected as A and B is that identical outside reference time source is when arriving described network node through different paths, be that A equates with the corresponding outside reference time source of the time source ID that B is connected, the A of connection outside reference time source and the port id of B are unequal, as shown in Figure 3, judge in accordance with the following methods the quality in port A and B institute connect hours source:
The temporal information of at first more described outside reference time source arrive before this node the network node number of process; If A>B+1, namely the temporal information of described outside reference time source arrive the A port process interstitial content than arrive the B port the interstitial content of process more than 1 (not comprising 1), judge that the time source of B port is better than A; If B>A+1, namely the temporal information of described outside reference time source arrive the B port process interstitial content than arrive the A port the interstitial content of process more than 1 (not comprising 1), judge that the time source of A port is better than B; If the temporal information of described outside reference time source arrive the A port process interstitial content with arrive the B port the interstitial content of process be no more than 1, further judge its magnitude relationship;
If A>B, the port id of the network node that further relatively A port connects and the size of A port id, if the port id of the network node that the A port connects is greater than the A port id, the time source that judges the B port is better than A, if the port id of the network node that the A port connects less than the A port id, judges the time source of B port and wants topology to be better than A; If equate, mistake appears in explanation;
If A<B, the port id of the network node that further relatively B port connects and the size of B port id, if the port id of the network node that the B port connects is greater than the B port id, the time source that judges the A port is better than B, if the port id of the network node that the B port connects less than the B port id, judges the time source of B port and wants topology to be better than A; If equate, mistake appears in explanation;
If A=B, further judge the size of the port id of the network node that the port id of the network node that the A port connects is connected with the B port, if the port id of the network node that the port id of the network node that the A port connects connects greater than the B port judges that the time source of B port wants topology to be better than A; If the port id of the network node that the port id of the network node that the A port connects connects less than the B port judges that the time source of A port wants topology to be better than B; If both equate, further judge the port id of A and B;
If the port id of A greater than the port id of B, judges the time source of B port and wants topology to be better than A; If the port id of A less than the port id of B, judges the time source of A port and wants topology to be better than B; If both equate, mistake appears in explanation.
By Fig. 2 and comparison algorithm shown in Figure 3, can compare the quality of the time source that any two ports of a network node connect, thereby finally can choose optimum time source from the time source that each port connects.
104, according to the optimal time source of choosing and the CO parameter attribute of configuration, determine the state of each port.
Can determine the state of a certain port according to the port status decision making algorithm in the BMC algorithm, as shown in Figure 4, the below will simply describe:
When network node obtains the temporal information of opposite end by port r, at first judge the temporal quality rate range of local zone time, when the temporal quality grade of local zone time is between 1 to 127, continue to judge whether local zone time is better than or the topological operating time that is better than the network node of port r connection, if, the state of determining port r is the master state, if not, determine that the state of port r is the passive state;
when the temporal quality grade of local zone time is positioned at outside 1 to 127, judge first whether local zone time is better than or topology is better than optimal time information in present networks node each port institute connect hours source, if, determine that port r state is the master state, if not, continue to judge that whether described optimal time information obtained by port r tracking time source by the present networks node, the state of if it is determining port r is the slave state, if not, continue to judge whether described optimal time information wants topology to be better than the time source that the present networks node is followed the tracks of by port r, the state of if it is determining port r is passive, if not, the state of determining port r is master.
Determine algorithm by above-mentioned port status, can determine port status for each port of network node, and and then the state by its port determine the operating time of network node self to follow the tracks of the optimal time source.By operation IEEE1588V2 agreement, finally realize the same optimal time of each node tracking source in whole net, realize network time synchronization.
After determining port status, mutually different from prior art is, if connecting the state of the port of outside reference time source is master or passive, determine not by this port acquisition time information and distribution temporal information, if connecting the state of the port of outside reference time source is slave, determine to follow the tracks of outside reference time source acquisition time information by this port.
The network synchronization method that the embodiment of the present invention provides, by configuration CO parameter attribute and standard time source attribute, when a certain outside reference time source lost efficacy, according to the various attributes that configure, obtain the optimal time source from the outside reference time source of normal operation and the network internal time source that can obtain, and then determine the state of each port; The embodiment of the present invention can realize when a certain outside reference time source lost efficacy, and coupled network node can auto switching obtains the operating time to other outside reference time source, thereby has realized the mutual protection of a plurality of outside reference time sources.
As shown in Figure 5, a kind of network node that the embodiment of the present invention provides comprises:
Local zone time configuration module 501 is used for obtaining local time information, according to described local time information configuration CO parameter attribute;
Outside reference time source configuration module 502 is used for obtaining the outside reference time source information of introducing, according to described outside reference time source information configuration standard time source attribute;
Module 503 is chosen in the optimal time source, be used for when detecting when having the inefficacy of outside reference time source, according to the standard time source attribute of described outside reference time source configuration module 502 configurations, choose optimum time source from the outside reference time source of the normal operation introduced and time source that network internal can be obtained;
Port status determination module 504 is used for choosing optimal time source that module 503 chooses and the CO parameter attribute of described local zone time configuration module 501 configurations according to described optimal time source, determines the state of each port.
The network node that the embodiment of the present invention provides also comprises:
Follow the tracks of distribution module 505, be used for after described port status determination module 504 is determined the state of each ports, according to the state of port, follow the tracks of or distribute temporal information by described port.
The network node that the embodiment of the present invention provides, the CO parameter attribute of described local zone time configuration module 501 configurations wherein comprises: the ID of the priority of local zone time, the temporal quality of local zone time, local zone time.
The network node that the embodiment of the present invention provides, the standard time source attribute of described outside reference time source configuration module 502 configuration wherein comprises: the temporal information of the temporal quality of the priority of outside reference time source, outside reference time source, the ID of outside reference time source, outside reference time source arrive before described network node the network node number, a upper network node of described network node of process send the port id of the temporal information of outside reference time source.
The network node that the embodiment of the present invention provides, by configuration CO parameter attribute and standard time source attribute, when a certain outside reference time source lost efficacy, according to the various attributes that configure, obtain the optimal time source from the outside reference time source of normal operation and the network internal time source that can obtain, and then determine the state of each port; The embodiment of the present invention can realize when a certain outside reference time source lost efficacy, and coupled network node can auto switching obtains the operating time to other outside reference time source, thereby has realized the mutual protection of a plurality of outside reference time sources.
A kind of network synchronous system that the embodiment of the present invention provides comprises a plurality of outside reference time sources and a plurality of network node, wherein:
Described outside reference time source is used for providing reference time information to described network node;
Described network node is used for obtaining local time information, according to described local time information configuration CO parameter attribute; Obtain the outside reference time source information of introducing, according to described outside reference time source information configuration standard time source attribute; When detecting when existing the outside reference time source to lose efficacy, according to source attribute of described standard time, choose optimum time source from the outside reference time source of the normal operation introduced and intrasystem other network node; And according to described optimal time source and described CO parameter attribute, determine the state of each port.
After the state of determining each port, determine follow the tracks of or distribute temporal information by each port according to port status.
the below to described network synchronous system when the first outside reference time source lost efficacy, switch to the process of the second outside reference time source and simply describe, as shown in Figure 6, described network synchronous system comprises four nodes, be N1, N2, N3 and N4, node N1 and node N3 connect respectively the outside reference time source, the outside reference time source that node N1 connects is very first time source, the port status that node N1 connects described very first time source is slave, the outside reference time source that node N3 connects is the second time source, the port status that node N3 is connected with described the second time source is master.Node N1 is from the operating time of source acquisition time information of the described very first time as self, and operating time information is distributed to node N2 and node N4, node N2 and node N4 receive described operating time information, respectively with its operating time as oneself, then by node N2 with self operating time distribution of information to node N3;
When the very first time lost efficacy in the source, node N1 will follow the tracks of the operating time of node N2 as the operating time of self by choosing the optimal time source and determining port status, and the port status that this moment, node N1 connected very first time source becomes master by slave; Node N2 and node N4 will follow the tracks of respectively the operating time of node N3 as the operating time of self, node N3 becomes slave with the port status that the second time source is connected by master, from the operating time of the second time source acquisition time information as self, this moment, first, second time source reversed process was completed, and the temporal information that whole network will provide with the second time source is as fiducial time.
The network synchronous system that the embodiment of the present invention provides, by configuration CO parameter attribute and standard time source attribute, when a certain outside reference time source lost efficacy, according to the various attributes that configure, obtain the optimal time source from the outside reference time source of normal operation and the network internal time source that can obtain, and then determine the state of each port; The embodiment of the present invention can realize when a certain outside reference time source lost efficacy, and coupled network node can auto switching obtains the operating time to other outside reference time source, thereby has realized the mutual protection of a plurality of outside reference time sources.
The contents such as the information interaction between above-mentioned network node and intrasystem each module, implementation, due to the inventive method embodiment based on same design, particular content can referring to the narration in the inventive method embodiment, repeat no more herein.
One of ordinary skill in the art will appreciate that all or part of step that realizes in above-described embodiment method is to come the relevant hardware of instruction to complete by program, described program can be stored in computer-readable recording medium, as ROM/RAM, magnetic disc or CD etc.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion by described protection range with claim.