A Collaborative Correction Method for NTP Timing Errors Based on Multi-Level Clock References

By constructing a multi-level clock reference system and a neural network collaborative correction method, the problem of NTP timing system's dependence on a single GNSS is solved, achieving high-precision time synchronization in complex environments, which is applicable to fields such as power, finance, and communications.

CN122131568APending Publication Date: 2026-06-02CHENGDU HENGYU CHUANGXIANG TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHENGDU HENGYU CHUANGXIANG TECH CO LTD
Filing Date
2026-04-21
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing NTP timing systems rely excessively on a single GNSS clock reference source, resulting in decreased time synchronization accuracy under interference or failure conditions, which fails to meet the requirements of high-security and high-reliability application scenarios.

Method used

A multi-level clock reference system is constructed, and the quality of each communication link is evaluated in real time by combining neural networks. The residual weights of the time level are dynamically allocated, and error collaborative optimization and compensation are carried out by using redundant information from satellites, servers and local time synchronization.

Benefits of technology

In the event of interference or failure of GNSS signals, the system maintains time synchronization accuracy in the range of microseconds to sub-microseconds, improving the robustness and survivability of the system. It is suitable for high-reliability scenarios such as power, finance, and communications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122131568A_ABST
    Figure CN122131568A_ABST
Patent Text Reader

Abstract

This application relates to the fields of time frequency and time synchronization technology, specifically, to a collaborative correction method for NTP timing errors based on multi-level clock references. The method includes: Step 1: acquiring time signals from each level to generate a time-level signal set; Step 2: constructing communication links for the time signals at each level, and using a neural network to detect the communication quality of each link in real time. This application effectively overcomes the excessive dependence of traditional NTP timing on a single GNSS clock source by constructing a multi-level clock reference system and introducing a neural network-driven collaborative correction mechanism. In extreme scenarios where GNSS signals are interfered with, spoofed, or completely fail, the system can automatically fuse redundant time information from intermediate and bottom-level local oscillators, dynamically allocate residual weights at each level based on the link quality evaluated in real time by the neural network, and achieve collaborative optimization compensation for errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of time frequency and time synchronization technology, and more specifically, to an NTP timing error collaborative correction method based on multi-level clock references. Background Technology

[0002] The content in this section provides only background information related to this application and may not constitute prior art.

[0003] In modern high-precision time synchronization systems, a "multi-level clock reference" refers to constructing a hierarchical reference system composed of various time reference sources of different types, accuracy levels, and sources. This system typically presents a pyramid structure: at the top is the most accurate and authoritative time source, such as Global Navigation Satellite System (GNSS) signals (e.g., GPS, BeiDou), providing nanosecond to microsecond accuracy close to International Standard Time (UTC); the middle layer consists of sources with slightly lower accuracy but easier access or redundancy, such as a Stratum 1 NTP server connected via a dedicated network or the internet, or ground-based long-wave / low-frequency time signals (e.g., BPC, DCF77); the bottom layer consists of the device's own local clock oscillator (e.g., OCXO, TCXO, or ordinary crystal oscillator), which has the lowest accuracy but serves as the foundation for timekeeping. The core idea of ​​this architecture is to leverage the complementarity of different levels of reference sources, through collaborative processing, to improve the overall time synchronization accuracy, stability, and robustness of the system, rather than relying solely on a single specific source.

[0004] Current mainstream NTP high-precision time synchronization schemes typically rely heavily on and trace directly to the highest-level clock reference source, especially GNSS (such as GPS receivers), for their error correction logic. Specifically, NTP servers (especially Stratum 1 servers) directly acquire high-precision UTC time from GNSS receivers and use it as the absolute reference. Downstream NTP clients then measure the round-trip delay and clock offset with these servers over the network and correct their local clocks accordingly. In this model, GNSS is considered the undisputed "gold standard," and all error correction aims to make the local time as close as possible to the time provided by GNSS. This method can indeed provide high synchronization accuracy in environments with good GNSS signal quality and stable network paths.

[0005] This error correction strategy, which relies excessively on a single highest-level clock reference (especially GNSS), is significantly vulnerable. GNSS signals are highly susceptible to various forms of interference: intentional interference (suppression or deception), which can cause receivers to fail to lock onto the signal or output completely incorrect time; unintentional interference (co-channel or adjacent-channel interference from other radio devices); and physical obstructions (such as indoor environments, tunnels, urban canyons, and severe weather conditions that cause signal attenuation or loss). Once the GNSS signal is interfered with, deceived, or completely unavailable, the time information used as a reference source becomes invalid or experiences significant deviations. In this case, the NTP system relying on it for error correction will lose its accurate reference, leading to a sharp decline in the time synchronization accuracy of downstream clients, even resulting in significant time errors on the order of minutes or more. This single point of failure risk is unacceptable in applications with high security and reliability requirements (such as power grid synchronization, financial transactions, 5G / 6G base station synchronization, and industrial control). There is an urgent need for a time error correction method that can overcome the vulnerability of a single reference source and maintain high accuracy and reliability even in complex interference environments. Summary of the Invention

[0006] The summary section of this application is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.

[0007] Some embodiments of this application propose an NTP timing error collaborative correction method based on multi-level clock references to solve the technical problems mentioned in the background section above.

[0008] As a first aspect of this application, some embodiments of this application provide a collaborative correction method for NTP timing errors based on multi-level clock references, including: Step 1: Acquire the time signals at each level and generate a time-level signal set; Step 2: Construct communication links for time signals at each level, and use neural networks to detect the communication quality of each communication link in real time; Step 3: Based on the time-level signal set, calculate the time signal error at each time level and generate an error set; Step 4: Obtain the time-level signal set, the communication quality of each communication link, and the error set. Match the time signal error of each time level with the communication link quality to generate a residual allocation scheme for each time level. Step 5: Correct the NTP timing based on the residual allocation scheme of each time level, and generate NTP timing for each time level; The neural network model is corrected based on the NTP timing at each time level, and the accuracy of the most recent NTP timing is generated based on the rate of change of the internal parameters of the neural network model.

[0009] This application effectively overcomes the excessive reliance of traditional NTP timing on a single GNSS clock source by constructing a multi-level clock reference system and introducing a neural network-driven collaborative correction mechanism. In extreme scenarios where GNSS signals are interfered with, spoofed, or completely fail, the system can automatically fuse redundant time information from intermediate layers (such as a primary NTP server and long-wave timing) and the underlying local oscillator. Based on the link quality evaluated in real-time by the neural network, it dynamically allocates residual weights at each level, achieving collaborative optimization and compensation for errors. This not only significantly improves the robustness and survivability of the time synchronization system under complex electromagnetic environments and network fluctuations, avoiding minute-level time deviations caused by single-point failures, but also maintains overall timing accuracy at the microsecond to sub-microsecond level even without GNSS through multi-source complementary optimization, providing a continuously stable and high-precision time reference for high-reliability scenarios such as power, finance, and communications. Simultaneously, the timing accuracy evaluation mechanism based on the neural network parameter change rate further enhances the system's observability and adaptive correction capabilities regarding timing status.

[0010] Furthermore, the time levels include: satellite time synchronization, server time synchronization, and local time synchronization; Among them, satellite time synchronization refers to the satellite time obtained by the terminal equipment in sync with the BeiDou satellite; Server time synchronization refers to the server time obtained by the terminal device through synchronization with the server. Local time synchronization refers to the local time generated by the local time source of the terminal device.

[0011] Furthermore, the communication link for satellite timing is the signal channel between the satellite and the terminal equipment; The communication link for server time synchronization is the signal channel between the server and the terminal device. The local time synchronization communication link is the signal channel inside the terminal device.

[0012] This application constructs a three-tiered clock reference system comprising satellite timing (BeiDou), server timing, and local timing. It utilizes a neural network to evaluate the communication quality of satellite links, network links, and internal channels in real time. Based on the evaluation results, residuals are allocated to the time signal errors at each tier, ultimately collaboratively correcting NTP timing errors. When satellite timing is unreliable (e.g., due to interference failure), the system can dynamically fuse server and local timing information based on link quality to compensate for errors, maintaining NTP timing accuracy at the microsecond level and avoiding severe degradation of time synchronization accuracy due to a single satellite timing failure. Simultaneously, the evaluation of NTP timing accuracy based on the neural network parameter change rate provides a reference for the system status.

[0013] Furthermore, step 2 includes the following steps: Step 21: Monitor the RTT distribution, network jitter, and network latency of each communication link in real time to obtain characteristic data; Step 22: Input the feature data into the neural network model to obtain the communication quality of each communication link; Each communication link is trained separately using a neural network model with the same structure, resulting in two neural network models with different parameters. This application obtains a communication quality assessment for each communication link by real-time monitoring of the RTT distribution, network jitter, and network latency of satellite links, network links, and internal channels, and inputting these into a neural network model with the same structure (each link model is trained using its own time signal offset). This enables the communication quality assessment results to more accurately match and reflect the current actual transmission time signal capability of each link, providing a reliable basis for subsequent residual allocation based on link quality.

[0014] Furthermore, step 3 includes the following steps: Step 31: The terminal device obtains the real-time satellite time, service area time, and local time; Step 32: Calculate the errors between satellite time and server time, satellite time and local time, and server time and local time respectively to obtain the error set; The error set includes a first time error, a second time error, and a third time error. The first time error is the error between satellite time and server time; the second time error is the error between satellite time and local time; and the third time error is the error between server time and local time.

[0015] This application acquires satellite time, server time, and local time in real time through terminal devices, and calculates the first time error between satellite time and server time, the second time error between satellite time and local time, and the third time error between server time and local time, respectively, to obtain an error set containing these three errors. By performing pairwise calculations, the relative deviations between time sources at each level are comprehensively quantified, providing a multi-dimensional error data foundation for subsequent residual allocation schemes based on link quality.

[0016] Furthermore, neural network models include: The input layer is used to input feature data, standardize the feature data, and generate standard features; The LSTM layer extracts historical and future features from standard features; The splicing layer combines historical and future features to generate combined features. The probability prediction head outputs an offset probability distribution map of NTP timing based on combined features.

[0017] This application processes communication link feature data using a neural network model comprising an input layer, an LSTM layer, a concatenation layer, and a probabilistic prediction head. The input layer standardizes the feature data to generate standard features; the LSTM layer extracts historical and future features from the standard features; the concatenation layer concatenates the historical and future features to generate combined features; and the probabilistic prediction head outputs an NTP timing offset probability distribution map based on the combined features. The model can simultaneously utilize historical states and predicted future trends to assess link quality and characterize the uncertainty of time signal offset in the form of a probability distribution, providing a more comprehensive and probabilistic basis for subsequent residual allocation of link quality.

[0018] Furthermore, the loss function of the neural network model for: ; in, This represents the true time offset of the i-th sample within time period t. This represents the predicted probability of the i-th sample within time period t. Let represent the predicted standard deviation of the i-th sample within time period t, where i represents the sample index, N represents the total number of samples, and t represents the time period index. Represents the regularization parameter. Represents the model parameter set, This represents the squared L2 norm of the model parameters.

[0019] Furthermore, step 4 includes the following steps: Step 41: Obtain the time-level signal set, the communication quality of each communication link, and the error set; Step 42: Add an offset to the time signal at each time level, with the primary objective of minimizing the error at each time level, and establish a time level error allocation model with the highest possible sum of confidence of the time signals at each time level. Step 43: Solve the allocation model using the particle swarm optimization algorithm to generate residual allocation schemes for each time level.

[0020] This application acquires a set of time-level signals, the communication quality and error sets of each communication link, adds an offset to the time signal at each time level, establishes a time-level error allocation model with minimizing the time-level error as the primary objective and maximizing the sum of the confidence levels of the time signals at each time level, and solves the model using a particle swarm optimization algorithm to generate a residual allocation scheme for each time level. By establishing and solving an optimization model that incorporates both error minimization and confidence maximization, the application determines the most reliable residual compensation amount for each time signal level that minimizes the overall error, providing a basis for subsequent collaborative correction of NTP timing errors.

[0021] Furthermore, step 5 includes the following steps: Step 51: Correct the time obtained at each time level according to the residual allocation scheme to obtain the accurate time; Step 52: Using accurate time as a label and communication quality as a sample, repeatedly train the neural network model to obtain the overall rate of change of the model parameters inside the neural network model; Step 53: Generate the accuracy probability of NTP time synchronization based on the abrupt change characteristics of the overall rate of change.

[0022] This application corrects the time obtained at each time level according to the residual allocation scheme to obtain the accurate time; using this accurate time as a label and communication quality as a sample, the neural network model is repeatedly trained to obtain the overall rate of change of the model's internal parameters; based on the abrupt change characteristics of this overall rate of change, the accuracy probability of NTP time synchronization is generated. The neural network model is continuously optimized through the corrected accurate time, and the abrupt change characteristics of the model parameter change rate are used to achieve a probabilistic evaluation of the current accuracy of NTP time synchronization, providing a reference for system status monitoring. Attached Figure Description

[0023] Figure 1 This is a flowchart of an NTP timing error collaborative correction method based on multi-level clock references.

[0024] Figure 2 Confidence distribution for satellite time synchronization; Figure 3 Confidence distribution for server timing; Figure 4 The confidence distribution for local time synchronization. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments. The same reference numerals in the accompanying drawings represent the same components. It should be noted that the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the described embodiments of this application without creative effort are within the scope of protection of this application.

[0026] Compared to the embodiments shown in the accompanying drawings, feasible embodiments within the scope of this application may have fewer components, other components not shown in the drawings, different components, differently arranged components, or components with different connections, etc. Furthermore, two or more components in the drawings may be implemented in a single component, or a single component shown in the drawings may be implemented as multiple separate components.

[0027] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” and similar terms used in this specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not necessarily indicate a quantity limitation. Terms such as “upper” and “lower” are used only to indicate relative positional relationships, and these relative positional relationships may change accordingly when the absolute position of the described object changes.

[0028] refer to Figure 1 Example 1: A collaborative correction method for NTP timing errors based on multi-level clock references, comprising the following steps: Step 1: Acquire the time signals at each level and generate a time-level signal set; Time synchronization levels include: satellite time synchronization, server time synchronization, and local time synchronization; Among them, satellite time synchronization refers to the satellite time obtained by the terminal equipment in sync with the BeiDou satellite; Server time synchronization refers to the server time obtained by the terminal device through synchronization with the server. Local time synchronization refers to the local time generated by the local time source of the terminal device.

[0029] Satellite time synchronization refers to the process by which terminal devices receive and analyze wireless signals from the BeiDou Navigation Satellite System to extract satellite timestamps containing Coordinated Universal Time (UTC) information. Server time synchronization refers to the process by which terminal devices interact with a remote high-precision time server (such as a Level 1 Stratum 1 NTP server deployed in a data center with an atomic clock or GPS / BeiDou disciplined clock) through network protocols (such as NTP or PTP) to synchronize time. By measuring network round-trip delay and calculating clock offset, the system ultimately obtains the authoritative time maintained by the server. Local time synchronization refers to the process by which terminal devices rely entirely on their internally integrated local clock source (such as a temperature-controlled crystal oscillator OCXO, a temperature-compensated crystal oscillator TCXO, or a common quartz crystal oscillator) to generate a local time signal. This time signal is generated by a counter driven by the frequency signal of the local oscillator.

[0030] The time accuracy decreases sequentially from satellite time synchronization to server time synchronization and then to local time synchronization.

[0031] Step 2: Construct communication links for time signals at each level, and use neural networks to detect the communication quality of each communication link in real time.

[0032] The communication link for satellite time synchronization is the signal channel between the satellite and the terminal equipment; The communication link for server time synchronization is the signal channel between the server and the terminal device. The local time synchronization communication link is the signal channel inside the terminal device.

[0033] Both satellite time synchronization and server time synchronization communication links require long-distance wireless propagation paths, resulting in latency. Therefore, time synchronization systems generally employ the following methods: The client sends an NTP request packet to the server at local time T1.

[0034] The server records the local time T2 when it receives the packet (T1 is from the client packet) and T2.

[0035] The server sends a response packet to the client at local time T3, and the packet contains T1, T2, and T3.

[0036] The client receives the response packet at local time T4, and gets T1, T2, and T3.

[0037] Assuming the network path is symmetrical (outbound delay ≈ return delay), then the one-way delay is half the round-trip delay. Based on the round-trip delay and the clock information received by the client, the actual receiving clock can be accurately adjusted.

[0038] However, wireless paths are not ideal channels, and their propagation delays are affected by a variety of factors, resulting in fluctuations: dynamically changing path delays and receiver processing delays together manifest as uncertainty in the time when the time signal arrives at the terminal device, thus leading to errors.

[0039] Therefore, satellite time synchronization, server time synchronization, and local time synchronization are becoming increasingly robust against signal interference. In this scheme, the error of the local time synchronization communication link is set to a fixed error probability distribution (related to the properties of the local clock, and therefore there is no communication error).

[0040] Step 2 includes the following steps: Step 21: Monitor the RTT distribution, network jitter, and network latency of each communication link in real time to obtain characteristic data; This scheme primarily monitors the characteristic data of communication links for satellite time synchronization and server time synchronization. No calculations are performed on communication links for local time synchronization, because these links are unaffected by communication fluctuations.

[0041] The characteristic data acquisition methods for satellite time synchronization communication links and server time synchronization communication links are the same. The method for acquiring the characteristic data of server time synchronization communication links is provided below.

[0042] When calculating feature data, the main focus is on monitoring the round-trip latency between the terminal device and the server. Specifically: Round-trip time is the time delay obtained through the timestamp exchange mechanism of the NTP protocol.

[0043] The sequential round-trip test measurements include: T1, T2, T3, and T4; T1 is the local time at which the terminal device sends the NTP request; T2 is the local time when the server received the NTP request; T3 is the local time at which the server issued the NTP response; T4 is the local time at which the terminal device receives the NTP response; T1 and T4 use the client clock, while T2 and T4 use the server clock. The above is a complete round-trip delay measurement cycle, and the above scheme needs to be executed for each round-trip delay measurement.

[0044] In this scheme, the most recent round-trip delay measurement is set to n, and i represents the index of the round-trip delay measurement.

[0045] When calculating the characteristic data of a satellite link, it is only necessary to continuously calculate the time delay each time using the timestamp exchange mechanism of the NTP protocol. Based on each time delay, the required RTT distribution, network jitter, and network latency can be calculated. Specifically: RTT distributions include: and ; ; ; in, This represents the skewness of the round-trip delay for the nth measurement, where n represents the number of round-trip delay measurements at the current time point, and i represents the index of the round-trip delay. This represents the round-trip time delay for the i-th time. This represents the average round-trip time delay. The standard deviation of round-trip time; Kurtosis represents the round-trip delay of the nth measurement; Network jitter includes: and ; ; ; ; Indicates average jitter. Indicates the standard deviation of jitter. represents the absolute difference between adjacent RTTs, k represents the index of the absolute difference between adjacent RTTs, and m represents the size of the sliding window; Network jitter describes the jitter of the network during the most recent round-trip delay measurement compared to previous measurements.

[0046] Network latency includes and ; ; ; Indicates the average uplink latency. Indicates the average downlink delay. Indicates the server's packet reception time. This indicates that the server is sending and receiving packets. Indicates the time when the terminal device sends the packet. This indicates the time it takes for the terminal device to receive the packet.

[0047] The above are the methods for obtaining feature data.

[0048] Among the characteristic data: RTT distribution reveals the existence of abnormally long latency or sudden congestion in the network by statistically analyzing the overall fluctuation pattern and extreme high values ​​of latency. Network jitter measures the drasticness and unpredictability of latency changes. Network latency reflects the basic time consumption and path symmetry of signal transmission. Therefore, using these three data points, it is possible to accurately identify patterns in time offset.

[0049] Step 22: Input the feature data into the neural network model to obtain the communication quality of each communication link; Each communication link is trained separately using a neural network model with the same structure, resulting in two neural network models with different parameters. Each communication link in this scheme actually consists of two communication links: the signal channel between the satellite and the terminal equipment, and the signal channel between the server and the terminal equipment. For each of these two signal channels, a neural network model is used to train twice to obtain the corresponding network parameters, which are then used for subsequent operations.

[0050] The two communication links (satellite-terminal and server-terminal) require independently trained neural network models. The satellite link is affected by atmospheric interference and orbital drift, resulting in long-period, high-amplitude latency fluctuations. The ground server link, on the other hand, is mainly affected by network congestion and routing jumps, exhibiting short-term, bursty jitter. If trained together, the models will confuse the two noise patterns, causing mutual interference when predicting offsets. Independent training allows each model to focus on learning the unique error patterns of its own link, enabling targeted corrections.

[0051] Specifically, The neural network model uses training samples as feature data and label data as the offset at the current moment. This is essentially the standard deviation between the time acquired by the terminal device and the actual reference time.

[0052] In practice, a high-precision clock source can be connected to the terminal device to obtain the training data of the two links of the terminal device. After training the neural network model separately, the high-precision clock source can be removed.

[0053] After training, a neural network model will have an initial set of model parameters, which will be continuously updated.

[0054] Specifically, neural network models include: The input layer is used to input feature data, standardize the feature data, and generate standard features. ; The input layer primarily performs standardization on the feature data. In this scheme, the standardization process is Z-score, and the output standard feature is a 6-dimensional vector. The value after standardization.

[0055] The LSTM layer extracts historical and future features from standard features; The LSTM layer consists of two parallel LSTM networks, one for extracting historical features and the other for extracting future features. ; ; in, Indicates future characteristics, Indicating historical characteristics, This represents the model parameters of the first LSTM network. This represents the model parameters of the second LSTM network; The splicing layer combines historical and future features to generate combined features. The splicing layer is mainly for... and Concatenate along length to obtain the concatenated vector. ; The probability prediction head outputs an offset probability distribution map of NTP timing based on combined features.

[0056] The probability prediction head includes: A fully connected layer network is used to reduce the dimensionality of the concatenated vector Hco to obtain the dimensionality-reduced feature Z; ; in, This represents the activation function. This represents the weight matrix of the connection layer network. Indicates the bias term of the fully connected layer network; The probability distribution network uses an activation function to generate the probability for each continuous interval.

[0057] Specifically, before generating the probability distribution map, B intervals are pre-generated. Example: ; The probability distribution network generates a B-dimensional vector based on the dimensionality reduction feature Z. The B-dimensional vector implicitly contains the probability of selecting the corresponding interval; ; Represents the B-th dimension vector; The Softmax function layer uses the Softmax function to convert a B-dimensional vector into a probability distribution map.

[0058] ; i represents the index of the interval. Let B represent the probability that the b-th interval is a time synchronization interval, and let B represent the total number of intervals.

[0059] Specifically, the neural network model actually describes the offset of the time synchronization interval. For example, the time synchronization result between the server and the terminal device shows that the current time is 0ns, but the neural network model determines that the accuracy is highest between 100 and 200ns based on standard features, so the current time of the device is most likely 200ns.

[0060] In practice, the Softmax function layer is usually followed by an output layer, which selects the interval with the highest probability as the final output. This application removes this output layer and selects the original probability space.

[0061] like Figures 2-4 As shown, the offset probability distribution maps for satellite time synchronization, server time synchronization, and local time synchronization are presented respectively.

[0062] Therefore, in practice, training can be completed simply by using the standard deviation between the acquired time and the actual reference time.

[0063] The following is the loss function for the neural network model. Given the model's input and output, the specific methods for training the neural network model, as described in current technology, will not be described here: Furthermore, the loss function L of the neural network model is: ; in, This represents the true time offset of the i-th sample within time period t. This represents the predicted probability of the i-th sample within time period t. Let represent the predicted standard deviation of the i-th sample within time period t, where i represents the sample index, N represents the total number of samples, and t represents the time period index. Represents the regularization parameter. Represents the model parameter set, This represents the squared L2 norm of the model parameters.

[0064] Therefore, the communication quality of each communication link is the confidence distribution of the received time at each time level.

[0065] For local time synchronization communication links, this solution simply sets a standard distribution probability map based on historical data. That is, the local time synchronization offset probability distribution map is a normal distribution with the current time as the mean, and the remaining information remains unchanged.

[0066] Step 3: Based on the time-level signal set, calculate the time signal error at each time level and generate an error set.

[0067] Step 3 includes the following steps: Step 31: The terminal device obtains the real-time satellite time, service area time, and local time; Step 32: Calculate the errors between satellite time and server time, satellite time and local time, and server time and local time respectively to obtain the error set; The error set includes a first time error, a second time error, and a third time error. The first time error is the error between satellite time and server time; the second time error is the error between satellite time and local time; and the third time error is the error between server time and local time.

[0068] Step 4: Obtain the time-level signal set, the communication quality of each communication link, and the error set. Match the time signal error of each time level with the communication link quality to generate a residual allocation scheme for each time level.

[0069] Step 4 includes the following steps: Step 41: Obtain the time-level signal set, the communication quality of each communication link, and the error set; Specifically, the time-level signal set is as follows: ; in, Indicates satellite time. Indicates server time. Indicates local time; The communication quality of each communication link is as follows: ; ; ; in, A probability distribution diagram showing the offset of the communication link for satellite time synchronization. Indicates the actual time synchronization of the satellite within the specified interval. The probability of , where B represents the total number of intervals; An offset probability distribution diagram representing the communication link in the service area time synchronization. Indicates that the service area time synchronization is within the interval. The probability of; In practice, server time synchronization and satellite time synchronization are very close, so the same interval distribution scheme is used for both.

[0070] Indicates a normal distribution. Indicates the historical offset standard deviation (preset). This represents the mean (i.e., the current time). The error set is: ; Indicates the first time error. This indicates the second time error. This indicates the third time error.

[0071] Step 42: Add an offset to the time signal at each time level, with the first objective being to minimize the error at each time level and the second objective being to maximize the sum of the confidence levels of the time signals at each time level, and establish a time level error allocation model. The time-level error allocation model is as follows: First goal: ; ; ; ; Second objective: ; in, Indicates satellite time. Indicates server time. Indicates local time. Indicates the offset of satellite time. This indicates the offset of the server time. This indicates the offset of the local time. Indicates the first time error. This indicates the second time error. This indicates the third time error. This indicates the confidence level of the time signal after the satellite time has shifted. This indicates the confidence level of the time signal after the server time offset. This indicates the confidence level of the time signal after the local time offset.

[0072] Step 43: Solve the allocation model using the particle swarm optimization algorithm to generate residual allocation schemes for each time level.

[0073] Step 431: Define the particle setting method and generate G particles according to the particle definition method; A time window of a preset size is set with the average of satellite time, server time, and local time as the center. The adjustment values ​​of satellite time, server time, and local time are all within the time window.

[0074] Set the minimum step distance The step distance The smallest unit for adjusting satellite time, server time, and local time; With the smallest step distance The unit is randomly generated from satellite time, server time, and local time. ; ; ; ; in, , , All are random integers, when , , A value greater than zero indicates an increase in the time offset. , , A value less than zero indicates a reduction in the time offset; By randomly generating group G , , G particles were obtained; Step 432: Set the objective function F(t) according to the first and second objectives; ; in, , These represent the first weight and the second weight, respectively. Step 433: Set the termination condition. Iterate over G particles according to the objective function F(t) until the termination condition is met. The termination condition is that the number of iterations reaches the maximum value, or the gradient rate of change of the objective function reaches a preset value.

[0075] The specific iteration method will not be elaborated here. Each particle in this scheme includes... , , These three elements are sufficient to complete the particle iteration operation. During iteration, adjustments are mainly made based on the global best position and the historical best position.

[0076] The following is a description of particle g: ; The speed update formula is: ; The update formula for each dimension of the particle is: ; in, Let g represent the g-th particle, where g represents the particle index. This represents the d-th dimension of the g-th particle. Let w represent the velocity of the g-th particle in the d-th dimension at the (t+1)-th iteration, where t represents the index of the iteration number and w represents the inertial crowd. This represents the velocity of the g-th particle in the d-th dimension at the t-th iteration. Represents individual learning factors. r1 and r2 represent random numbers, where r1 and r2 represent social learning factors. This represents the position of the g-th particle in the d-th dimension at iteration t. Indicates to Round up.

[0077] Step 434: Use the offset of each time level as the residual of each time level to obtain the residual allocation scheme.

[0078] Step 5: Correct the NTP timing based on the residual allocation scheme of each time level, and generate NTP timing for each time level; The neural network model is corrected based on the NTP timing at each time level, and the accuracy of the most recent NTP timing is generated based on the rate of change of the internal parameters of the neural network model.

[0079] Step 5 includes the following steps: Step 51: Correct the time obtained for each time level according to the residual allocation scheme to obtain the accurate time for each time level; Step 51 includes the following steps: Step 51: Calculate the corrected time for each time level. , , ; in, This indicates the corrected satellite time. This indicates the server time is the corrected time. This indicates the local time after correction. Step 512: with , , The time with the highest confidence level is taken as the accurate time.

[0080] Step 52: Using accurate time as a label and communication quality as a sample, repeatedly train the neural network model to obtain the overall rate of change of the model parameters inside the neural network model; A neural network model was provided in step 2. The communication links for satellite time synchronization and server time synchronization were modified.

[0081] In step 51, two relatively accurate samples can be obtained. Therefore, using these samples, two neural network models for the satellite timing communication link and the server timing communication link can be trained once.

[0082] After each training iteration, the overall rate of change of the internal model parameters of the two neural network models after training is calculated.

[0083] For example, if a neural network model has 1000 model parameters, and after training once, the rate of change of each model parameter is 0.1, then the overall rate of change is 100, which is the sum of the rates of change of all model parameters.

[0084] Step 53: Generate the accuracy probability of NTP timing based on the abrupt change characteristics of the overall rate of change, where the abrupt change characteristics are the slope of the overall rate of change.

[0085] It is foreseeable that if the model's rate of change remains relatively constant, it indicates that the acquired data chain is highly stable and there are no specific issues. However, when the abrupt change in the overall rate of change suddenly increases within a short period, it indicates that the neural network model is learning new information, that is, learning new mapping patterns. This situation is expected to be relatively rare in routine and initial training, thus posing a risk of reduced clock stability.

[0086] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A collaborative correction method for NTP timing errors based on multi-level clock references, characterized in that, Includes the following steps: Step 1: Acquire the time signals at each level and generate a time-level signal set; Step 2: Construct communication links for time signals at each level, and use neural networks to detect the communication quality of each communication link in real time; Step 3: Based on the time-level signal set, calculate the time signal error at each time level and generate an error set; Step 4: Obtain the time-level signal set, the communication quality of each communication link, and the error set. Match the time signal error of each time level with the communication link quality to generate a residual allocation scheme for each time level. Step 5: Correct the NTP timing based on the residual allocation scheme of each time level, and generate NTP timing for each time level; The neural network model is corrected based on the NTP timing at each time level, and the accuracy of the most recent NTP timing is generated based on the rate of change of the internal parameters of the neural network model.

2. The NTP timing error collaborative correction method based on multi-level clock reference as described in claim 1, characterized in that, Time synchronization levels include: satellite time synchronization, server time synchronization, and local time synchronization; Among them, satellite time synchronization refers to the satellite time obtained by the terminal equipment in sync with the BeiDou satellite; Server time synchronization refers to the server time obtained by the terminal device through synchronization with the server. Local time synchronization refers to the local time generated by the local time source of the terminal device.

3. The NTP timing error collaborative correction method based on multi-level clock reference according to claim 1, characterized in that, The communication link for satellite time synchronization is the signal channel between the satellite and the terminal equipment; The communication link for server time synchronization is the signal channel between the server and the terminal device. The local time synchronization communication link is the signal channel inside the terminal device.

4. The NTP timing error collaborative correction method based on multi-level clock reference according to claim 1, characterized in that, Step 2 includes the following steps: Step 21: Monitor the RTT distribution, network jitter, and network latency of each communication link in real time to obtain characteristic data; Step 22: Input the feature data into the neural network model to obtain the communication quality of each communication link; Each communication link is trained separately using a neural network model with the same structure, resulting in two neural network models with different parameters.

5. The NTP timing error collaborative correction method based on multi-level clock reference according to claim 1, characterized in that, Step 3 includes the following steps: Step 31: The terminal device obtains the real-time satellite time, service area time, and local time; Step 32: Calculate the errors between satellite time and server time, satellite time and local time, and server time and local time respectively to obtain the error set; The error set includes a first time error, a second time error, and a third time error. The first time error is the error between satellite time and server time; the second time error is the error between satellite time and local time; and the third time error is the error between server time and local time.

6. The NTP timing error collaborative correction method based on multi-level clock reference according to claim 4, characterized in that, Neural network models include: The input layer is used to input feature data, standardize the feature data, and generate standard features; The LSTM layer extracts historical and future features from standard features; The splicing layer combines historical and future features to generate combined features. The probability prediction head outputs the offset probability distribution map of NTP timing based on the combined features, and obtains the confidence level of each time signal.

7. The NTP timing error collaborative correction method based on multi-level clock reference according to claim 6, characterized in that, Loss function of neural network model for: ; in, This represents the true time offset of the i-th sample within time period t. This represents the predicted probability of the i-th sample within time period t. Let represent the predicted standard deviation of the i-th sample within time period t, where i represents the sample index, N represents the total number of samples, and t represents the time period index. Represents the regularization parameter. Represents the model parameter set, This represents the squared L2 norm of the model parameters.

8. The NTP timing error collaborative correction method based on multi-level clock reference according to claim 1, characterized in that, Step 4 includes the following steps: Step 41: Obtain the time-level signal set, the communication quality of each communication link, and the error set; Step 42: Add an offset to the time signal at each time level, with the primary objective of minimizing the error at each time level, and establish a time level error allocation model with the highest possible sum of confidence of the time signals at each time level. Step 43: Solve the allocation model using the particle swarm optimization algorithm to generate residual allocation schemes for each time level.

9. The NTP timing error collaborative correction method based on multi-level clock reference according to claim 8, characterized in that, The time-level error allocation model is as follows: First goal: ; ; ; ; Second objective: ; in, Indicates satellite time. Indicates server time. Indicates local time. Indicates the offset of satellite time. This indicates the offset of the server time. This indicates the offset of the local time. Indicates the first time error. This indicates the second time error. This indicates the third time error. This indicates the confidence level of the time signal after the satellite time has shifted. This indicates the confidence level of the time signal after the server time offset. This indicates the confidence level of the time signal after the local time offset.

10. The NTP timing error collaborative correction method based on multi-level clock reference according to claim 9, characterized in that, Step 5 includes the following steps: Step 51: Correct the time obtained at each time level according to the residual allocation scheme to obtain the accurate time; Step 52: Using accurate time as a label and communication quality as a sample, repeatedly train the neural network model to obtain the overall rate of change of the model parameters inside the neural network model; Step 53: Generate the accuracy probability of NTP timing based on the mutation characteristics of the overall rate of change. The mutation rate characteristic is the slope of the overall rate of change.