A Kalman filter time synchronization method and device based on a virtual accompanying clock

By constructing a method of combining virtual accompanying clock with Kalman filter, the problem of inaccurate and prone to divergence of attacks in the time synchronization system is solved, and higher synchronization accuracy and stability are achieved.

CN116131986BActive Publication Date: 2025-07-22NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310102870.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-01
Publication Date
2025-07-22
Estimated Expiration
2043-02-01

AI Technical Summary

Technical Problem

The traditional Kalman filtering algorithm has low accuracy in identifying malicious attacks from outside in the time synchronization system, resulting in a decrease in synchronization accuracy and prone to divergence. The accumulation of errors in iterative calculations affects the stability of the system.

Method used

The virtual accompanying clock of the local clock is constructed, and the channel security status is determined in a comprehensive manner with the Kalman filter, and the virtual accompanying clock is updated in real time to correct the divergence trend of the Kalman filtering algorithm.

Benefits of technology

It improves the recognition accuracy of the time synchronization system under attack, reduces the impact of misjudgment, ensures synchronization accuracy and system stability, and improves the attack resistance of time synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116131986B_ABST
    Figure CN116131986B_ABST
Patent Text Reader

Abstract

The present invention discloses a Kalman filter time synchronization method and device based on a virtual companion clock. The method includes: Step 1. Obtain the cumulative clock error measurement value of the time synchronization system; Step 2. Estimate the time synchronization error based on the Kalman filter; Step 3. Estimate the time synchronization error of the virtual companion clock of the local clock; Step 4. Comprehensively determine whether the k-th time synchronization link is under attack; Step 5. Supervise the Kalman filter to determine whether it diverges. By constructing a virtual companion clock for the local clock, the present invention can, on the one hand, comprehensively determine the security state of the channel in combination with the Kalman filter calculation result of the local clock, and on the other hand, supervise the state of the Kalman filter algorithm and intervene in a timely manner, so as to improve the time synchronization accuracy of the time synchronization system in a time synchronization link that may be under attack.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of time synchronization systems, and in particular, to a Kalman filter time synchronization method and device based on a virtual companion clock. Background Art

[0002] The Kalman filter is a method based on minimum variance that can filter noise from an observation signal containing noise and solve the optimal estimate of the system state or the true signal. It is widely used in dynamic system estimation, so the Kalman filter is widely used in time synchronization systems. For a relatively stable environment, the traditional Kalman filter algorithm can obtain good prediction results. However, when data is abnormal or missing, the prediction results of the traditional Kalman filter algorithm will fluctuate.

[0003] In a time synchronization system, the time synchronization channel may be subject to external malicious attacks, resulting in observation results that deviate far from the expected value. In this case, once the attack behavior is misjudged, it will cause the estimated value of the Kalman filter to deviate, and this deviation will continuously affect the subsequent synchronization effect of the system, seriously affecting the clock synchronization accuracy, and even causing the Kalman filter algorithm to diverge. At the same time, rounding errors and truncation errors accumulate and propagate in the iterative calculation of the variance matrix, which may cause the error variance matrix to lose symmetric positive definiteness, and ultimately cause the calculation result of the Kalman gain to be unstable. Summary of the Invention

[0004] To solve the above problems, on the one hand, it is necessary to improve the accuracy of channel attack recognition and reduce the decline in synchronization accuracy caused by misjudgment; on the other hand, it is necessary to supervise and intervene in the Kalman filter algorithm, and correct it when it has a divergence trend to ensure the synchronization accuracy and stability of the time synchronization system.

[0005] Therefore, the present invention proposes a Kalman filter time synchronization method and device based on a virtual companion clock. By constructing a virtual companion clock of the local clock, on the one hand, it comprehensively determines the security state of the channel with the calculation result of the Kalman filter of the local clock; on the other hand, the virtual companion clock is updated in real time according to the measurement value and will not generate cumulative errors, and can be used to supervise the state of the Kalman filter algorithm and intervene in a timely manner to improve the time synchronization accuracy of the time synchronization system in a time synchronization link that may be attacked.

[0006] The technical solution adopted by the present invention is as follows:

[0007] A Kalman filter time synchronization method based on a virtual companion clock, comprising:

[0008] Step 1. Obtain the cumulative clock error measurement value of the time synchronization system: Based on the time synchronization error calculation model, use a time error measurement instrument to calculate and obtain the current non-updated cumulative time error between the reference clock and the local clock;

[0009] Step 2. Estimate the time synchronization error based on the Kalman filter: Based on the Kalman filter and the current non-updated cumulative time error between the reference clock and the local clock, determine whether the time synchronization system is under attack through the threshold comparison method;

[0010] Step 3. Estimate the time synchronization error of the virtual companion clock of the local clock: Calculate the measurement value of the virtual companion clock of the local clock, and determine whether the time synchronization system is under attack based on this;

[0011] Step 4. Comprehensively determine whether the k-th time synchronization link is under attack: If at least one of Step 2 and Step 3 determines that the time synchronization system is under attack, then finally determine that the link at the current moment is under attack, and the time synchronization system is updated according to the predicted value; otherwise, it is not under attack, and proceed to Step 5; Whether under attack or not, both the Kalman filter and the virtual companion clock are compensated and updated;

[0012] Step 5. Supervise the Kalman filter to determine whether it diverges: Calculate the difference between the compensation update amounts of the Kalman filter and the virtual companion clock. If the absolute value of the difference is less than the preset value, it is determined that the Kalman filter does not diverge, and continue to iterate; otherwise, it is determined that the Kalman filter diverges, and use the compensation update amount of the virtual companion clock to correct the compensation update amount of the Kalman filter, and continue to iterate.

[0013] Further, in Step 1, the current non-updated cumulative time error between the reference clock and the local clock is:

[0014]

[0015] where Δt RealUpdate (i) is the update amount of the local clock at the i-th time, Δt RealMeasure (k) is the clock error measured by the time synchronization system at the k-th time, Δt sum_RealMeasure (k) is the cumulative time error of the time synchronization system without synchronization correction at the k-th time point.

[0016] Further, Step 2 includes the following sub-steps:

[0017] Step 201. Conduct a priori estimation:

[0018] Based on the best state estimation at the previous moment, i.e., the posterior estimation Predict the state X at the current moment - (k) = [θ- (k), γ - (k)] T ;

[0019] The prior estimation model is:

[0020]

[0021] where τ is the time interval between the (k - 1)th and kth moments, and the prior estimation model is an iterative process. The initial state can be obtained through the measurement statistics of the time synchronization system;

[0022] The prior estimation equation can be expressed as:

[0023]

[0024] Step 202. Determine the system observation equation:

[0025]

[0026] In the formula, H is the observation matrix from the state variable to the observed quantity, and the observed quantity Z(k) = Δt Sum_RealMeasure (t), σ v is the standard deviation of the noise introduced in the transmission process included in the observed value, which is composed of the timestamp noise σ v,t and the transmission noise σ v,d ;

[0027] Step 203. Calculate the prior estimation covariance matrix of the state variable:

[0028]

[0029] In the formula, σ θ is the standard deviation of the local clock phase noise, and σ γ is the standard deviation of the local clock frequency noise.

[0030] Step 204. Determine the Kalman gain:

[0031] K(n) = P - (n) · H T · (H · P - (n) · H T + R) -1

[0032] where R is the observation noise covariance matrix.

[0033] Step 205. Calculate the posterior estimation covariance matrix:

[0034]

[0035] Step 206. Optimal estimation of Kalman state variables:

[0036] Based on the prior estimated state and the observed state at the current moment, estimate the optimal state.

[0037]

[0038] Step 207. Determine the update amount based on the optimal estimation of state variables:

[0039]

[0040] Step 208. Determine whether the time synchronization system is under attack through the threshold comparison method:

[0041] If |Δt RealMeasure (k) - τ·γ - (k)| < KalmanThresh Attack , it is determined that the time synchronization system is not under attack; otherwise, it is determined that the time synchronization system is not under attack.

[0042] Furthermore, the state variables include the cumulative phase error and frequency error of the time synchronization system.

[0043] Furthermore, Step 3 includes the following sub-steps:

[0044] Step 301. Calculate the k-th measurement value of the virtual companion clock of the local clock:

[0045]

[0046]

[0047] Step 302. Determine the local clock update amount Δt FicUpdate (k) = Δt FicMeasure (k);

[0048] Step 303. Based on the virtual companion clock measurement value Δt FicMeasure (k) of the local clock, determine whether the time synchronization system is under attack:

[0049] If |Δt FicMeasure (k) - τ·ΔF′ Fic | < FicThresh Attack , it is determined that the time synchronization system is not under attack; otherwise, it is determined that the time synchronization system is not under attack; where ΔF ′ Fic is the optimal frequency array ΔF FicWhen the latest result indicates that no attack has occurred, the current frequency error value is updated into the best frequency array.

[0050] Furthermore, if at least one of Step 2 and Step 3 determines that the time synchronization system has been attacked, it is considered that the link is under attack at the current moment. The time synchronization system is updated according to the predicted value, and the Kalman filter will use the prior estimate value As the compensation update amount, the virtual companion clock will use ΔF′ Fic *τ as the compensation update amount; if both are determined not to be attacked, the Kalman filter will use the posterior estimate value Δt KalmanUpdate (k) as the compensation update amount, and the virtual companion clock will use Δt FicUpdate (k) as the compensation update amount.

[0051] Furthermore, under the condition that both Step 2 and Step 3 determine that the time synchronization system has not been attacked, calculate the difference between the compensation update amounts of the Kalman filter and the virtual companion clock. If the absolute value of the difference is less than the preset value, that is, |Δt KalmanUpdate (k) - Δt FicUpdate (k)| < Thresh stable , it is determined that the Kalman filter has not diverged, and continue to iterate; otherwise, it is determined that the Kalman filter has diverged, and use the compensation value of the virtual companion clock to correct the compensation value of the Kalman filter; at the same time, let be used as the correction value of the posterior estimate value of the Kalman filter, and continue to iterate.

[0052] A Kalman filter time synchronization device based on a virtual companion clock, based on the foregoing time synchronization method, the time synchronization device includes:

[0053] A communication interface unit, configured to obtain time error measurement data, and feedback the time synchronization calculation result to the local clock for time synchronization adjustment;

[0054] A memory unit, configured to store the Kalman filter algorithm program of the virtual companion clock and store the relevant parameters of the time synchronization system;

[0055] A data processing unit, configured to run the algorithm program to obtain the time synchronization calculation result and control the time synchronization system.

[0056] The beneficial effects of the present invention are as follows:

[0057] The present invention proposes a Kalman filter time synchronization method and device based on a virtual companion clock. During the clock synchronization process of the Kalman filter, a virtual companion clock that directly updates using measurement values is constructed to supervise the system. The Kalman filter can effectively filter out random noise during the time synchronization process. However, its iterative update characteristic determines that it is insensitive to attacks and has a risk of iterative divergence. The virtual companion clock directly updates using measurement values, and the time synchronization error is directly updated and compensated into the system through the measurement values, without an error accumulation effect, and is sensitive to attacks, but cannot filter out the interference of system noise. The present invention comprehensively considers the characteristics of the two time synchronization methods. On the one hand, by comprehensively determining the link security state through the Kalman filter clock and its virtual companion clock, the accuracy of channel attack recognition can be improved, and the impact of attacks caused by misjudgment on the system synchronization accuracy can be reduced. On the other hand, the virtual companion clock supervises and intervenes in the Kalman filter algorithm, and corrects it when it has a divergence trend, ensuring the synchronization accuracy and stability of the time synchronization system. Description of the Drawings

[0058] Figure 1 Flowchart of the Kalman filter time synchronization method based on a virtual companion clock.

[0059] Figure 2 Relationship diagram between the clock difference measurement value and the Kalman clock difference estimate value under the condition that the attack is not recognized at 3000 seconds.

[0060] Figure 3 Local enlarged view of the clock difference measurement value and the Kalman clock difference estimate value at 3000 seconds under the condition that the attack is not recognized at 3000 seconds.

[0061] Figure 4 Relationship diagram between the true clock difference value and the Kalman clock difference estimate value under the condition that the attack is not recognized at 3000 seconds.

[0062] Figure 5 Local enlarged view of the true clock difference value and the Kalman clock difference estimate value at 3000 seconds under the condition that the attack is not recognized at 3000 seconds.

[0063] Figure 6 Influence diagram of the mutation of the Kalman filter estimate value on the time synchronization accuracy at 3001 seconds.

[0064] Figure 7 Local enlarged view at 3000 seconds of the influence of the mutation of the Kalman filter estimate value on the time synchronization accuracy at 3001 seconds.

[0065] Figure 8 Schematic diagram of the Kalman filter time synchronization device based on a virtual companion clock. Detailed Implementation Manner

[0066] To have a clearer understanding of the technical features, objectives, and effects of the present invention, the specific embodiments of the present invention will now be described. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention, that is, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present invention.

[0067] Embodiment 1

[0068] This embodiment provides a Kalman filter time synchronization method based on a virtual companion clock, as Figure 1 shown, including:

[0069] Step 1. Obtain the cumulative clock error measurement value of the time synchronization system: Based on the time synchronization error calculation model, through a time error measurement instrument, calculate and obtain the current non-updated cumulative time error between the reference clock and the local clock.

[0070] Step 2. Estimate the time synchronization error based on the Kalman filter: Based on the Kalman filter and the current non-updated cumulative time error between the reference clock and the local clock, determine whether the time synchronization system is under attack through the threshold comparison method.

[0071] Step 3. Estimate the time synchronization error of the virtual companion clock of the local clock: Calculate the measurement value of the virtual companion clock of the local clock and use this to determine whether the time synchronization system is under attack.

[0072] Step 4. Comprehensively determine whether the kth time synchronization link is under attack: If at least one of Step 2 and Step 3 determines that the time synchronization system is under attack, then finally determine that the current link is under attack, and the time synchronization system is updated according to the predicted value; otherwise, it is not under attack, and execute Step 5; Whether or not it is under attack, the Kalman filter and the virtual companion clock are both compensated and updated.

[0073] Step 5. Supervise the Kalman filter to determine whether it diverges: Calculate the difference between the compensation update amounts of the Kalman filter and the virtual companion clock. If the absolute value of the difference is less than the preset value, it is determined that the Kalman filter does not diverge and continue to iterate; otherwise, it is determined that the Kalman filter diverges, and use the compensation update amount of the virtual companion clock to correct the compensation update amount of the Kalman filter and continue to iterate.

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

[0075] Step 1. Obtain the cumulative clock error measurement value of the time synchronization system:

[0076] Based on the time synchronization error calculation model, through a time error measuring instrument, calculate and obtain the current non-updated cumulative time error between the reference clock and the local clock, denoted as:

[0077]

[0078] where Δt RealUpdate (i) is the update amount of the local clock at the i-th time, and Δt RealMeasure (k) is the clock error measured by the time synchronization system at the k-th time, and Δt Sum_RealMeasure (k) is the assumed non-synchronized corrected cumulative time error of the time synchronization system at the k-th time point.

[0079] Step 2. Perform time synchronization error estimation based on the Kalman filter:

[0080] Step 201. Perform a priori estimation:

[0081] Based on the best state estimation at the previous moment, i.e., the posterior estimation Predict the state X at the current moment - (k) = [θ - (k), γ - (k)] T . Preferably, the state variables include the cumulative phase error and frequency error of the time synchronization system.

[0082] The a priori estimation model is:

[0083]

[0084] where τ is the time interval between the (k - 1)-th moment and the k-th moment, and the a priori estimation model is an iterative process, and the initial state can be obtained through the measurement statistics of the time synchronization system.

[0085] The a priori estimation equation can be expressed as:

[0086]

[0087] Step 202. Determine the system observation equation:

[0088]

[0089] In the formula, H is the observation matrix from the state variable to the observed quantity, and the observed quantity Z(k) = Δt Sum_RealMeasure (k), and σ v is the standard deviation of the noise introduced in the transmission process included in the observed value, which is composed of the timestamp noise σ v,t and the transmission noise σ v,d .

[0090] Step 203. Calculation of the prior estimate covariance matrix of the state variable:

[0091]

[0092] In the formula, σ θ is the standard deviation of the local clock phase noise, and σ γ is the standard deviation of the local clock frequency noise.

[0093] Step 204. Determine the Kalman gain:

[0094] K(n) = P - (n) · H T · (H · P - (n) · H T + R) -1

[0095] where R is the observation noise covariance matrix.

[0096] Step 205. Calculation of the posterior estimate covariance matrix:

[0097]

[0098] Step 206. Optimal estimate of the Kalman state variable:

[0099] Integrate the prior estimate state and the observation state at the current moment to estimate the optimal state.

[0100]

[0101] Step 207. Determine the update amount based on the optimal estimate of the state variable:

[0102]

[0103] Step 208. Determine whether the time synchronization system is under attack through the threshold comparison method:

[0104] If |Δt RealMeasure (k) - τ · γ - (k)| < KalmanThresh Attack , it is determined that the time synchronization system is not under attack; otherwise, it is determined that the time synchronization system is under attack.

[0105] In Step 208, Δt RealMeasure (k) reflects the true state of the link, which includes possible attack values and the time error of the system. γ -(k) is the current system frequency error predicted based on the posterior frequency estimate of the previous moment, which reflects the error relationship between clocks and has little relation with the true state of the system link. Therefore, Δt RealMeasure (k) - τ·γ - (k) can more accurately reflect the true security state of the system link.

[0106] The Kalman filtering algorithm can effectively resist the influence of abnormal data on the time scale, and can improve the accuracy and stability of the time scale. Combining the analysis of the Kalman filtering model, the predicted data is related to the previous optimal estimate, and the current predicted data is affected by the previous one. For the Kalman filtering time synchronization method in step 2, the system's response to attacks is relatively slow. When the attack is misidentified, the impact of the attack on the system accuracy cannot be immediately fully reflected, showing that the synchronization accuracy is less affected by the attack; when the system is affected by the attack and shows a large synchronization error, after the attack is withdrawn, the system cannot immediately restore the synchronization accuracy, but instead slowly restores the time synchronization accuracy in a decaying oscillation trend with iterations. Therefore, the Kalman filtering method has a relatively slow response to attacks.

[0107] Such as Figure 2 and Figure 3 shown, there is an attack at the 3000th second, and the measured value is affected by the attack with a large mutation. Assuming that the Kalman filter fails to correctly identify the attack and updates the attack into the system, since the Kalman filter has a relatively slow response to attacks, the system synchronization accuracy is not significantly affected. As Figure 4 and Figure 5 shown is the relationship and local enlarged view between the true value of the clock difference and the Kalman clock difference estimate under the condition that the attack at the 3000th second is not recognized.

[0108] Such as Figure 6 and Figure 7 shown, there is a large error in the system posterior estimate at the 3001st second. As the iteration progresses, the synchronization error shows a decaying oscillation trend. After about 30 iterations, the Kalman filtering system restores the synchronization accuracy.

[0109] Step 3. Estimation of the time synchronization error of the virtual companion clock of the local clock:

[0110] Step 301. Calculate the kth measurement value of the virtual companion clock of the local clock:

[0111]

[0112] Step 302. Determine the local clock update amount Δt FicUpdate (k) = Δt FicMeasure (k);

[0113] Step 303. Based on the virtual companion clock measurement value Δt of the local clockFicMeasure (k), determine whether the time synchronization system is under attack:

[0114] If |Δt FicMeasure (k) - τ·ΔF′ Fic | < FicThresh Attack , then determine that the time synchronization system is not under attack; otherwise, determine that the time synchronization system is not under attack; where ΔF′ Fic is the latest result of the optimal frequency array ΔF Fic , when it is determined that there is no attack, update the current frequency error value ΔF FicMeasure (k) into the optimal frequency array.

[0115] The virtual companion clock in step 3 uses the direct update method. The synchronization system directly updates each measurement value into the clock system. The system is relatively sensitive to attacks. When an attack is not recognized, the attack will be directly reflected in the synchronization accuracy. When the attack is withdrawn, the system will directly update according to the measurement value and immediately restore the synchronization accuracy. Therefore, the direct update method only relates to the current measurement, has no continuous influence, has good dynamic performance, and has no error accumulation effect.

[0116] Step 4. Comprehensively determine whether the k-th time synchronization link is under attack:

[0117] If at least one of step 2 and step 3 determines that the time synchronization system is under attack, it is considered that the link is under attack at the current moment. The time synchronization system is updated according to the predicted value. The Kalman filter will use the prior estimate value as the compensation update amount, and the virtual companion clock will use ΔF′ Fic *τ as the compensation update amount; if both are determined to be not under attack, the Kalman filter will use the posterior estimate value Δt KalmanUpdate (k) as the compensation update amount, and the virtual companion clock will use Δt FicUpdate (k) as the compensation update amount.

[0118] Step 5. Supervise the Kalman filter to determine whether it diverges:

[0119] Combining the response characteristics of the Kalman filter to attacks and the response characteristics of the direct update method to attacks, compare the posterior estimate value (update value) of the Kalman filter with the update value of the virtual companion clock, and judge through the difference between the two time error predictions.

[0120] Under the condition that both step 2 and step 3 determine that the time synchronization system is not under attack, calculate the difference between the compensation update amounts of the Kalman filter and the virtual companion clock. If the absolute value of the difference is less than the preset value, that is, |Δt KalmanUpdate (k) - Δt FicUpdate(k)|<Thresh stable , it is determined that the Kalman filter has not diverged, and the iteration is continued; otherwise, it is determined that the Kalman filter has diverged, and the compensation value of the virtual companion clock is used to correct the compensation value of the Kalman filter; at the same time, let be used as the correction value of the posterior estimate of the Kalman filter, and the iteration is continued.

[0121] Embodiment 2

[0122] On the basis of Embodiment 1, this embodiment:

[0123] As Figure 8 shown, this embodiment provides a Kalman filter time synchronization device based on a virtual companion clock, including a communication interface unit, a memory unit, and a data processing unit. The communication interface unit is configured to obtain time error measurement data and feedback the time synchronization calculation result to the local clock for time synchronization adjustment. The memory unit is configured to store the Kalman filter algorithm program of the virtual companion clock and store the relevant parameters of the time synchronization system. The data processing unit is configured to run the algorithm program to obtain the time synchronization calculation result and control the time synchronization system.

[0124] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

Claims

1. A Kalman filter time synchronization method based on a virtual accompanying clock, characterized in that Including: Step 1. Obtain the cumulative clock error measurement value of the time synchronization system: Based on the time synchronization error calculation model, through a time error measurement instrument, calculate and obtain the current non-updated cumulative time error between the reference clock and the local clock; Step 2. Estimate the time synchronization error based on the Kalman filter: Based on the Kalman filter and the current non-updated cumulative time error between the reference clock and the local clock, determine whether the time synchronization system is under attack through the threshold comparison method; Step 3. Estimate the time synchronization error of the virtual companion clock of the local clock: Calculate the measurement value of the virtual companion clock of the local clock, and determine whether the time synchronization system is under attack based on this; Step 4. Comprehensively determine whether the kth time synchronization link is under attack: If at least one of Step 2 and Step 3 determines that the time synchronization system is under attack, then finally determine that the link at the current moment is under attack, and the time synchronization system is updated according to the predicted value; Otherwise, it is not under attack, and execute Step 5; Whether it is under attack or not, the Kalman filter and the virtual companion clock are both compensated and updated; Step 5. Supervise the Kalman filter to determine whether it diverges: Calculate the difference between the compensation update amounts of the Kalman filter and the virtual companion clock. If the absolute value of the difference is less than the preset value, it is determined that the Kalman filter does not diverge, and continue to iterate; Otherwise, it is determined that the Kalman filter diverges, and use the compensation update amount of the virtual companion clock to correct the compensation update amount of the Kalman filter, and continue to iterate.

2. The Kalman filter time synchronization method based on a virtual companion clock according to claim 1, wherein In Step 1, the current non-updated cumulative time error between the reference clock and the local clock is: where Δt RealUpdate (i) is the update amount of the local clock for the i-th time, Δt RealMeasure (k) is the clock error measured by the time synchronization system for the k-th time, Δt Sum_RealMeasure (k) is the cumulative time error of the time synchronization system without synchronization correction at the k-th time point.

3. The Kalman filter time synchronization method based on a virtual companion clock according to claim 2, wherein Step 2 includes the following sub-steps: Step 201. Conduct a priori estimation: Based on the best state estimate at the previous moment, i.e., the posterior estimate Predict the state X at the current moment - (k)=[θ - (k), γ - (k)] T ; The a priori estimation model is: where τ is the time interval between the (k - 1)-th moment and the k-th moment, and the prior estimation model is an iterative process with the initial state which can be obtained through the measurement statistics of the time synchronization system; The a priori estimation equation can be expressed as: Step 202. Determine the system observation equation: where H is the observation matrix from the state variable to the observation quantity, and the observation quantity Z(k) = Δt Sum_RealMeasure (k), σ v is the standard deviation of the noise introduced by the transmission process included in the observation value, and is composed of the timestamp noise σ v,t and the transmission noise σ v,d ; Step 203. Calculate the covariance matrix of the a priori estimation of the state variables: where σ θ is the standard deviation of the local clock phase noise, and σ γ is the standard deviation of the local clock frequency noise, Step 204. Determine the Kalman gain: K(n) = P - (n)·H T ·(H·P - (n)·H T +R) -1 where R is the observation noise covariance matrix, Step 205. Calculation of the posterior estimation covariance matrix: Step 206. Optimal estimation of the Kalman state variables: Integrate the a priori estimated state and the observed state at the current moment to estimate the optimal state, Step 207. Determine the update amount based on the optimal estimation of the state variables: Step 208. Determine whether the time synchronization system is under attack through the threshold comparison method: If |Δt RealMeasure (k)-τ·γ - (k)| < KalmanThresh Attack , it is determined that the time synchronization system has not been attacked; otherwise, it is determined that the time synchronization system has not been attacked.

4. The Kalman filter time synchronization method based on a virtual companion clock according to claim 3, characterized in that The state variables include the cumulative phase error and frequency error of the time synchronization system.

5. The Kalman filter time synchronization method based on a virtual companion clock according to claim 3, wherein Step 3 includes the following sub-steps: Step 301. Calculate the kth measurement value of the virtual companion clock of the local clock: ΔF FicMeasure (k) = {Δt FicMeasure (k) - [Δt FicMeasure (k - 1) - Δt FicUpdate (k - 1)]} / τ; Step 302. Determine the local clock update amount Δt FicUpdate (k) = Δt FicMeasure (k); Step 303. Determine whether the time synchronization system is under attack based on the measured value Δt FicMeasure (k) of the virtual companion clock based on the local clock: If |Δt FicMeasure (k)-τ·ΔF′ Fic | < FicThresh Attack , it is determined that the time synchronization system has not been attacked; otherwise, it is determined that the time synchronization system has not been attacked; where ΔF′ Fic is the latest result of the optimal frequency array ΔF Fic When it is determined that no attack has occurred, the current frequency error value ΔF FicMeasure (k) is updated into the optimal frequency array.

6. The Kalman filter time synchronization method based on a virtual companion clock according to claim 5, characterized in that If at least one of Step 2 and Step 3 determines that the time synchronization system is under attack, it is considered that the link is under attack at the current moment. The time synchronization system is updated according to the predicted value, and the Kalman filter will use the prior estimate value as the compensation update amount, and the virtual companion clock will use ΔF′ Fic *τ as the compensation update amount; if both are determined not to be under attack, the Kalman filter will use the posterior estimate value Δt KalmanUpdate (k) as the compensation update amount, and the virtual companion clock will use Δt FicUpdate (k) as the compensation update amount.

7. The Kalman filter time synchronization method based on a virtual companion clock according to claim 6, wherein Under the condition that it is determined in both Step 2 and Step 3 that the time synchronization system has not been attacked, calculate the difference between the compensation update amount of the Kalman filter and the virtual companion clock. If the absolute value of the difference is less than the preset value, that is, |Δt KalmanUpdate (k) - Δt FicUpdate (k)| < Thresh stable , it is determined that the Kalman filter has not diverged, and continue to execute iteratively; otherwise, it is determined that the Kalman filter has diverged, and use the compensation value of the virtual companion clock to correct the compensation value of the Kalman filter; at the same time, let be the correction value of the posterior estimate of the Kalman filter, and continue to iterate.

8. A Kalman filter time synchronization device based on a virtual accompanying clock, based on the time synchronization method according to any one of claims 1-7, characterized in that, The time synchronization device includes: A communication interface unit, configured to obtain time error measurement data, feedback the time synchronization calculation result to the local clock for time synchronization adjustment; A memory unit, configured to store the Kalman filter algorithm program of the virtual companion clock and store the relevant parameters of the time synchronization system; A data processing unit, configured to run the algorithm program to obtain the time synchronization calculation result and control the time synchronization system.

Citation Information

Patent Citations

  • A parameter estimation algorithm of rubidium atomic clock based on improved Kalman filter

    CN109508510A

  • Method and device for improving time synchronization precision of industrial Internet of Things terminal

    CN114785439A