Clock kalman filter initialization method and data link terminal

By detecting the effective length value of RTT time difference measurement data and using phased filtering logic, the clock Kalman filter initialization problem was solved, enabling fast and stable time synchronization of the data link system in complex electromagnetic environments.

CN122340601APending Publication Date: 2026-07-03FEIXIN INTELLIGENT CONTROL (CHENGDU) TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FEIXIN INTELLIGENT CONTROL (CHENGDU) TECH CO LTD
Filing Date
2026-06-05
Publication Date
2026-07-03

Smart Images

  • Figure CN122340601A_ABST
    Figure CN122340601A_ABST
Patent Text Reader

Abstract

This application discloses a clock Kalman filter initialization method and a data link terminal. The method includes: when the data link terminal receives RTT time difference measurement data obtained through round-trip time measurement, detecting the effective length value of the time difference data record used to store the RTT time difference measurement data; based on the effective length value, executing corresponding phased filtering logic to judge the RTT time difference measurement data, and storing the judged RTT time difference measurement data; when the effective length value reaches a preset length value, calculating an initial state vector and an initial covariance matrix based on the stored RTT time difference measurement data to initialize the clock Kalman filter. Through this application's solution, the received RTT time difference measurement data can be judged and stored, and the clock Kalman filter can be initialized using the stored RTT time difference measurement data, ensuring that the Kalman filter operates quickly and stably, and the data link terminal can achieve accurate time synchronization in a short time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of time synchronization technology for wireless communication networks and data link systems, and in particular to a clock Kalman filter initialization method and a data link terminal. Background Technology

[0002] Precise time synchronization in a network is not only a prerequisite for normal message exchange in a data link system, but also a crucial foundation for collaborative positioning based on the data link. While satellite navigation system time synchronization is an important means of achieving time synchronization among various equipment units, the availability of satellite navigation system time synchronization is difficult to guarantee in modern operating environments with increasingly fierce electromagnetic warfare. Therefore, more and more data link systems typically consider using Round-Trip Time (RTT) combined with a Kalman filter algorithm to achieve precise autonomous time synchronization. The main process is as follows: the member to be synchronized (the querying end) sends an RTT query message to the synchronized member (the responding end) at the beginning of its time slot; the synchronized member measures the arrival time of this message signal and sends the value to the member to be synchronized via an RTT response message at a fixed time; the member to be synchronized measures the arrival time of the RTT response message signal, parses the value in the message, obtains its own time deviation, and sends it to a clock Kalman filter for processing. The clock Kalman filter effectively reduces the error in the RTT time difference measurement, and more importantly, it can output a predicted value in real time between two RTTs to adjust the time, thus achieving precise network time synchronization with lower communication resource overhead.

[0003] Filter initialization is the crucial first step in clock Kalman filtering. However, in practical applications, due to multipath interference and other reasons, singular values ​​may exist in the RTT time difference measurement data. The existing time synchronization methods based on Kalman filtering have not yet clearly defined the clock Kalman filter initialization method. Summary of the Invention

[0004] This application provides a clock Kalman filter initialization method and a data link terminal, which solves the technical problem in the prior art of how to synchronize the autonomous time based on RTT time difference measurement data and Kalman filter in a data link system under complex electromagnetic environments or multipath interference. This enables the data link terminal to resist interference in the most vulnerable initialization stage, thereby laying a reliable foundation for stable and accurate time synchronization of the entire network.

[0005] In a first aspect, embodiments of this application provide a clock Kalman filter initialization method, the initialization method comprising: S1. When the data link terminal receives RTT time difference measurement data obtained by round-trip time measurement, it detects the effective length value of the time difference data record used to store the RTT time difference measurement data, wherein the RTT time difference measurement data includes at least: time difference value, measurement error, and update time. S2. Based on the effective length value, execute the corresponding phased filtering logic to judge the RTT time difference measurement data; when the RTT time difference measurement data passes the filtering logic of the corresponding phase, store the RTT time difference measurement data as valid data in the corresponding position of the time difference data record, and update the effective length value; otherwise, discard or replace the RTT time difference measurement data according to the filtering logic. S3. When the effective length value reaches the preset length value, calculate the initial state vector and initial covariance matrix of the clock Kalman filter based on the stored RTT time difference measurement data. S4. Based on the initial state vector and the initial covariance matrix, initialize the clock Kalman filter so that the clock Kalman filter enters a working state capable of real-time filtering and time deviation prediction.

[0006] Preferably, step S2 includes: when the effective length value is 0, the phased filtering logic is as follows: The RTT time difference measurement data is directly stored in the first position of the time difference data record, and the effective length value is updated to 1.

[0007] Preferably, step S2 includes: when the effective length value is 1, the phased filtering logic is as follows: The clock drift speed is obtained based on the RTT time difference measurement data and the first RTT time difference measurement data stored in the time difference data record; If the absolute value of the clock drift speed is less than or equal to the preset maximum drift speed, the RTT time difference measurement data is stored in the second position of the time difference data record, and the effective length value is updated to 2; If the absolute value of the clock drift speed is greater than the preset maximum drift speed, the RTT time difference measurement data is stored in the first position of the time difference data record, and the effective length value is kept at 1. Preferably, the clock drift speed is calculated according to the following formula:

[0008] in, For clock drift speed, and These are the time difference value and update time in the RTT time difference measurement data, respectively. and These are the time difference value and update time in the first RTT time difference measurement data stored in the time difference data record, respectively; The maximum drift speed is calculated according to the following formula:

[0009] in, For maximum drift speed, f For the accuracy of the data link terminal clock.

[0010] Preferably, step S2 includes: when the effective length value is 2, the phased filtering logic is as follows: The estimated RTT time difference value is obtained by estimating the time difference value in the first RTT time difference measurement data stored in the time difference data record and the time difference value in the second RTT time difference measurement data stored in the time difference data record. The error value is obtained based on the time difference value in the RTT time difference measurement data and the estimated RTT time difference value. When the error value is less than the preset error threshold, the RTT time difference measurement data is stored in the third position of the time difference data record, and the effective length value is updated to 3.

[0011] Preferably, the estimated RTT time difference is calculated according to the following formula:

[0012] in, To estimate the RTT time difference, and The time difference value and update time are the first stored RTT time difference measurement data in the time difference data record. and The second position in the time difference data record stores the time difference value and update time from the RTT time difference measurement data. This refers to the update time in the RTT time difference measurement data; The error value is calculated according to the following formula:

[0013] in, The error value is... The time difference value in the RTT time difference measurement data; The error threshold value is ,in, This represents the maximum value of the measurement error in the three RTT time difference measurement data.

[0014] Preferably, step S3 includes: The initial state vector and initial covariance matrix of the clock Kalman filter are obtained based on the RTT time difference measurement data stored in the first, second and third positions of the time difference data record. The clock Kalman filter is initialized based on the initial state vector and the initial covariance matrix. The initial state vector of the clock Kalman filter is calculated based on the stored RTT time difference measurement data according to the following formula:

[0015] in, Let be the initial state vector of the clock Kalman filter. and The time difference value and time are the first stored RTT time difference measurement data in the time difference data record. and The time difference value and time are stored in the second position of the time difference data record, which is the RTT time difference measurement data. and The time difference value and update time are stored in the third position of the time difference data record in the RTT time difference measurement data; The covariance matrix of the clock Kalman filter is calculated based on the stored RTT time difference measurement data according to the following formula:

[0016] in, The initial covariance matrix, The measurement error is stored in the third position of the time difference data record. , , These are the update times stored in the 1st, 2nd, and 3rd positions of the time difference data record, which are the RTT time difference measurement data.

[0017] Preferably, the phased screening logic further includes: When the error value is equal to or greater than the preset error threshold, the RTT time difference measurement data is determined to be abnormal data, and the abnormality count value is set to 1. When the number of abnormal occurrences reaches a preset number, the newly received RTT time difference measurement data is stored in the first position of the time difference data record, and the effective length of the time difference data record is set to 1. When the number of abnormal occurrences is less than the preset number of occurrences, the newly received RTT time difference measurement data is processed according to steps S1-S3.

[0018] Secondly, embodiments of this application also provide a data link terminal, including: a processor; a memory for storing processor-executable instructions; when the processor executes the executable instructions, it implements the clock Kalman filter initialization method as described above.

[0019] Thirdly, embodiments of this application also provide a non-volatile computer-readable storage medium, including a computer program or instructions for storing a clock Kalman filter initialization method as described above, which, when executed, causes the clock Kalman filter initialization method described above to be implemented.

[0020] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: This application embodiment detects the effective length of the time difference data record storing the RTT time difference measurement data when receiving RTT time difference measurement data, selects the corresponding processing method, judges and stores the RTT time difference measurement data, and finally optimizes the clock Kalman filter based on the stored valid RTT time difference measurement data. This effectively solves the technical problem of how to initialize the Kalman filter in the time synchronization method based on Kalman filtering in the prior art. It realizes the judgment and storage of the received RTT time difference measurement data, and initializes the clock Kalman filter based on the stored time difference measurement data, ensuring that the Kalman filter works quickly and stably, so that the data link terminal can quickly achieve accurate time synchronization in a short time. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a schematic flowchart of the clock Kalman filter initialization method provided in the embodiments of this application; Figure 2 This is a schematic diagram of the processing flow when RTT time difference measurement data is abnormal, provided in an embodiment of this application. Figure 3 This is a schematic diagram illustrating the effect of time difference data recording provided in the embodiments of this application. Figure 1 ; Figure 4 This is a schematic diagram illustrating the effect of time difference data recording provided in the embodiments of this application. Figure 2 ; Figure 5This is a schematic diagram illustrating the effect of time difference data recording provided in the embodiments of this application. Figure 3 ; Figure 6 This is a schematic diagram illustrating the effect of time difference data recording provided in the embodiments of this application. Figure 4 ; Figure 7 This is a schematic diagram illustrating the effect of time difference data recording provided in the embodiments of this application. Figure 5 . Detailed Implementation

[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0024] The following description of some technologies involved in the embodiments of this application is provided to aid understanding and should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and conciseness, some descriptions of well-known functions and structures are omitted in the following description.

[0025] refer to Figure 1 As shown in the embodiment of this application, a clock Kalman filter initialization method includes: S1. When the data link terminal receives the RTT time difference measurement data obtained by round-trip time measurement, it detects the effective length value of the time difference data record used to store the RTT time difference measurement data, wherein the RTT time difference measurement data includes at least: time difference value, measurement error, and update time.

[0026] In the embodiments of this application, the interrogating end in the data communication link initiates an RTT query message to the responding end at the start of its local time slot and starts local timing. The responding end measures the arrival time TOA_ask of the RTT query message and records the time error between the RTT query message and its own time. After a fixed and known delay, it sends an RTT response message back to the interrogating end. The interrogating end measures the arrival time TOA_reply of the RTT response message, parses the arrival time TOA_ask of the RTT query message and the responding end's own time synchronization error from the RTT response message, and calculates the deviation of the interrogating end's local clock from the network time by combining the arrival time TOA_reply of the RTT response message and the fixed and known delay, i.e., the time difference value z. The interrogating end combines its own arrival time TOA measurement error and the responding end's own time synchronization error to obtain the total error of this measurement, i.e., the measurement error r. Finally, based on the time difference value z, the measurement error r, and the current update time t, a complete set of RTT time difference measurement data (time difference value z, measurement error r, update time t) is generated and output. In the embodiments of this application, upon receiving the RTT time difference measurement data, the initialization status of the clock Kalman filter is first determined. If the clock Kalman filter has been initialized, the received RTT time difference measurement data is directly sent to the clock Kalman filter for update processing. If the clock Kalman filter initialization has not been completed, the effective length value of the time difference data record is detected and determined. In this embodiment, the time difference data record is used to store the received RTT time difference measurement data. The effective length value of the corresponding time difference data record changes with the number of bits of the stored RTT time difference measurement data. When no RTT time difference measurement data is stored, the effective length value of the time difference data record is 0. When one RTT time difference measurement data is stored, the effective length value of the time difference data record is 1. When two RTT time difference measurement data are stored, the effective length value of the time difference data record is 2, and so on. In this embodiment, the maximum effective length value of the time difference data record is 3, that is, the maximum number of RTT time difference measurement data stored is three.

[0027] S2. Based on the effective length value, execute the corresponding phased filtering logic to judge the RTT time difference measurement data; when the RTT time difference measurement data passes the filtering logic of the corresponding phase, store the RTT time difference measurement data as valid data in the corresponding position of the time difference data record, and update the effective length value; otherwise, discard or replace the RTT time difference measurement data according to the filtering logic.

[0028] In the embodiments of this application, after detecting the valid length value of the time difference data record, a phased filtering logic for judging the reasonableness of the currently received RTT time difference measurement data is further determined based on the valid length value. In this embodiment, different filtering logics are set according to different valid length values ​​of the time difference data record. The reasonableness of the RTT time difference measurement data is judged by the filtering logic, and the RTT time difference measurement data that passes the reasonableness judgment is stored as valid data in the next storage location.

[0029] In an exemplary embodiment, when the effective length value of the time difference data record is 0, that is, when the first position in the time difference data record has not yet stored any RTT time difference measurement data, the corresponding filtering logic is: directly store the received RTT time difference measurement data into the first position in the time difference data record, and at the same time, update the effective length value of the time difference data record to 1.

[0030] In an exemplary embodiment, when the effective length of the time difference data record is 1, meaning that the first bit of the time difference data record has already stored one RTT time difference measurement data, the corresponding filtering logic is as follows: The clock drift rate is obtained based on the received RTT time difference measurement data and the first RTT time difference measurement data stored in the time difference data record. The clock drift rate is calculated according to the following formula:

[0031] in, For clock drift speed, and These are the time difference value and update time from the received RTT time difference measurement data, respectively. and These are the time difference value and update time stored in the first RTT time difference measurement data in the time difference data record.

[0032] The calculated clock drift speed The absolute value and the preset maximum drift speed Compare the clock drift speeds. The absolute value is less than or equal to the preset maximum drift speed. The RTT time difference measurement data is stored in the second position of the time difference data record, and the effective length value of the time difference data record is updated to 2. In this embodiment, the preset maximum drift speed... Set to twice the clock accuracy, preset maximum drift speed Calculate using the following formula:

[0033] in,f For the clock accuracy of the data link terminal; For example, the clock accuracy of the data link terminal. f When the value is 1.0E-6, the preset maximum drift speed =2×1.0E-6=2.0E-6, because f Since it is a dimensionless constant, it needs to be converted to velocity units. The 10 in the formula... 9 It is the coefficient for converting "seconds" to "nanoseconds" (1 second = 10^12 nanoseconds). 9 (nanoseconds), then the preset maximum drift speed =2×1000ns / s=2000ns / s.

[0034] In the embodiments of this application, when the calculated clock drift speed The absolute value is greater than the preset maximum drift speed When the received RTT time difference measurement data is stored in the first position of the time difference data record, the effective length value of the time difference data record remains unchanged.

[0035] In one exemplary embodiment, when the effective length of the time difference data record is determined to be 2, that is, the first and second digits of the time difference data record have each stored an RTT time difference measurement data, the corresponding filtering logic is as follows: Based on the time difference values ​​stored in the first and second RTT time difference measurements in the time difference data record, the time difference value in the third possible RTT time difference measurement data is estimated. This estimated RTT time difference value is calculated according to the following formula:

[0036] in, To estimate the RTT time difference, and This refers to the time difference value and update time stored in the first RTT time difference measurement data in the time difference data record. and The second element in the time difference data record stores the time difference value and update time from the RTT time difference measurement data. The update time is the received RTT time difference measurement data.

[0037] Furthermore, the obtained estimated RTT time difference value The error value is calculated by comparing it with the time difference value z in the actually received RTT time difference measurement data. This error value Calculate using the following formula:

[0038] in, This refers to the time difference value in the RTT time difference measurement data. To estimate the RTT time difference.

[0039] Furthermore, this error value Compared with the preset error threshold Compare and determine the error value Is it less than the error threshold? In this embodiment, the error threshold value ,in, This represents the maximum measurement error among the three RTT time difference measurements.

[0040] When the error value Less than the error threshold When the error value is reached, the real-time received RTT time difference measurement data is stored in the third position of the time difference data record, and the effective length value of the time difference data record is updated to 3. In this embodiment, the filtering logic further includes: when the error value is reached... Greater than or equal to the error threshold value If the received RTT time difference measurement data is abnormal, the abnormal count is updated to 1. If all subsequent received RTT time difference measurement data are abnormal, the abnormal count is incremented.

[0041] S3. When the effective length value reaches the preset length value, calculate the initial state vector and initial covariance matrix of the clock Kalman filter based on the stored RTT time difference measurement data.

[0042] In the embodiments of this application, during the process of judging the reasonableness and storing the received RTT time difference measurement data according to the above steps, it is also necessary to determine whether the effective length value of the time difference data record has reached the preset length value, for example, the preset length value is 3. In this embodiment, by setting the effective length value to 3, the following effects are achieved: extremely fast initialization speed, initialization is completed immediately after 3 consecutive measurements; the engineering logic is simple and clear, with few branch judgments, making it easy to implement and verify; and the response is rapid, as the rule of "reset after 3 consecutive abnormalities" can quickly discard abnormal data segments and start over.

[0043] When the effective length of the time difference data record reaches the preset length, the initial state vector and initial covariance matrix of the clock Kalman filter are calculated based on the stored RTT time difference measurement data; the initial state vector and initial covariance matrix are then used to initialize the clock Kalman filter.

[0044] In this embodiment, the initial state vector is calculated according to the following formula:

[0045] in, Let be the initial state vector of the clocked Kalman filter. and This refers to the time difference value and update time stored in the first RTT time difference measurement data in the time difference data record. and The second element in the time difference data record stores the time difference value and update time from the RTT time difference measurement data. and The time difference value and update time are stored in the third position of the time difference data record in the RTT time difference measurement data.

[0046] The initial covariance matrix is ​​calculated using the following formula:

[0047] in, The initial covariance matrix, This refers to the measurement error in the RTT time difference measurement data stored in the third position of the time difference data record. , , These are the update times stored in the 1st, 2nd, and 3rd positions of the time difference data record, which are the RTT time difference measurement data.

[0048] Furthermore, the number of anomalies is set to 0, the effective length of the time difference data record is set to 0, and the clock Kalman filter initialization is marked as complete.

[0049] refer to Figure 2 As shown in the embodiments of this application, the processing steps when the received RTT time difference measurement data is abnormal are as follows: S41. When the error value is equal to or greater than the preset error threshold, the RTT time difference measurement data is determined to be abnormal data, and the abnormal number value is set to 1.

[0050] S42. When the received RTT time difference measurement data is continuously abnormal, the number of abnormalities is incremented by 1.

[0051] S43. When the number of abnormal occurrences reaches a preset number, the newly received RTT time difference measurement data is stored in the first position of the time difference data record, and the effective length of the time difference data record is set to 1.

[0052] S44. When the number of abnormal occurrences is less than the preset number of occurrences, the newly received RTT time difference measurement data shall be processed in accordance with the steps of S1-S3.

[0053] In the embodiments of this application, when the error value is used... With error threshold If the received RTT time difference measurement data is found to be abnormal during comparison, the abnormal count is set to 1. If subsequent received RTT time difference measurement data continues to be abnormal, the abnormal count is continuously incremented by 1 until it reaches a preset value. At this point, the most recently received RTT time difference measurement data is stored in the first position of the time difference data record, and the RTT time difference measurement data stored in other positions is cleared. Simultaneously, the effective length of the time difference data record is set to 1, and the abnormal count is set to 0. In this embodiment, when the received RTT time difference measurement data is continuously abnormal, the abnormal count will continue to accumulate. When the accumulated value becomes too large or continues to increase, the old RTT time difference measurement data that has already been stored is matched and verified with the new abnormal data. This can easily cause the initialization process to stall, resulting in the initialization process being stuck indefinitely until normal data is received. Furthermore, it can easily cause the clock Kalman filter to lock onto an incorrect initialization trajectory, causing the initial state to deviate significantly from the true value, resulting in divergence during initialization (the Kalman filter diverges during the initialization phase). Therefore, in this embodiment of the application, the maximum number of abnormal occurrences is set to 3. That is, when abnormal data occurs 3 times in a row, it is determined that the current "data context" has expired, the first two "valid" data that may have been contaminated are cleared, and the latest (even abnormal) RTT time difference measurement data is used as a new starting point to re-accumulate, so as to avoid doing useless work on the basis of errors and accelerate the recovery after the interference ends.

[0054] Exemplary embodiment 1, refer to Figure 3 As shown, blank dots indicate that the received RTT time difference measurement data is normal.

[0055] Step 1: Receive the first RTT time difference measurement data (normal value). At this time, the clock Kalman filter has not been initialized and the effective length value of the time difference data record is 0. Then, directly store the first RTT time difference measurement data into the first position of the time difference data record, and increment the effective length value of the time difference data record by 1.

[0056] Step 2: Receive the second RTT time difference measurement data (normal value). When the clock drift speed calculated based on the second RTT time difference measurement data and the first RTT time difference measurement data is less than the preset maximum drift speed, store the second RTT time difference measurement data in the second position of the time difference data record. At the same time, the effective length value of the time difference data record is 2.

[0057] Step 3: Receive the third RTT time difference measurement data (normal value). If the error between the third RTT time difference measurement data and the estimated RTT time difference value is less than the error threshold, then the third RTT time difference measurement data is determined to be valid data. The initial state vector and initial covariance matrix of the clock Kalman filter are calculated by comprehensively utilizing the three valid RTT time difference measurement data, thereby completing the initialization of the clock Kalman filter.

[0058] Exemplary Example 2, Reference Figure 4 As shown, blank dots indicate that the received RTT time difference measurement data is normal, while black triangles indicate that the received RTT time difference measurement data is abnormal.

[0059] Step 1: Receive the first RTT time difference measurement data (abnormal value). At this time, the clock Kalman filter has not been initialized and the effective length value of the time difference data record is 0. Directly store the first RTT time difference measurement data into the first position of the time difference data record and set the effective length value of the time difference data record to 1.

[0060] Step 2: Receive the second RTT time difference measurement data (normal value). At this time, the effective length of the time difference data record is 1. The clock drift speed calculated based on the second RTT time difference measurement data and the first RTT time difference measurement data in the time difference data record is greater than the preset maximum drift speed. Store the second RTT time difference measurement data in the first position of the time difference data record, replacing the stored first RTT time difference measurement data. The effective length of the time difference data record remains unchanged.

[0061] Step 3: Receive the third RTT time difference measurement data (normal value). At this time, the effective length value of the time difference data record is 1. The clock drift speed calculated based on the third RTT time difference measurement data and the first RTT time difference measurement data in the time difference data record (i.e., the second RTT time difference measurement data) is less than the preset maximum drift speed. Store the third RTT time difference measurement data in the second position of the time difference data record, and increment the effective length value of the time difference data record by 1. The effective length value is 2.

[0062] Step 4: Receive the fourth RTT time difference measurement data (normal value). At this time, the effective length of the time difference data record is 2. When the error value between the fourth RTT time difference measurement data and the estimated RTT time difference value is less than the error threshold, the fourth RTT time difference measurement data is determined to be valid data and stored in the third position of the time difference data record. Calculate the initial state vector and initial covariance matrix of the clock Kalman filter by comprehensively utilizing the three valid RTT time difference measurement data, thereby completing the initialization of the clock Kalman filter.

[0063] Exemplary embodiment 3, refer to Figure 5 As shown, blank dots indicate that the received RTT time difference measurement data is normal, while black triangles indicate that the received RTT time difference measurement data is abnormal.

[0064] Step 1: Receive the first RTT time difference measurement data (normal value). At this time, the clock Kalman filter has not been initialized and the effective length value of the time difference data record is 0. Directly store the first RTT time difference measurement data into the first position of the time difference data record and set the effective length value of the time difference data record to 1.

[0065] Step 2: Receive the second RTT time difference measurement data (abnormal value). At this time, the effective length value of the time difference data record is 1. The clock drift speed calculated based on the second RTT time difference measurement data and the first RTT time difference measurement data in the time difference data record is greater than the preset maximum drift speed. Store the second RTT time difference measurement data in the first position of the time difference data record, and keep the effective length value of the time difference data record unchanged.

[0066] Step 3: Receive the third RTT time difference measurement data (normal value). At this time, the effective length value of the time difference data record is 1. The clock drift speed calculated by the third RTT time difference measurement data and the first RTT time difference measurement data stored in the time difference data record is greater than the preset maximum drift speed. Store the third RTT time difference measurement data in the first position of the time difference data record, and keep the effective length value of the time difference data record unchanged.

[0067] Step 4: Receive the fourth RTT time difference measurement data (normal value). At this time, the effective length value of the time difference data record is 1. The clock drift speed calculated based on the fourth RTT time difference measurement data and the first RTT time difference measurement data stored in the time difference data record is less than the preset maximum drift speed. Store the fourth RTT time difference measurement data in the second position of the time difference data record and set the effective length value of the time difference data record to 2.

[0068] Step 5: Receive the fifth RTT time difference measurement data (normal value). At this time, the effective length of the time difference data record is 2. When the error value between the fifth RTT time difference measurement data and the estimated RTT time difference value is less than the error threshold, the fifth RTT time difference measurement data is determined to be valid data and stored in the third position of the time difference data record. Calculate the initial state vector and initial covariance matrix of the clock Kalman filter by comprehensively utilizing the three valid RTT time difference measurement data, thereby completing the initialization of the clock Kalman filter.

[0069] Exemplary embodiment 4, refer to Figure 6As shown, blank dots indicate that the received RTT time difference measurement data is normal, while black triangles indicate that the received RTT time difference measurement data is abnormal.

[0070] Step 1: Receive the first RTT time difference measurement data (normal value). At this time, the clock Kalman filter has not been initialized and the effective length value of the time difference data record is 0. Directly store the first RTT time difference measurement data into the first position of the time difference data record and set the effective length value of the time difference data record to 1.

[0071] Step 2: Receive the second RTT time difference measurement data (normal value). At this time, the effective length value of the time difference data record is 1. The clock drift speed calculated based on the second RTT time difference measurement data and the first RTT time difference measurement data in the time difference data record is less than the preset maximum drift speed. Store the second RTT time difference measurement data in the second position of the time difference data record and set the effective length value of the time difference data record to 2.

[0072] Step 3: Receive the third RTT time difference measurement data (abnormal value). At this time, the effective length of the time difference data record is 2. When the error between the third RTT time difference measurement data and the estimated RTT time difference value is greater than the error threshold, the third RTT time difference measurement data is determined to be abnormal data. The effective length of the time difference data record remains unchanged and continues to be 2.

[0073] Step 4: Receive the fourth RTT time difference measurement data (normal value). At this time, the effective length of the time difference data record is 2. When the error value between the fourth RTT time difference measurement data and the estimated RTT time difference value is less than the error threshold value, the fourth RTT time difference measurement data is determined to be valid data and stored in the third position of the time difference data record. Calculate the initial state vector and initial covariance matrix of the clock Kalman filter by comprehensively utilizing the three valid RTT time difference measurement data, thereby completing the initialization of the clock Kalman filter.

[0074] Exemplary embodiment 5, refer to Figure 7 As shown, blank dots indicate that the received RTT time difference measurement data is normal, while black triangles indicate that the received RTT time difference measurement data is abnormal.

[0075] Step 1: Receive the first RTT time difference measurement data (abnormal value). At this time, the clock Kalman filter has not been initialized and the effective length value of the time difference data record is 0. Directly store the first RTT time difference measurement data to the first position of the time difference data record and set the effective length value of the time difference data record to 1.

[0076] Step 2: Receive the second RTT time difference measurement data (abnormal value). At this time, the effective length value of the time difference data record is 1. The clock drift speed calculated based on the second RTT time difference measurement data and the first RTT measurement data in the time difference data record is less than the preset maximum drift speed. Store the second RTT time difference measurement data in the second position of the time difference data record and set the effective length value of the time difference data record to 2.

[0077] Step 3: Receive the third RTT time difference measurement data (normal value). At this time, the effective length of the time difference data record is 2. When the error between the third RTT time difference measurement data and the estimated RTT time difference value is greater than the error threshold, the third RTT time difference measurement data is determined to be abnormal data, and the effective length of the time difference data record remains unchanged.

[0078] Step 4: Receive the fourth RTT time difference measurement data (abnormal value). At this time, the effective length of the time difference data record is 2. When the error between the fourth RTT time difference measurement data and the estimated RTT time difference value is greater than the error threshold, the fourth RTT time difference measurement data is determined to be abnormal data, and the effective length of the time difference data record remains unchanged.

[0079] Step 5: Receive the fifth RTT time difference measurement data (normal value). At this time, the effective length of the time difference data record is 2. If the error between the fifth RTT time difference measurement data and the estimated RTT time difference value is greater than the error threshold, this fifth RTT time difference measurement data is determined to be abnormal data. Since there have been three consecutive abnormal data points, both sets of data in the time difference data record are determined to be abnormal data. The fifth RTT time difference measurement data is stored in the first position of the time difference data record, and the effective length of the time difference data record is set to 1.

[0080] Step 6: Receive the sixth RTT time difference measurement data (normal value). At this time, the effective length value of the time difference data record is 1. The clock drift speed calculated based on the sixth RTT time difference measurement data and the first RTT measurement data in the time difference data record is less than the preset maximum drift speed. Store the sixth RTT time difference measurement data in the second position of the time difference data record and set the effective length value of the time difference data record to 2.

[0081] Step 7: Receive the seventh RTT time difference measurement data (abnormal value). At this time, the effective length of the time difference data record is 2. When the error between the seventh RTT time difference measurement data and the estimated RTT time difference value is greater than the error threshold, the seventh RTT time difference measurement data is determined to be abnormal data, and the effective length of the time difference data record remains unchanged.

[0082] Step 8: Receive the eighth RTT time difference measurement data (normal value). At this time, the effective length of the time difference data record is 2. When the error value between the eighth RTT time difference measurement data and the estimated RTT time difference value is less than the error threshold value, the eighth RTT time difference measurement data is determined to be valid data and saved to the third position in the time difference data record. Calculate the initial state vector and initial covariance matrix of the clock Kalman filter by comprehensively utilizing the three valid RTT time difference measurement data, thereby completing the initialization of the clock Kalman filter.

[0083] Embodiments of this application also provide a data link terminal, including: a processor; a memory for storing processor-executable instructions; and, when the processor executes the executable instructions, implementing the clock Kalman filter initialization method as described above.

[0084] This application also provides a non-volatile computer-readable storage medium, including a computer program or instructions for storing a clock Kalman filter initialization method as described above, which, when executed, causes the clock Kalman filter initialization method described above to be implemented.

[0085] In summary, the solution proposed in this application judges the rationality of the time difference measurement value by combining the clock frequency accuracy index and the TOA measurement error characteristics during the initialization process of the clock Kalman filter. This allows for the accurate identification of possible outliers through a small amount of measurement data, preventing outliers from participating in the calculation of the initial state of the Kalman filter, ensuring that the Kalman filter works quickly and stably, and enabling the data link terminal to achieve accurate time synchronization in a short time.

[0086] While this application provides the method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in this embodiment is merely one possible execution order among many and does not represent the only possible execution order. In actual pilot-scale devices or client products, the methods shown in this embodiment or the accompanying drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).

[0087] The aforementioned storage media include, but are not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), Cache, Hard Disk Drive (HDD), or Memory Card. The memory can be used to store computer program instructions.

[0088] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary hardware. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, or it can be embodied in the process of data migration. The computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0089] The various embodiments described in this specification are presented in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. All or part of this application can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, mobile communication terminals, multiprocessor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.

[0090] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of this application.

Claims

1. A clock Kalman filter initialization method, characterized by, The initialization method includes: S1. When the data link terminal receives RTT time difference measurement data obtained by round-trip time measurement, it detects the effective length value of the time difference data record used to store the RTT time difference measurement data, wherein the RTT time difference measurement data includes at least: time difference value, measurement error, and update time. S2. Based on the effective length value, execute the corresponding phased filtering logic to judge the RTT time difference measurement data; when the RTT time difference measurement data passes the filtering logic of the corresponding phase, store the RTT time difference measurement data as valid data in the corresponding position of the time difference data record, and update the effective length value; otherwise, discard or replace the RTT time difference measurement data according to the filtering logic. S3. When the effective length value reaches the preset length value, calculate the initial state vector and initial covariance matrix of the clock Kalman filter based on the stored RTT time difference measurement data. S4. Based on the initial state vector and the initial covariance matrix, initialize the clock Kalman filter so that the clock Kalman filter enters a working state capable of real-time filtering and time deviation prediction.

2. The clock Kalman filter initialization method of claim 1, wherein, Step S2 includes: when the effective length value is 0, the phased filtering logic is as follows: The RTT time difference measurement data is directly stored in the first position of the time difference data record, and the effective length value is updated to 1.

3. The clock Kalman filter initialization method of claim 1, wherein, Step S2 includes: when the effective length value is 1, the phased filtering logic is as follows: The clock drift speed is obtained based on the RTT time difference measurement data and the first RTT time difference measurement data stored in the time difference data record; If the absolute value of the clock drift speed is less than or equal to the preset maximum drift speed, the RTT time difference measurement data is stored in the second position of the time difference data record, and the effective length value is updated to 2; If the absolute value of the clock drift speed is greater than the preset maximum drift speed, the RTT time difference measurement data is stored in the first position of the time difference data record, and the effective length value is kept at 1.

4. The clock Kalman filter initialization method according to claim 3, characterized in that, The clock drift speed is calculated according to the following formula: in, For clock drift speed, and These are the time difference value and update time in the RTT time difference measurement data, respectively. and These are the time difference value and update time in the first RTT time difference measurement data stored in the time difference data record, respectively; The maximum drift speed is calculated according to the following formula: in, The preset maximum drift speed, f For the clock accuracy of the data link terminal.

5. The clock Kalman filter initialization method according to claim 1, characterized in that, Step S2 includes: when the effective length value is 2, the phased filtering logic is as follows: The estimated RTT time difference value is obtained by estimating the time difference value in the first RTT time difference measurement data stored in the time difference data record and the time difference value in the second RTT time difference measurement data stored in the time difference data record. The error value is obtained based on the time difference value in the RTT time difference measurement data and the estimated RTT time difference value. When the error value is less than the preset error threshold, the RTT time difference measurement data is stored in the third position of the time difference data record, and the effective length value is updated to 3.

6. The clock Kalman filter initialization method according to claim 5, characterized in that, The estimated RTT time difference is calculated according to the following formula: in, To estimate the RTT time difference, and The first bit of the time difference data record stores the time difference value and update time from the RTT time difference measurement data. and The second position in the time difference data record stores the time difference value and update time from the RTT time difference measurement data. This refers to the update time in the RTT time difference measurement data; The error value is calculated according to the following formula: in, The error value is... The time difference value in the RTT time difference measurement data; The error threshold value is ,in, This represents the maximum value of the measurement error in the three RTT time difference measurement data.

7. The clock Kalman filter initialization method according to claim 1, characterized in that, Step S3 includes: The initial state vector and initial covariance matrix of the clock Kalman filter are obtained based on the RTT time difference measurement data stored in the first, second and third positions of the time difference data record. The clock Kalman filter is initialized based on the initial state vector and the initial covariance matrix. The initial state vector of the clock Kalman filter is calculated based on the stored RTT time difference measurement data according to the following formula: in, Let be the initial state vector of the clock Kalman filter. and The time difference value and update time are the first stored RTT time difference measurement data in the time difference data record. and The second bit in the time difference data record stores the time difference value and update time in the RTT time difference measurement data. and The time difference value and update time are stored in the third position of the time difference data record in the RTT time difference measurement data; The initial covariance matrix of the clock Kalman filter is calculated based on the stored RTT time difference measurement data according to the following formula: in, The initial covariance matrix, The measurement error is stored in the third position of the time difference data record. , , These are the update times stored in the 1st, 2nd, and 3rd positions of the time difference data record, which are the RTT time difference measurement data.

8. The clock Kalman filter initialization method according to claim 5, characterized in that, The phased screening logic also includes: When the error value is equal to or greater than the preset error threshold, the RTT time difference measurement data is determined to be abnormal data, and the abnormality count value is set to 1. When the number of abnormal occurrences reaches a preset number, the newly received RTT time difference measurement data is stored in the first position of the time difference data record, and the effective length of the time difference data record is set to 1. When the number of abnormal occurrences is less than the preset number of occurrences, the newly received RTT time difference measurement data is processed according to steps S1-S3.

9. A data link terminal, characterized in that, include: processor; Memory used to store processor-executable instructions; When the processor executes the executable instructions, it implements the clock Kalman filter initialization method as described in any one of claims 1 to 8.

10. A non-volatile computer-readable storage medium, characterized in that, Includes storage of computer programs or instructions that, when executed, cause the clock Kalman filter initialization method as described in any one of claims 1 to 8 to be implemented.