The present invention belongs to the technical field of wireless sensor networks, and relates to a timestamp-free synchronization clock parameter tracking method based on extended Kalman filter.
Because of the advantages such as low power consumption, easy deployment and low price, wireless sensor networks have been widely used, for example, for target tracking, data fusion and deterministic scheduling. The applications require nodes in networks to run on the same time reference, so the time synchronization technology is an important support technology for wireless sensor networks.
Timestamp-free synchronization is a low power synchronization mechanism that can realize synchronization between nodes without the need of exchanging timestamps. Because no time information is transmitted during synchronization and the synchronization function is easy to embed in a network data flow, the synchronization mechanism has received extensive attention. Most of the current timestamp-free synchronization methods are designed based on the assumption that the clock skew parameter remains unchanged, but the clock skew of wireless sensor nodes is nonlinearly time-varying due to the influence of factors such as external environment and life of crystal oscillator. Although some schemes can track the clock skew parameter of timestamp-free synchronization, the estimation of the instantaneous clock offset parameter cannot be realized, which restricts the application of timestamp-free synchronization in actual wireless sensor networks.
In view of this, the purpose of the present invention is to provide a timestamp-free synchronization clock parameter tracking method based on extended Kalman filter. A first order Gauss Markov model and a clock model are used to model time-varying clock offset and skew, and a tracking method based on extended Kalman filter is used to realize joint tracking of timestamp-free synchronization instantaneous clock offset and clock skew. The whole tracking process follows a network data flow without needing a dedicated synchronization frame to transmit timestamp information. A node to be synchronized can realize long-term synchronization with a reference clock node according to the recorded timestamp and the known response time, which saves communication bandwidth and energy and improves synchronization precision.
To achieve the above purpose, the present invention provides the following technical solution:
A timestamp-free synchronization clock parameter tracking method based on extended Kalman filter, comprising the following steps:
Further, for the state equation in step S1, dynamically changing clock skew is considered as a random variable of which the characteristics are described with the first order Gauss Markov model, and the specific formula is as follows:
ρ[n]=mρ[n−1]+u[n]
wherein ρ[n] represents the clock skew of the node to be synchronized relative to the reference clock node at the nth sampling moment; m represents a coefficient less than and close to 1 and is assumed to be known; and u[n] represents Gaussian driving noise with the mean value of 0 and the variance of σu2;
The clock model is used to describe instantaneous clock offset, and the specific formula is as follows:
θ[n]=θ[n−1]+ρ[n]τ[n]
wherein θ[n] represents the clock offset of the node to be synchronized relative to the reference clock node at the nth sampling moment; and τ[n] represents the sampling interval of a nth sample and is assumed to be a fixed value, i.e., τ[n]=τ0;
The formulas of instantaneous clock offset and clock skew are combined to constitute a matrix form, thus obtaining a state equation as follows:
x[n]=Ax[n−1]+u[n]
Further, the step of establishing an observation equation in step S2 is as follows:
S21: in the ith synchronization round, carrying out timestamp-free exchange between the node to be synchronized and the reference clock node, with the general synchronization formula as follows:
Δi=(1+ρi)[(T4,i−T1,i)−2δ−(νi+ωi)]
wherein Δi is the response time of the reference clock node, T1,i and T4,i respectively represent the time for the node to be synchronized to send data packets and the time for the node to be synchronized to receive data packets, δ is a fixed delay of message transmission between two nodes, and νi and ωi are random delays of uplink and downlink during message transmission and modeled as Gaussian distribution with the mean value of 0 and the variances of ε2 and σ2;
wherein
i is an odd number, Si=T4,i−T1,i, and wi=νi+ωi;
wherein S′[n] is an observed value at the nth sampling moment, ρ[n] represents clock skew at the nth sampling moment, w′[n] represents observation noise at the nth sampling moment, and Δ′[n]=Δi+1−Δi;
Combining the discrete observation model of timestamp-free synchronization and the observation model of instantaneous clock offset, thus obtaining an observation equation as follows:
R[n]=H[n]x[n]+W[n]+(h({circumflex over (x)}[n|n−1])−H[n]{circumflex over (x)}[n|n−1]).
Further, the step of jointly tracking clock skew and instantaneous clock offset by a tracking method based on extended Kalman filter in step S2 specifically comprises:
Recording a timestamp of timestamp-free exchange by the node to be synchronized, calculating an observed value according to the timestamp, and jointly tracking instantaneous clock offset and clock skew by the tracking method based on extended Kalman filter in combination with predicted values of state models of clock skew and offset, wherein the formula of extended Kalman filter is as follows:
Prediction: {circumflex over (x)}[n|n−1]=A{circumflex over (x)}[n−1|n−1]
Predicted minimum mean square error: M[n|n−1]=AM[n−1|n−1]AT+Cs
Correction: {circumflex over (x)}[n|n]={circumflex over (x)}[n|n−1]+K[n](R[n]−h({circumflex over (x)}[n|n−1]))
Minimum mean square error: M[n|n]=(I−K[n]H[n])M[n|n−1]
wherein {circumflex over (x)}[n|n−1] represents a predicted value matrix of instantaneous clock offset and clock skew at the nth sampling moment, A is an update coefficient matrix, M[n|n−1] represents a predicted minimum mean square error matrix at the nth sampling moment,
represents a covariance matrix of driving noise, K[n] represents a Kalman gain matrix at the nth sampling moment, H[n] represents a Jacobi matrix at the nth sampling moment,
is a covariance matrix of observation noise, {circumflex over (x)}[n|n] represents a corrected value matrix of corrected instantaneous clock offset and clock skew at the nth sampling moment, R[n] represents an observed value matrix at the nth sampling moment, h({circumflex over (x)}[n|n−1]) represents a transformation matrix from state variables to ideal observation of instantaneous clock offset and clock skew at the nth sampling moment, and M[n|n] represents a corrected minimum mean square error matrix at the nth sampling moment.
Further, the joint tracking method of clock skew and instantaneous clock offset of sensor nodes based on extended Kalman filter for timestamp-free exchange comprises the following specific steps:
The present invention has the following beneficial effects:
Other advantages, objectives and features of the present invention will be illustrated in the following description to some extent, and will be apparent to those skilled in the art based on the following investigation and research to some extent, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description.
To enable the purpose, the technical solution and the advantages of the present invention to be more clear, the present invention will be preferably described in detail below in combination with the drawings, wherein:
Embodiments of the present invention are described below through specific embodiments. Those skilled in the art can understand other advantages and effects of the present invention easily through the disclosure of the description. The present invention can also be implemented or applied through additional different specific embodiments. All details in the description can be modified or changed based on different perspectives and applications without departing from the spirit of the present invention. It should be noted that the figures provided in the following embodiments only exemplarily explain the basic conception of the present invention, and if there is no conflict, the following embodiments and the features in the embodiments can be mutually combined.
Wherein the drawings are only used for exemplary description, are only schematic diagrams rather than physical diagrams, and shall not be understood as a limitation to the present invention. In order to better illustrate the embodiments of the present invention, some components in the drawings may be omitted, scaled up or scaled down, and do not reflect actual product sizes. It should be understandable for those skilled in the art that some well-known structures and description thereof in the drawings may be omitted.
Same or similar reference numerals in the drawings of the embodiments of the present invention refer to same or similar components. It should be understood in the description of the present invention that terms such as “upper”, “lower”, “left”, “right”, “front” and “back” indicate direction or position relationships shown based on the drawings, and are only intended to facilitate the description of the present invention and the simplification of the description rather than to indicate or imply that the indicated device or element must have a specific direction or constructed and operated in a specific direction, and therefore, the terms describing position relationships in the drawings are only used for exemplary description and shall not be understood as a limitation to the present invention; for those ordinary skilled in the art, the meanings of the above terms may be understood according to specific conditions.
With reference to
In the ith synchronization round, the node A to be synchronized sends data packets containing no timestamp information to the reference clock node R and records the time as T1,j(A), the time when the reference clock node R receives the data packets is recorded as T2,i, and the implementation model of T2,i can be expressed as follows:
T
2,i
=T
1,i+θi+δ+ωi+ρi(T1,i−T1,1+δ+νi) (1)
wherein θi and ρi respectively represent clock offset and skew between the node A and the node R, δ is a fixed delay in the data packet transmission process, and νi is a random delay in the data packet transmission process and is modeled as independent Gaussian distribution with the mean value of 0 and the variance of ε2.
The reference clock node R waits for a period of fixed response time Δi after receiving the data packets and returns the data packets containing no timestamp at moment T3,i, the node A receives the data packets at moment T4,i, and the implementation model of T3,i can be expressed as follows:
T
3,i
=T
4,i+θi−δ−ωi+ρi(T4,i−T1,1−δ−ωi) (2)
wherein δ and ωi are respectively a fixed delay and a random delay in the data packet transmission process, and the random delay is modeled as independent Gaussian distribution with the mean value of 0 and the variance of σ2. Formula (1) is subtracted from formula (2) to obtain a general formula as follows:
Δi=(1+ρi)[(T4,i−T1,i)−2δ−(νi+ωi)] (3)
The general formula of the ith round is subtracted from the general formula of the i+1th round, and clock skew is assumed to be unchanged for two consecutive rounds, i.e., ρi+1=ρi, wherein i is an odd number. The observation model of timestamp-free synchronization is obtained as follows:
wherein
i is an odd number, Si=T4,i−T1,i, and wi=νi+ωi.
After sampling, the discrete observation model of timestamp-free synchronization of the node to be synchronized A as follows:
wherein S′[n] is an observed value at the nth sampling moment, ρ[n] represents clock skew at the nth sampling moment, W[n] represents observation noise at the nth sampling moment of the mean value, and Δ′[n]=Δi+1−Δi.
The observed value of instantaneous clock offset is comprised of a true value and noise, offset in the state equation is the true value, and the observation model of instantaneous clock offset can be written as: {tilde over (θ)}[n]=θ[n]+υ[n], wherein {tilde over (θ)}[n] is an observed value of offset, and υ[n] represents Gaussian observation noise with the mean value of 0 and the variance of συ2. The discrete observation model of timestamp-free synchronization and the observation model of instantaneous clock offset are combined, thus obtaining an observation equation as follows:
The observed value in the observation equation and a state value of clock skew between nodes have nonlinear relation, so clock parameters are tracked by extended Kalman filter rather than ordinary Kalman filter, the observation equation needs to be linearized before the use of the tracking method based on extended Kalman filter, and the specific steps are as follows:
R[n]=H[n]x[n]+W[n]+(h({circumflex over (x)}[n|n−1])−H[n]{circumflex over (x)}[n|n−1]) (9)
Due to the nonlinearity of a crystal oscillator and the influence of phase noise as well as external environment (temperature, humidity, pressure intensity, etc.), clock skew will change randomly with time. To accurately reflect the change of clock skew, the present invention considers clock skew as a random variable and models the variable by the first order Gauss Markov model, and the specific model is as follows:
ρ[n]=mρ[n−1]+u[n] (10)
wherein ρ[n] represents the clock skew of the node A to be synchronized relative to the reference clock node R at the nth sampling moment; m represents a coefficient less than and close to 1 and is considered known; and u[n] represents Gaussian driving noise with the mean value of 0 and the variance of σu2.
The clock model is used to describe instantaneous clock offset, and the specific model is as follows:
θ[n]=θ[n−1]+ρ[n]τ[n] (11)
wherein θ[n] represents the clock offset of the node A to be synchronized relative to the reference clock node R at the nth sampling moment; and τ[n] represents the sampling interval of a nth sample and is assumed to be a fixed value, i.e., τ[n]=τ0.
The models of clock skew and offset are combined to constitute a matrix form, thus obtaining a state equation as follows:
Based on the state equation (12) and the observation equation (9), the present invention uses the tracking method based on extended Kalman filter to jointly track clock skew and offset parameters, and the specific formula is as follows:
Prediction: {circumflex over (x)}[n|n−1]=A{circumflex over (x)}[n−1|n−1] (13)
Predicted minimum mean square error: M[n|n−1]=AM[n−1|n−1]AT+Cs (14)
Correction: {circumflex over (x)}[n|n]={circumflex over (x)}[n|n−1]+K[n](R[n]−h({circumflex over (x)}[n|n−1])) (16)
Minimum mean square error: M[n|n]=(I−K[n]H[n])M[n|n−1] (17)
In order to verify the effectiveness of the timestamp-free synchronization clock parameter tracking method based on extended Kalman filter provided by the present invention, posterior Cramer-Rao Bounds (PCRBs) of clock skew and instantaneous clock offset are calculated according to the state equation and the observation equation.
var(ρ)≥J[n]11−1 (18)
var(θ)≥J[n]22−1 (19)
wherein:
J[n+1]=(Cs+AJ[n]−1AT)−1+Ex[n+1]{H[n+1]C0−1H[n+1]} (20)
Finally, it should be noted that the above embodiments are only used for describing, rather than limiting the technical solution of the present invention. Although the present invention is described in detail with reference to the preferred embodiments, those ordinary skilled in the art shall understand that the technical solution of the present invention can be amended or equivalently replaced without departing from the purpose and the scope of the technical solution. The amendment or equivalent replacement shall be covered within the scope of the claims of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
202110710014.2 | Jun 2021 | CN | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2022/076843 | 2/18/2022 | WO |