# Adaptive Fractional-Order Operator Clock Synchronization Algorithm Based on Grey Prediction

Authors: Hongwei Yang; Long Wang; Jing Zhang; Li Li
Journal: Journal of Sensors
 (2020)

---

## Abstract

As a result of the influence of clock drift and uncertainty delay in synchronous message transmission, the clock synchronization model based on statistical distribution cannot accurately describe clock deviation. This model also requires a large number of timestamp samples that cause a storage occupation issue for wireless sensor nodes with limited resources. The modeling method based on grey prediction has advantages of low sample demand and simple modeling process. However, the accuracy of the existing clock synchronization models needs to be improved. Based on the grey prediction theory, this paper proposes an adaptive fractional-order operator clock synchronization algorithm considering uncertainty delay. First, based on the clock model and clock offset model, the frequency offset between nodes is optimized by taking the mean on the clock frequencies. Second, a grey prediction algorithm based on a fractional-order operator is proposed by estimating the uncertainty delay in message transmission to obtain the clock offset. Finally, the order of the fractional-order accumulation is adjusted adaptively in the grey prediction model according to the collected timestamp sample values so that the estimation of the uncertainty delay is more accurate, thereby improving the accuracy of the clock offset. Compared with the first-order accumulative grey prediction clock synchronization algorithms and timing-sync protocol for sensor networks, the proposed scheme improved the synchronization accuracy by 29.18% and 44.01%, respectively, and reduced the variance of the clock offset by 48.66% and 64.89%. Thus, the proposed algorithm is characterized by improved stability.


---

## Body

## 1. Introduction

Clock synchronization between different nodes in wireless sensor networks (WSNs) is an important basis for coordinating network operations [1]. Data fusion, energy management, transmission scheduling, and other processes require sensor nodes to be clock synchronized [2, 3]. However, sensor nodes tend to have limited energy. Under the premise of ensuring a certain clock synchronization accuracy, reducing the energy consumption of the nodes during the clock synchronization process and extending the life cycle of the nodes are the primary considerations in designing the clock synchronization algorithm [4]. Clock synchronization usually relies on the way of message transmission between the nodes. However, the time delay is generated in the stage of message transmission between the nodes, and the delay can be usually divided into two parts: certainty delay and uncertainty delay. As the former can be directly measured, the latter is one of the key factors that affect the accuracy of synchronization. Therefore, the influence of uncertainty delay on synchronization accuracy in message transmission can be reduced by establishing an accurate prediction model [5, 6].Existing clock synchronization methods can be generally classified into two types according to the transmission message interaction mode: sender-receiver synchronization (SRP) model and receiver-receiver synchronization (RRP) model. The SRP model can be divided into a two-way message exchange synchronization mechanism and a one-way broadcast synchronization mechanism according to the message exchange manner in the synchronization process. In the algorithm based on the two-way message exchange synchronization mechanism, two sensor nodes are synchronized with each other through a two-way message exchange. The message has a local timestamp value, and the node calculates the clock offset by four collected timestamps, which has the advantage of high synchronization precision. However, in this process, frequent message exchanges between two nodes cause an increase in energy consumption. In the algorithm based on the one-way broadcast synchronization mechanism, the reference node broadcasts a data packet including its timestamp. The node to be synchronized calculates the data communication delay and performs delay compensation as soon as they receive a timestamp message, and then completes the clock synchronization with the reference node. The advantage is that the algorithm has low complexity and energy consumption. However, the certainty delay is regarded as a part of the clock offset; thus, the synchronization precision is lower than the synchronization mechanism of the two-way message exchange. On the other hand, such clock synchronization algorithm depends on the broadcast node, and the intranetwork synchronization fails if only the broadcast node fails. In the timing-sync protocol for sensor networks (TPSNs) based on the SRP model [7], the realization of clock synchronization with the help of a tree structure in which each leaf node can establish a clock synchronization with its parent node, and the average delay of the message, is calculated by using a two-way message exchange. The synchronization precision is relatively high, but the tree-based structure easily results in limited robustness and scalability. Especially when a node dies or a new node needs to be added, the tree structure has to be rebuilt, thereby adding extra overhead. In the RRP model, the sensor node synchronizes with the reference node by listening to the two-way synchronization message. The reference broadcast synchronization protocol [8] is a typical method based on the RRP model. Generally, the reference node broadcasts the message, and the other nodes receive the message by comparing the two timestamps that two nodes received the same data packet, which can reduce the influence of the uncertainty delay in the message transmission and improve the synchronization accuracy. However, due to a large amount of message exchange, the large-scale sensor network consumes a large amount of energy. Above all, the clock synchronization algorithm in this study is implemented based on the SRP model.Furthermore, each sensor node has its clock while being equipped with a crystal oscillator. In the actual environment, the oscillator frequency is unstable due to the oscillator quality, node power battery, temperature, humidity, and device aging. These issues often cause clock frequency offset, and the clock synchronization deviation becomes increasingly larger over time. Maintaining accuracy requires frequent synchronization to correct the clock offset, which also causes energy waste. Thus, the effect of clock frequency offset needs to be considered in clock synchronization deviation. To reduce the energy consumption created by the clock synchronization process, extend the network life cycle, and improve the accuracy of clock synchronization, this study proposes an adaptive fractional-order operator clock synchronization algorithm based on the grey prediction GM(1,1) model [9]. The main contributions are as follows:
(i)
Based on the GM(1,1) grey prediction model, the grey prediction clock synchronization algorithm using a fractional accumulative operator is proposed. The accuracy of clock synchronization is improved in comparison with the grey prediction clock synchronization algorithm of the first order(ii)
The study uses the collected timestamp sample values to adaptively obtain the best fractional-order cumulative generation order. When the timestamp received by the node is significantly different from the historical record, the proposed algorithm can be adaptive to adjust the cumulative generation order to fit the current timestamp sequence, thereby improving the accuracy of the estimation of the uncertainty delay(iii)
Compared with the entire network synchronization based on the spanning tree algorithm, the proposed algorithm does not require a lot of energy to maintain the network structure. This method should be robust to the dynamic changes in the network topology; furthermore, the applicable scene is widerThe subsequent parts of this paper are organized as follows. Section2 provides an in-depth study of the proposed clock synchronization algorithm. Section 3 describes the series of models used in this paper. Section 4 details the grey prediction clock synchronization algorithm based on fractional-order operators. Section 5 evaluates and compares the performance between our proposed algorithm and other existing algorithms through simulation experiments. Section 6 summarizes the entire study.


## 2. Related Work

Clock synchronization is essentially related to the prediction of clock parameters, and the accuracy of the synchronization algorithm depends on the statistical properties of the parameter estimation algorithm. At present, many clock parameter estimation algorithms based on a two-way message exchange mechanism have been proposed to solve the accuracy problem in clock synchronization [10–12]. In the algorithm of clock synchronization from the perspective of statistical signal processing, the uncertainty delay in the message transmission process is modeled as a probability density function model [13]. Under the assumption that the uncertainty delay obeys the exponential distribution, Jeske in [14] deduces the closed solution of the clock offset maximum likelihood estimator, and the derivation process assumes that the means of the certainty delay and exponential distribution are both unknown. In [15], under the premise of symmetric and asymmetric exponential delay distributions, the minimum variance undeviating estimator of the clock offset and the best linear undeviating estimator using the order statistic are derived. However, if only the clock offset is estimated, then the frequency offset of the clock becomes increasingly larger to maintain synchronization between the nodes. The clock offset needs to be corrected frequently, thereby increasing the energy consumption of the node. To extend the synchronization cycle, Chaudhari et al. in [16] deduced the joint maximum likelihood estimation of the clock offset and clock frequency offset under the exponential delay model. Noh et al. in [17] assumes that the certainty delay is known and the Gaussian delay model is applied, and then derives the joint maximum likelihood estimation of the clock offset and clock frequency offset, as well as the corresponding Cramer lower bound. In [18], under the case of unknown certainty delay and Gaussian delay model, three different clock offset and clock frequency offset estimation methods are proposed. In [19], the unknown certainty delay is regarded as a redundant parameter; based on the exponential delay model, the approximate Cramer’s lower bound of the joint maximum likelihood estimation is derived. Nevertheless, the performance of the maximum likelihood estimation depends on the type of random delay model, and its estimation accuracy on the Gaussian distribution model is relatively better than that of the exponential distribution model. At the same time, under the linear clock model, the clock parameters obtained by the maximum likelihood estimation are only valid for short-term applications; in the nonlinear clock model, the search algorithm is required and the algorithm complexity is relatively high. In [20], an adaptive power-efficient time synchronization algorithm is proposed for mobile underwater sensor networks; the study takes into account the time-varying clock frequency offset and combines the Doppler-Enhanced synchronization protocol (DE-Sync) and the Kalman filter tracking the clock frequency offset to achieve time synchronization; the study reduces the energy consumption of the nodes and guarantees accurate time synchronization. In [21], the clock parameter estimation problem under the exponential model is transformed into a linear programming problem through which the geometric analysis of the feasible domain, a low power consumption estimator is proposed. Owing to the characteristic of slow variation in clock parameters, the clock parameter estimated value obtained in the previous synchronization cycle can be used for prediction in the next cycle; thus, the clock parameter tracking technique has recently received attention. Assuming that the clock frequency offset and clock offset can be directly observed under the influence of noise, and the uncertainty delay obeys the Gaussian distribution, Freris et al. in [22] uses the Kalman filter to track the clock frequency offset. In [23], the Kalman filter is also employed to track both the clock frequency offset and clock offset. In [24, 25], the factor-graph model is applied to derive the method of tracking clock offset under the hypothesis exponential distribution delay model. However, the probability density function of the uncertainty delay model is unknown in advance, and frequent changes in the application environment of the wireless sensor network result in no certain statistical distribution model that can simulate the uncertainty delay in the message transmission process [26–28]. The literature [29] implemented a time synchronization service for low-power WSN using low frequency real-time clocks in each node; what is more, three algorithms based on different strategies have been proposed, the research fulfilled a trade-off between the desired level of synchronization and the associated energy consumption. Abdel-Ghaffar in [30] also proves that the clock parameter estimation algorithm is highly sensitive to the choice of the delay model. Therefore, studying the clock parameter estimation method under any delay distribution model is necessary. The aforementioned algorithms do not study the clock synchronization under any delay distribution model.The preceding analysis shows that only the clock offset correction without considering the clock frequency offset must be increasing the synchronization overhead, while the synchronization algorithm based on statistical distribution corrects the clock frequency offset. However, the delay distribution depends on the specific environment; thus, the adaptability is poor and requires a large number of timestamp samples. Energy consumption is large as well. Based on the tree-structured clock synchronization protocol, when the network topology changes, additional energy is needed to maintain the network topology, especially when the reference node fails, the network structure needs to be reconstructed, and the energy consumption is relatively large. Wu et al. in [31] proposed a clock synchronization scheme based on grey prediction, which estimates the clock offset based on the grey prediction model of GM(1,1); the scheme requires a few timestamp samples and does not need to hypothesize that the uncertainty delay obeys the specific distribution model, which effectively solves the problem of relying on a specific statistical distribution model in the estimation of clock synchronization parameters. However, this scheme does not correct the clock frequency offset nor does it have a specific network structure to synchronize the entire network. In addition, modeling the timestamp data based on the first-order grey accumulation sequence is not the optimal order for modeling. From the perspective of statistical signal processing, this paper proposes an adaptive grey prediction clock synchronization algorithm with fractional-order operators, which can estimate the clock offset of a node without a specific delay distribution model. The proposed algorithm calculates the timestamp samples collected to determine the current best fractional-order accumulator operator that is applied to the next clock offset estimation process, thereby improving the synchronization accuracy. Compared with the spanning tree-based whole-network clock synchronization scheme [32], the proposed synchronization scheme in this paper based on the breadth-first search of the graph does not need to consider the failure and rotation of the root node, to a certain extent, which prolongs the life cycle of the entire network.


## 3. System Models

### 3.1. Network Model

Based on the assumption that the sensor network consists ofN nodes, the entire network structure can be represented by an undirected graph G=V,E, where V=1,2,⋯,N represents the set of nodes in the network, and E⊆V×V represents the edge set. If an edge <i,j> exists, then communication between nodes i and j can be conducted directly. A node located within the broadcast communication range of the node u∈V is called a neighbor node of the node u, and is represented by Nu=v∈V∣u,v∈E. Furthermore, the following assumptions are made:
(i)
The network communication link is reliable and no message packet loss occurs(ii)
Each node is static and has a unique ID(iii)
Each node has its own clock and is equipped with a crystal oscillator(iv)
Any two nodes can communicate through a limited hop


### 3.2. Clock Model

Ideally, the clock of a sensor node is defined asCt=t, where t represents the ideal time [33]. Usually, the clock function of the ith node is
(1)Cit=θ+f×t.Among them, the parameterθ is the clock offset and f is the clock frequency offset.The clock model is shown in Figure1. The three oblique lines indicate the fast clock of node A, slow clock of node B, and ideal clock. Equation (2) defines the clock relationship between nodes A and B.
(2)CBt=θAB+fAB×CAt.Figure 1
Clock model of sensor nodes.Among the lines,θAB and fAB represent the clock offset and clock frequency offset between the two nodes, respectively. When θAB=0 and fAB=1, the clocks of node A and B are synchronized.


#### 3.2.1. Clock Offset Model

Assume that nodesA and B perform clock synchronization, and the clock offset model of two-way time message exchange is as shown in Figure 2.Figure 2
Clock offset model of two-way time message exchange.As shown in Figure2, during the timestamp exchange of the ith round, node A transmits its ith timestamp at time T1, and then records the local time as T1,iA. Node B at time T2 receives the timestamp sent from node A at time T1 and records the local time as T2,iB, similarly. Node B then sends its ith timestamp at time T3, recording the local time as T3,iB. At time T4, node A receives the timestamp sent from node B at time T3 and records the local time as T4,iA. Assume that node A is the primary synchronization node and node B is synchronized to node A. Combined with formula (2), the local clocks of nodes A and B at time t are as follows:
(3)T1,iA=fAt1+θA,T2,iB=fBt2+θB,T3,iB=fBt3+θB,T4,iA=fAt4+θA,where fA and fB are the clock frequency offsets of nodes A and B, respectively; θA and θB are the clock offsets of nodes A and B, respectively; and t is the real time.According to Figure2, the relationship between the four time points of sending and receiving timestamps of nodes A and B and the transmission delay can be obtained as follows:
(4)t2=t1+d+XiAB,t4=t3+d+XiBA,where d+XiAB and d+XIBA are the propagation delays between nodes A and B, d is the certainty delay and XiAB and XiBA are uncertainty delays. Combined with formula (3) and (4), the time when nodes A and B receive the data packet for the ith time can be expressed as
(5)T2,iB=fBfAT1,iA+fBd+XiAB+θB−fBfAθA,T4,iA=fAfBT3,iB+fAd+XiBA+θA−fAfBθB.


## 3.1. Network Model

Based on the assumption that the sensor network consists ofN nodes, the entire network structure can be represented by an undirected graph G=V,E, where V=1,2,⋯,N represents the set of nodes in the network, and E⊆V×V represents the edge set. If an edge <i,j> exists, then communication between nodes i and j can be conducted directly. A node located within the broadcast communication range of the node u∈V is called a neighbor node of the node u, and is represented by Nu=v∈V∣u,v∈E. Furthermore, the following assumptions are made:
(i)
The network communication link is reliable and no message packet loss occurs(ii)
Each node is static and has a unique ID(iii)
Each node has its own clock and is equipped with a crystal oscillator(iv)
Any two nodes can communicate through a limited hop


## 3.2. Clock Model

Ideally, the clock of a sensor node is defined asCt=t, where t represents the ideal time [33]. Usually, the clock function of the ith node is
(1)Cit=θ+f×t.Among them, the parameterθ is the clock offset and f is the clock frequency offset.The clock model is shown in Figure1. The three oblique lines indicate the fast clock of node A, slow clock of node B, and ideal clock. Equation (2) defines the clock relationship between nodes A and B.
(2)CBt=θAB+fAB×CAt.Figure 1
Clock model of sensor nodes.Among the lines,θAB and fAB represent the clock offset and clock frequency offset between the two nodes, respectively. When θAB=0 and fAB=1, the clocks of node A and B are synchronized.


### 3.2.1. Clock Offset Model

Assume that nodesA and B perform clock synchronization, and the clock offset model of two-way time message exchange is as shown in Figure 2.Figure 2
Clock offset model of two-way time message exchange.As shown in Figure2, during the timestamp exchange of the ith round, node A transmits its ith timestamp at time T1, and then records the local time as T1,iA. Node B at time T2 receives the timestamp sent from node A at time T1 and records the local time as T2,iB, similarly. Node B then sends its ith timestamp at time T3, recording the local time as T3,iB. At time T4, node A receives the timestamp sent from node B at time T3 and records the local time as T4,iA. Assume that node A is the primary synchronization node and node B is synchronized to node A. Combined with formula (2), the local clocks of nodes A and B at time t are as follows:
(3)T1,iA=fAt1+θA,T2,iB=fBt2+θB,T3,iB=fBt3+θB,T4,iA=fAt4+θA,where fA and fB are the clock frequency offsets of nodes A and B, respectively; θA and θB are the clock offsets of nodes A and B, respectively; and t is the real time.According to Figure2, the relationship between the four time points of sending and receiving timestamps of nodes A and B and the transmission delay can be obtained as follows:
(4)t2=t1+d+XiAB,t4=t3+d+XiBA,where d+XiAB and d+XIBA are the propagation delays between nodes A and B, d is the certainty delay and XiAB and XiBA are uncertainty delays. Combined with formula (3) and (4), the time when nodes A and B receive the data packet for the ith time can be expressed as
(5)T2,iB=fBfAT1,iA+fBd+XiAB+θB−fBfAθA,T4,iA=fAfBT3,iB+fAd+XiBA+θA−fAfBθB.


## 3.2.1. Clock Offset Model

Assume that nodesA and B perform clock synchronization, and the clock offset model of two-way time message exchange is as shown in Figure 2.Figure 2
Clock offset model of two-way time message exchange.As shown in Figure2, during the timestamp exchange of the ith round, node A transmits its ith timestamp at time T1, and then records the local time as T1,iA. Node B at time T2 receives the timestamp sent from node A at time T1 and records the local time as T2,iB, similarly. Node B then sends its ith timestamp at time T3, recording the local time as T3,iB. At time T4, node A receives the timestamp sent from node B at time T3 and records the local time as T4,iA. Assume that node A is the primary synchronization node and node B is synchronized to node A. Combined with formula (2), the local clocks of nodes A and B at time t are as follows:
(3)T1,iA=fAt1+θA,T2,iB=fBt2+θB,T3,iB=fBt3+θB,T4,iA=fAt4+θA,where fA and fB are the clock frequency offsets of nodes A and B, respectively; θA and θB are the clock offsets of nodes A and B, respectively; and t is the real time.According to Figure2, the relationship between the four time points of sending and receiving timestamps of nodes A and B and the transmission delay can be obtained as follows:
(4)t2=t1+d+XiAB,t4=t3+d+XiBA,where d+XiAB and d+XIBA are the propagation delays between nodes A and B, d is the certainty delay and XiAB and XiBA are uncertainty delays. Combined with formula (3) and (4), the time when nodes A and B receive the data packet for the ith time can be expressed as
(5)T2,iB=fBfAT1,iA+fBd+XiAB+θB−fBfAθA,T4,iA=fAfBT3,iB+fAd+XiBA+θA−fAfBθB.


## 4. Adaptive Fractional-Order Clock Synchronization Algorithm Based on Grey Prediction Theory

The clock synchronization algorithm in this study consists of four parts: graph structure establishment based on breadth-first search, clock frequency offset correction, clock synchronization prediction based on fractional-order operator, and adaptive synchronization process. In the establishment period of the graph structure, the sensor network is constructed as an undirected graph, all nodes are equally connected in a breadth-first search manner in the network, and they communicate only with their neighbor nodes. In the clock frequency offset correction period, the nodes broadcast their respective clock frequencies, and correct the clock frequency offset among the nodes by taking the mean to the clock frequencies. In the clock offset synchronization period of the fractional-order operator, the grey prediction of the fractional-order operator is modeled for the clock offset so that the uncertainty delay is estimated. Finally, the estimated value of the clock offset is obtained. In the adaptive synchronization period, whether to optimize the fractional-order operator is determined according to the clock offset. When an order needs to be optimized, the optimal order is calculated according to the previously received timestamp samples.


### 4.1. Breadth-First-Wide Network-Wide Clock Synchronization

To improve the robustness of the clock synchronization network structure, this paper proposes a graph-based breadth-first search synchronization algorithm. All nodes in the network are equal, do not need to maintain a specific network structure, and perform the same synchronization algorithm. Furthermore, no root node or gateway node exists. As all nodes only communicate with their neighbor nodes, the algorithm should be robust to the dynamic changes of the topology, and the scalability improves as the network scale increases. Compared with the spanning tree-based clock synchronization protocol, the proposed algorithm consumes less energy and is more suitable for WSNs with frequent changes in topology. The network structure of the breadth-first search based on the graph is shown in Figure3.Figure 3
Network topology diagram based on graph-based breadth-first search.N sensor nodes are randomly laid on the monitored area, where each node has a different ID number and the same transmission range. The nodes in the same node transmission range are neighbor nodes. One node is randomly selected in the initial stage of the network as the origin node, which initiates the broadcast data packet and connects its neighbor nodes. In the process of connecting its neighbor nodes, the node with the small ID is connected before the node with the large ID. The process is repeated until all the nodes in the network are connected. All nodes in the network only communicate with their neighbor nodes, and nonneighbor nodes can communicate with each other through multihop transmission. As each node is peer-to-peer, all nodes can synchronize to the entire network by synchronizing with neighbor nodes.


### 4.2. Correction of Clock Frequency Offset

If the clock of the node is not corrected to its frequency offset, the clock offset increases over time. The clock frequency offset is a random variable that changes with time. It is not only affected by many factors but also difficult to model. Usually, in an extremely short period, the change in clock frequency offset is negligible, but the clock frequency offset needs to be corrected for long-term synchronization. Therefore, this study adopts a frequency offset optimization strategy to achieve frequency offset correction by exchanging and computing the clock frequency information between sensor nodes. Assume that in a WSN consisting ofN nodes, the clock frequencies of the nodes i,ji,j=1,2,⋯,N are, respectively, denoted as ωi,ωj, where ωi≠ωj. The specific frequency offset optimization algorithm is as follows:Step 1.
For each nodej in the connected network, j=1,2,⋯,N, at time n, n=0,1,2,⋯,∞, respectively, broadcast their own clock frequency information ωj(n), j=1,2,⋯,N.Step 2.
Nodei in the broadcast domain of node j receives frequency information ωjn, j=1,2,⋯,K, from its neighbor nodes, where K is the total number of messages received. The node i performs arithmetic mean on the received K frequency information and then takes this mean as the frequency of the next time n+1 of the node i, namely,
(6)ωin+1=1K∑j=1Kωjn.Step 3.
Nodei broadcasts the updated frequency information ωin+1 to its neighbor node.Step 4.
The preceding process is repeated until the clock frequencies of all nodes in the network reach the same value, that is, the entire network reaches frequency synchronization.The frequency offset optimization process is presented in Figure4. Node 1 collects all clock frequency information from surrounding nodes for a period of time t, computes the clock frequency of the entire group, and then sends the computed clock frequency value to its neighbor nodes 2, 3, and 4. Finally, the neighbor nodes update the clock frequency at the next moment according to the received frequency value.Figure 4
Frequency offset optimization process.


### 4.3. Modeling of Clock Offset Based on Fractional-Order Operator

The grey prediction model [34] is based on the accumulation of small data of uncertainty on the offset of the cumulative generation of the original sequence. The application of the buffer operator data transformation technique [35] ensures the validity and rationality of the model prediction results. The modeling process is relatively simple and does not need to consider the probability distribution rule and statistical characteristics of the sample data. For the clock synchronization of wireless sensor network nodes with limited resources, the delay of information transmission is uncertain and the sample size is small, which is highly suitable for grey estimation theory for offset estimation.As the frequency offset of the clock has been optimized in Section2, when performing the clock synchronization prediction, this study only considers the offset of the clock, that is, the clock frequency offset is set to 1, which only estimates the clock offset. In this case, the clock offset between nodes A and B is θAB=θA−θB. Thus, formula (5) can be rewritten as
(7)T2,iB=T1,iA+d+XiAB+θBA.T4,iA=T3,iB+d+XiBA+θAB.The existing grey prediction model is mainly based on first-order cumulative generation sequence modeling, and then the prediction value is obtained by first-order cumulative reduction. However, the modeling based on the first-order accumulation generation sequence is unsuitable for modeling data or experimental scenes of all features. Therefore, this study establishes a grey prediction model based on fractional-order operator [36] without first-order accumulation of sequences but adaptively finds the optimal order suitable for synchronization to improve the accuracy of grey prediction. At the same time, only a small sample is used to estimate the transmission delay of the clock information to achieve clock synchronization, thereby improving the application range of the algorithm. Thus, formula (7) can be rewritten as
(8)Uk=T2,iB−T1,iA=d+XiAB+θBA,Vk=T4,iA−T3,iB=d+XiBA+θAB=d+XiBA−θBA,where Uk=T2,iB−T1,iA, Vk=T4,iA−T3,iB, d is the certainty delay in message transmission, and XIAB and XiBAare the uncertainty delays in message transmission. Formula (8) shows that Uk and Vk are related to the delay of message transmission. Suppose that U^k and V^k are predicted values obtained by grey prediction, and U1 and V1 represent the minimum values of Uk and Vk, respectively.From [14], the maximum likelihood estimation of the certainty delay d and uncertainty delay XiAB, XiBA is
(9)d^XiAB^XiBA^=12N−1NU1+V1−U¯+V¯2NU¯−U12NV¯−V1,where U¯ and V¯ represent the average of the samples UkNk=1 and VkNk=1, respectively (N is the number of samples). The method of maximum likelihood estimation requires a large number of samples to obtain a meaningful mean, whereas the grey prediction method can be modeled with only a small sample, and can also be used for estimation. The method can be used in clock synchronization to reduce energy consumption. In this study, U¯ and V¯ are replaced by the estimated values obtained by grey prediction. The certainty delay d and uncertainty delay XiAB, XiBA of the grey prediction can be obtained as follows:
(10)d^XiAB^XiBA^=12N−1NU1+V1−U^k+V^k2NU^k−U12NV^k−V1,where N is the number of samples used in calculation, and the grey model requires at least 4 samples. As increasing the number of samples does not necessarily improve the prediction accuracy [37], N is set to 4 when considering the node energy consumption. The following is the step of estimating U^k and V^k using the grey model of the fractional-order operator.From [37], when r∈R+,Xr=xr1,xr2,⋯,xrn is the r-order accumulation that generates operators of X0, where
(11)xrk=∑i=1kΓr+k−iΓk−i+1Γrx0i,k=1,2,⋯,n.From equation (8), Uk=T2,iB−T1,iA, Vk=T4,iA−T3,iB. Uk,Vk are the difference values of the timestamp samples. The algorithm for estimating Uk,Vk using fractional-order operators is as follows:Step 1.
Initialize the orderrr∈R+ of the fractional-order accumulative operator.Step 2.
Introduce the grey weakening buffer operator to reduce the randomness of the sample sequence. Let the original timestamp sample sequence beW=U1,U2,⋯,Un, and the W disposed by the operator D have a sequence that is recorded as WD=U1d,U2d,⋯,Und, and D be the average weakening buffer operator [38], among them
(12)Ukd=1n−k+1Uk+Uk+1+⋯+Un,k=1,2,⋯n.
Using the constructed average weakening buffer operator to work on the original data sequence smoothens the sequence and considers the principle of new information prioritization. The latest information remains unchanged under the action of the average weakening buffer operator, that is, whenk=n in formula (12), Und=Un, the randomness of the sample sequence is reduced, thereby improving the accuracy of the prediction model [38].Step 3.
Performr-order accumulation on the grey sequence of the sample sequence WD to obtain Ur1,Ur2,⋯,Urnr∈R+, among them
(13)Urk=∑i=1kΓr+k−iΓk−i+1ΓrU0i,k=1,2,⋯,n.Step 4.
Obtain the estimated value ofUrk using the fractional-order accumulative operator grey model (where r∈R+)
(14)U^rk=U01−bae−ak−1+ba,k=2,3,⋯,n.
The parametersa,b in equation (14) can be estimated by least squares as follows:
(15)ab=BTB−1BTY,where Y and B are, respectively (where r∈R+),
(16)Y=Ur−12Ur−13⋮Ur−1n,B=−zr2−zr3⋮−zrn11⋮1.
The expression forzrk is
(17)zrk=Urk+Urk−12,k=2,3,⋯,n.Step 5.
Accumulate the fractional-order (−r order) to obtain the restored value of Uk, that is, the estimated value of the kth time of Uk (where r∈R+):
(18)U^k=U^0k=U^r−rk=∑i=0k−1−1iΓr+1Γi+1Γr−i+1U^rk−i,k=2,3,⋯,n.
Similarly, the estimated value of thekth time of Vk (where r∈R+) is obtained as follows:
(19)V^k=V^0k=V^r−rk=∑i=0k−1−1iΓr+1Γi+1Γr−i+1V^rk−i,k=2,3,⋯,n.
When the estimated values ofUk and Vk are substituted into equation (10) with the deterministic delay d and uncertainty delay XiAB, the estimated value of XiBA [d^X^iABX^iBA].Step 6.
The ratioR of the message transmission delay in the node communication link is
(20)R=d^+X^iBAd^+X^iAB.
According to formulas (8) and (20), the clock offsets of nodes A and B is obtained
(21)θBA=U^k−U^k+V^k1+R.
After computing the clock offset between nodesA and B, node B can synchronize to node A according to its current local clock time minus θBA. As each node is peer-to-peer, the algorithms executed are also the same, and all nodes can achieve full-network synchronization by synchronizing with neighboring nodes.


### 4.4. Synchronization Process of Adaptive Clock Offset

Due to changes in environmental factors, the timestamp value sent by the node after a period of time may change. Thus, setting a thresholdQ of clock synchronization offset is necessary, where Q is equal to the mean of the clock offset obtained by the fractional-order cumulative grey prediction synchronization algorithm. Based on the assumption that nodes A and B are clock-synchronized, the clock offset of their ith synchronization is θBAi, where n is the number of times that nodes A and B have been synchronized. The expression of threshold Q is
(22)Q=∑i=1nθBAin.When the remaining energy of the node meets the requirement of one synchronization, we have to check whether the current clock offset is greater than a given threshold. If the remaining energy is greater than the threshold, then the node calculates an optimal fractional cumulative generation order according to the currently obtained timestamp value as a new fractional-order cumulative generation order in the synchronization model. The clock offset is estimated using the new order when performing a new round of clock offset predictions.A flowchart of the clock offset correction and adaptive clock offset synchronization process of the fractional-order operator is shown in Figure5.Figure 5
Clock offset correction and adaptive clock offset synchronization process.


## 4.1. Breadth-First-Wide Network-Wide Clock Synchronization

To improve the robustness of the clock synchronization network structure, this paper proposes a graph-based breadth-first search synchronization algorithm. All nodes in the network are equal, do not need to maintain a specific network structure, and perform the same synchronization algorithm. Furthermore, no root node or gateway node exists. As all nodes only communicate with their neighbor nodes, the algorithm should be robust to the dynamic changes of the topology, and the scalability improves as the network scale increases. Compared with the spanning tree-based clock synchronization protocol, the proposed algorithm consumes less energy and is more suitable for WSNs with frequent changes in topology. The network structure of the breadth-first search based on the graph is shown in Figure3.Figure 3
Network topology diagram based on graph-based breadth-first search.N sensor nodes are randomly laid on the monitored area, where each node has a different ID number and the same transmission range. The nodes in the same node transmission range are neighbor nodes. One node is randomly selected in the initial stage of the network as the origin node, which initiates the broadcast data packet and connects its neighbor nodes. In the process of connecting its neighbor nodes, the node with the small ID is connected before the node with the large ID. The process is repeated until all the nodes in the network are connected. All nodes in the network only communicate with their neighbor nodes, and nonneighbor nodes can communicate with each other through multihop transmission. As each node is peer-to-peer, all nodes can synchronize to the entire network by synchronizing with neighbor nodes.


## 4.2. Correction of Clock Frequency Offset

If the clock of the node is not corrected to its frequency offset, the clock offset increases over time. The clock frequency offset is a random variable that changes with time. It is not only affected by many factors but also difficult to model. Usually, in an extremely short period, the change in clock frequency offset is negligible, but the clock frequency offset needs to be corrected for long-term synchronization. Therefore, this study adopts a frequency offset optimization strategy to achieve frequency offset correction by exchanging and computing the clock frequency information between sensor nodes. Assume that in a WSN consisting ofN nodes, the clock frequencies of the nodes i,ji,j=1,2,⋯,N are, respectively, denoted as ωi,ωj, where ωi≠ωj. The specific frequency offset optimization algorithm is as follows:Step 1.
For each nodej in the connected network, j=1,2,⋯,N, at time n, n=0,1,2,⋯,∞, respectively, broadcast their own clock frequency information ωj(n), j=1,2,⋯,N.Step 2.
Nodei in the broadcast domain of node j receives frequency information ωjn, j=1,2,⋯,K, from its neighbor nodes, where K is the total number of messages received. The node i performs arithmetic mean on the received K frequency information and then takes this mean as the frequency of the next time n+1 of the node i, namely,
(6)ωin+1=1K∑j=1Kωjn.Step 3.
Nodei broadcasts the updated frequency information ωin+1 to its neighbor node.Step 4.
The preceding process is repeated until the clock frequencies of all nodes in the network reach the same value, that is, the entire network reaches frequency synchronization.The frequency offset optimization process is presented in Figure4. Node 1 collects all clock frequency information from surrounding nodes for a period of time t, computes the clock frequency of the entire group, and then sends the computed clock frequency value to its neighbor nodes 2, 3, and 4. Finally, the neighbor nodes update the clock frequency at the next moment according to the received frequency value.Figure 4
Frequency offset optimization process.


## 4.3. Modeling of Clock Offset Based on Fractional-Order Operator

The grey prediction model [34] is based on the accumulation of small data of uncertainty on the offset of the cumulative generation of the original sequence. The application of the buffer operator data transformation technique [35] ensures the validity and rationality of the model prediction results. The modeling process is relatively simple and does not need to consider the probability distribution rule and statistical characteristics of the sample data. For the clock synchronization of wireless sensor network nodes with limited resources, the delay of information transmission is uncertain and the sample size is small, which is highly suitable for grey estimation theory for offset estimation.As the frequency offset of the clock has been optimized in Section2, when performing the clock synchronization prediction, this study only considers the offset of the clock, that is, the clock frequency offset is set to 1, which only estimates the clock offset. In this case, the clock offset between nodes A and B is θAB=θA−θB. Thus, formula (5) can be rewritten as
(7)T2,iB=T1,iA+d+XiAB+θBA.T4,iA=T3,iB+d+XiBA+θAB.The existing grey prediction model is mainly based on first-order cumulative generation sequence modeling, and then the prediction value is obtained by first-order cumulative reduction. However, the modeling based on the first-order accumulation generation sequence is unsuitable for modeling data or experimental scenes of all features. Therefore, this study establishes a grey prediction model based on fractional-order operator [36] without first-order accumulation of sequences but adaptively finds the optimal order suitable for synchronization to improve the accuracy of grey prediction. At the same time, only a small sample is used to estimate the transmission delay of the clock information to achieve clock synchronization, thereby improving the application range of the algorithm. Thus, formula (7) can be rewritten as
(8)Uk=T2,iB−T1,iA=d+XiAB+θBA,Vk=T4,iA−T3,iB=d+XiBA+θAB=d+XiBA−θBA,where Uk=T2,iB−T1,iA, Vk=T4,iA−T3,iB, d is the certainty delay in message transmission, and XIAB and XiBAare the uncertainty delays in message transmission. Formula (8) shows that Uk and Vk are related to the delay of message transmission. Suppose that U^k and V^k are predicted values obtained by grey prediction, and U1 and V1 represent the minimum values of Uk and Vk, respectively.From [14], the maximum likelihood estimation of the certainty delay d and uncertainty delay XiAB, XiBA is
(9)d^XiAB^XiBA^=12N−1NU1+V1−U¯+V¯2NU¯−U12NV¯−V1,where U¯ and V¯ represent the average of the samples UkNk=1 and VkNk=1, respectively (N is the number of samples). The method of maximum likelihood estimation requires a large number of samples to obtain a meaningful mean, whereas the grey prediction method can be modeled with only a small sample, and can also be used for estimation. The method can be used in clock synchronization to reduce energy consumption. In this study, U¯ and V¯ are replaced by the estimated values obtained by grey prediction. The certainty delay d and uncertainty delay XiAB, XiBA of the grey prediction can be obtained as follows:
(10)d^XiAB^XiBA^=12N−1NU1+V1−U^k+V^k2NU^k−U12NV^k−V1,where N is the number of samples used in calculation, and the grey model requires at least 4 samples. As increasing the number of samples does not necessarily improve the prediction accuracy [37], N is set to 4 when considering the node energy consumption. The following is the step of estimating U^k and V^k using the grey model of the fractional-order operator.From [37], when r∈R+,Xr=xr1,xr2,⋯,xrn is the r-order accumulation that generates operators of X0, where
(11)xrk=∑i=1kΓr+k−iΓk−i+1Γrx0i,k=1,2,⋯,n.From equation (8), Uk=T2,iB−T1,iA, Vk=T4,iA−T3,iB. Uk,Vk are the difference values of the timestamp samples. The algorithm for estimating Uk,Vk using fractional-order operators is as follows:Step 1.
Initialize the orderrr∈R+ of the fractional-order accumulative operator.Step 2.
Introduce the grey weakening buffer operator to reduce the randomness of the sample sequence. Let the original timestamp sample sequence beW=U1,U2,⋯,Un, and the W disposed by the operator D have a sequence that is recorded as WD=U1d,U2d,⋯,Und, and D be the average weakening buffer operator [38], among them
(12)Ukd=1n−k+1Uk+Uk+1+⋯+Un,k=1,2,⋯n.
Using the constructed average weakening buffer operator to work on the original data sequence smoothens the sequence and considers the principle of new information prioritization. The latest information remains unchanged under the action of the average weakening buffer operator, that is, whenk=n in formula (12), Und=Un, the randomness of the sample sequence is reduced, thereby improving the accuracy of the prediction model [38].Step 3.
Performr-order accumulation on the grey sequence of the sample sequence WD to obtain Ur1,Ur2,⋯,Urnr∈R+, among them
(13)Urk=∑i=1kΓr+k−iΓk−i+1ΓrU0i,k=1,2,⋯,n.Step 4.
Obtain the estimated value ofUrk using the fractional-order accumulative operator grey model (where r∈R+)
(14)U^rk=U01−bae−ak−1+ba,k=2,3,⋯,n.
The parametersa,b in equation (14) can be estimated by least squares as follows:
(15)ab=BTB−1BTY,where Y and B are, respectively (where r∈R+),
(16)Y=Ur−12Ur−13⋮Ur−1n,B=−zr2−zr3⋮−zrn11⋮1.
The expression forzrk is
(17)zrk=Urk+Urk−12,k=2,3,⋯,n.Step 5.
Accumulate the fractional-order (−r order) to obtain the restored value of Uk, that is, the estimated value of the kth time of Uk (where r∈R+):
(18)U^k=U^0k=U^r−rk=∑i=0k−1−1iΓr+1Γi+1Γr−i+1U^rk−i,k=2,3,⋯,n.
Similarly, the estimated value of thekth time of Vk (where r∈R+) is obtained as follows:
(19)V^k=V^0k=V^r−rk=∑i=0k−1−1iΓr+1Γi+1Γr−i+1V^rk−i,k=2,3,⋯,n.
When the estimated values ofUk and Vk are substituted into equation (10) with the deterministic delay d and uncertainty delay XiAB, the estimated value of XiBA [d^X^iABX^iBA].Step 6.
The ratioR of the message transmission delay in the node communication link is
(20)R=d^+X^iBAd^+X^iAB.
According to formulas (8) and (20), the clock offsets of nodes A and B is obtained
(21)θBA=U^k−U^k+V^k1+R.
After computing the clock offset between nodesA and B, node B can synchronize to node A according to its current local clock time minus θBA. As each node is peer-to-peer, the algorithms executed are also the same, and all nodes can achieve full-network synchronization by synchronizing with neighboring nodes.


## 4.4. Synchronization Process of Adaptive Clock Offset

Due to changes in environmental factors, the timestamp value sent by the node after a period of time may change. Thus, setting a thresholdQ of clock synchronization offset is necessary, where Q is equal to the mean of the clock offset obtained by the fractional-order cumulative grey prediction synchronization algorithm. Based on the assumption that nodes A and B are clock-synchronized, the clock offset of their ith synchronization is θBAi, where n is the number of times that nodes A and B have been synchronized. The expression of threshold Q is
(22)Q=∑i=1nθBAin.When the remaining energy of the node meets the requirement of one synchronization, we have to check whether the current clock offset is greater than a given threshold. If the remaining energy is greater than the threshold, then the node calculates an optimal fractional cumulative generation order according to the currently obtained timestamp value as a new fractional-order cumulative generation order in the synchronization model. The clock offset is estimated using the new order when performing a new round of clock offset predictions.A flowchart of the clock offset correction and adaptive clock offset synchronization process of the fractional-order operator is shown in Figure5.Figure 5
Clock offset correction and adaptive clock offset synchronization process.


## 5. Simulation Results

### 5.1. Simulation Setup

In this paper, the proposed fractional-order grey prediction algorithm is simulated by MATLAB_R2017b and compared with the first-order grey prediction algorithm [33] and TPSN [7] algorithm to analyze the performance. The simulation scene is set as follows: 100 nodes are randomly deployed in an area of 400m×400m. The nodes in the area are distributed randomly. In order to simulate the uncertainty of network environment, the value of the uncertain delay, the packet sending time and the channel access time are selected randomly in a fixed interval [4 μs, 55 μs], respectively. Set the number of synchronizations per node to 500, and each synchronization cycle lasts 10 s because this duration is sufficient to synchronize all nodes in the network [17]. Each message propagation of the three algorithms is conducted by broadcasting to ensure fairness, and the communication channel condition is supposed to be ideal. The details of the algorithm parameter settings are listed in Table 1. The three parameters that clock synchronization offset, clock offset variance, and distribution of the clock offset are evaluated for the three algorithms, and the performance differences between the first-order accumulative operator and fractional-order operator in the grey prediction are compared in this section.Table 1
Parameter setting for simulation environment.
ParameterValueNode coverage area(400 m, 400 m)Number of nodes100Node transmission distance78 mNumber of synchronizations500Synchronization cycle10 sNode frequency offset±50 ppm


### 5.2. Performance Evaluation

The variance of the clock offset obtained by the first-order cumulative grey prediction and fractional-order cumulative grey prediction based on the same timestamp data is shown in Figure6.Figure 6
Fractional-order cumulative gray prediction based on the same timestamp.The green circle represents the variance of the first-order accumulated clock synchronization offset, the blue solid line indicates the variance of the fractional-order accumulated clock synchronization offset, and the red circle marks the position of the minimum offset variance obtained by the fractional-order cumulative grey prediction. In the synchronization process, the deviation based on the 3.6-order cumulative grey prediction clock synchronization offset is the smallest. Thus, this study selects the 3.6-order fractional-order to perform the grey accumulation prediction.In addition, since the fractional-order also contains the integer-order (the cumulative order is in the first-order, the variance of the clock offset obtained by the fractional grey prediction and the first-order grey prediction is the same), so the grey prediction is compared with the first-order. The grey prediction of fractional-order accumulation is more applicable. As shown in Figure6, the result shows that the variance of the offset obtained by some fractional grey predictions are large, indicating that the accumulated order at that time is not suitable for grey prediction.Figure7(a) shows the clock offset change between two nodes with clock synchronization for 500 times. Since the fractional-order operator is used to improve the adaptability of the algorithm and the clock frequency offset is optimized, the clock synchronization offset based on the fractional-order grey prediction is closer to 0 and smaller than using the first-order grey prediction algorithm and the TPSN algorithm. Since the TPSN algorithm does not estimate the uncertainty delay, the offset of the synchronization is large. Thus, it can be seen from the figure that the clock synchronization algorithm of the fractional-order operator converges faster and can achieve synchronization quickly.Figure 7
(a) 500 times of clock synchronization offset change. (b) 100 times of clock synchronization offset change.
(a)(b)Figure7(b) shows the clock offset change between the two nodes with clock synchronization for 100 times. It can be seen that the fractional-order cumulative grey prediction algorithm obtains a smaller range of clock offset fluctuations and is more accurate. The average value of the clock offset is about 8.98 μs. The average value of the clock offset obtained by the first-order cumulative grey prediction algorithm is about 12.68 μs, and the average value of the clock offset obtained by the TPSN algorithm is about 16.04 μs. Compared with the first-order accumulative grey prediction algorithm, the fractional-order cumulative grey prediction algorithm reduces the average offset by about 29.18%. Compared with the TPSN algorithm, the fractional-order cumulative grey prediction algorithm reduces the average offset by about 44.01%.Figure8 shows the variance of the first-order cumulative grey prediction algorithm, the fractional-order accumulation grey prediction algorithm, and the TPSN algorithm at 500 times clock synchronizations. Because the algorithm proposed in this paper optimizes the clock frequency offset and adaptively adjusts the cumulative order of the grey prediction model, the obtained offset has smaller variance and better stability. Relative to the first-order accumulative grey prediction algorithm, the fractional-order cumulative grey prediction algorithm reduces the variance by about 48.66%. For the TPSN algorithm, the fractional-order cumulative grey prediction algorithm reduces the variance by about 64.89%.Figure 8
Variance of clock synchronization offset.Figure9 depicts the clock offset distribution for the three algorithms. Since the clock frequency offset is optimized and a reasonable fractional order is used, the clock offset based on the fractional-order grey prediction clock synchronization algorithm is close to 0, the synchronization precision is higher, and the clock offset distribution range is more centralized, most of which are concentrated in between 8 μs and 12 μs, thereby suggesting that the algorithm is more stable than that of the other two algorithms. Meanwhile, the clock offset distribution of the first-order cumulative grey prediction clock synchronization algorithm and the TPSN algorithm is more dispersed, and the stability of the algorithm is worse than that of the proposed algorithm.Figure 9
Clock offset distribution of clock offset.


### 5.3. Discussion

The stability of clock synchronization is an important criterion for evaluating a clock synchronization algorithm. Based on the simulation results in Figures7(a) and 7(b), compared with the other two algorithms, the clock synchronization offset obtained by the algorithm proposed in this paper is the most stable. The average value of the clock synchronization offset is about 9 μs. In the process of clock synchronization proposed in this paper, when the clock synchronization offset is greater than the threshold, the adaptive mechanism is triggered to stabilize the clock offset in a small range. The experimental results in Figure 9 show that the synchronization accuracy of the proposed algorithm is the highest among the three algorithms. The main reasons for the stability of clock offset are that the proposed algorithm optimizes the clock frequency offset and selects the best fractional-order accumulation order, which makes fluctuation of the clock offset small. The clock offset distribution of the first-order grey prediction algorithm is relatively concentrated as the first-order grey prediction algorithm does not adjust the accumulation order. The clock offset distribution of TPSN is scattered, and the offset range of TPSN is larger than that of fractional-order cumulative grey prediction algorithm and first-order cumulative grey prediction algorithm. Meanwhile, the offset of TPSN is very unstable as the clock offset estimating process is absent; thus, the clock correction of each node is not accurate, and the clock frequency offset is also not being optimized in TPSN.


## 5.1. Simulation Setup

In this paper, the proposed fractional-order grey prediction algorithm is simulated by MATLAB_R2017b and compared with the first-order grey prediction algorithm [33] and TPSN [7] algorithm to analyze the performance. The simulation scene is set as follows: 100 nodes are randomly deployed in an area of 400m×400m. The nodes in the area are distributed randomly. In order to simulate the uncertainty of network environment, the value of the uncertain delay, the packet sending time and the channel access time are selected randomly in a fixed interval [4 μs, 55 μs], respectively. Set the number of synchronizations per node to 500, and each synchronization cycle lasts 10 s because this duration is sufficient to synchronize all nodes in the network [17]. Each message propagation of the three algorithms is conducted by broadcasting to ensure fairness, and the communication channel condition is supposed to be ideal. The details of the algorithm parameter settings are listed in Table 1. The three parameters that clock synchronization offset, clock offset variance, and distribution of the clock offset are evaluated for the three algorithms, and the performance differences between the first-order accumulative operator and fractional-order operator in the grey prediction are compared in this section.Table 1
Parameter setting for simulation environment.
ParameterValueNode coverage area(400 m, 400 m)Number of nodes100Node transmission distance78 mNumber of synchronizations500Synchronization cycle10 sNode frequency offset±50 ppm


## 5.2. Performance Evaluation

The variance of the clock offset obtained by the first-order cumulative grey prediction and fractional-order cumulative grey prediction based on the same timestamp data is shown in Figure6.Figure 6
Fractional-order cumulative gray prediction based on the same timestamp.The green circle represents the variance of the first-order accumulated clock synchronization offset, the blue solid line indicates the variance of the fractional-order accumulated clock synchronization offset, and the red circle marks the position of the minimum offset variance obtained by the fractional-order cumulative grey prediction. In the synchronization process, the deviation based on the 3.6-order cumulative grey prediction clock synchronization offset is the smallest. Thus, this study selects the 3.6-order fractional-order to perform the grey accumulation prediction.In addition, since the fractional-order also contains the integer-order (the cumulative order is in the first-order, the variance of the clock offset obtained by the fractional grey prediction and the first-order grey prediction is the same), so the grey prediction is compared with the first-order. The grey prediction of fractional-order accumulation is more applicable. As shown in Figure6, the result shows that the variance of the offset obtained by some fractional grey predictions are large, indicating that the accumulated order at that time is not suitable for grey prediction.Figure7(a) shows the clock offset change between two nodes with clock synchronization for 500 times. Since the fractional-order operator is used to improve the adaptability of the algorithm and the clock frequency offset is optimized, the clock synchronization offset based on the fractional-order grey prediction is closer to 0 and smaller than using the first-order grey prediction algorithm and the TPSN algorithm. Since the TPSN algorithm does not estimate the uncertainty delay, the offset of the synchronization is large. Thus, it can be seen from the figure that the clock synchronization algorithm of the fractional-order operator converges faster and can achieve synchronization quickly.Figure 7
(a) 500 times of clock synchronization offset change. (b) 100 times of clock synchronization offset change.
(a)(b)Figure7(b) shows the clock offset change between the two nodes with clock synchronization for 100 times. It can be seen that the fractional-order cumulative grey prediction algorithm obtains a smaller range of clock offset fluctuations and is more accurate. The average value of the clock offset is about 8.98 μs. The average value of the clock offset obtained by the first-order cumulative grey prediction algorithm is about 12.68 μs, and the average value of the clock offset obtained by the TPSN algorithm is about 16.04 μs. Compared with the first-order accumulative grey prediction algorithm, the fractional-order cumulative grey prediction algorithm reduces the average offset by about 29.18%. Compared with the TPSN algorithm, the fractional-order cumulative grey prediction algorithm reduces the average offset by about 44.01%.Figure8 shows the variance of the first-order cumulative grey prediction algorithm, the fractional-order accumulation grey prediction algorithm, and the TPSN algorithm at 500 times clock synchronizations. Because the algorithm proposed in this paper optimizes the clock frequency offset and adaptively adjusts the cumulative order of the grey prediction model, the obtained offset has smaller variance and better stability. Relative to the first-order accumulative grey prediction algorithm, the fractional-order cumulative grey prediction algorithm reduces the variance by about 48.66%. For the TPSN algorithm, the fractional-order cumulative grey prediction algorithm reduces the variance by about 64.89%.Figure 8
Variance of clock synchronization offset.Figure9 depicts the clock offset distribution for the three algorithms. Since the clock frequency offset is optimized and a reasonable fractional order is used, the clock offset based on the fractional-order grey prediction clock synchronization algorithm is close to 0, the synchronization precision is higher, and the clock offset distribution range is more centralized, most of which are concentrated in between 8 μs and 12 μs, thereby suggesting that the algorithm is more stable than that of the other two algorithms. Meanwhile, the clock offset distribution of the first-order cumulative grey prediction clock synchronization algorithm and the TPSN algorithm is more dispersed, and the stability of the algorithm is worse than that of the proposed algorithm.Figure 9
Clock offset distribution of clock offset.


## 5.3. Discussion

The stability of clock synchronization is an important criterion for evaluating a clock synchronization algorithm. Based on the simulation results in Figures7(a) and 7(b), compared with the other two algorithms, the clock synchronization offset obtained by the algorithm proposed in this paper is the most stable. The average value of the clock synchronization offset is about 9 μs. In the process of clock synchronization proposed in this paper, when the clock synchronization offset is greater than the threshold, the adaptive mechanism is triggered to stabilize the clock offset in a small range. The experimental results in Figure 9 show that the synchronization accuracy of the proposed algorithm is the highest among the three algorithms. The main reasons for the stability of clock offset are that the proposed algorithm optimizes the clock frequency offset and selects the best fractional-order accumulation order, which makes fluctuation of the clock offset small. The clock offset distribution of the first-order grey prediction algorithm is relatively concentrated as the first-order grey prediction algorithm does not adjust the accumulation order. The clock offset distribution of TPSN is scattered, and the offset range of TPSN is larger than that of fractional-order cumulative grey prediction algorithm and first-order cumulative grey prediction algorithm. Meanwhile, the offset of TPSN is very unstable as the clock offset estimating process is absent; thus, the clock correction of each node is not accurate, and the clock frequency offset is also not being optimized in TPSN.


## 6. Conclusions

To improve the clock synchronization accuracy, this study estimates the uncertainty delay in clock synchronization from the perspective of statistical signal processing and proposes an adaptive fractional-order operator clock synchronization algorithm based on the grey prediction model. First, the frequency offset between nodes is optimized by taking the mean on the clock frequency so that the sensor nodes do not need to be frequently synchronized, thereby reducing the energy consumption of the nodes to a certain extent. Second, after frequency offset optimization, a fractional-order operator clock model based on grey prediction theory is proposed to estimate the uncertainty delay in synchronous message transmission and then an accurate clock offset is obtained. In addition, the algorithm adaptively adjusts the order of the fractional-order accumulation in the grey prediction model according to the collected timestamp sample values, thereby improving the accuracy of the uncertainty delay estimation. At the same time, the graph-based breadth-first search is more suitable than the spanning tree to construct the clock synchronization network structure for the wireless sensor network with frequent changes in topology, which does not require a large amount of energy to maintain the topology network while achieving clock synchronization of the entire network. Compared with the existing first-order cumulative grey prediction and TPSN algorithms, the proposed algorithm reduces the mean on the clock offset by approximately 29.18% and 44.01%, respectively. The proposed algorithm also reduces the variance of the offset by approximately 48.66% and 64.89%. The result of the distribution of the clock deviation shows that the proposed algorithm has higher synchronization accuracy and stability than the first-order accumulated grey prediction and TPSN algorithms. In our further research work, we will testify the performance of the proposed algorithm in the real IoT platform and optimize the communication performance of the proposed clock synchronization algorithm; the characteristics of the communication channel will be considered simultaneously.



---

*Source: 9218616-2020-08-01.xml*