Summary of the invention
The embodiment of the invention provides method, system and the 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 invention is by the following technical solutions:
On the one hand, the embodiment of the 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,, from the outside reference time source of the operate as normal introduced and time source that network internal can be obtained, choose optimum time source according to source attribute of described standard time; 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 invention provides a kind of network node, comprising:
The local zone time configuration module is used to obtain local time information, according to described local time information configuration CO parameter attribute;
Outside reference time source configuration module is used to obtain 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 existing the outside reference time source to lose efficacy, according to the standard time source attribute of described outside reference time source configuration module configuration, from the outside reference time source of the operate as normal introduced and time source that network internal can be obtained, choose optimum time source;
The port status determination module is used for choosing the 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 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 to obtain 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,, from the outside reference time source of the operate as normal introduced and described intrasystem other network node, choose optimum time source according to source attribute of described standard time; And, determine the state of each port according to described optimal time source and described CO parameter attribute.
The technical scheme that the embodiment of the 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 disposed, from the time source that the outside reference time source and the network internal of operate as normal can be obtained, obtain the optimal time source, and then determine the state of each port; When the embodiment of the invention can be implemented in a certain outside reference time source and lost efficacy, 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 invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making all other embodiment that obtained under the creative work prerequisite.
As shown in Figure 1, the method for a kind of Network Synchronization that the embodiment of the invention provides, this method is implemented by network node, comprising:
101, obtain local time information, according to described local time information configuration CO parameter attribute.
Described local time information is the temporal information that crystal oscillating circuit provided of network node inside, and described CO parameter attribute is the attribute list that is arranged in the 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 only are as an example, other priority also can be arranged 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 connected.Source attribute of described standard time is meant that according to the regulation set attribute of standard agreement for source setup time it is arranged at the attribute list in the 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 port id of temporal information of last network node transmission outside reference time source of network node number, present networks node of process.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 in embodiments of the present invention outside reference time source, outside reference time source only is as an example, other priority also can be arranged in other embodiment of the present invention, and the present invention does not do any restriction to this.
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,,, from the outside reference time source of the operate as normal introduced and time source that network internal can be obtained, choose optimum time source according to source attribute of described standard time when detecting when existing the outside reference time source to lose efficacy.
Because other node of network internal has operating time information, can transmit operating time information by the mode of message, so other node of network internal can be considered as the time source that network internal can be obtained.
When node detection when certain the outside reference time source that connects lost efficacy, from the outside reference time source of other operate as normal of introducing and time source that network internal can be obtained, choose optimum time source; Can judge the quality of time source between the 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, be connected time source by A respectively with B, described time source comprises outside reference time source and other node of network internal, the time source that is connected with B as A is that different outside reference time sources is when arriving described network node through different paths, be that the pairing outside reference time source of the time source ID that is connected with B of A is unequal, as shown in Figure 2, judge the quality in A and B institute connect hours source in accordance with the following methods:
At first relatively A is connected the value of the priority 1 of outside reference time source with B; If A>B judges that then the time source of B port is better than A; If A<B judges that then the time source of A port is better than B; If A=B then further compares A is connected the temporal quality of outside reference time source with B value;
If A>B judges that then the time source of B port is better than A; If A<B judges that then the time source of A port is better than B; If A=B then further compares A is connected the priority 2 of outside reference time source with B value;
If A>B judges that then the time source of B port is better than A; If A<B judges that then the time source of A port is better than B; If A=B then further compares the pairing outside reference time source of the time source ID that A is connected with B;
Because being different outside reference time sources, the time source that A is connected with B arrives described network node through different paths, therefore, described outside reference time source ID is inevitable unequal, if A>B, the time source of then judging the B port is better than A, if A<B judges that then the time source of A port is better than B.
The time source that is connected with B as A is that identical outside reference time source is when arriving described network node through different paths, be that the pairing outside reference time source of the time source ID that A is connected with B equates, the A of connection outside reference time source and the port id of B are unequal, as shown in Figure 3, judge the quality in port A and B institute connect hours source in accordance with the following methods:
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, the temporal information of promptly 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 then the time source of B port is better than A; If B>A+1, the temporal information of promptly 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 then 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, then further judge its magnitude relationship;
If A>B, the port id of the network node that further relatively A port is connected and the size of A port id, if the port id of the network node that the A port is connected is greater than the A port id, the time source of then judging the B port is better than A, if the port id of the network node that the A port is connected, is then judged the time source of B port less than the A port id and is wanted topology to be better than A; If equate, then mistake appears in explanation;
If A<B, the port id of the network node that further relatively B port is connected and the size of B port id, if the port id of the network node that the B port is connected is greater than the B port id, the time source of then judging the A port is better than B, if the port id of the network node that the B port is connected, is then judged the time source of B port less than the B port id and is wanted topology to be better than A; If equate, then mistake appears in explanation;
If A=B, then further judge the size of the port id of the network node that the port id of the network node that the A port is connected 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 is connected is connected greater than the B port judges that then 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 is connected is connected less than the B port judges that then the time source of A port wants topology to be better than B; If the two equates, then further judge the port id of A and B;
If the port id of A, is then judged the time source of B port greater than the port id of B and is wanted topology to be better than A; If the port id of A, is then judged the time source of A port less than the port id of B and is wanted topology to be better than B; If the two equates that then mistake appears in explanation.
By Fig. 2 and comparison algorithm shown in Figure 3, can compare the quality of any two time sources that port connected of a network node, thereby finally can from the time source that each port connects, choose optimum time source.
104,, determine the state of each port according to the optimal time source of choosing and the CO parameter attribute of configuration.
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, will simply describe below:
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 1 between 127 the time, 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 then determining port r is the master state, if not, determine that then the state of port r is the passive state;
When the temporal quality grade of local zone time is positioned at 1 outside 127 the time, judge earlier whether local zone time is better than or the topological optimal time information that is better than in each port institute connect hours source of present networks node, if, determine that then port r state is the master state, if not, continue to judge whether described optimal time information is obtained by port r tracking time source by the present networks node, if determine that then the state of port r is the slave state, if not, continue then 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, if determine that then the state of port r is passive, if not, determine that then the state of 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, the final realization realized network time synchronization in the same optimal time of each node tracking source in the whole net.
After determining port status, mutually different with prior art is, if connecting the state of the port of outside reference time source is master or passive, then 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, then 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 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 disposed, from the time source that the outside reference time source and the network internal of operate as normal can be obtained, obtain the optimal time source, and then determine the state of each port; When the embodiment of the invention can be implemented in a certain outside reference time source and lost efficacy, 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 invention provides comprises:
Local zone time configuration module 501 is used to obtain local time information, according to described local time information configuration CO parameter attribute;
Outside reference time source configuration module 502 is used to obtain 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 existing the outside reference time source to lose efficacy, according to the standard time source attribute of described outside reference time source configuration module 502 configurations, from the outside reference time source of the operate as normal introduced and time source that network internal can be obtained, choose optimum time source;
Port status determination module 504 is used for choosing the 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 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 port,, follow the tracks of or distribute temporal information by described port according to the state of port.
The network node that the embodiment of the 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 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 the described network node the port id of temporal information of last network node transmission outside reference time source of network node number, described network node of process.
The network node that the embodiment of the 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 disposed, from the time source that the outside reference time source and the network internal of operate as normal can be obtained, obtain the optimal time source, and then determine the state of each port; When the embodiment of the invention can be implemented in a certain outside reference time source and lost efficacy, 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 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 to obtain 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,, from the outside reference time source of the operate as normal introduced and intrasystem other network node, choose optimum time source according to source attribute of described standard time; And, determine the state of each port according to described optimal time source and described CO parameter attribute.
After the state of determining each port, determine to follow the tracks of or distribute temporal information by each port according to port status.
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 is connected the outside reference time source respectively with node N3, 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 second time source, and the port status that node N3 is connected with described 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 with operating time information to node N2 and node N4 distribution, node N2 and node N4 receive described operating time information, with its operating time, give node N3 by node N2 with the operating time distribution of information of self then respectively as oneself;
When the very first time lost efficacy in the source, node N1 will follow the tracks of the operating time of the operating time of node N2 as 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 the operating time of the operating time of node N3 as self respectively, node N3 becomes slave with the port status that 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 finished, and the temporal information that whole network will provide with second time source is as fiducial time.
The network synchronous system that the embodiment of the 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 disposed, from the time source that the outside reference time source and the network internal of operate as normal can be obtained, obtain the optimal time source, and then determine the state of each port; When the embodiment of the invention can be implemented in a certain outside reference time source and lost efficacy, 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.
Contents such as the information interaction between above-mentioned network node and intrasystem each module, implementation and since with the inventive method embodiment based on same design, particular content can repeat no more referring to the narration among the inventive method embodiment herein.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to finish by program, described program can be stored in the computer-readable recording medium, as ROM/RAM, magnetic disc or CD etc.
The above; only be the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion by described protection range with claim.