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

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.


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 pro-posed. 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 wider The subsequent parts of this paper are organized as follows. Section 2 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.

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][11][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 2 Journal of Sensors 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 powerefficient 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][27][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.

Network Model.
Based on the assumption that the sensor network consists of N nodes, the entire network structure can be represented by an undirected graph G = ðV, EÞ, where V = f1, 2, ⋯, Ng 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 = fv ∈ V | fu, vg ∈ Eg. Furthermore, the following assumptions are made: (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 as CðtÞ = t, where t represents the ideal time [33]. Usually, the clock function of the ith node is Among them, the parameter θ is the clock offset and f is the clock frequency offset.
The clock model is shown in Figure 1. 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.
Among the lines, θ AB and f AB represent the clock offset and clock frequency offset between the two nodes, respectively. When θ AB = 0 and f AB = 1, the clocks of node A and B are synchronized.     Figure 2. As shown in Figure 2, during the timestamp exchange of the ith round, node A transmits its ith timestamp at time T 1 , and then records the local time as T ðAÞ 1,i . Node B at time T 2 receives the timestamp sent from node A at time T 1 and records the local time as T ðBÞ 2,i , similarly. Node B then sends its ith timestamp at time T 3 , recording the local time as T ðBÞ 3,i . At time T 4 , node A receives the timestamp sent from node B at time T 3 and records the local time as T ðAÞ 4,i . 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: where f A and f B 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 Figure 2, 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: where d + X  (3) and (4), the time when nodes A and B receive the data packet for the ith time can be expressed as

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 breadthfirst 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.

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 Figure 3. 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.

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 5 Journal of Sensors frequency offset correction by exchanging and computing the clock frequency information between sensor nodes. Assume that in a WSN consisting of N nodes, the clock frequencies of the nodes i, j ði, 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 node j 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. Node i in the broadcast domain of node j receives frequency information ω j ðnÞ, 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, Step 3. Node i broadcasts the updated frequency information ω i ðn + 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 Figure 4. 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.

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.    Journal of Sensors 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 Section 2, 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 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 firstorder 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 firstorder 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 From [14], the maximum likelihood estimation of the certainty delay d and uncertainty delay X where U and V represent the average of the samples fUðkÞ gN k = 1 and fVðkÞgN k = 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 X ðABÞ i , X ðBAÞ i of the grey prediction can be obtained as follows: 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 estimatinĝ UðkÞ andVðkÞ using the grey model of the fractional-order operator. From [37], when r ∈ R + , X ðrÞ = ðx ðrÞ ð1Þ, x ðrÞ ð2Þ, ⋯, x ðrÞ ðnÞÞ is the r-order accumulation that generates operators of X ð0Þ , where From equation (8), Step 1. Initialize the order rðr ∈ 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 be W = ðUð1Þ, Uð2Þ, ⋯, UðnÞÞ, and the W disposed by the operator D have a sequence that is recorded as WD = ðUð1Þd, Uð2Þd, ⋯,

Journal of Sensors
UðnÞdÞ, and D be the average weakening buffer operator [38], among them 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, when k = n in formula (12), UðnÞd = UðnÞ, the randomness of the sample sequence is reduced, thereby improving the accuracy of the prediction model [38].
Step 3. Perform r-order accumulation on the grey sequence of the sample sequence WD to obtain U ðrÞ ð1Þ, U ðrÞ ð2Þ, ⋯, U ðrÞ ðnÞ ðr ∈ R + Þ, among them Step 4. Obtain the estimated value of U ðrÞ ðkÞ using the fractional-order accumulative operator grey model (where The parameters a, b in equation (14) can be estimated by least squares as follows: where Y and B are, respectively (where r ∈ R + ), The expression for z ðrÞ ðkÞ is Step 5. Accumulate the fractional-order (−r order) to obtain the restored value of UðkÞ, that is, the estimated value of the kth time of UðkÞ (where r ∈ R + ): Similarly, the estimated value of the kth time of VðkÞ (where r ∈ R + ) is obtained as follows: When the estimated values of UðkÞ and VðkÞ are substituted into equation (10) with the deterministic delay d and uncertainty delay X Step 6. The ratio R of the message transmission delay in the node communication link is According to formulas (8) and (20), the clock offsets of nodes A and B is obtained After computing the clock offset between nodes A 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.

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 threshold Q 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 8 Journal of Sensors synchronization is θ ðiÞ BA , where n is the number of times that nodes A and B have been synchronized. The expression of threshold Q is 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 Figure 5.

Simulation Setup.
In this paper, the proposed fractionalorder 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 400 m × 400 m. The nodes in the area are distributed randomly. In order to simulate the uncertainty of network environment, the value of the  (20) Obtain clock offset between nodes according to equations (8) and (20) Synchronization node clock Whether the remaining energy of the node satisfies one synchronization  Journal of Sensors 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.

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 Figure 6.
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 synchro-nization 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 fractionalorder 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 Figure 6, 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. Figure 7(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 fractionalorder 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 8 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 9 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.

5.
3. Discussion. The stability of clock synchronization is an important criterion for evaluating a clock synchronization algorithm. Based on the simulation results in Figures 7(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.

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.

Data Availability
The test data, simulation data, and the proposed method used to support the findings of this study are available from the corresponding author upon request. The proposed algorithm is in the state of patent-pending; thus, the access of the data used in the proposed algorithm is restricted now.

Conflicts of Interest
The authors declare no conflict of interest. 13 Journal of Sensors