High-precision time synchronization method

11196498 · 2021-12-07

Assignee

Inventors

Cpc classification

International classification

Abstract

The present disclosure provides a high-precision time synchronization method. With the method, a traditional time synchronization protocol of a traditional IEEE 1588 network can be improved by introducing a periodic perturbation time between any two nodes in the time synchronization network, the perturbation time can be caused by changing the lengths of transmission paths or introducing clock phase perturbation due to different clock frequencies in the transistor and the receiver. With the method, the relevance of resulting errors of multiple synchronizations can be eliminated, and the perturbation can be compensated by means of statistical averaging, such that the synchronization error due to the low clock resolution of the synchronization node can be decreased. The method may realize the time synchronization at the precision of nanosecond, having significant advantages over the traditional time synchronization method based on IEEE 1588 protocol.

Claims

1. A time synchronization method, comprising: introducing a periodic perturbation time in a transmission time between any two nodes in a time synchronization network, defining a value of the periodic perturbation time from an ith node to a jth node as a function ƒ.sub.i,j(t) of time, where t indicates time and a maximum of the value of the periodic perturbation time is larger than or equal to a receiving clock period of the jth node, wherein a perturbation period of the periodic perturbation time is P.sub.i,j, and a mean of the periodic perturbation time within the perturbation period is E i , j = 1 P i , j 0 P i , j f i , j ( t ) dt ; and during a time synchronization between the ith node and the jth node, recording a transmitting time t.sub.1.sup.j,i of a message sent from the ith node to the jth node and a receiving time t.sub.2.sup.j,i of the message received by the jth node, a transmitting time t.sub.3.sup.j,i of a message sent from the jth node to the ith node and a receiving time t.sub.4.sup.j,i of the message received by the ith node; for a perturbation period, calculating a mean t.sub.1.sup.j,i of the transmitting time t.sub.1.sup.j,i, a mean t.sub.2.sup.j,i of the receiving time t.sub.2.sup.j,i, a mean t.sub.3.sup.j,i of the transmitting time t.sub.3.sup.j,i, a mean t.sub.4.sup.j,i of the receiving time t.sub.4.sup.j,i and determining a time correction of the jth node with respect to the ith node according to a first formula of offset.sub.j,i=(t.sub.2.sup.j,it.sub.1.sup.j,i+t.sub.3.sup.j,it.sub.4.sup.j,i+E.sub.i,j−E.sub.j,i)/2, wherein E.sub.i,j represents the mean of the periodic perturbation time within the perturbation period ranging from the transmitting time t.sub.1.sup.j,i to the receiving time t.sub.2.sup.j,i, and E.sub.j,i represents a mean of a periodic perturbation time within a perturbation period ranging from the transmitting time t.sub.3.sup.j,i to the receiving time t.sub.4.sup.j,i; and completing the time synchronization between the jth node and the ith node based on the time correction of the jth node with respect to the ith node.

2. The method according to claim 1, wherein the value of the periodic perturbation time is represented by an arithmetic progression ƒ.sub.i,j(t)=d.Math.t,t∈[0,P.sub.i,j), where d represents a common difference, wherein t∈[0,P.sub.i,j) represents that t takes one or more values from an interval ranging from 0 to the perturbation period of the periodic perturbation time P.sub.i,j.

3. The method according to claim 1, wherein the value of the periodic perturbation time is represented by a random function
ƒ.sub.i,j(t)=random(t),t∈[0,P.sub.i,j).

4. The method according to claim 1, wherein the node in the time synchronization network sends pulses to each other to perform the time synchronization, and introducing the periodic perturbation time in the transmission time between any two nodes in the time synchronization network comprises: setting a transmitting clock period of the ith node as T.sub.s.sup.i, and a receiving clock period of the ith node as T.sub.r.sup.i, and setting a transmitting clock period of the jth node as T.sub.s.sup.j, and a receiving clock period of the jth node as T.sub.r.sup.j, wherein T.sub.s.sup.i is not equal to T.sub.r.sup.j, and T.sub.s.sup.j is not equal to T.sub.r.sup.i, the perturbation periods of the periodic perturbation time in a two-way transmission between the ith node and the jth node are respectively a least common multiple of T.sub.s.sup.i and T.sub.r.sup.j, and a least common multiple of T.sub.s.sup.j and T.sub.r.sup.i.

5. The method according to claim 4, further comprising converting the first formula for calculating the time correction of the jth node with respect to the ith node, comprising: calculating a simplest integer ratio between T.sub.s.sup.i and T.sub.r.sup.j as n.sub.s.sup.i:n.sub.r.sup.j=T.sub.s.sup.i:T.sub.r.sup.j, and a simplest integer ratio between T.sub.s.sup.j and T.sub.r.sup.i as n.sub.s.sup.j:n.sub.r.sup.i=T.sub.s.sup.j:T.sub.r.sup.i, wherein n.sub.s.sup.i represents a simplest integer of T.sub.s.sup.i, n.sub.r.sup.j represents a simplest integer of T.sub.r.sup.j, n.sub.s.sup.j represents a simplest integer of T.sub.s.sup.j, and n.sub.r.sup.i represents a simplest integer of T.sub.r.sup.i; defining a time interval between a time when a kth pulse sent by the ith node arrives at the jth node and a time of a next rising edge of a receiving clock of the jth node as e.sub.i,j.sup.k; and converting the first formula to a second formula of: offset j , i = [ ( t 2 j , i _ - t 1 j , i _ ) + ( t 3 j , i _ - t 4 j , i _ ) ] / 2 + ( n r i - 1 2 n r i .Math. T r i + e i , j 1 - T r i n r i .Math. [ n r i .Math. e i , j 1 T r i ] ) / 2 - ( n r j - 1 2 n r j .Math. T r j + e j , i 1 - T r j n r j .Math. [ n r j .Math. e j , i 1 T r j ] ) / 2 , wherein e.sub.i,j.sup.1 represents a time interval between a time when a first pulse sent by the ith node arrives at the jth node and a time of a next rising edge of a receiving clock of the jth node, and e.sub.j,i.sup.1 represents a time interval between a time when a first pulse sent by the jth node arrives at the ith node and a time of a next rising edge of a receiving clock of the ith node.

6. The method according to claim 5, wherein converting the first formula further comprises: setting T.sub.s.sup.i, T.sub.s.sup.j, T.sub.r.sup.i, T.sub.r.sup.j to enable n.sub.r.sup.i and n.sub.r.sup.j to meet n.sub.r.sup.i>>1 and n.sub.r.sup.j>>1, and simplifying the second formula to a third formula of
offset.sub.j,i=[(t.sub.2.sup.j,it.sub.1.sup.j,i) +(t.sub.3.sup.j,it.sub.4.sup.j,i)]/ 2+(T.sub.r.sup.i−T.sub.r.sup.j)/4 .

7. The method according to claim 6, wherein converting the first formula further comprises: setting a transmitting clock period of each node in the time synchronization network as T.sub.s, and a receiving clock period of the node as T.sub.r, and simplifying the third formula to a fourth formula of offset.sub.j,i=[(t.sub.2.sup.j,it.sub.1.sup.j,i)+(t.sub.3.sup.j,it.sub.4.sup.j,i)]/2, wherein T.sub.s is not equal to T.sub.r.

8. The method according to claim 7, wherein setting the transmitting clock period of each node in the time synchronization network as T.sub.s, and the receiving clock period of the node as T.sub.r further comprises: setting the transmitting clock period T.sub.s of each node and the receiving clock period T.sub.r, of the node to enable a preset upper limit Error.sub.max of a time synchronization error to meet T.sub.r/2n.sub.r<Error.sub.max, wherein n.sub.r represents a simplest integer of the receiving clock period of the node T.sub.r.

9. The method according to claim 1, further comprising: defining a set of adjacent nodes of the jth node as {N.sub.j}, wherein {N.sub.j} contains n nodes and i∈{N.sub.j}, wherein i∈{N.sub.j} represents that the ith node belongs to the set of adjacent nodes of the jth node {N.sub.j}; and calculating a time correction of the jth node with respect to each node in {N.sub.j}, and obtaining a final time correction of the jth node by a formula of: Offset j = 1 n + 1 .Math. i ϵ { N j } offset j , i = 1 n + 1 .Math. i ϵ { N j } ( t 2 j , i _ - t 1 j , i _ + t 3 j , i _ - t 4 j , i _ + E i , j - E j , i ) / 2 ; and completing the time synchronization on the jth node based on the final time correction of the jth node.

10. The method according to claim 9, wherein defining the set of adjacent nodes of the jth node comprises: defining a threshold for failure waiting time as F.sub.th and removing the ith node from {N.sub.j}, when a communication failure time between the ith node and the jth node is greater than F.sub.th.

11. The method according to claim 4, wherein recording a transmitting time t.sub.1.sup.j,i of a message sent from the ith node to the jth node and a receiving time t.sub.2.sup.j,i of the message received by the jth node further comprises: the ith node sending the message carrying a time stamp and a data package signal to the jth node, the jth node deriving a data package which is received respectively by a data package analyzing module and a time stamp generating module from the data package signal, wherein the time stamp indicates the transmitting time t.sub.1.sup.j,i of the message sent from the ith node, a constant delay line is set for the time stamp generating module so as to ensure that the data package analyzing module can finish an analysis on the data package within a delay time period set through the constant delay line; the data package analyzing module analyzing a head of the data package with a clock C1 having a frequency the same as a transmitting frequency of the data package and a period of T.sub.s.sup.i, generating a control signal and sending the control signal to the time stamp generating module when the data package is identified as a time synchronization package; only after the control signal is received, the time stamp generating module marking a time stamp for the data package to record a time when the data package arrives at the time stamp generating module and sending the data package along with the marked time stamp to a data processor for processing, wherein a clock C2 of the time stamp generating module has a different frequency from C1 and a period of T.sub.r.sup.j, and the marked time stamp indicates the receiving time t.sub.2.sup.j,i of the message received by the jth node.

12. A device, comprising: one or more processors; a memory; one or more programs, stored in the memory, that when executed by the one or more processors, cause the one or more processors to perform the high-precision time synchronization method comprising: introducing a periodic perturbation time in a transmission time between any two nodes in a time synchronization network, defining a value of the periodic perturbation time from an ith node to a jth node as a function ƒ.sub.i,j(t) of time, where t indicates time and a maximum of the value of the periodic perturbation time is larger than or equal to a receiving clock period of the jth node, wherein a perturbation period of the periodic perturbation time is P.sub.i,j, and a mean of the periodic perturbation time within the perturbation period is E i , j = 1 P i , j 0 P i , j f i , j ( t ) dt ; and during a time synchronization between the ith node and the jth node, recording a transmitting time t.sub.1.sup.j,i of a message sent from the ith node to the jth node and a receiving time t.sub.2.sup.j,i of the message received by the jth node, a transmitting time t.sub.3.sup.j,i of a message sent from the jth node to the ith node and a receiving time t.sub.4.sup.j,i of the message received by the ith node; for a perturbation period, calculating a mean t.sub.1.sup.j,i the transmitting time t.sub.1.sup.j,i , a mean t.sub.2.sup.j,i of the receiving time t.sub.2.sup.j,i, a mean t.sub.3.sup.j,i of the transmitting time t.sub.3.sup.j,i, a mean t.sub.4.sup.j,i of the receiving time t.sub.4.sup.j,i, and determining a time correction of the jth node with respect to the ith node according to a first formula of offset.sub.j,i=(t.sub.2.sup.j,it.sub.1.sup.j,i+t.sub.3.sup.j,it.sub.4.sup.j,i+E.sub.i,j−E.sub.j,i)/2, wherein E.sub.i,j represents the mean of the periodic perturbation time within the perturbation period ranging from the transmitting time t.sub.1.sup.j,i to the receiving time t.sub.2.sup.j,i, and E.sub.j,i represents a mean of a periodic perturbation time within a perturbation period ranging from the transmitting time t.sub.3.sup.j,i to the receiving time t.sub.4.sup.j,i; and completing the time synchronization between the jth node and the ith node based on the time correction of the jth node with respect to the ith node.

13. A non-transitory computer readable storage medium, having one or more programs stored thereon, wherein when the one or more programs are executed by a device, the device is caused to perform the high-precision time synchronization method comprising: introducing a periodic perturbation time in a transmission time between any two nodes in a time synchronization network, defining a value of the periodic perturbation time from an ith node to a jth node as a function ƒ.sub.i,j(t) of time, where t indicates time and a maximum of the value of the periodic perturbation time is larger than or equal to a receiving clock period of the jth node, wherein a perturbation period of the periodic perturbation time is P.sub.i,j, and a mean of the periodic perturbation time within the perturbation period is E i , j = 1 P i , j 0 P i , j f i , j ( t ) dt ; and during a time synchronization between the ith node and the jth node, recording a transmitting time t.sub.1.sup.j,i of a message sent from the ith node to the jth node and a receiving time t.sub.2.sup.j,i of the message received by the jth node, a transmitting time t.sub.3.sup.j,i of a message sent from the jth node to the ith node and a receiving time t.sub.4.sup.j,i of the message received by the ith node; for a perturbation period, calculating a mean t.sub.1.sup.j,i the transmitting time t.sub.1.sup.j,i, a mean t.sub.2.sup.j,i of the receiving time t.sub.2.sup.j,i, a mean t.sub.3.sup.j,i of the transmitting time t.sub.3.sup.j,i, a mean t.sub.4.sup.j,i of the receiving time t.sub.4.sup.j,i, and determining a time correction of the jth node with respect to the ith node according to a first formula of offset.sub.j,i=(t.sub.2.sup.j,it.sub.1.sup.j,i+t.sub.3.sup.j,it.sub.4.sup.j,i+E.sub.i,j−E.sub.j,i)/2, wherein E.sub.i,j represents the mean of the periodic perturbation time within the perturbation period ranging from the transmitting time t.sub.1.sup.j,i to the receiving time t.sub.2.sup.j,i and E.sub.j,i represents a mean of a periodic perturbation time within a perturbation period ranging from the transmitting time t.sub.3.sup.j,i to the receiving time t.sub.4.sup.j,i; and completing the time synchronization between the jth node and the ith node based on the time correction of the jth node with respect to the ith node.

14. The device according to claim 12, wherein the node in the time synchronization network sends pulses to each other to perform the time synchronization, and introducing the periodic perturbation time in the transmission time between any two nodes in the time synchronization network comprises: setting a transmitting clock period of the ith node as T.sub.s.sup.i, and a receiving clock period as T.sub.r.sup.i, and setting a transmitting clock period of the jth node as T.sub.s.sup.j, and a receiving clock period as T.sub.r.sup.j, wherein T.sub.s.sup.i is not equal to T.sub.r.sup.j, and T.sub.s.sup.j is not equal to T.sub.r.sup.i, the perturbation periods of the periodic perturbation time in a two-way transmission between the ith node and the jth node are respectively a least common multiple of T.sub.s.sup.i and T.sub.r.sup.j, and a least common multiple of T.sub.s.sup.j and T.sub.r.sup.i.

15. The device according to claim 14, further comprising converting the first formula for calculating the time correction of the jth node with respect to the ith node, comprising: calculating a simplest integer ratio between T.sub.s.sup.i and T.sub.r.sup.j as n.sub.s.sup.i:n.sub.r.sup.j=T.sub.s.sup.i:T.sub.r.sup.j, and a simplest integer ratio between T.sub.s.sup.j and T.sub.r.sup.i as n.sub.s.sup.j:n.sub.r.sup.i=T.sub.s.sup.j:T.sub.r.sup.i, wherein n.sub.s.sup.i represents a simplest integer of T.sub.s.sup.i, n.sub.r.sup.j represents a simplest integer of T.sub.r.sup.j, n.sub.s.sup.j represents a simplest integer of T.sub.s.sup.j, and n.sub.r.sup.i represents a simplest integer of T.sub.r.sup.i; defining a time interval between a time when a kth pulse sent by the ith node arrives at the jth node and a time of a next rising edge of a receiving clock of the jth node as e.sub.i,j.sup.k; and converting the first formula to a second formula of: offset j , i = [ ( t 2 j , i _ - t 1 j , i _ ) + ( t 3 j , i _ - t 4 j , i _ ) ] / 2 + ( n r i - 1 2 n r i .Math. T r i + e i , j 1 - T r i n r i .Math. [ n r i .Math. e i , j 1 T r i ] ) / 2 - ( n r j - 1 2 n r j .Math. T r j + e j , i 1 - T r j n r j .Math. [ n r j .Math. e j , i 1 T r j ] ) / 2. wherein e.sub.i,j.sup.1 represents a time interval between a time when a first pulse sent by the ith node arrives at the jth node and a time of a next rising edge of a receiving clock of the jth node , and e.sub.j,i.sup.1 represents a time interval between a time when a first pulse sent by the jth node arrives at the ith node and a time of a next rising edge of a receiving clock of the ith node.

16. The device according to claim 15, wherein converting the first formula further comprises: setting T.sub.s.sup.i, T.sub.s.sup.j, T.sub.r.sup.i, T.sub.r.sup.j to enable n.sub.r.sup.i and n.sub.r.sup.j to meet n.sub.r.sup.i>>1 and n.sub.r.sup.j>>1, and simplifying the second formula to a third formula of
offset.sub.j,i=[(t.sub.2.sup.j,it.sub.1.sup.j,i)+(t.sub.3.sup.j,it.sub.4.sup.j,i)]/2+(T.sub.r.sup.i−T.sub.r.sup.j)/4.

17. The device according to claim 16, wherein converting the first formula further comprises: setting a transmitting clock period of each node in the time synchronization network as T.sub.s, and a receiving clock period of the node as T.sub.r, and simplifying the third formula to a fourth formula of offset.sub.j,i=[(t.sub.2.sup.j,it.sub.1.sup.j,i)+(t.sub.3.sup.j,it.sub.4.sup.j,i)]/2, wherein T.sub.s is not equal to T.sub.r.

18. The device according to claim 17, wherein setting the transmitting clock period of each node in the time synchronization network as T.sub.s, and the receiving clock period of the node as T.sub.r further comprises: setting the transmitting clock period T.sub.s of each node and the receiving clock period T.sub.r, of the node to enable a preset upper limit Error.sub.max of a time synchronization error to meet T.sub.r/2n.sub.r<Error.sub.max, wherein n.sub.r represents a simplest integer of the receiving clock period of the node T.sub.r.

19. The device according to claim 12, further comprising: defining a set of adjacent nodes of the jth node as {N.sub.j}, wherein {N.sub.j} contains n nodes and i∈{N.sub.j}wherein i∈{N.sub.j}represents that the ith node belongs to the set of adjacent nodes of the jth node {N.sub.j}; and calculating a time correction of the jth node with respect to each node in {N.sub.j}, and obtaining a final time correction of the jth node by a formula of: Offset j = 1 n + 1 .Math. i ϵ { N j } offset j , i = 1 n + 1 .Math. i ϵ { N j } ( t 2 j , i _ - t 1 j , i _ + t 3 j , i _ - t 4 j , i _ + E i , j - E j , i ) / 2 ; and completing the time synchronization on the jth node based on the final time correction of the jth node.

20. The device according to claim 14, wherein recording a transmitting time t.sub.1.sup.j,i of a message sent from the ith node to the jth node and a receiving time t.sub.2.sup.j,i of the message received by the jth node further comprises: the ith node sending the message carrying a time stamp and a data package signal to the jth node, the jth node deriving a data package which is received respectively by a data package analyzing module and a time stamp generating module from the data package signal, wherein the time stamp indicates the transmitting time t.sub.1.sup.j,i of the message sent from the ith node, a constant delay line is set for the time stamp generating module so as to ensure that the data package analyzing module can finish an analysis on the data package within a delay time period set through the constant delay line; the data package analyzing module analyzing a head of the data package with a clock C1 having a frequency the same as a transmitting frequency of the data package and a period of T.sub.s.sup.i, generating a control signal and sending the control signal to the time stamp generating module when the data package is identified as a time synchronization package; only after the control signal is received, the time stamp generating module marking a time stamp for the data package to record a time when the data package arrives at the time stamp generating module and sending the data package along with the marked time stamp to a data processor for processing, wherein a clock C2 of the time stamp generating module has a different frequency from C1 and a period of T.sub.r.sup.j, and the marked time stamp indicates the receiving time t.sub.2.sup.j,i of the message received by the jth node.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

(1) The above and/or additional aspects and advantages of embodiments of the present disclosure will become apparent and more readily appreciated from the following descriptions made with reference to the drawings, in which:

(2) FIG. 1 is a flowchart of a high-precision time synchronization method according to an embodiment of the present disclosure.

(3) FIG. 2 is a schematic diagram of a state machine for processing failures in a high-precision time synchronization network according to an embodiment of the present disclosure.

(4) FIG. 3 is a schematic diagram showing an experimental result of time synchronization according to an embodiment of the present disclosure.

(5) FIG. 4 is a schematic diagram showing a node structure for time synchronization with data packages according to an embodiment of the present disclosure.

DETAILED DESCRIPTION

(6) Embodiments of the present disclosure will be described in detail and examples of embodiments are illustrated in the drawings. The same or similar elements and the elements having the same or similar functions are denoted by like reference numerals throughout the descriptions. Embodiments described herein with reference to drawings are explanatory, serve to explain the present disclosure, and are not construed to limit embodiments of the present disclosure.

(7) In the specification, it is to be understood that terms such as “central,” “longitudinal,” “lateral,” “length,” “width,” “thickness,” “upper,” “lower,” “front,” “rear,” “left,” “right,” “vertical,” “horizontal,” “top,” “bottom,” “inner,” “outer,” should be construed to refer to the orientation as then described or as shown in the drawings under discussion. These relative terms are for convenience of description and do not require that the present invention be constructed or operated in a particular orientation. In addition, terms such as “first” and “second” are used herein for purposes of description and are not intended to indicate or imply relative importance or significance or to imply the number of indicated technical features.

(8) In the present invention, unless specified or limited otherwise, the terms “mounted,” “connected,” “coupled,” “fixed” and the like are used broadly, and may be, for example, fixed connections, detachable connections, or integral connections; may also be mechanical or electrical connections; may also be direct connections or indirect connections via intervening structures; may also be inner communications of two elements, which can be understood by those skilled in the art according to specific situations.

(9) A high-precision time synchronization method according to embodiments of the present disclosure will be described below with reference to the accompanying drawings.

(10) The high-precision time synchronization method according to the embodiments of the present disclosure includes the followings.

(11) Step S1: a predict perturbation time is introduced in a transmission time between any two nodes in a time synchronization network. A value of the periodic perturbation time from an ith node to a jth node is defined as a function ƒ.sub.i,j(t) of time, where t indicates time and a maximum of the value of the periodic perturbation time is larger than or equal to a receiving clock period of the jth node. A perturbation period of the periodic perturbation time is P.sub.i,j, and a mean of the periodic perturbation time within the perturbation period is

(12) E i , j = 1 P i , j 0 P i , j f i , j ( t ) dt .

(13) Step S2: during a time synchronization between the ith node and the jth node, the ith node and the jth node send a message carrying a time stamp to each other. A transmitting time t.sub.1.sup.j,i of the message sent from the ith node, a receiving time t.sub.2.sup.j,i of the message received by the jth node, a transmitting time t.sub.3.sup.j,i of the message sent from the jth node, a receiving time t.sub.4.sup.j,i of the message received by the ith node are recorded. For a perturbation period, a mean t.sub.1.sup.j,i the transmitting time t.sub.1.sup.j,i, a mean t.sub.2.sup.j,i of the receiving time t.sub.2.sup.j,i, a mean t.sub.3.sup.j,i of the transmitting time t.sub.3.sup.j,i, a mean t.sub.4.sup.j,i of the receiving time t.sub.4.sup.j,i are calculated and a time correction of the jth node with respect to the ith node is determined as offset.sub.j,i=(t.sub.2.sup.j,it.sub.1.sup.j,i+t.sub.3.sup.j,i t.sub.4.sup.j,i+E.sub.i,j−E.sub.j,i)/2.

(14) In one embodiment of the present disclosure, the value of the periodic perturbation time is represented by an arithmetic progression ƒ.sub.i,j(t)=d.Math.t,t∈[0,P.sub.i,j), where d represents a common difference. For example, when d=1 ns/s,P.sub.i,j=10 s and one synchronization is performed every second, ƒ.sub.i,j(t) can be expressed by an arithmetic progression from 0 ns to 9 ns, with the mean of E.sub.i,j=4.5 ns which can be put into the formula for calculating the time correction so as to achieve precise time synchronization.

(15) In one embodiment of the present disclosure, the value of the periodic perturbation time is represented by a random function ƒ.sub.i,j(t)=random(t),t∈[0,P.sub.i,j). For example, when P.sub.i,j=4 s and one synchronization is performed every second, ƒ.sub.i,j(t) can be generated randomly: ƒ.sub.i,j(0)=0, ƒ.sub.i,j(1)=6, ƒ.sub.i,j(2)=4, ƒ.sub.i,j(3)=2, with the mean of E.sub.i,j=4.5 ns which can be put into the formula for calculating the time correction so as to achieve precise time synchronization.

(16) In one embodiment of the present disclosure, when a time synchronization node sends pulses to another node, a transmitting clock period of the ith node is recoded as T.sub.s.sup.i, and a receiving clock period of the ith node is recorded as T.sub.r.sup.i, a transmitting clock period of the jth node is recoded as T.sub.s.sup.j, and a receiving clock period of the jth node is recorded as T.sub.r.sup.j, so as to introduce the periodic perturbation time between the ith node and the jth node, the perturbation periods of the periodic perturbation time in a two-way transmission between the ith node and the jth node are respectively a least common multiple of T.sub.s.sup.i and T.sub.r.sup.j, and a least common multiple of T.sub.s.sup.j and T.sub.r.sup.i, and the mean of the periodic perturbation time between the ith node and the jth node and the time correction are calculated based on steps S1 and S2.

(17) Further, in one embodiment of the present disclosure, the method further includes: determining a simplest integer ratio between T.sub.s.sup.i and T.sub.r.sup.j as n.sub.s.sup.i:n.sub.r.sup.j=T.sub.s.sup.i:T.sub.r.sup.j, and a simplest integer ratio between T.sub.s.sup.j and T.sub.r.sup.i as n.sub.s.sup.j:n.sub.r.sup.i=T.sub.s.sup.j:T.sub.r.sup.i; defining a time interval between a time when a kth pulse sent by the ith node arrives at the jth node and a time of a next rising edge of a receiving clock of the jth node as e.sub.i,j.sup.k; and calculating the time correction by a formula of:

(18) offset j , i = [ ( t 2 j , i _ - t 1 j , i _ ) + ( t 3 j , i _ - t 4 j , i _ ) ] / 2 + ( n r i - 1 2 n r i .Math. T r i + e i , j 1 - T r i n r i .Math. [ n r i .Math. e i , j 1 T r i ] ) / 2 - ( n r j - 1 2 n r j .Math. T r j + e j , i 1 - T r j n r j .Math. [ n r j .Math. e j , i 1 T r j ] ) / 2.

(19) In one embodiment of the present disclosure, the method further includes: setting T.sub.s.sup.i, T.sub.s.sup.j, T.sub.r.sup.i, T.sub.r.sup.j to enable n.sub.r.sup.i and n.sub.r.sup.i to meet n.sub.r.sup.i>>1 and n.sub.r.sup.j>>1, and simplifying the above formula to a formula of offset.sub.j,i=[(t.sub.2.sup.j,it.sub.1.sup.j,i)+(t.sub.3.sup.j,it.sub.4.sup.j,i)]/2+(T.sub.r.sup.i−T.sub.r.sup.j)/4. For example, let T.sub.r1=10 ns, T.sub.r2=9.9 ns to enable n.sub.r1=100>>1,n.sub.r2=99>>1 to be met, then the time correction can be calculated using the simplified formula.

(20) In one embodiment of the present disclosure, the method further includes: setting a transmitting clock period of each node in the time synchronization network as T.sub.s, and a receiving clock period of each node as T.sub.r, and simplifying the above formula to a formula of offset.sub.j,i=[(t.sub.2.sup.j,it.sub.1.sup.j,i)+(t.sub.3.sup.j,it.sub.4.sup.j,i)]/2.

(21) In one embodiment of the present disclosure, the method further includes: defining an upper limit of a time synchronization error as Error.sub.max, in which the upper limit meets T.sub.r/2n.sub.r<Error.sub.max by means of frequency selection. For example, when Error.sub.max=0.1 ns, if the transmitting clock period is defined as T.sub.s=10 ns, and the receiving clock period is defined as T.sub.r=9.9 ns, i.e., n.sub.s=100,n.sub.r=99, then T.sub.r/2n.sub.r=0.05 ns<Error.sub.max=0.1 ns.

(22) In an embodiment of the present disclosure, the method further includes: defining a set of adjacent nodes of the jth node as {N.sub.j}, wherein {N.sub.j} contains n nodes and i∈{N.sub.j}; and calculating a time correction of the jth node with respect to each node in {N.sub.j}; and obtaining a final time correction of the jth node by a formula of:

(23) Offset j = 1 n + 1 .Math. i ϵ { N j } offset j , i = 1 n + 1 .Math. i ϵ { N j } ( t 2 j , i _ - t 1 j , i _ + t 3 j , i _ - t 4 j , i _ + E i , j - E j , i ) / 2.

(24) For example, a node Node1 is adjacent to nodes Node2, Node3 and Node 4 (n=3). If the time corrections of Node1 with respect to Node2, Node3 and Node4 are Offset.sub.1,2=3 ns,Offset.sub.1,3=2 ns,Offset.sub.1,4=3 ns, respectively, then the time correction of Node1 is Offset.sub.1=2 ns.

(25) In an embodiment of the present disclosure, the method further includes: defining a threshold for failure waiting time as F.sub.th, and considering the ith node to be not the adjacent node of the jth node and removing the ith node from {N.sub.j}, when a communication failure time between the ith node and the jth node is greater than F.sub.th.

(26) In an embodiment of the present disclosure, the method further includes: a time synchronization node sending a message carrying a time stamp to another node and a data package signal to perform the time synchronization, a receiving node deriving a data package which is received respectively by a data package analyzing module and a time stamp generating module from the data package signal, wherein a constant delay line is set for the time stamp generating module so as to ensure that the data package analyzing module can finish an analysis on the data package within a delay time period; the data package analyzing module analyzing a head of the data package with a clock C1 having a frequency the same as a transmitting frequency of the data package and a period of T.sub.s′, i.e., the transmitting clock period of the time synchronization node, generating a control signal and sending the control signal to the time stamp generating module when the data package is identified as a time synchronization package; when the control signal is received, the time stamp generating module marking a time stamp for the data package to record a time when the data package arrives at the time stamp generating module and sending the data package along with the marked time stamp to a data processor for processing, wherein a clock C2 of the time stamp generating module has a different frequency from C1 and a period of T.sub.r′, i.e., the receiving clock period of the receiving node; and setting the marked time stamp generated by the time stamp generating module as an arriving time of the data package, a perturbation period of the periodic perturbation time as a least common multiple of T.sub.s′ and T.sub.r′, and calculating the mean of the periodic perturbation time and the time correction based on steps S1 and S2.

(27) In order to providing a comprehensive understanding of the present disclosure to those skilled in the art, the high-precision time synchronization method according to the embodiments of the present disclosure is further described below with reference to FIGS. 1-4.

(28) FIG. 1 shows a flowchart of the high-precision time synchronization method according to an embodiment of the present disclosure. The synchronization is performed between two nodes by sending pulses. The transmitting pulse and the receiving pulse may use different clock frequencies, such that a recording error of receiving time (time difference between a real receiving time and a recorded receiving time) for each synchronization is distinct, equivalent to introducing a perturbation time in the transmission time, where a perturbation period is a least common multiple of the transmitting clock period and the receiving clock period. A mean of values of the perturbation time can be calculated within the perturbation period. By measuring the value of the perturbation time several times within one perturbation period to obtain a plurality of measured values of the perturbation time and averaging the plurality of measured values to obtain a mean of the measured values, and then compensating the perturbation time, a time correction at the precision exceeding the clock resolution can be obtained.

(29) FIG. 2 shows a state machine for processing failures in a high-precision time synchronization network. When a time synchronization node cannot receive a synchronization pulse sent from an adjacent node at expected time, the state machine is switched from a normal time synchronization state to an adjacent node monitoring state. If the node receives the synchronization pulse within a time period less than a preset threshold for failure waiting time, it is determined that the failure is overcome, and the state machine goes back to the normal time synchronization state. If the node does not receive the synchronization pulse within the time period less than the preset threshold for failure waiting time, it is determined that the adjacent node is failed, the state machine enters an adjacent node updating state and a database of adjacent nodes is updated. A network manager actively removes the adjacent node, and may also change the state of the state machine to the adjacent node updating state. After the database is updated, the state machine enters a time synchronization initializing state, and enters the normal time synchronization state after initialization. To this, the node completes a failure processing.

(30) FIG. 3 shows an experimental result of the high-precision time synchronization method according to an embodiment of the present disclosure. The experimentation is based on a ring topology having four nodes. The time synchronization method according to the embodiment of the present disclosure is applied to the ring topology. The transmitting frequency and the receiving frequency of pulses are 50 MHz and 52 MHz, respectively. A clock signal of each node is input into a frequency meter for measuring the time error at the level of picosecond. The experimental result shows that, compared to the traditional time synchronization method based on IEEE 1588 protocol, the dual-frequency high-precision time synchronization method according to the embodiment of the present disclosure decreases the synchronization error from 9.58 ns to 0.17 ns, which means that the synchronization precision is improved by a factor of 56, thus realizing the nanosecond-level time synchronization.

(31) FIG. 4 shows a node structure for time synchronization by means of data packages according to an embodiment of the present disclosure. A crystal oscillator signal of a node and a frequency synchronization signal from another node are input to a clock locked loop to realize the frequency synchronization of the node. The clock locked loop generates clock C1 and clock C2 and provides them to a data package analyzing module and a time stamp generating module, respectively.

(32) Two data packages are generated from a data package signal received by the node and received by the data package analyzing module and the time stamp generating module, respectively. A constant delay line is set for the time stamp generating module to ensure that the data package analyzing module can finish the analysis of the data package within a delay time period.

(33) The data package analyzing module uses the clock C1 which has a frequency the same as the transmitting frequency of the data package and a period T.sub.s, and analyzes a head of the data package. When the data package is identified as the time synchronization package, a control signal is generated and sent to the time stamp generating module.

(34) The time stamp generating module uses the clock C2 which has a frequency different from the clock C1 and a period of T.sub.r. When the control signal sent from the data package analyzing module is received, the time stamp generating module marks a time stamp for the data package to record a time when the data package arrives at the time stamp generating module, and sends the data package with the time stamp to a data processor for processing.

(35) The data processor sets the time stamp generated by the time stamp generating module as the arriving tine of the data package, a period of the perturbation as a least common multiple of T.sub.s and T.sub.r, and calculates the mean of the perturbation and the time correction based on steps S1 and S2.

(36) A system manager performs system processes such as node initialization and failure processing.

(37) A frequency synchronization signal outputting module outputs the frequency synchronization signal to realize the frequency synchronization with other nodes.

(38) A synchronization data package outputting module outputs the synchronization data package at the frequency of clock C1 to realize the time synchronization with other nodes.

(39) In conclusion, with the high-precision time synchronization method according to the embodiment of the present disclosure, a relevance of resulting errors of multiple synchronizations can be eliminated, a perturbation can be compensated by means of statistical averaging, and a synchronization error due to a low clock resolution of a synchronization node can be decreased. The method may realize the time synchronization at the precision of nanosecond, having significant advantages over the traditional time synchronization method based on IEEE 1588 protocol.

(40) Any process or method described in a flow chart or described herein in other ways may be understood to include one or more modules, segments or portions of codes of executable instructions for achieving specific logical functions or steps in the process, and the scope of a preferred embodiment of the present disclosure includes other implementations, which should be understood by those skilled in the art. It is understood that the order of execution may differ from that which is depicted. For example, the order of execution of two or more boxes may be scrambled relative to the order shown.

(41) The logic and/or step described in other manners herein or shown in the flow chart, for example, a particular sequence table of executable instructions for realizing the logical function, may be specifically achieved in any computer readable medium to be used by the instruction execution system, device or equipment (such as the system based on computers, the system comprising processors or other systems capable of obtaining the instruction from the instruction execution system, device and equipment and executing the instruction), or to be used in combination with the instruction execution system, device and equipment.

(42) It should be understood that each part of the present disclosure may be realized by the hardware, software, firmware or their combination. In the above embodiments, a plurality of steps or methods may be realized by the software or firmware stored in the memory and executed by the appropriate instruction execution system. For example, if it is realized by the hardware, likewise in another embodiment, the steps or methods may be realized by one or a combination of the following techniques known in the art: a discrete logic circuit having a logic gate circuit for realizing a logic function of a data signal, an application-specific integrated circuit having an appropriate combination logic gate circuit, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

(43) Those skilled in the art shall understand that all or parts of the steps in the above exemplifying method of the present disclosure may be achieved by commanding the related hardware with programs. The programs may be stored in a computer readable storage medium, and the programs comprise one or a combination of the steps in the method embodiments of the present disclosure when run on a computer.

(44) In addition, each function cell of the embodiments of the present disclosure may be integrated in a processing module, or these cells may be separate physical existence, or two or more cells are integrated in a processing module. The integrated module may be realized in a form of hardware or in a form of software function modules. When the integrated module is realized in a form of software function module and is sold or used as a standalone product, the integrated module may be stored in a computer readable storage medium.

(45) The storage medium mentioned above may be read-only memories, magnetic disks, CD, etc.

(46) Reference throughout this specification to “an embodiment,” “some embodiments,” “one embodiment”, “another example,” “an example,” “a specific example,” or “some examples,” means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. Thus, the appearances of the phrases such as “in some embodiments,” “in one embodiment”, “in an embodiment”, “in another example,” “in an example,” “in a specific example,” or “in some examples,” in various places throughout this specification are not necessarily referring to the same embodiment or example of the present disclosure. Furthermore, the particular features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.

(47) Although explanatory embodiments have been shown and described, it would be appreciated by those skilled in the art that the above embodiments cannot be construed to limit the present disclosure, and changes, alternatives, and modifications can be made in the embodiments without departing from spirit, principles and scope of the present disclosure.