The present invention belongs to the technical field of wireless sensor networks, and relates to a consensus-based clock synchronization skew estimation method based on sequential least squares.
Wireless sensor networks are a kind of typical distributed wireless communication networks. Due to functions such as information collection, data processing and wireless communication, the wireless sensor networks have very important theoretical significance and application value in the fields of environmental monitoring, medical treatment & health, industrial production, dangerous environment, etc. Time synchronization is an important prerequisite for effective application of the wireless sensor networks, and a plurality of applications such as protocol running, TDMA scheduling, energy management and target location need to be run on the basis of keeping time of nodes in a network synchronous. As a core for cooperative control research of a multi-agent system, a consensus-based synchronization protocol is an effective method for solving a problem of cooperative control of a distributed network. Introducing a consensus theory into clock synchronization of a wireless sensor network can improve robustness and expansibility of a synchronization method. Therefore, researching a clock synchronization method based on consensus to solve a problem of distributed synchronization has a good development prospect.
In a practical wireless sensor network scenario, random communication time delay in clock synchronization is usually unavoidable. The random communication time delay can be modeled as Gaussian distribution, exponential distribution and gamma distribution for different applications. Considering presence of communication time delay, early proposed consensus-based clock synchronization methods which ignore influence of time delay cannot effectively guarantee convergence of synchronization between network nodes. Relative skew estimation plays an important role in a clock synchronization method, because an estimated value thereof can be directly used in logical clock parameter compensation, thus influencing synchronization accuracy and convergence performance of a clock synchronization algorithm. In recent years, some consensus-based clock synchronization algorithms have suppressed influence of communication time delay on clock parameter estimation and consensus synchronization by improving relative skew estimation methods, thus effectively solving a problem that synchronization cannot be converged in the presence of time delay. However, such consensus-based clock synchronization methods have two limitations: first, due to limitation of a specific type of random time delay distribution, the methods cannot be applied to an actual network environment with variable time delay; second, the skew estimation methods used are relatively simple, so clock information received by the nodes cannot be fully utilized to estimate a more accurate skew, and performance of time synchronization is also limited.
Therefore, a novel relative skew estimation method which can solve a problem of consensus-based clock synchronization in wireless sensor networks and has low storage requirements and high estimation accuracy in an arbitrary bounded random communication time delay scenario is urgently needed.
In view of this, the purpose of the present invention is to provide a consensus-based clock synchronization skew estimation method based on sequential least squares. Aiming at problems that consensus-based time synchronization cannot be converged in the presence of arbitrary random communication time delay and clock information is not fully utilized in skew estimation, concentrating on an efficient and practical data processing optimization method, and considering high synchronization accuracy and low node storage requirements, relative skew is estimated by a sequential least squares method, and estimation results are applied to a clock synchronization method based on consensus to perform logical clock parameter compensation, so that convergence performance of a consensus-based time synchronization method in the presence of time delay is effectively guaranteed, and effects of adapting to different types of delay scenarios and improving synchronization accuracy of an entire network can be achieved at the same time.
To achieve the above purpose, the present invention provides following technical solution:
A consensus-based clock synchronization frequency offset estimation method based on sequential least squares, which is to establish a relationship model of clock information and time delay between nodes with respect to a bounded random communication time delay scenario subject to arbitrary distribution, fully consider all clock information received by a node from a neighbor, build a clock parameter estimation model and a cost function based on a least squares principle, iteratively estimate a relative skew by a sequential least squares method, and update logical clock parameters of nodes by a consensus-based clock synchronization method, so as to achieve global clock consensus of all nodes in a network in a completely distributed way. The method comprises the following specific steps:
Further, in step S1, a relationship model of clock information and time delay between nodes is established, specifically comprising: assuming that any sensor node i in a network periodically broadcasts a local clock τi(tki) and relevant synchronization clock information at an interval T, and a neighbor node j thereof receives and records a local clock τj(tkid) thereof at a receiving moment to obtain a communication time delay relationship between nodes under real time scale:
dij(tkid)=tkid−tki
Where dij(tkid) represents random communication time delay subject to arbitrary distribution, which is non-negative and has an upper bound of constant Dd.
Further, in step S2, a relative relationship of any set of local clock information is established according to a communication time delay relationship, specifically comprising: after the neighbor node j receives n+1 pieces of synchronization clock information from the node i, obtaining n+1 sets of local clock observed values {τi(tki), τj(tkid)}k=0n, and establishing the relative relationship of any set of local clock information according to the communication time delay relationship:
τj(tkid)=αijτi(tki)+βij+αjdij(tkid)
Where αij and βij respectively represent a relative skew and a relative offset of the node i relative to the node j, and αj represents a local clock skew of the node j.
Further, in step S3, a clock parameter estimation model and a cost function based on a least squares principle are built, specifically comprising: processing communication time delay items according to the relative relationship of the clock information in order to reduce influence of time delay on parameter estimation and clock synchronization, and considering a time delay part in a formula of the relative relationship of the local clock information as an error function:
eij(tkid)=τj(tkid)−αijτi(tki)−βij
Extending the error function to all local clock observations, and then processing an error by a least squares principle, so as to obtain the following cost function J(αij, βij) containing the clock parameters αij and βij:
Obtaining estimations of the relative skew and the relative offset by minimizing the cost function.
Further, in step S4, relative skew estimation based on a least squares principle is a value obtained by minimizing the cost function J(αij, βij), the cost function contains all clock information received and recorded, and as time synchronization progresses, more and more clock information {τi(tki), τj(tkid)} needs to be stored by the nodes. A sensor node with a limited storage capacity will not have enough memory space to keep all the clock information; in this scenario, a relative clock skew is iteratively estimated by a sequential least squares method, so as to effectively reduce storage overhead of the sensor node, specifically comprising following steps:
S41: In a first round of synchronization, receiving and storing, by the node j, two sets of clock information {τi(t0i), τj(t0id)} and {τi(t1i), τj(t1id)}, and obtaining estimated values {circumflex over (α)}ij(1) and {circumflex over (β)}ij(1) in the first round of synchronization directly by a standard least squares method:
In addition, to start a process of iteratively estimating clock parameters, setting a covariance matrix in the first round of synchronization to be:
Σ(1)=(HT(1)H(1))−1
Where H(1)=[h(0) h(1)]T, h(0)=[τi(t0i)1]T and h(1)=[τi(t1i)1]T;
S42: For a mth (m=2, 3, 4, . . . , n) round of synchronization, storing, by the node j, only clock information {τi(tmi), τj(tmid)} received in the current round, estimated values {circumflex over (α)}ij(m−1) and {circumflex over (β)}ij(m−1) of the clock parameters calculated in a previous round, and a covariance matrix Σ(m−1) generated in the previous round, and then iteratively estimating a relative skew and a relative offset in the current round of synchronization by the sequential least squares method;
{circumflex over (θ)}(m)={circumflex over (θ)}(m−1)+K(m)(τj(tmid)−hT(m){circumflex over (θ)}(m−1)) Estimation updating:
Σ(m)=(I2−K(m)hT(m))Σ(m−1) Covariance updating:
Where {circumflex over (θ)}(m) represents the estimated values of the clock parameters in the mth round, i.e., {circumflex over (θ)}(m)=[{circumflex over (α)}ij(m) {circumflex over (β)}ij(m)]T, h(m)=[τi(tmi) 1]T, K(m) represents a gain matrix in the mth round, Σ(m) represents a covariance matrix of the mth round of parameter estimation, and I2 is a second-order unit matrix. Thus it can be seen that, according to the skew estimation method based on sequential least squares, the node only needs to store the clock information of the current round of synchronization and the estimated information obtained from the previous round.
Further, in step S4, the logical clock parameters include: logical skew compensation and logical offset compensation.
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.
Referring to
dij(tkid)=tkid−tki
Where dij(tkid) is considered as a positive random variable with an upper bound of a fixed value Dd, and the upper bound is usually set to be a maximum measurable round-trip time. Thus, the neighbor node j establishes a relative relationship of a clock information pair {τi(tki), τj(tkid)} according to the time delay model:
τj(tkid)=αijτi(tki)+βij+αjdij(tkid)
Where αij and βij respectively represent a relative skew and a relative offset of the node i relative to the node j, and αj represents a local clock skew of the node j. In order to reduce influence of time delay on relative skew estimation, a time delay part in a formula of a clock relationship is regarded as an error function eij(tkid):
eij(tkid)=αjdij(tkid)=τj(tkid)−αijτi(tki)−βij
The error function is extended to n+1 pairs of clock information recorded, and a cost function J(αij, βij) can be obtained by using a standard least squares method to synchronously process corresponding errors of all the clock information:
Then is a process of minimizing the cost function to obtain estimated values of parameters, which is to obtain a partial derivative of J(αij, βij) with respect to unknown parameters αij and βij first, let an expression result of the partial derivative obtained be zero, and put two partial derivative equations and a periodic broadcast moment τi(tki)=kT together to obtain estimations {circumflex over (α)}ij and {circumflex over (β)}ij:
As all the recorded clock information is taken into account, the obtained relative skew estimation {circumflex over (α)}ij has a relatively high accuracy, which can effectively ensure convergence performance of a consensus-based clock synchronization algorithm in the presence of communication time delay when applied to the algorithm.
It can be seen from an expression of the relative skew estimation derived by the standard least squares method that the node needs to store all the recorded clock information for parameter estimation, and amount of calculation is relatively complicated. Obviously, as the number of rounds of synchronization increases, the amount of synchronization clock information received will increase; for a scenario that a sensor node has limited storage capacity and calculation capability and cannot store all the recorded clock information, it is necessary to take special consideration to reduce storage overhead and design a completely equivalent sequential least squares estimation method. As the cost function contains two parameters which need to be estimated, at least two pieces of clock information are needed as initialization points of estimation; at the same time, the parameters to be estimated are denoted as a vector θ=[αij βij]T for the convenience of using during sequential least squares estimation. In a first round of synchronization, the node j needs to record two pieces of clock information {τi(t0i), τj(t0id)} and {τi(t1i), τj(t1id)}, then the obtained expressions {circumflex over (α)}ij(n) and {circumflex over (β)}ij(n) are processed by the standard least squares method, and estimated values of the parameters in the first round of synchronization can be calculated:
Where {circumflex over (θ)}(1)[{circumflex over (α)}ij(1) {circumflex over (β)}ij(1)]T represents the estimated values of the clock parameters in the first round. Whereas in a mth (m=2, 3, 4, . . . , n) round of synchronization, the node j only needs to store clock information {τi(tmi), τj(tmid)} received in the current round, estimated values {circumflex over (α)}ij(m−1) and {circumflex over (β)}ij(m−1) calculated in a previous round, and a covariance matrix used in an iterative estimation process, and a relative skew and a relative offset in the current round are iteratively estimated by the sequential least squares method:
{circumflex over (θ)}(m)={circumflex over (θ)}(m−1)+K(m)(τj(tmid)−hT(m){circumflex over (θ)}(m−1)) Estimation updating:
Σ(n)=(I2−K(n)hT(n))Σ(n−1) Covariance updating:
Where {circumflex over (θ)}(m)=[{circumflex over (α)}ij(m) {circumflex over (β)}ij(m)]T represents the estimated values of the clock parameters in the mth round, h(m)=[τi(tmi) 1]T, K(m) represents a gain matrix in the mth round, τ(m) represents a covariance matrix of the mth round of parameter estimation, and I2 is a second-order unit matrix. In addition, to start a process of iteratively estimating clock parameters, a covariance matrix in the first round is given as τ(1)=(HT(1)H(1))−1, where H(1)=[h(0) h(1)]T. Thus it can be seen obviously that, when the relative skew is estimated by the sequential least squares method, the node only needs to store a small amount of clock information and relevant iteration information.
After the relative skew between nodes is estimated, applying the relative offset to a consensus synchronization method to compensate logical clock parameters of nodes, such as skew compensation and offset compensation based on an average consensus protocol. Periodically repeating the processes of relative skew estimation, logical offset compensation and logical offset compensation until the logical clocks of all nodes in a distributed network are synchronized.
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 |
---|---|---|---|
202110506223.5 | May 2021 | CN | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2021/099979 | 6/15/2021 | WO |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2022/236916 | 11/17/2022 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
20160330012 | Liu | Nov 2016 | A1 |
20170286675 | Shin | Oct 2017 | A1 |
Number | Date | Country | |
---|---|---|---|
20240163821 A1 | May 2024 | US |