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

Through matrix completion algorithm and reverse adaptive Kalman filter, the problem of time synchronization performance degradation caused by time stamp loss in industrial wireless networks is solved, and the accuracy and stability of time synchronization are achieved, and the application scope of the PTP protocol is expanded.

CN119922681AActive Publication Date: 2025-05-02JIANGSU UNIV
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In industrial wireless network environments, the loss of timestamps leads to a degradation of time synchronization performance. The PTP protocol cannot effectively ensure the accuracy and stability of time synchronization, especially under harsh channel conditions.

Method used

The matrix completion algorithm is used to recover the lost PTP timestamp data, and the timestamp matrix and index set matrix are constructed, and matrix completion is performed using the OptSpace algorithm, and the clock offset and offset rate are estimated in combination with the reverse adaptive Kalman filter.

Benefits of technology

It improves the fault tolerance performance of time synchronization in dynamic network environments, enhances the accuracy and stability of time synchronization, expands the application scope of the PTP protocol and improves the reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922681A_ABST
    Figure CN119922681A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial wireless time-sensitive network fault-tolerant time synchronization method adopting matrix completion, and the method comprises the following steps: S1, in each synchronization period, a to-be-synchronized node and a reference node exchange timestamp information according to a message sending process defined in a PTP protocol; s2, the node to be synchronized collects and stores the received timestamps, constructs a timestamp matrix, and records observed item coordinates in an index set matrix; s3, a matrix completion algorithm is adopted to process the timestamp matrix under the observation set obtained in the S2, and a matrix after lost timestamps are recovered is obtained; s4, based on the recovered timestamp matrix, estimating the true values of the clock skew and the clock skew rate through a reverse adaptive Kalman filter; and S5, the to-be-synchronized node adjusts the local clock to be synchronized with the reference node clock. According to the invention, the matrix completion algorithm is introduced and improved to recover the missing timestamp, and then the clock parameter estimation is carried out, so that the time synchronization precision in the packet loss environment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial wireless network, and in particular to an industrial wireless time-sensitive network time synchronization method based on matrix completion, which aims to improve the fault tolerance performance of time synchronization when communication delay fluctuates and some timestamps are lost in a dynamic network environment. Background Art

[0002] As a key technology of time-sensitive networks, the time synchronization protocol based on IEEE 1588v2 (Precision Time Protocol, PTP) provides a guarantee for deterministic real-time data transmission. At the same time, the interaction of time messages between network nodes is the basis for achieving network time synchronization. However, in the industrial wireless network environment, compared with the stable and reliable data transmission of wired Ethernet, the wireless communication medium is susceptible to channel fading, hardware transceiver problems and external signal interference, resulting in uncertain transmission delays and packet loss, which reduces the accuracy and stability of time synchronization. Although the PTP protocol allows occasional message loss, duplication and out-of-order arrival, PTP still cannot guarantee the time synchronization performance under harsh industrial wireless channel conditions. When the timestamp-related messages are continuously abnormal or missing, the periodic time synchronization process will be broken, resulting in the divergence of the calculated clock parameters. This limitation is particularly prominent in wireless networks and industrial networks with dense data packet transmission, which seriously limits the application and promotion of the PTP protocol. How to solve the interference problem of timestamp loss on time synchronization performance has become a challenge that needs to be solved in the design of time synchronization methods for industrial wireless time-sensitive networks.

[0003] The matrix completion algorithm developed from the theory of compressed sensing is often used to deal with scenarios where data is missing, damaged, and the original data is contaminated by noise. The PTP timestamp matrix has a strong spatiotemporal correlation, and most traditional data recovery methods cannot fully utilize the information in the matrix. In contrast, the matrix completion algorithm has obvious advantages in processing spatiotemporal correlated data, and provides a new idea for improving the fault tolerance of time synchronization. Therefore, the present invention recovers the lost PTP timestamp data through a matrix completion algorithm, fully utilizes the timestamp correlation information and node computing resources during packet loss, and designs an industrial wireless time-sensitive network fault-tolerant time synchronization method to improve the time synchronization accuracy in the case of random transmission delay and timestamp data loss in complex industrial network environments, expands the application scope of the PTP protocol and enhances the reliability of the time synchronization system. Summary of the invention

[0004] In view of the deficiencies in the prior art, the purpose of the present invention is to provide an industrial wireless time-sensitive network fault-tolerant time synchronization method using matrix completion, which recovers the PTP timestamp lost in the network time synchronization process based on the 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 highly congested networks.

[0005] The technical solution adopted by the industrial wireless time-sensitive network fault-tolerant time synchronization method using matrix completion described in the present invention is:

[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 , and record the observed entry coordinates into the index set matrix E;

[0008] S3: Use the matrix completion algorithm to process the timestamp matrix M under the observation set E obtained in S2 E , get the matrix after recovering the lost timestamp

[0009] S4: Based on the restored timestamp matrix The true value of the clock offset and the clock offset rate is estimated by using an inverse adaptive Kalman filter;

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

[0011] In the S1, the message sending process in the PTP protocol refers to: time synchronization is performed in a fixed cycle. When recording the timestamp normally, if the event message is lost, the synchronization timeout causes the whole group synchronization to fail, while the general message is lost, the synchronization continues, that is, only the timestamp transmitted by the general message 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 the Sync message is received, and then the reference node encapsulates the time value T1 into the Follow_Up message and sends it to the node to be synchronized. The node to be synchronized receives the Follow_Up message (may be lost), and the node to be synchronized learns the timestamps T1 and T2; after a random wait for a 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 the Delay_Resp message and sends it to the node to be synchronized. After receiving it, the node to be synchronized learns T4 (may be lost).

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

[0013] In S3, the steps of restoring the timestamp matrix using matrix completion are:

[0014] S31: Identify the structural fault of the timestamp matrix, use local filling to pre-interpolate the matrix, and recover the structural fault of the matrix;

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

[0016] In S31, the timestamp matrix structural failure refers to: the continuous and associated timestamp loss caused by the failure to send subsequent synchronization messages due to the loss of event messages or synchronization timeout in the timestamp information. For the message exchange process defined in the PTP protocol, the loss of all four timestamps or the simultaneous loss of T1 and T4 is considered a structural failure.

[0017] In S31, historical information is used to perform time domain linear interpolation to fill in the lost data at the matrix structure failure. When preprocessing local filling, continuous linear interpolation is used. Assuming that the period and delay of each round of time synchronization are constant and not affected by noise, the timestamp obtained in the k+1th round of synchronization can be regarded as a linear superposition on the timestamp in the kth round, that is,

[0018]

[0019] Among them, 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] Since the relative clock offset rate changes slowly, α(k) uses the value of α(k-1) at the previous moment for a short period of time. Therefore, for the matrix structure fault, local information of size i+j is selected and the interpolation value is calculated by 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 the same as T m (k) The most recent non-missing timestamp in the same column. i and j are both integers, indicating the number of times in the same column relative to T. m (k) row offset;

[0023] If there is prior information about the noise uncertainty and the magnitude of the transmission delay jitter is much larger than the observed noise, it is necessary to normalize the timestamp matrix after the structural failure recovery.

[0024] In S32, the matrix completion process is to optimize the timestamp matrix using the OptSpace algorithm, which includes the following sub-steps:

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

[0026]

[0027] S322: To M E Perform the Trim operation, specifically to M E The rows and columns with too large degrees are set to 0. In the present invention, the Trim step in OptSpace is usually not performed because the matrix is ​​a time series and is 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, use S322 procedure:

[0029] S322-a: multiple sets of timestamp data sets with the same synchronization time are collected through multiple access points or redundant transmission;

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

[0031] S323: Through M E Perform singular value decomposition and central scaling, retaining only the two largest non-zero singular values, and obtain M E Orthogonal projection on a set of matrices of rank r = 2

[0032]

[0033] Among them, P r (·) is the projection operator, which means that the matrix M E Projected onto a subspace of rank r, m and n are the number of rows and columns of the matrix, |E| is the number of non-missing elements in the observation set, σ i 、x i and i T are the transpose of the i-th singular value, left singular vector, and right singular vector obtained by singular value decomposition, respectively;

[0034] S324: Iterate X and Y by gradient descent T , reduce P r (M E ) and M E The error is to the error limit, where the error is

[0035]

[0036] Among them, M ij M E The non-missing elements in , X, S, and Y are the transpose of the iterated left singular vector matrix, singular value matrix, and right singular vector matrix, respectively, represents the clock offset value calculated using the data in the row of the lth complete observation, The matrix representing the iterative recovery uses the clock offset values ​​computed using the data at the row positions corresponding to the complete observations;

[0037] S325: Output the completion result, according to the formula Get the completed matrix, where is the matrix restored after the iteration ends.

[0038] In the step S4, the clock parameter estimation step is to use a series of algorithms to filter the relative clock offset offset and the relative clock offset rate skew calculated value. The present invention preferably adopts the reverse adaptive Kalman filtering method. This is because after applying the step S3 of this solution, the original noise characteristics of the data will be affected. In order to solve this problem, the reverse adaptive Kalman filtering method can adaptively modify the gain by combining reverse processing and adaptive adjustment mechanism, thereby improving the accuracy and stability of the estimation. The specific steps are as follows:

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

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

[0041] S43: The reverse processing step specifically includes:

[0042] Calculate the normalized square of the new information at time k;

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

[0044] Calculate the reverse normalized innovation square 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 estimation and error covariance matrix at time k+1 are updated in sequence; otherwise, the conventional Kalman iterative update is returned.

[0047] In S5, the specific steps of adjusting the local clock of the node to be synchronized to the reference node clock are as follows:

[0048] Based on the calculated clock offset value, the node to be synchronized evaluates the offset and selects a correction strategy, which is as follows:

[0049] S51: For the case of small offset, select the direct adjustment method;

[0050] S52: For situations where the offset is large, select the progressive adjustment method to ensure system stability.

[0051] The beneficial effects of the above technical solution adopted by the present invention are:

[0052] 1. The bidirectional time synchronization method under packet loss based on matrix completion provided by the present invention fully considers the poor 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 to solve the problems of low time synchronization accuracy and poor stability under packet loss.

[0053] 2. Before using the matrix completion algorithm, the present invention utilizes the strong time correlation of the timestamp matrix and first uses linear interpolation to directly pre-restore the matrix, thereby overcoming the problems of low accuracy, poor reliability and inability to restore all lost rows and columns of the matrix completion algorithm under specific missing conditions, and has low operation difficulty and high reliability.

[0054] 3. The OptSpace matrix completion algorithm selected by the present invention transforms the nuclear norm minimization problem into a convex optimization problem based on Grassmann manifold, does not rely on frequent singular value decomposition, has a lower algorithm complexity, and balances real-time performance and accuracy. On the basis of the OptSpace algorithm, by adding iterative error judgment conditions, the reliability of the completion result is guaranteed and the recovery accuracy is improved.

[0055] 4. The reverse adaptive Kalman filtering 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, solving the interference of noise model changes caused by matrix completion on clock parameter estimation. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram of a solution flow chart provided for an embodiment of the present invention;

[0057] Figure 2The basic PTP message exchange process defined by the IEEE 1588 protocol provided in the embodiment of the present invention and the corresponding relationship between the timestamp and the ideal time;

[0058] Figure 3 A description of timestamp loss provided in an embodiment of the present invention;

[0059] Figure 4 The clock offset estimation error simulation result provided by the embodiment of the present invention;

[0060] Figure 5 The clock offset rate estimation error simulation result provided by the embodiment of the present invention. DETAILED DESCRIPTION

[0061] The present invention is further described in detail below in conjunction with 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 scheme of the present invention, and cannot be used to limit the protection scope of the present invention. It should be pointed out that the following detailed description is exemplary and is intended to provide further description of the present application.

[0062] Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those generally understood by those of ordinary skill in the art to which this application belongs. It should be noted that the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0063] like Figure 1 As shown, the specific implementation of the present invention includes the following contents:

[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 , and record the observed entry coordinates into the index set matrix E;

[0066] S3: Use the matrix completion algorithm to process the timestamp matrix M under the observation set E obtained in S2 E , get the matrix after recovering the lost timestamp

[0067] S4: Based on the restored timestamp matrix The true value of the clock offset and the clock offset rate is estimated by using an inverse adaptive Kalman filter;

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

[0069] Preferably, the time synchronization method of this embodiment specifically implements the steps of:

[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 S1, the timestamp information should be generated according to the specific physical clock model and the message flow relationship. This embodiment takes the common master-slave node clock offset model as an example to describe the local clock timing process of the node to be synchronized, and its physical clock is modeled as:

[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 clock phase, ω θ represents random clock offset noise;

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

[0075]

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

[0077] like Figure 2As shown in FIG. 1 , the message sending process defined in the PTP protocol means that time synchronization is performed in a fixed cycle. When recording timestamps normally, if the event message is lost, the synchronization timeout causes the entire group synchronization to fail. If the general message is lost, the synchronization continues, that is, only the timestamp transmitted through the general message 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 the Sync message is received, and then the reference node encapsulates the time value T1 into the 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), and the node to be synchronized learns the timestamps T1 and T2; after a random wait period, 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 the Delay_Resp message and sends it to the node to be synchronized. After receiving the message, the node to be synchronized learns T4 (which may be lost).

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

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

[0080] Similarly, we can infer that other timestamps in the same group are

[0081]

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

[0083] At this time, the original complete timestamp matrix generated ideally is recorded as M.

[0084] In S2, the loss of data packets in a dynamic network environment will cause the node to be synchronized to be unable to obtain the original complete timestamp matrix M. Based on the actual PTP protocol message exchange process, if the T1 and T4 messages in S1 are lost or timed out, they are recorded as 0 in the index set; if synchronization fails, the entire group is recorded as 0; the message that arrives normally is recorded as 1. At this point, the node to be synchronized has completed the marking of a group of timestamps, that is, the observation index set matrix E is obtained. At the same time, the node to be synchronized obtains the timestamp matrix M containing missing data based on the received timestamp informationE .

[0085] like Figure 3 As shown in the figure, the green diamond is the location of data that has not been lost and can be observed normally, and the circle is the location of lost data. Since subsequent messages will not be sent after the synchronization message is lost, the loss of timestamps has a certain correlation. If no processing is performed, it will lead to a decrease in synchronization performance. Assuming that the probability of each message being lost is exactly the same as p, then Figure 3 The probabilities of missing timestamps caused by various packet loss situations shown in

[0086] (1-p) 4 Ι

[0087] p ΙΙ

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

[0089] p(1-p) 2 +p(1-p) 3 ΙV

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

[0091] The S3 includes two sub-steps:

[0092] S31: Identify the structural fault of the timestamp matrix, use local filling to pre-interpolate the matrix, and recover the structural fault of the matrix.

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

[0094] In S31, the timestamp matrix structural failure refers to the loss of consecutive, associated timestamps due to event message loss or synchronization timeout in the timestamp information, which results in the failure to send subsequent synchronization messages. For the message exchange process defined in the PTP protocol, this embodiment determines that the loss of all four timestamps in a group and the simultaneous loss of T1 and T4 are structural failures. Figure 3 As shown, the circled cross indicates the structural fault targeted in the pre-interpolation stage.

[0095] In S31, the historical information is used to perform time domain linear interpolation to fill in the lost data at the matrix structure failure. When performing preprocessing local filling, the present invention adopts continuous linear interpolation. Assuming that the period and delay of each round of time synchronization are constant and not affected by noise, the timestamp obtained in the k+1th round of synchronization can be regarded as a linear superposition of the timestamp in the kth round, that is,

[0096]

[0097] Among them, 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 S31, the specific steps of continuous linear interpolation are:

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

[0100] S312: Initialize the current behavior line 1;

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

[0102] S314: Check whether there are two or more elements that are 0 at the same time starting from the current row. If so, record the current row number and execute S315; otherwise, add 1 to the current row and execute S313 again;

[0103] S315: For the column where the 0 element of the current row is located, search the upper and lower rows of the column until the non-0 element is found, and calculate the interpolation value using the following formula:

[0104]

[0105] Current row +1, return to S313.

[0106] Among them, T m (k) is the timestamp of the fault location, T m (k+j) and T m (ki) is the same as T m (k) The most recent non-missing timestamp in the same column. i and j are both integers, indicating the number of times in the same column relative to T. m (k) row offset;

[0107] If there is prior information about the noise uncertainty and the magnitude of the transmission delay is much larger than the observation noise, it is necessary to normalize the timestamp matrix after the structural failure recovery.

[0108] In S32, the matrix completion process is to optimize the timestamp matrix using the OptSpace algorithm, which specifically includes the following sub-steps:

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

[0110]

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

[0112] In the following special cases, step S222 can be adopted:

[0113] S322-a: multiple sets of timestamp data sets with the same synchronization time are collected through multiple access points or redundant transmission;

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

[0115] S323: Through M E Perform singular value decomposition and central scaling, retaining only the two largest non-zero singular values, and obtain M E Orthogonal projection on a set of matrices of rank r = 2 Get the initial values ​​of iteration S0, X0, Y0.

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

[0117] S324: Iterate X and Y by gradient descent T , reduce P r (M E ) and M E The specific steps are:

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

[0119] Determine whether 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, M ij ME The non-missing elements in , X, S, and Y are the transpose of the iterated left singular vector matrix, singular value matrix, and right singular vector matrix, respectively, represents the clock offset value calculated using the data in the row of the lth complete observation, The matrix representing the iterative recovery uses the clock offset values ​​computed using the data at the row positions corresponding to the complete observations;

[0122] S325: Output the completion result. Get the completed matrix, where is the matrix restored after the iteration ends;

[0123] In S4, the clock parameters are preferably estimated using the reverse adaptive Kalman algorithm because the original noise characteristics of the data will be affected after applying the step S3 of the present invention. In order to solve this problem, the reverse adaptive Kalman filter method can adaptively modify the gain by combining reverse processing and adaptive adjustment mechanism, thereby improving the accuracy and stability of the estimation. The specific steps are as follows:

[0124] S41: Set the new information threshold range, initialize the system state x0 and the error covariance matrix P0, and construct the observation equation and state equation according to 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:

[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) is the Gaussian noise fluctuation of clock offset and clock offset rate.

[0129] The clock offset observation value is directly calculated according to the PTP protocol:

[0130]

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

[0132]

[0133] Then, 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), Q and R are the system noise matrix and observation noise matrix respectively, and are the state noise of clock offset and offset rate respectively. In the present invention, unless otherwise specified, the noise is Gaussian noise with zero mean.

[0136] S42: Prediction and update steps using conventional Kalman filtering, including:

[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 step specifically includes:

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

[0144] S432: Reversely 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 reverse normalized innovation square at time k: Among them, v- (k) = y(k) - x - (k);

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

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

[0148] S436: Update the innovation at time k+1, and update the gain, state estimation and error covariance matrix in sequence according to the updated innovation. The innovation update formula at time k+1 is:

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

[0150] In S5, the specific steps of adjusting the local clock of the node to be synchronized to the reference node clock are as follows:

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

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

[0153] S52: For situations where the offset is large, select the progressive adjustment method to ensure system stability.

[0154] In order to achieve the best performance of the algorithm of the present invention, the initial clock synchronization error needs to be set to 0. Therefore, it is recommended to perform initial synchronization after the device is powered on and execute this algorithm immediately or use it when the device has completed normal time synchronization but burst packet loss cannot continue to maintain high-precision synchronization.

[0155] Computer simulation is further used to verify the effectiveness of the method of the present invention. The simulation environment is Matlab2020a. The software operating environment is Windows 10Pro 64-bit operating system, version number is 20H2, configured with Intel Core i5-12490F CPU, 32GB RAM. The simulation parameters are set as follows: the initial clock offset is 0, the initial clock frequency deviation is a random number between [0.98 and 1.02], and the clock offset noise variance is 1e -8 , the clock frequency deviation noise variance is 1e -12 , the global observation noise variance is 10 -10 , processing delay is 0.5ms, link fixed delay is 15ms, delay jitter variance is 10 -6, the packet loss rate is set to 0.6. The OptSpace algorithm is set to rank 2, the initial iteration step is 0.0001, the maximum number of iterations is 100000, and the convergence error threshold is 0.00001. The simulation time is 15s, that is, 150 standard synchronization processes.

[0156] like Figure 4 , 5 As shown in the figure, the estimation errors of clock offset and clock offset rate after three different data recovery schemes are used to complete the timestamp data and use the reverse adaptive Kalman filter. As shown in the figure, the direct application of the OptSace algorithm has the worst estimation effect. This is because it shows obvious fragility in the face of structural faults, especially when all 0 rows are caused by synchronization failure, it cannot be effectively recovered, resulting in a sharp increase in errors. The method of the present invention improves the time synchronization estimation accuracy by introducing pre-interpolation to process all 0 rows and optimizes the error conditions, enhances the adaptability of the OptSpace algorithm to abnormal situations, and shows high robustness. The historical mean method uses adjacent information to restore the currently lost timestamp, which can alleviate the impact of timestamp loss on synchronization performance to a certain extent, but its overall recovery accuracy is still not as good as the method of the present invention, because the noise reduction capability of OptSpace provides a more accurate and stable estimate. In summary, the method of the present invention not only improves the robustness of the algorithm in dealing with the problem of clock parameter estimation under packet loss, but also has superiority in accuracy.

[0157] The above are only a few embodiments of the present application and do not constitute any form of limitation to the present application. Although the present application is disclosed as above with preferred embodiments, it is not intended to limit the present application. Any technician familiar with the profession, without departing from the scope of the technical solution of the present application, using the technical content disclosed above to make slight changes or modifications are equivalent to equivalent implementation cases and fall within the scope of the technical solution.

Claims

1. A fault-tolerant time synchronization method for industrial wireless time-sensitive networks using matrix completion, characterized in that: The method comprises the following steps: 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; S2: The node to be synchronized collects and stores the received timestamps Construct timestamp matrix M E , and record the observed entry coordinates into the index set matrix E; S3: Use the matrix completion algorithm to process the timestamp matrix M under the observation set E obtained in S2 E , get the matrix after recovering the lost timestamp S4: Based on the restored timestamp matrix The true value of the clock offset and the clock offset rate is estimated by using an inverse adaptive Kalman filter; S5: The node to be synchronized adjusts the local clock to synchronize with the reference node clock.

2. The method according to claim 1, characterized in that In S1, the message sending process in the PTP protocol means that time synchronization is performed in a fixed cycle. When recording timestamps normally, if the event message is lost, the synchronization timeout causes the entire group synchronization to fail. If the general message is lost, the synchronization continues, that is, only the timestamp transmitted through the general message 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 the Sync message is received. Then the reference node encapsulates the time value T1 into the 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 randomly waiting for a 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 the Delay_Resp message and sends it to the node to be synchronized. After receiving it, the node to be synchronized knows T4 (which may be lost).

3. The method according to claim 1, characterized in that In S2, the observed entry coordinate index set is related to the specific message exchange process. If the T1 and T4 messages in S1 are lost or timed out, they are recorded as 0 in the index set; if synchronization fails, the entire group is recorded as 0; the message that arrives normally is recorded as 1. At this point, the node to be synchronized has completed the marking of a set of timestamps.

4. The method according to claim 1, characterized in that: In S3, the steps for restoring the timestamp matrix using matrix completion are: S31: Identify the structural fault of the timestamp matrix, use local filling to pre-interpolate the matrix, and recover the structural fault of the matrix; S32: Use the OptSpace algorithm to restore all remaining missing elements.

5. The method according to claim 4, characterized in that In S31, the timestamp matrix structural failure refers to: the continuous and correlated timestamp loss caused by the failure to send subsequent synchronization messages due to the loss of event messages or synchronization timeout in the timestamp information. For the message exchange process defined in the PTP protocol, the loss of a group of four timestamps or the simultaneous loss of T1 and T4 is considered a structural failure.

6. The method according to claim 4, characterized in that In S31, historical information is used to perform time domain linear interpolation to fill in the lost data at the matrix structure failure. When preprocessing local filling, continuous linear interpolation is used. Assuming that the period and delay of each round of time synchronization are constant and not affected by noise, the timestamp obtained in the k+1th round of synchronization can be regarded as a linear superposition of the timestamp in the kth round, that is, Among them, 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; Since the relative clock offset rate changes slowly, α(k) uses the value of α(k-1) at the previous moment for a short period of time. Therefore, for the matrix structure fault, local information of size i+j is selected and the interpolation value is calculated by the following formula: Among them, T m (k) is the timestamp of the fault location, T m (k+j) and T m (ki) is the same as T m (k) The most recent non-missing timestamp in the same column. i and j are both integers, indicating the number of times in the same column relative to T. m (k) row offset; If there is prior information about the noise uncertainty and the magnitude of the transmission delay jitter is much larger than the observed noise, it is necessary to normalize the timestamp matrix after the structural failure recovery.

7. The method according to claim 4, characterized in that In S32, the matrix completion process is to optimize the timestamp matrix using the OptSpace algorithm, which includes the following sub-steps: S321: Input the observed timestamp matrix M E The rank of the matrix is ​​r, where the rank of the timestamp matrix is ​​generally set to 2, M E The relationship between the real timestamp matrix M and the index set E is as follows: S322: To M E Perform the Trim operation, specifically to M E The rows and columns with too large degrees are set to 0. In the present invention, the Trim step in OptSpace is usually not performed because the matrix is ​​a time series and is sparse enough. The trimming operation will cause some rows or columns to be completely removed, which will lead to errors. In the following special cases, use S322 procedure: S322-a: multiple sets of timestamp data sets with the same synchronization time are collected through multiple access points or redundant transmission; S322-b: The synchronization interval of the timestamp data deviates significantly from the set synchronization period; S323: Through M E Perform singular value decomposition and central scaling, retaining only the two largest non-zero singular values, and obtain M E Orthogonal projection on a set of matrices of rank r = 2 Among them, P r (·) is the projection operator, which means that the matrix M E Projected onto a subspace of rank r, m and n are the number of rows and columns of the matrix, |E| is the number of non-missing elements in the observation set, σ i 、x i and i T are the transpose of the i-th singular value, left singular vector, and right singular vector obtained by singular value decomposition, respectively; S324: Iterate X and Y by gradient descent T , reduce P r (M E ) and M E The error is to the error limit, where the error is: Among them, M ij M E The non-missing elements in , X, S and Y are the transpose of the iterated left singular vector matrix, singular value matrix and right singular vector matrix, respectively, M l offset represents the clock offset value calculated using the data in the row of the lth complete observation, (XSY T ) l offset The matrix representing the iterative recovery uses the clock offset values ​​computed using the data at the row positions corresponding to the complete observations; S325: Output the completion result, according to the formula Get the completed matrix, where is the matrix restored after the iteration ends.

8. The method according to claim 1, characterized in that In S4, the clock parameter estimation step is to use a series of algorithms to filter the relative clock offset offset and the relative clock offset rate skew calculated values, using the reverse adaptive Kalman filtering method. The specific steps are as follows: S41: Set the new information threshold range, initialize the system state x0 and the error covariance matrix P0, and construct the observation equation and state equation according to the clock model; S42: Prediction and update process of conventional Kalman filter; S43: The reverse processing step specifically includes: Calculate the normalized square of the innovation at time k; Reversely predict the clock state at time k based on 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 falls below the threshold range, the innovation, gain, state estimation and error covariance matrix at time k+1 are updated in sequence; otherwise, the conventional Kalman iterative update is returned.

9. The method according to claim 1, characterized in that: In S5, the specific steps of adjusting the local clock of the node to be synchronized to the reference node clock are as follows: Based on the calculated clock offset value, the node to be synchronized evaluates the offset and selects a correction strategy, which is as follows: S51: For the case of small offset, select the direct adjustment method; S52: For situations where the offset is large, select the progressive 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

  • Systems and Methods for Optimal Synchrophasor Data Recovery

    US20230036843A1