Industrial wireless time-sensitive network fault-tolerant time synchronization method using matrix completion

By recovering lost PTP timestamp data using a matrix completion algorithm and an inverse adaptive Kalman filter, the synchronization accuracy and stability issues caused by timestamp loss in industrial wireless networks are resolved, thereby improving the robustness and reliability of time synchronization.

CN119922681BActive Publication Date: 2026-03-03JIANGSU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510056762.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2026-03-03
Estimated Expiration
2045-01-14

AI Technical Summary

Technical Problem

In industrial wireless network environments, the loss of timestamps leads to a decrease in time synchronization accuracy and stability, and the existing PTP protocol cannot effectively handle time synchronization problems under harsh channel conditions.

Method used

A matrix completion algorithm is used to recover lost PTP timestamp data. The clock offset and offset rate are estimated by combining the inverse adaptive Kalman filter. The timestamp matrix is ​​processed by the matrix completion algorithm. By taking advantage of the strong spatiotemporal correlation of timestamps, a fault-tolerant time synchronization method is designed.

Benefits of technology

It improves the robustness and reliability of time synchronization, enhances the application capability of the PTP protocol in complex network environments, solves the interference of timestamp loss on synchronization performance, and improves the accuracy and stability of time synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922681B_ABST
    Figure CN119922681B_ABST
Patent Text Reader

Abstract

The application discloses a kind of industrial wireless time-sensitive network fault-tolerant time synchronization methods using matrix completion, the method includes the following steps: S1: in each synchronization period, and reference node is exchanged timestamp information according to the message sending flow defined in PTP protocol by to-be-synchronized node;S2: to-be-synchronized node collects and stores received timestamp, constructs timestamp matrix, and the observed entry coordinates are recorded to index set matrix;S3: using matrix completion algorithm processing timestamp matrix matrix under the observation set of S2 acquisition, obtain the matrix after recovery missing timestamp;S4: based on the timestamp matrix after recovery, the real value of clock offset and clock offset rate is estimated by reverse adaptive Kalman filter;S5: to-be-synchronized node adjusts local clock and reference node clock synchronization.The application carries out clock parameter estimation after recovery missing timestamp by introducing and improving matrix completion algorithm, improves time synchronization precision under the environment of packet loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial wireless network technology, specifically a time synchronization method for industrial wireless time-sensitive networks based on matrix completion, which aims to improve the fault tolerance performance of time synchronization in dynamic network environments when communication delay fluctuations and partial timestamp loss occur. Background Technology

[0002] The IEEE 1588v2 (Precision Time Protocol, PTP) time synchronization protocol is a key technology for time-sensitive networks, ensuring deterministic real-time data transmission. The exchange of time messages between network nodes is fundamental to network time synchronization. However, in industrial wireless network environments, compared to the stable and reliable data transmission of wired Ethernet, wireless communication media are susceptible to channel fading, hardware transceiver problems, and external signal interference, leading to uncertain transmission delays and packet loss, thus reducing time synchronization accuracy and stability. Although the PTP protocol allows for occasional packet loss, duplication, and out-of-order arrival, it still cannot guarantee time synchronization performance under harsh industrial wireless channel conditions. When timestamp-related messages experience persistent anomalies or missing messages, the periodic time synchronization process is disrupted, causing the calculated clock parameters to diverge. This limitation is particularly pronounced in wireless networks and industrial networks with dense packet transmission, severely restricting the application and promotion of the PTP protocol. Solving the problem of timestamp loss interfering with time synchronization performance has become a pressing challenge in the design of time synchronization methods for industrial wireless time-sensitive networks.

[0003] Matrix completion algorithms, developed from compressed sensing theory, are commonly used to handle scenarios involving missing, corrupted, or noise-contaminated original data. PTP timestamp matrices exhibit strong spatiotemporal correlation, and traditional data recovery methods often fail to fully utilize the information within the matrix. In contrast, matrix completion algorithms demonstrate significant advantages in handling spatiotemporally correlated data, providing a new approach to improving the fault tolerance of time synchronization. Therefore, this invention utilizes a matrix completion algorithm to recover lost PTP timestamp data, fully leveraging the timestamp correlation information and node computing resources at the time of packet loss. It designs a fault-tolerant time synchronization method for industrial wireless time-sensitive networks to improve time synchronization accuracy under conditions of random transmission delays and timestamp data loss in complex industrial network environments, expanding the application scope of the PTP protocol and enhancing the reliability of the time synchronization system. Summary of the Invention

[0004] To address the shortcomings of existing technologies, the purpose of this invention is to provide a fault-tolerant time synchronization method for industrial wireless time-sensitive networks using matrix completion. This method recovers lost PTP timestamps during the network time synchronization process based on a matrix completion algorithm, thereby improving the robustness and reliability of the PTP protocol in complex network environments and expanding its application potential in industrial wireless networks and high-congestion networks.

[0005] The technical solution adopted in the fault-tolerant time synchronization method for industrial wireless time-sensitive networks using matrix completion described in this invention is as follows:

[0006] S1: In each synchronization cycle, the node to be synchronized and the reference node exchange timestamp information according to the message sending process defined in the PTP protocol;

[0007] S2: The node to be synchronized collects and stores the received timestamps. Construct timestamp matrix M E The observed entry coordinates are recorded in the index set matrix E;

[0008] S3: The timestamp matrix M under the observation set E obtained in S2 is processed using the matrix completion algorithm. E Obtain the matrix after recovering the lost timestamps.

[0009] S4: Based on the recovered timestamp matrix The true values ​​of clock skew and clock skew rate are estimated by using an inverse adaptive Kalman filter;

[0010] S5: The node to be synchronized adjusts its local clock to synchronize with the reference node's clock.

[0011] In S1, the message sending process in the PTP protocol refers to the following: Time synchronization is performed at fixed intervals. During normal timestamp recording, if an event message is lost, synchronization timeout will cause the entire synchronization group to fail. However, if a general message is lost, synchronization will continue. That is, only timestamps transmitted through general messages will be lost. In each synchronization cycle, the reference node sends a Sync message to the node to be synchronized and records the sending time T1. The node to be synchronized records the time T2 when it receives the Sync message. Immediately afterwards, the reference node encapsulates the time value T1 into a Follow_Up message and sends it to the node to be synchronized. The node to be synchronized receives the Follow_Up message (which may be lost). At this point, the node to be synchronized knows the timestamps T1 and T2. After waiting for a random period of time, the node to be synchronized sends a Delay_Req message to the reference node and records the sending time T3. When the reference node receives the Delay_Req message, it records the timestamp T4 and then encapsulates the T4 information into a Delay_Resp message and sends it to the node to be synchronized. The node to be synchronized receives the message and knows T4 (which may be lost).

[0012] In S2, the observed entry coordinate index set is related to the specific message exchange process. If T1 and T4 messages are lost or timed out in S1, they are recorded as 0 in the index set; if a synchronization failure occurs, the entire set is recorded as 0; messages that arrive normally are recorded as 1. At this point, the node to be synchronized has completed the marking of a set of timestamps.

[0013] In step S3, the timestamp matrix recovery step using matrix completion is as follows:

[0014] S31: Identify structural faults in the timestamp matrix, pre-interpolate the matrix using local padding, and restore the structural faults in the matrix;

[0015] S32: Use the OptSpace algorithm to recover all remaining missing elements.

[0016] In S31, a timestamp matrix structure failure refers to the loss of consecutive and related timestamps in the timestamp information due to the loss of event messages or synchronization timeouts, resulting in the failure to send subsequent synchronization messages. For the message exchange process defined in the PTP protocol, the loss of all four timestamps in a set, or the simultaneous loss of T1 and T4, is considered a structure failure.

[0017] In step S31, historical information is used to perform temporal linear interpolation to fill in the lost data at the matrix structure fault location. During preprocessing and local filling, continuous linear interpolation is used. Assuming that the period and delay of each round of time synchronization are constant and unaffected by noise, the timestamp obtained in the (k+1)th round of synchronization can be considered as a linear superposition of the timestamps from the kth round.

[0018]

[0019] Where T is the synchronization period, T1, T2, T3, T4 are the timestamps recorded in S1, and α is the relative clock offset rate of the slave node relative to the reference node.

[0020] Because the relative clock offset changes slowly, α(k) retains the value of α(k-1) from the previous moment for a short period. Therefore, for matrix structure faults, local information of size i+j is selected, and the interpolation is calculated using the following formula.

[0021]

[0022] Among them, T m (k) is the timestamp of the fault location, T m (k+j) and T m (ki) is related to T m (k) The nearest unlost timestamp in the same column, where i and j are both integers, representing the timestamp in the same column relative to T. m (k) row offset;

[0023] If there is prior information about noise uncertainty, and the transmission delay jitter is much larger than the observation noise, then the timestamp matrix after recovering the structural fault needs to be normalized.

[0024] In step S32, the matrix completion process involves optimizing the timestamp matrix using the OptSpace algorithm, and includes the following sub-steps:

[0025] S321: Input the observed timestamp matrix M E The rank r of the timestamp matrix, where the rank of the timestamp matrix is ​​typically set to 2, M E The relationship between the real timestamp matrix M and the index set E is as follows:

[0026]

[0027] S322: For M E Perform the Trim operation, specifically by modifying M... E Rows and columns with excessively high degree are set to 0. In this invention, the Trim step in OptSpace is usually not performed because the matrix is ​​a time series and is already sparse enough. The trimming operation will cause some rows or columns to be completely removed, which will lead to errors.

[0028] In the following special cases, step S322 shall be used:

[0029] S322-a: Collects multiple sets of timestamp datasets at the same synchronization time through multiple access points or redundant transmission;

[0030] S322-b: The synchronization interval of timestamp data deviates significantly from the set synchronization period;

[0031] S323: By adjusting M E Perform singular value decomposition and center scaling, retaining only the two largest non-zero singular values ​​to obtain M. E Orthogonal projection on the set of matrices with rank r = 2

[0032]

[0033] Among them, P r (·) is the projection operator, indicating that the matrix M is projected... E Projected onto a subspace of rank r, where m and n are the number of rows and columns of the matrix, respectively, |E| is the number of non-missing elements in the observation set, and σ i x i and y i T These are the transposes of the i-th singular value, the left singular vector, and the right singular vector obtained through singular value decomposition, respectively.

[0034] S324: Iterate X and Y using gradient descent. T Decrease P r (M E ) and M E The error is within the error limit, where the error is...

[0035]

[0036] Among them, M ij For M E The elements that are not missing are X, S, and Y, which are the transposes of the left singular vector matrix, singular values, and right singular vector matrix of the iteration, respectively. This represents the clock offset value calculated using data from the row of the l-th complete observation. The matrix representing the iterative recovery uses the clock offset value calculated from the data at the row positions corresponding to the complete observation;

[0037] S325: Output the completion result, based on the formula. Obtain the completed matrix, where This is the matrix recovered after the iteration ends.

[0038] In step S4, the clock parameter estimation step involves filtering the calculated values ​​of the relative clock offset and relative clock skew using a series of algorithms. This invention preferably employs the inverse adaptive Kalman filter method. This is because the original noise characteristics of the data are affected after applying step S3 of this scheme. To address this issue, the inverse adaptive Kalman filter method, by combining inverse processing and adaptive adjustment mechanisms, can adaptively modify the gain, thereby improving the accuracy and stability of the estimation. The specific steps are as follows:

[0039] S41: Set the information threshold range, initialize the system state x0 and error covariance matrix P0, and construct the observation equation and state equation based on the clock model;

[0040] S42: Prediction and update process of conventional Kalman filtering;

[0041] S43: The reverse processing steps specifically include:

[0042] Calculate the normalized squared innovation at time k;

[0043] Predict the clock state at time k based on the state at time k+1;

[0044] Calculate the squared backward normalized innovation at time k;

[0045] Calculate the normalized innovation ratio and compare it with the set threshold;

[0046] When the normalized innovation square ratio exceeds or falls below the threshold range, the innovation, gain, state estimate, and error covariance matrix at time k+1 are updated sequentially; otherwise, the regular Kalman iteration update is returned.

[0047] In step S5, the specific steps for the node to be synchronized to adjust its local clock to synchronize with the reference node's clock are as follows:

[0048] Based on the calculated clock offset value, the node to be synchronized evaluates the magnitude of the offset and selects a correction strategy, specifically:

[0049] S51: For cases with small offsets, choose the direct adjustment method;

[0050] S52: For cases with large offsets, choose the gradual adjustment method to ensure system stability.

[0051] The beneficial effects of the above-mentioned technical solution adopted in this invention are as follows:

[0052] 1. The bidirectional time synchronization method based on matrix completion under packet loss provided by this invention fully considers the harsh channel conditions and real-time requirements of industrial wireless time-sensitive networks. By analyzing the strong spatiotemporal correlation of the timestamp matrix, a timestamp matrix recovery and filtering scheme is designed, which solves the problems of low time synchronization accuracy and poor stability under packet loss.

[0053] 2. Before using the matrix completion algorithm, this invention utilizes the strong temporal correlation of the timestamp matrix to directly pre-recover the matrix using linear interpolation. This overcomes the problems of low accuracy, poor reliability, and inability to recover all lost rows and columns under specific missing conditions in the matrix completion algorithm. Moreover, it is easy to operate and has high reliability.

[0054] 3. The OptSpace matrix completion algorithm selected in this invention transforms the nuclear norm minimization problem into a convex optimization problem based on the Grassmann manifold. It does not rely on frequent singular value decomposition, has lower algorithm complexity, and balances real-time performance and accuracy. Based on the OptSpace algorithm, the reliability of the completion result is ensured and the recovery accuracy is improved by adding an iteration error judgment condition.

[0055] 4. The inverse adaptive Kalman filter method is used to process the timestamp information after matrix completion. It does not rely on a fixed noise preset model and can achieve adaptive high-precision estimation of clock parameters, thus solving the interference of noise model changes caused by matrix completion on clock parameter estimation. Attached Figure Description

[0056] Figure 1 This is a schematic diagram of the solution process provided in an embodiment of the present invention;

[0057] Figure 2The basic PTP message exchange process defined by the IEEE 1588 protocol and the correspondence between timestamps and ideal times are provided for embodiments of the present invention.

[0058] Figure 3 Explanation of timestamp loss provided for embodiments of the present invention;

[0059] Figure 4 Simulation results of clock offset estimation error provided in embodiments of the present invention;

[0060] Figure 5 Simulation results of clock offset estimation error provided for embodiments of the present invention. Detailed Implementation

[0061] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments, but the present invention is not limited to these embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention, and should not be used to limit the scope of protection of the present invention. It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of this application.

[0062] Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0063] like Figure 1 As shown, specific implementations of the present invention include the following:

[0064] S1: In each synchronization cycle, the node to be synchronized and the reference node exchange timestamp information according to the message sending process defined in the PTP protocol;

[0065] S2: The node to be synchronized collects and stores the received timestamps. Construct timestamp matrix M E The observed entry coordinates are recorded in the index set matrix E;

[0066] S3: The timestamp matrix M under the observation set E obtained in S2 is processed using the matrix completion algorithm. E Obtain the matrix after recovering the lost timestamps.

[0067] S4: Based on the recovered timestamp matrix The true values ​​of clock skew and clock skew rate are estimated by using an inverse adaptive Kalman filter;

[0068] S5: The node to be synchronized adjusts its local clock to synchronize with the reference node's clock.

[0069] Preferably, the specific implementation steps of the time synchronization method in this embodiment are as follows:

[0070] S1: In each synchronization cycle, the node to be synchronized and the reference node exchange timestamp information according to the message sending process defined in the PTP protocol.

[0071] In step S1, the timestamp information should be generated based on the specific physical clock model and message flow relationship. This embodiment uses a common master-slave node clock offset model as an example to describe the local clock timing process of the node to be synchronized. Its physical clock is modeled as follows:

[0072]

[0073] Where C(t) represents the physical clock time of the local node at reference time t, Δf(·) represents the clock rate function, θ0 represents the initial phase of the clock, and ω θ Indicates random clock skew noise;

[0074] Since the clock frequency offset changes slowly, it is assumed to remain constant over a certain period of time. Through discretization, the clock timing process can be expressed as a discrete-form difference equation.

[0075]

[0076] Where C(k) represents the local clock time of the discretized local node at reference time k, τ is the discrete time interval, α is the relative clock offset rate, and ψ θ (k) represents the instantaneous value of clock offset noise fluctuation ω θ sum.

[0077] like Figure 2As shown, the message sending process defined in the PTP protocol is as follows: Time synchronization is performed at fixed intervals. During normal timestamp recording, if an event message is lost, synchronization timeout will cause the entire synchronization group to fail. However, if a general message is lost, synchronization will continue. That is, only timestamps transmitted through general messages will be lost. In each synchronization cycle, the reference node sends a Sync message to the node to be synchronized and records the sending time T1. The node to be synchronized records the time T2 when it receives the Sync message. Immediately afterwards, the reference node encapsulates the time value T1 into a Follow_Up message and sends it to the node to be synchronized. The node to be synchronized receives the Follow_Up message (which may be lost). At this point, the node to be synchronized knows the timestamps T1 and T2. After waiting for a random period of time, the node to be synchronized sends a Delay_Req message to the reference node and records the sending time T3. When the reference node receives the Delay_Req message, it records the timestamp T4 and then encapsulates the T4 information into a Delay_Resp message and sends it to the node to be synchronized. The node to be synchronized receives the message and knows T4 (which may be lost).

[0078] Assuming the ideal time for the reference node to send the first Sync message is time 0, then the timestamp for the master clock to send the kth round of Sync messages is defined as:

[0079] T1(k)=T1(0)+(k-1)×T=(k-1)×T

[0080] Similarly, it can be deduced that other timestamps in the same group are...

[0081]

[0082] Where T is the synchronization period, α(k) is the clock skew rate at the k-th synchronization, and it is assumed that it is approximately constant within a synchronization period, β(k) is the sum of the initial clock skew and random walk noise at the k-th synchronization, b is the fixed processing delay, and D... G D represents the total uplink latency. H Let be the total downlink delay, which is the sum of the fixed link delay and random Gaussian noise.

[0083] At this point, the original complete timestamp matrix generated under ideal conditions is denoted as M.

[0084] In step S2, packet loss in a dynamic network environment can prevent the node to be synchronized from obtaining the original complete timestamp matrix M. Based on the actual PTP protocol message exchange process, if T1 and T4 messages are lost or time out in S1, they are recorded as 0 in the index set; if synchronization fails, the entire set is recorded as 0; normally arriving messages are recorded as 1. At this point, the node to be synchronized has completed marking a set of timestamps, thus obtaining the observation index set matrix E. Simultaneously, the node to be synchronized obtains the timestamp matrix M containing missing data based on the received timestamp information.E .

[0085] like Figure 3 As shown, the green diamonds represent data locations that are not lost and can be observed normally, while the circles represent lost data locations. Since subsequent messages are not sent after a synchronization message is lost, the loss of timestamps is correlated, and without any handling, it will lead to a decrease in synchronization performance. Assuming that the probability of each message being lost is exactly the same, p, then... Figure 3 The probabilities of missing timestamps caused by various packet loss scenarios shown in the figure are as follows:

[0086] (1-p) 4 Ι

[0087] p ΙΙ

[0088] (1-p) 3 ΙΙΙ

[0089] p(1-p) 2 +p(1-p) 3 IV

[0090] p 2 (1-p)+p 2 (1-p) 2 V

[0091] S3 includes two sub-steps:

[0092] S31: Identify structural faults in the timestamp matrix, pre-interpolate the matrix using local padding, and restore the matrix's structural faults.

[0093] S32: Use the OptSpace algorithm to recover all remaining missing elements.

[0094] In S31, a timestamp matrix structure failure refers to the loss of consecutive, correlated timestamps due to the loss of event messages or synchronization timeouts, resulting in the failure to send subsequent synchronization messages. For the message exchange process defined in the PTP protocol, this embodiment determines the loss of all four timestamps in a set, or the simultaneous loss of T1 and T4, as a structure failure. Figure 3 As shown, the circled and crossed-out areas represent structural faults addressed during the pre-interpolation stage.

[0095] In step S31, historical information is used to perform temporal linear interpolation to fill in the lost data at the location of a matrix structure failure. During preprocessing and local filling, this invention employs continuous linear interpolation. Assuming that the period and delay of each round of time synchronization are constant and unaffected by noise, the timestamp obtained in the (k+1)th round of synchronization can be considered as a linear superposition of the timestamps from the kth round, i.e.

[0096]

[0097] Where T is the synchronization period, T1, T2, T3, T4 are the timestamps recorded in S1, and α is the relative clock offset rate of the slave node relative to the reference node.

[0098] In step S31, the specific steps of continuous linear interpolation are as follows:

[0099] S311: Get the number of rows in the matrix;

[0100] S312: Initialize the first line of the current behavior;

[0101] S313: Determine if the current row is a matrix row number. If yes, end the interpolation; otherwise, execute S314.

[0102] S314: Starting from the current row, check if there are two or more elements that are both 0. If so, record the current row number and execute S315; otherwise, increment the current row number by 1 and execute S313 again.

[0103] S315: For the column containing the 0th element in the current row, search the rows above and below that column until a non-zero element is found, and calculate the interpolation using the following formula:

[0104]

[0105] Increment the current line by 1, and return S313.

[0106] Among them, T m (k) is the timestamp of the fault location, T m (k+j) and T m (ki) is related to T m (k) The nearest unlost timestamp in the same column, where i and j are both integers, representing the timestamp in the same column relative to T. m (k) row offset;

[0107] If there is prior information about noise uncertainty, and the transmission delay is much larger than the observation noise, then the timestamp matrix after the structural fault needs to be normalized.

[0108] In step S32, the matrix completion process is optimized using the OptSpace algorithm on the timestamp matrix, and specifically includes the following sub-steps:

[0109] S321: Initialize parameters. Input the observed timestamp matrix M E And the rank r of the timestamp matrix. The rank of the timestamp matrix is ​​typically set to 2, M E The relationship between the actual timestamp matrix M and the index set E is as follows:

[0110]

[0111] S322: In this scheme, the Trim step in OptSpace is usually not executed because the matrix is ​​a time series and is already sparse enough. The trimming operation will cause some rows or columns to be completely removed, which will lead to errors.

[0112] Step S222 may be used in the following special circumstances:

[0113] S322-a: Collects multiple sets of timestamp datasets at the same synchronization time through multiple access points or redundant transmission;

[0114] S322-b: The synchronization interval of timestamp data deviates significantly from the set synchronization period.

[0115] S323: By adjusting M E Perform singular value decomposition and center scaling, retaining only the two largest non-zero singular values ​​to obtain M. E Orthogonal projection on the set of matrices with rank r = 2 Obtain the initial values ​​S0, X0, and Y0 for iteration.

[0116] Among them, P r (·) is the projection operator, indicating that the matrix M is projected... E Projected onto a subspace of rank r, where m and n are the number of rows and columns of the matrix, respectively, |E| is the number of non-missing elements in the observation set, and σ i x i and y i T Let Si be the i-th singular value obtained through singular value decomposition, the transpose of the left singular vector, and the transpose of the right singular vector, respectively. Let S0, X0, and Y0 be σi, Xi, and Y0, respectively. i x i y i The diagonal matrix, left singular vector matrix, and right singular vector matrix are formed.

[0117] S324: Iterate X and Y using gradient descent. T Decrease P r (M E ) and M E The error is brought to the error limit. The specific steps are as follows:

[0118] The left and right singular vectors X0 and Y0 are adjusted using the gradient descent method.

[0119] Determine if the error is less than the threshold; if so, end the iteration; otherwise, return to the previous step. The error expression is:

[0120]

[0121] Among them, Mij For M E The elements that are not missing are X, S, and Y, which are the transposes of the left singular vector matrix, singular values, and right singular vector matrix of the iteration, respectively. This represents the clock offset value calculated using data from the row of the l-th complete observation. The matrix representing the iterative recovery uses the clock offset value calculated from the data at the row positions corresponding to the complete observation;

[0122] S325: Output the completed result. (Based on the formula...) Obtain the completed matrix, where This is the matrix recovered after the iteration ends;

[0123] In step S4, the inverse adaptive Kalman algorithm is preferably used to estimate the clock parameters because the original noise characteristics of the data are affected after applying step S3 of this invention. To address this issue, the inverse adaptive Kalman filtering method combines inverse processing and adaptive adjustment mechanisms to adaptively modify the gain, thereby improving the accuracy and stability of the estimation. The specific steps are as follows:

[0124] S41: Set the information threshold range, initialize the system state x0 and error covariance matrix P0, and construct the observation equation and state equation based on the clock model.

[0125] Based on the clock model in S1, the state equations for the clock offset and clock offset rate between the reference node and the node to be synchronized are as follows:

[0126] θ(k+1)=θ(k)+α(k)τ(k)+ω θ (k)

[0127] α(k+1)=α(k)+ω α (k)

[0128] Where θ(k) represents the clock offset at time k, τ(k) is the discrete time interval, α(k) is the relative clock offset rate, and ω θ (k), ω θ (k) represents the Gaussian noise fluctuation of the clock offset and clock offset rate.

[0129] Clock offset observations are calculated directly according to the PTP protocol:

[0130]

[0131] The clock skew rate is calculated based on two consecutive clock skew observations:

[0132]

[0133] Therefore, the clock state-space model is:

[0134]

[0135] Among them, x(k)=[θ(k)α(k)], y(k)=[θ M (k)α M (k)],T=τ, ω~N(0,Q), ν~(0,R), where Q and R are the system noise matrix and the observation noise matrix, respectively. and These are the state noises for clock skew and skew rate, respectively. Unless otherwise specified, all noise in this invention is Gaussian noise with a mean of 0.

[0136] S42: Prediction and update steps using conventional Kalman filtering. Specifically, this includes:

[0137] State prediction: x(k+1|k)=Ax(k);

[0138] Minimum prediction error: P(k+1|k)=AP(k)A T +Q;

[0139] Calculate the gain: K(k+1)=P(k+1|k)H T [HP(k+1|k)H T +R] -1 ;

[0140] State correction: x(k+1)=x(k+1|k)+K(k+1)[y(k+1)-x(k+1|k)];

[0141] Minimum prediction error correction: P(k+1)=[IK(k+1)]P(k+1|k).

[0142] S43: The reverse processing steps specifically include:

[0143] S431: Calculate the normalized squared innovation at time k: ε v (k)=v T (k)S -1 (k)v(k), where the information covariance at time k is S(k)=HP(k|k-1)H T +R, the news at time k is v(k) = y(k) - Hx(k|k-1);

[0144] S432: Predict the clock state at time k based on the state at time k+1: x - (k)=A -1 x(k+1);

[0145] S433: Calculate the squared backward-normalized innovation at time k: Among them, v - (k)=y(k)-x - (k);

[0146] S434: Calculate the normalized innovation ratio And compare it with the set threshold;

[0147] S435: When the normalized innovation square ratio exceeds or falls below the threshold range, execute S436; otherwise, exit the reverse processing step.

[0148] S436: Update the information at time k+1. Based on the updated information, update the gain, state estimate, and error covariance matrix in sequence. The formula for updating the information at time k+1 is:

[0149] S(k+1)=H[AP(kk-1)A T +λQ]H T +R

[0150] In step S5, the specific steps for the node to be synchronized to adjust its local clock to synchronize with the reference node's clock are as follows:

[0151] Based on the calculated clock offset value, the node to be synchronized evaluates the magnitude of the offset and selects a correction strategy. Specifically:

[0152] S51: For cases with small offsets, choose the direct adjustment method.

[0153] S52: For cases with large offsets, choose the gradual adjustment method to ensure system stability.

[0154] To achieve optimal performance of the algorithm of this invention, the initial clock synchronization error should be set to 0. Therefore, it is recommended to perform initial synchronization after the device is powered on and execute the algorithm immediately, or to use the algorithm when the device has completed normal time synchronization but sudden packet loss makes it impossible to maintain high-precision synchronization.

[0155] The effectiveness of the method of the present invention was further verified by computer simulation. The simulation environment was Matlab 2020a. The software running environment was Windows 10 Pro 64-bit operating system, version number 20H2, configured with Intel Core i5-12490F CPU and 32GB RAM. The simulation parameters were set as follows: initial clock offset was 0, initial clock frequency offset was a random number between [0.98 and 1.02], and clock offset noise variance was 1e. -8 The clock frequency offset noise variance is 1e -12 The global observation noise variance is 10. -10 The processing latency is 0.5ms, the link fixed latency is 15ms, and the latency jitter variance is 10. -6The packet loss rate was set to 0.6%. The OptSpace algorithm was set to a rank of 2, an initial iteration step size of 0.0001, a maximum number of iterations of 100,000, and a convergence error threshold of 0.00001. The simulation time was 15 seconds, which is equivalent to 150 standard synchronization processes.

[0156] like Figure 4 , 5 The figure shows the estimation errors of clock offset and clock offset rate after using three different data recovery schemes to complete timestamp data and utilizing inverse adaptive Kalman filtering. As shown, directly applying the OptSpace algorithm yields the worst estimation result. This is because it exhibits significant vulnerability to structural faults, especially when synchronization failure results in rows of zeros, which cannot be effectively recovered, leading to a sharp increase in error. The method of this invention, by introducing pre-interpolation to handle rows of zeros and optimizing error conditions, improves the accuracy of time synchronization estimation, enhances the adaptability of the OptSpace algorithm to abnormal situations, and demonstrates higher robustness. The historical mean method uses proximity information to recover the currently lost timestamp, which can alleviate the impact of timestamp loss on synchronization performance to some extent, but its overall recovery accuracy is still inferior to the method of this invention. This is because OptSpace's noise reduction capability provides a more accurate and stable estimate. In summary, the method of this invention not only improves the robustness of the algorithm in handling clock parameter estimation under packet loss conditions but also has superior accuracy.

[0157] The above description is merely a few embodiments of this application and is not intended to limit this application in any way. Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any changes or modifications made by those skilled in the art without departing from the scope of the technical solution of this application using the disclosed technical content are equivalent to equivalent implementation cases and fall within the scope of the technical solution.

Claims

1. An industrial wireless time sensitive network fault-tolerant time synchronization method using matrix completion, characterized in that, The method comprises the following steps: S1: in each synchronization cycle, the to-be-synchronized node and the reference node exchange timestamp information according to the message sending process defined in the PTP protocol; S2: The nodes to be synchronized collect and store the received timestamps Constructing the timestamp matrix M E and record the observed entry coordinates into the index set matrix E; S3: using a matrix completion algorithm to process the timestamp matrix M under the observation set E obtained in S2 E , to obtain a matrix after restoring the missing timestamp In S3, the timestamp matrix recovery step by matrix completion is: S31: identify the structure failure of the timestamp matrix, pre-interpolate the matrix using local filling to recover the structure failure of the matrix; S32: use the OptSpace algorithm to recover all the remaining missing elements; S4: based on the restored timestamp matrix by means of a backward adaptive Kalman filter. S5: the to-be-synchronized node adjusts the local clock to be synchronized with the reference node clock.

2. The method of claim 1, wherein, In S1, the message sending process in the PTP protocol refers to: time synchronization is performed at a fixed cycle, and when event messages are lost during normal timestamp recording, synchronization timeout causes the whole group of synchronization to fail, and general message loss still continues synchronization, that is, only the timestamps transmitted through general messages are lost; in each synchronization cycle, the reference node sends a Sync message to the to-be-synchronized node and records the sending time T1; The to-be-synchronized node records the time T2 when the Sync message is received, and then the reference node encapsulates the time value T1 into a Follow_Up message and sends it to the to-be-synchronized node, and the to-be-synchronized node receives the Follow_Up message (which may be lost), and thus the to-be-synchronized node obtains the timestamps T1 and T2; after a random waiting period, the to-be-synchronized node sends a Delay_Req message to the reference node and records the sending time T3; when the reference node receives the Delay_Req message, it records the timestamp T4, and then encapsulates the T4 information into a Delay_Resp message and sends it to the to-be-synchronized node, and the to-be-synchronized node receives it and obtains T4 (which may be lost).

3. The method of claim 1, wherein, In S2, the observed entry coordinate index set is related to the specific message exchange process, and if T1 and T4 messages are lost or timeout in S1, they are recorded as 0 in the index set; if synchronization failure occurs, the whole set is recorded as 0; normally arrived messages are recorded as 1, and thus the to-be-synchronized node has completed the marking of a group of timestamps.

4. The method of claim 1, wherein, In S31, the structure failure of the timestamp matrix refers to: due to event message loss or synchronization timeout, the subsequent synchronization messages are not sent, resulting in continuous and associated loss of timestamps, and for the message exchange process defined in the PTP protocol, it is considered that a group of four timestamps are all lost or T1 and T4 are lost at the same time.

5. The method of claim 1, wherein, In S31, historical information is used to perform time domain linear interpolation to fill in the missing data at the matrix structure failure, and during the pre-processing local filling, continuous linear interpolation is adopted, assuming that the period and delay of each round of time synchronization are constant and are not affected by noise, then the timestamp obtained in the k+1 round of synchronization can be regarded as a linear superposition on the kth round of timestamp, that is Wherein, T is the synchronization period, T1, T2, T3, T4 are the timestamps recorded in S1, and a is the relative clock drift rate of the slave node relative to the reference node; Since the relative clock drift rate changes slowly, in a short period of time, a(k) follows the value of a(k-1) at the previous moment, therefore, for the matrix structure failure, local information with a size of i+j is selected, and the interpolation is calculated by the following formula where T m (k) is the timestamp of the fault, m (k+j) and T m (k-i) are the most recent non-missing timestamps in the same column as T m (k), i and j are integers, and represent row offsets relative to T m (k). If there is prior information about the noise uncertainty and the magnitude of the transmission delay jitter is much larger than the observation noise, the timestamp matrix after the recovery of the structure failure needs to be normalized.

6. The method of claim 1, wherein, In S32, the matrix completion process is to optimize the timestamp matrix by using the OptSpace algorithm, which includes the following sub-steps: S321: input the observed timestamp matrix M E and the rank r of the matrix, where the rank of the timestamp matrix is generally set to 2, M E The relationship between the real timestamp matrix M, the index set E is as follows: S322: Set M E Perform Trim operation, specifically set M E Moderately overpopulated rows and columns are set to zero. In the present invention, the Trim step in OptSpace is not usually performed because the matrix is time-sequential and already sufficiently sparse, and the trim operation would cause some rows or columns to be removed completely, leading to errors. In the following special cases, the S322 step is adopted: S322-a: Collect multiple sets of timestamp data sets of the same synchronization time through multiple access points or redundant transmission; S322-b: The synchronization interval of the timestamp data deviates significantly from the set synchronization period; S323: Obtain M by singular value decomposition and centering scaling on M E E Orthogonal projection on the set of matrices with rank r = 2​ Among them, P r (·) is the projection operator, indicating that the matrix M is projected... E Projected onto a subspace of rank r, where m and n are the number of rows and columns of the matrix, respectively, |E| is the number of non-missing elements in the observation set, and σ i x i and y i T These are the transposes of the i-th singular value, the left singular vector, and the right singular vector obtained through singular value decomposition, respectively. S324: iterate X and Y by gradient descent method T , reduce P r (M E ) and M E error to error limit, wherein the error is: where M ij is M E is the matrix of missing elements, X, S and Y are the transposed left and right singular vector matrices and singular values of iteration, M l offset represents the clock bias value calculated using the data in the row of the lth full observation, (XSY T ) l offset represents the matrix of iteration recovery using the clock bias value calculated using the data in the row position of the corresponding full observation; S325: output the completion result according to the formula The completed matrix is obtained, wherein is the matrix recovered after the iteration is finished.

7. The method of claim 1, wherein, In S4, the clock parameter estimation step is to filter the relative clock offset offset and the relative clock skew calculation value by using a series of algorithms, and the reverse adaptive Kalman filtering method is adopted, and the specific steps are as follows: S41: Set the innovation threshold range, initialize the system state x0 and the error covariance matrix P0, and construct the observation equation and the state equation according to the clock model; S42: The prediction and update process of the conventional Kalman filter; S43: The reverse processing steps specifically include: Calculate the normalized innovation square at time k; Backward predict the clock state at time k according to the state at time k+1; Calculate the reverse normalized innovation square at time k; Calculate the normalized innovation ratio and compare it with the set threshold; When the normalized innovation square ratio exceeds or is lower than the threshold range, update the innovation, gain, state estimation and error covariance matrix at time k+1 in turn; otherwise, return to the conventional Kalman iteration update.

8. The method of claim 1, wherein, In S5, the specific steps for the to-be-synchronized node to adjust the local clock to synchronize with the reference node clock are as follows: According to the calculated clock offset value, the to-be-synchronized node evaluates the size of the offset and selects a correction strategy, which is specifically: S51: For the case of small offset, select the direct adjustment method; S52: For the case of large offset, select the gradual adjustment method to ensure system stability.

Citation Information

Patent Citations

  • Underwater wireless sensor network node positioning method based on matrix completion

    CN115996461A

  • System and method for satellite positioning

    US20210382181A1