1. Technical Field
The present invention relates to the technical field of industrial wireless sensor networks, and in particular to a clock synchronization frequency offset estimation method adapted to a WIA-PA network.
2. Description of Related Art
An industrial wireless sensor network features low power consumption and low cost, and has become a hotspot as to the development direction in the industrial control field. The WIA-PA (Wireless Networks for Industrial Automation Process Automation) standard is based on the IEEE 802.15.4 standard for short-range wireless communications, and the data link layer of the WIA-PA is compatible with and expands a superframe structure in IEEE 802.15.4. The data link layer of the WIA-PA supports a time slot based frequency hopping, retransmission, CSMA and TDMA mixed channel access mechanisms, thereby guaranteeing the reliability and real-time capability for the transmission. Therefore, to guarantee the reliability of the TDMA mechanism, it is extremely important to perform time synchronization on the devices in the WIA-PA network.
According to different recording manners of the time information in a time synchronization process, the time synchronization methods for the wireless sensor networks can be divided into the following three classes: a one-way based synchronization algorithm, a two-way message exchange based synchronization algorithm, and a receiver-receiver based synchronization algorithm. The one-way based synchronization algorithm mainly includes an FTSP algorithm and a DMTS algorithm, the two-way message exchange based algorithm mainly includes an LTS algorithm and a TPSN algorithm, and the receiver-receiver based synchronization algorithm mainly refers to an RBS algorithm. The time synchronization mechanism of the WIA-PA network mainly involves beacon frame synchronization and command frame synchronization, where a child device receives a beacon frame attached with time information, which is broadcast periodically by a time source, records a local time when the beacon frame is received, and simply compares the two times to obtain a clock offset between the present device clock and a standard clock, thereby adjusting the local clock with the clock offset; and moreover, secondary synchronization can also be performed with a dedicated time synchronization command frame of the WIA-PA network.
In the WIA-PA network, the transmission of a message is necessary to complete the time synchronization between nodes, however, various delays in message transceiving have an important effect on the precision of the time synchronization.
At present, the time synchronization mechanism of the WIA-PA network has the following major problems: first, the clock offset is simply estimated only in a current beacon frame synchronization mechanism without estimating and compensating the more important frequency offset, resulting in that time errors rapidly accumulate in a time interval of the synchronization period, and the time source has to increase the broadcast frequency of the beacon frame to maintain the basic time synchronization precision of the network; second, in a time parameter estimation process, the effects of the six types of delays, including send time, access time, transmission time, propagation time, reception time and receive time, on an estimation result in the message transceiving process not being excluded, resulting in a larger deviation between the adjusted time and the standard time, and the reduction of synchronization precision; and finally, a general clock offset and frequency offset joint estimation method has the defects of high computation burden and higher complexity, and the situation, which is more conforming to an actual scene, that the child node compensates the local time in each synchronization period and then separately estimates the relative frequency offset as provided by the present invention is rarely taken into consideration.
Specific to the problems in the prior art, the present invention provides a clock synchronization frequency offset estimation method adapted to a WIA-PA network, for increasing the time synchronization precision of the WIA-PA network, prolonging the time synchronization period, reducing the broadcast frequency of the beacon frame, reducing the communication overhead of the network and the energy consumption of the node. A technical solution of the present invention is as follows: a clock synchronization frequency offset estimation method adapted to a WIA-PA network, comprising the following steps:
101. receiving a beacon frame, broadcast periodically by a time source device A, by a child node P in an industrial wireless sensor network WIA-PA to obtain a time T1,i(A) at which the time source device A sends the beacon frame and a time T2,i(P) when the child node P receives the beacon frame from the received beacon frame, calculating a difference value ΔTi=T2,i(P)−T1,i(A) between the two as a time adjustment quantity, and subtracting the time adjustment quantity ΔTi from a subsequent time T5,i(P) to obtain a time as its own local time for the child node P; and repeating the above process, and after N synchronization periods, separately estimating a frequency offset {circumflex over (ρ)}(AP) of a local clock relative to a time source with a frequency offset estimation formula; and
102. when a time needs to be reported, converting the local time into a current time of the node P by the child node P using the estimated relative frequency offset {circumflex over (ρ)}(AP) according to the formula (1+{circumflex over (ρ)}(AP))−1(t−ΔTi), and reporting the current time of the node P.
Further, when time synchronization is required to be implemented between the time source device A and the child node P in Step 101, the time source device A is taken as a time reference node, the child node P is a node to be synchronized, and the time synchronization step comprises the following steps:
A0. generating a beacon frame by a MAC layer of the node A, reserving a sending timestamp position in the beacon frame, performing interruption when the node A transmits the beacon frame to a delimiter SFD (i.e., single frequency dialling), and adding a sending timestamp into the reserved sending timestamp position in the beacon frame; and periodically broadcasting the beacon frame by the node A through a wireless interface;
A1. receiving the beacon frame by a MAC layer of the child node P, recording a receiving timestamp under SFD interruption and assigning a value to a variable T2,i(P), and analyzing the beacon frame to obtain the sending timestamp and assigning a value to a variable T1,i(A), wherein T2,i(P) represents a time when the child node P receives the beacon frame, and T1,i(A) represents a time when the time source device A sends the beacon frame;
A2. calculating a time adjustment quantity ΔTi by an application layer of the node P according to a formula ΔTi=T2,i(P)−T1,i(A), and adjusting its own local time at a subsequent time T5,i(P), i.e. subtracting the adjustment amount ΔTi from the current local time to obtain a time as a new time; and
A3. repeating Steps A1 and A2, preserving a point (T1,i(A), T2,i(P)) to a corresponding array, and after N periods, estimating a frequency offset {circumflex over (ρ)}(AP) of the node P relative to the node A by the application layer of the node P according to a frequency offset estimation formula
wherein in the formula, T1,i(A) is the time when the node A sends an ith beacon frame, T2,i(P) is a time when the node P receives the ith beacon frame, T2,i-1(P) is a time when the node P receives the (i-1)th beacon frame, and N is the number of time synchronization.
Further, in Step A0, the beacon frame is sent in a broadcast manner, a source address of the beacon frame is an address of the node A, and a time synchronization mechanism of the beacon frame is the time synchronization of a one-way message.
Further, in Step 101, N is 1, that is, for a first synchronization period, T2,1(P) can be expressed as:
T2,1(P)=T1,1(A)+θt
wherein ρ(AP) and θt
ΔT1=T2,1(P)−T1,1(A)=θt
T5,1(P)*=T5,1(P)+T2,1(P)−T1,1(A) (2)
in a time from t0 to T5,1(A), a real clock offset quantity ΔTtrue,1 generated between the node A and the node P is
ΔTtrue,1=θt
a new clock offset quantity θt
θt
supposing the time of the node A corresponding to the time T5,1(P)* is T5,1(A)*, at this point, the node A and the node P are very close in time since the local time of the node P is just adjusted, therefore, T5,1(P)*=T5,1(A)* can be established.
The present invention has the following advantages and beneficial effects:
1. According to the clock synchronization frequency offset estimation method adapted to the WIA-PA network provided by the present invention, the child node adjusts the local time after receiving the beacon frame in each synchronization period, and separately estimates the relative frequency offset after a plurality of synchronization periods, therefore, the accumulated synchronization errors is reduced in the time synchronization period, the time synchronization precision is effectively increased, the synchronization period is prolonged, and both the communication overhead of the network and the energy consumption of the node are reduced.
2. The present invention not only takes the six types of delays, including send time, access time, transmission time, propagation time, reception time and receive time, in the message receiving process into full consideration in the frequency offset estimation process, but also addresses the accumulated synchronization errors caused by the frequency offset in the beacon frame transceiving process, so that a synchronization model is more conforming to an actual condition, and an estimation result is more accurate.
3. According to the clock synchronization frequency offset estimation method adapted to the WIA-PA network provided by the present invention, a frequency offset estimation expression is only related to the sending timestamp T1,i(A) and the receiving timestamp T2,i(P) and is not affected by the time adjustment time T5,1(P) and the fixed delay d(AP). Therefore, the relative frequency offset can be estimated effectively with only two types of timestamps, i.e. {T1,i(A), T2,i(P)}i=1N, and the advantages of simple calculation and novel method are achieved.
4. The present invention takes the situation where the child node adjusts the local time in each period and separately estimates the frequency offset finally into consideration, and the clock offset and frequency offset joint estimation method is not needed, thereby reducing the number of the parameters to be estimated and the estimation complexity, therefore, the method provided by the present invention is more conforming to the actual scene.
The present invention will be further illustrated below in combination with the accompanying drawings.
The core concept of the present invention is as follows: based on the beacon frame broadcast in one way, the sending time and receiving time of the beacon frame are recorded, a difference value between the two is taken as a time adjustment quantity for adjusting the local time, and after such process is executed for a plurality of periods, the statistical signal estimation method is used to separately estimate the frequency offset for compensating the local time of the node, thereby reducing the accumulated synchronization errors in the period of time between two synchronization periods, and effectively increasing the time synchronization precision of the WIA-PA beacon frame.
For a first synchronization period, T2,1(P) can be expressed as:
T2,1(P)=T1,1(A)+θt
wherein ρ(AP) and θt
ΔT1=T2,1(P)−T1,1(A)=θt
T5,1(P)*=T5,1(P)+T2,1(P)−T1,1(A) (2)
In fact, in a period of time from t0 to T5,1(A), a real clock offset quantity ΔTtrue,1 generated between the node A and the node P is
ΔTtrue,1=θt
A new clock offset quantity θt
θt
Supposing the time of the node A corresponding to the time T5,1(P)* is T5,1(A)*, at this point, the node A and the node P are very close in time since the local time of the node P is just adjusted, therefore, T5,1(P)*=T5,1(A)* can be established.
In a second period following, the time adjustment quantity ΔT2 of the node P can be solved as
ΔT2=T2,2(P)−T1,2(A)=θt
θt
ΔT2=T2,2(P)−T1,2(A)=ρ(AP)(T1,2(A)−T2,1(P)+X2(AP)−X1(AP))+X2(AP)−X1(AP)) (6)
In fact, in a period of time from T5,1(P)* to T5,2(P), a real clock offset quantity ΔTtrue,2 between the node A and the node P can be expressed as
ΔTtrue,2=θt
A new clock offset quantity θt
θt
Table 1 lists the relevant parameters in a time synchronization period, including reference time, adjustment time, and initial offset quantity. As can be known from (4), the initial offset quantity θt
For a third period, the time adjustment quantity ΔT3 can be solved as
T2,3(P)−T1,3(A)=ρ(AP)(T1,3(A)−T2,2(P))+(1+ρ(AP))(X3(AP)−X2(AP))
By repeating the steps above, the time adjustment quantity of the ith period is
T2,i(P)−T1,i(A)=ρ(AP)(T1,i(A)−T2,i-1(P))+(1+ρ(AP))(Xi(AP)−Xi-1(AP))=ρ(AP)(T1,i(A)−T2,i-1(P))+(1+ρ(AP))Wi (8)
Thereunto, Wi is a Gaussian white noise with a mean value of 0 and a variance of σ2. The frequency offset ρ(AP) is estimated with a maximum likelihood estimation method, and a log-likelihood function based on an observed quantity {T2,i(P), T1,i(A)}i=1N in Formula (8) can be expressed as
A partial derivative is solved for ρ(AP) and is made to be 0 as follows
thereby obtaining a solution as follows
As can be obtained from the formula above, the frequency offset {circumflex over (ρ)}(AP) is irrelevant to the adjustment time T5,2(P) and and the fixed delay d(AP), the node P only needs to obtain the sending timestamp {T1,i(A)}i=1N and the receiving timestamp {T2,i(P)}i=1N to possibly estimate the frequency offset, and the advantages of the novel method and calculation simplicity are achieved. In addition, the node P does not need to conduct joint estimation on the clock offset and the frequency offset, and the synchronization with the node A can be implemented just by separately estimating the frequency offset, thereby reducing the calculation amount and the complexity.
To verify the effectiveness of the estimation results, a lower limit of CRLB (Cramer-Rao Lower Bound) of {circumflex over (ρ)}(AP) can be solved as follows
Based on the principle of the present invention above,
Step 401 is an initial action. In Step 402, a source node constructs a lead code and other parts of a beacon frame and updates the content of the beacon frame, and in Step 403, whether a beacon frame sending condition is met is judged, if not in Step 403, waiting continues, and if so in Step 403, the beacon frame is started to be sent in Step 404.
In Step 405, a child node detects the beacon frame after wireless receiving and waiting, and starts to receive the beacon frame. In Steps 406 and 407, when the source node sends the beacon frame to the delimiter SFD, an interruption occurs, and then, in Step 408, the source node adds the sending timestamp into a reserved timestamp position in the beacon frame. As the transmission speed is 250 kbps at the frequency band of 2.4 G in the IEEE 802.15.4 protocol, with 4 microseconds per bit, the running of an interruption program is ended when it is the timestamp part to be sent, the timestamp has been added to the reserved position, and the interruption and timestamp addition process and the sending process have no effect on each other. In Step 409, the source node sets a sending flag bit as 0, and Step 401 is returned to after the completion of the sending of the beacon frame. In Steps 410 and 411, when the child node receives the beacon frame, a receiving timestamp is recorded and preserved under SFD interruption, and then, in Step 412, a receiving flag bit is set, and the receiving of the beacon frame is completed. In Step 413, the child node analyzes the beacon frame to obtain the sending timestamp, and preserves the sending timestamp in a corresponding array, and then, in Step 414, a difference value between the sending timestamp and the receiving timestamp is calculated and used as a current time adjustment quantity. In Step 415, the child node records the number of the r if not in eceived beacon frame and judges whether a period number (i.e. the number of the received beacon frame) is a given value N; Step 415, Step 417 is executed and the time adjustment quantity is used to adjust the local clock; if so in Step 415, the child node separately estimates the relative frequency offset using the recorded historic timestamp data according to Formula (10) provided in the present invention in Step 416; and then in Step 417, the time adjustment quantity is used to adjust the local clock and compensate the frequency offset simultaneously. In Step 418, the historic timestamp data are updated, the period number is set to be 0, and Step 401 is returned to.
The embodiments above shall be construed to illustrating the present invention only, instead of limiting the protection scope of the present invention. After reading the described contents of the present invention, those skilled in the art may make various variations or alternations to the present invention, and these equivalent changes or modifications shall likewise fall within the scope defined by the claims of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
2015 1 0212566 | Apr 2015 | CN | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2016/077761 | 3/29/2016 | WO | 00 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2016/173358 | 11/3/2016 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
20100157975 | In et al. | Jun 2010 | A1 |
20160174016 | Moon | Jun 2016 | A1 |
20170033833 | Terry | Feb 2017 | A1 |
Number | Date | Country |
---|---|---|
103812595 | May 2014 | CN |
104968043 | Oct 2015 | CN |
Entry |
---|
The World Intellectual Property Organization (WIPO) International Search Report for PCT/CN2016/077761 dated Jun. 22, 2016 5 Pages. |
Tao, Zhi-Yong, Hu, Ming, Time Synchronization Algorithm Based on Hierarchical Structure in Wireless Sensor Network, Journal of Computer Applications, Jun. 1, 2012, China. |
Number | Date | Country | |
---|---|---|---|
20180041329 A1 | Feb 2018 | US |