A clock difference detection and correction method and device for real-time atomic time calculation
Patent Information
- Application Number
- CN202310370007.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-07
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-04-07
AI Technical Summary
[0005]本发明提出一种用于实时原子时计算的钟差检测与修正方法及装置,根据不同异常值所属的异常情况类型,选用合适的修正算法对该异常值进行修正,从而解决传统的钟差数据异常值检测与修正方法无法修正所有异常情况的问题
[0023]本发明实施例提供的用于实时原子时计算的钟差检测与修正方法及装置,通过采用合适的修正算法对不同的异常值进行修正,从而进一步提高检测效率和修正效果。
Smart Images

Figure CN116449672B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of clock error correction technology, and in particular to a method and apparatus for clock error detection and correction for real-time atomic time calculation. Background Technology
[0002] Due to various internal and external factors, the reliability of a single atomic clock in maintaining local time is significant. To improve the reliability of local time maintenance, multiple atomic clocks are typically used for integrated atomic time calculation to generate a continuously stable and reliable integrated local atomic time. Clock bias is the most fundamental and critical element in calculating this integrated local atomic time. However, due to numerous factors such as system power outages, clock lockouts, circuit thermal noise, and component aging, the original clock bias data is never ideal, exhibiting data gaps, errors, and phase jumps, making it unsuitable for direct use in integrated atomic time calculations. Correction of the clock bias data is necessary. This is especially crucial in real-time integrated atomic time calculations, where timely detection and correction of the clock bias data are essential.
[0003] Existing methods for detecting anomalies in clock bias data mainly include threshold methods, the 3σ criterion, wavelet analysis, the median method, and the method of comparing the mean of adjacent data windows. The empirical threshold value of the threshold method can only reflect long-term data distribution patterns and cannot adapt to short-term data changes. The 3σ criterion is suitable for data sequences that conform to a normal distribution. When there are individual outliers in the data sequence, the 3σ criterion can effectively detect them. However, atomic clock alignment data is quite complex, and sometimes phase jumps occur, which the 3σ criterion cannot accurately locate. Wavelet analysis has the characteristics of multi-resolution analysis and the ability to characterize local signal features in both the time and frequency domains. However, wavelet analysis algorithms are complex and difficult to implement. The median method, proposed by Riley, can effectively improve computational efficiency for large data sequences and is a simple and effective data detection method often used for outlier detection. Phase jumps are a special type of anomaly, characterized by an atomic clock phase jumping from one value to another, causing discontinuities in the phase data. Most algorithms detect them by comparing the average of two adjacent windows moving across the relevant data; others use cumulative summation plots or similar methods. Anomaly detection and correction of clock difference data used for real-time atomic time calculations requires meeting two requirements: real-time detection of outliers to meet the demands of real-time atomic time calculations; and correction of outliers to conform to the inherent operating characteristics of the atomic clock. All existing outlier detection and correction algorithms have their own advantages and disadvantages; currently, no single algorithm can correct all anomalies to an ideal level.
[0004] Therefore, there is a need for a clock error detection and correction method and apparatus for real-time atomic time calculation. Summary of the Invention
[0005] This invention proposes a clock error detection and correction method and apparatus for real-time atomic time calculation. According to the type of anomaly to which different outliers belong, an appropriate correction algorithm is selected to correct the outlier, thereby solving the problem that traditional clock error data outlier detection and correction methods cannot correct all anomalies.
[0006] This invention provides the following technical solution:
[0007] In one aspect, this specification provides a clock difference detection and correction method for real-time atomic time calculation, comprising: converting clock difference data into frequency data; detecting frequency data using the median detection method to obtain outliers; obtaining the anomaly type of the time difference data based on the correspondence between the clock difference data and the frequency data; and correcting the outliers based on the anomaly type.
[0008] Optionally, the step of using the median detection method to detect frequency data and obtain outliers specifically includes: obtaining the median of the frequency data based on the data sequence of the frequency data; obtaining the detected median of the frequency data based on the median of the frequency data; obtaining outliers based on the detected median of the frequency data; and marking the outliers using a flag bit.
[0009] Optionally, obtaining the anomaly type of the time difference data based on the correspondence between the clock difference data and the frequency data specifically includes: calculating the frequency difference between the time difference data corresponding to two non-abnormal flag bits before and after the abnormal flag bit to obtain the abnormal frequency difference; determining whether the abnormal frequency difference is greater than the anomaly judgment threshold based on the number of consecutive abnormal flag bits; if the number of consecutive abnormal flag bits is less than 10 and the abnormal frequency difference is not greater than the anomaly judgment threshold, then the time difference data corresponding to the abnormal flag bit is a gross error; if the number of consecutive abnormal flag bits is not less than 1 and less than 10 and the abnormal frequency difference is greater than the anomaly judgment threshold, then a phase jump occurs at the time difference acquisition time corresponding to the abnormal flag bit.
[0010] Optionally, after determining whether the abnormal frequency difference is greater than the abnormal determination threshold, the method further includes: if the number of consecutive abnormal flag bits is not less than 1 and less than 10 and the abnormal frequency difference is greater than the abnormal determination threshold, determining whether the number of consecutive normal clock errors is not less than a second preset threshold; if yes, it is a long-term phase jump; if no, it is a short-term phase jump.
[0011] Optionally, after determining whether the abnormal frequency difference is greater than the abnormal judgment threshold, the method further includes: if the number of consecutive abnormal flag bits is not less than 10, then an alarm is triggered to remind the user that the system clock difference acquisition is abnormal.
[0012] Optionally, after determining whether the abnormal frequency difference is greater than the abnormality determination threshold based on the number of consecutive abnormal flag bits, the method further includes: determining whether the number of consecutive normal clock errors is not less than a second preset threshold; if the number of consecutive abnormal flag bits is not less than 1 and less than 10, the abnormal frequency difference is greater than the abnormality determination threshold, and the number of consecutive normal clock errors is less than the second preset threshold, then the abnormality type is updated to short-term phase skipping; if the number of consecutive abnormal flag bits is not less than 1 and less than 10, the abnormal frequency difference is greater than the abnormality determination threshold, and the number of consecutive normal clock errors is not less than the second preset threshold, then the abnormality type is updated to long-term phase skipping.
[0013] Optionally, after determining whether the abnormal frequency difference is greater than the abnormality determination threshold based on the number of consecutive abnormal flag bits, the method further includes: if the number of consecutive abnormal flag bits is less than 3 and the abnormal frequency difference is not greater than the abnormality determination threshold, then the abnormal value is corrected using the linear interpolation method; if the number of consecutive abnormal flag bits is greater than 3 and less than 10 and the abnormal frequency difference is not greater than the abnormality determination threshold, then the abnormal value is corrected using the least squares combination model; if the number of consecutive abnormal flag bits is greater than 1 and less than 10 and the abnormal frequency difference is greater than the abnormality determination threshold, then the gross error is corrected using the conventional least squares method.
[0014] Optionally, after determining whether the number of consecutive normal clock errors is not less than the second preset threshold, the method further includes: if the number of consecutive normal clock errors is greater than the second preset threshold, using a phase compensation method to correct the anomaly.
[0015] Optionally, clock bias data can be converted to frequency data using the following formula:
[0016]
[0017] Among them, y i Represents frequency data, p i Represents clock bias data, t i This indicates the acquisition time corresponding to the clock difference data.
[0018] Secondly, the present invention provides a clock error detection and correction device for real-time atomic time calculation, comprising:
[0019] The conversion module is used to convert clock difference data into frequency data;
[0020] The detection module is used to detect frequency data using the median detection method to obtain outliers;
[0021] The judgment module is used to determine the anomaly type of the time difference data based on the correspondence between the clock difference data and the frequency data;
[0022] The correction module is used to correct the abnormal value according to the abnormal type.
[0023] The clock error detection and correction method and apparatus for real-time atomic time calculation provided in this invention improves detection efficiency and correction effect by employing appropriate correction algorithms to correct different outliers. Attached Figure Description
[0024] Figure 1 This is a schematic diagram illustrating the implementation process of the clock error detection and correction method in this embodiment of the invention;
[0025] Figure 2 This is a schematic diagram of the composition of the clock error detection and correction device in an embodiment of the present invention.
[0026] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.
[0028] As described herein, the term “comprising” and its various variations can be understood as open-ended terms that mean “including but not limited to”, and the term “one embodiment” can be understood as “at least one embodiment”.
[0029] Example 1
[0030] The inventors discovered that existing clock error detection and correction methods for real-time atomic time calculations are inadequate for correcting all anomalies. Therefore, embodiments of the present invention select appropriate correction algorithms for different types of anomalies, thereby meeting the anomaly correction requirements under different anomaly conditions.
[0031] like Figure 1 As shown, this embodiment of the invention provides a clock error detection and correction method for real-time atomic time calculation, including:
[0032] Step 1: Convert clock difference data into frequency data.
[0033] In practice, frequency data is more sensitive to anomalies than clock bias data. Therefore, to detect anomalies more promptly and accurately, clock bias data needs to be converted to frequency data first. The conversion method is as follows:
[0034]
[0035] Among them, y i —Frequency data; p i — Clock bias data, unit: s; t i —The acquisition time corresponding to the clock difference data, in seconds.
[0036] Step 2: Detect outliers in the frequency data using an improved median detection method.
[0037] In one embodiment, firstly, the median m of the frequency data is calculated, i.e., the value within the data sequence.
[0038] {(t1,y1),(t2,y2),,(t i ,y i The frequency data is located in the middle position; secondly, the median detection depth (MAD) of the frequency data is calculated.
[0039]
[0040] Then, using MAD to detect abnormal locations in frequency data, an anomaly detection threshold lim is set:
[0041] lim=m+n×MAD (3)
[0042] Among them, when the observed quantity |y i When |>lim (n is a positive integer, and the value of n is different for different atomic clocks), it is considered an outlier;
[0043] Finally, outlier frequencies are marked. In order to avoid introducing new outliers, the detected outlier frequency data are not set to zero using the traditional median method, but are marked using a flag bit.
[0044] Step 3: Determine the type of exception.
[0045] In this step, the anomaly type of the time difference data is determined based on the correspondence between frequency data and clock difference data, as well as the number of consecutive anomaly flags. Two parameters are set here: the number of consecutive anomaly flags, f_count, and the number of consecutive normal clock differences, t_count. The specific determination method is as follows:
[0046] 1) f_count<10, calculate the frequency difference between the time difference data corresponding to the two non-abnormal flag bits before and after the abnormal flag bit according to formula (1). If the frequency difference is not greater than lim in formula (3), then only the time difference data corresponding to the abnormal flag bit is a gross error.
[0047] 2) f_count = 1. Calculate the frequency difference between the time difference data corresponding to the two non-abnormal flag bits before and after the abnormal flag bit according to formula (1). If the frequency difference is greater than lim in formula (3), a phase jump will occur at the time difference acquisition time corresponding to the abnormal flag bit.
[0048] 3) f_count>1 and f_count<10, calculate the frequency difference between the time difference data corresponding to the two non-abnormal flags before and after the abnormal flag bit according to formula (1). If the frequency difference is greater than lim in formula (3), the time difference data corresponding to the abnormal flag bit is a gross error, and a phase jump occurs after the time difference acquisition time corresponding to the abnormal flag bit.
[0049] 4) After abnormal cases 2) and 3), if t_count < 10, it is considered a short-term phase jump;
[0050] 5) After abnormal cases 2) and 3), if t_count ≥ 10, it is considered to be a long-term phase jump, and an alarm is given to remind the user that the clock difference has a phase jump;
[0051] 6) f_count≥10 indicates that the clock error is abnormal for a long period of time. Instead of being treated as an occasional abnormality, an alarm will be triggered to remind the user that the system clock error acquisition is abnormal.
[0052] Step 4: Outlier Correction.
[0053] In one embodiment, outlier values are corrected based on different anomaly conditions, as follows:
[0054] 1) For the abnormal situation 1) in step three, when f_count < 3, the linear interpolation method is used to correct the outlier, i.e.
[0055]
[0056] Among them, y pre y next t represents the values of two adjacent normal points before and after the outlier. i t pre t next These represent the sampling times corresponding to the abnormal time difference and the two adjacent normal time difference values before and after the abnormal time difference, respectively.
[0057] 2) For the outlier case 1) in step 3, when f_count > 3 and f_count < 10, the least squares combination model is used to correct the outlier. The algorithm process of the least squares combination model is as follows:
[0058] a) Let the k sets of normal data points preceding the outlier be {(t1,y1),(t2,y2),,(t...}}. k ,y k The k sets of normal data points following the outlier are:
[0059] {(t k+f_count+1 ,y k+f_count+1 ),(t k+f_count+2 ,y k+f_count+2 ),,(t 2k+f_count ,y 2k+f_count Both sets of data points are known.
[0060] b) Model the forward k sets of data using least squares fitting, and use this model to calculate the predicted values corresponding to the anomalous times in the f_count group. The predicted values corresponding to the time points of the k sets of normal data backwards.
[0061]
[0062] c) Calculate the predicted values for the k sets of backward data points.
[0063] Compared with the measured value {(t) k+f_count+1 ,y k+f_count+1 ),(t k+f_count+2 ,y k+f_count+2 ),…,(t 2k+f_count ,y 2k+f_count The residual at the corresponding time {(t)} k+f_count+1 ,Δy k+f_count+1 ),(t k+f_count+2 ,Δy k+f_count+2 ),…,(t 2k+f_count ,Δy 2k+f_count )};
[0064] d) Use least squares fitting to fit the residuals {(t) of the backward k sets of data points k+f_count+1 ,Δy k+f_count+1 ),(t k+f_count+2 ,Δy k+f_count+2 ),,(t 2k+f_count ,Δy 2k+f_count Model the data and use the model to predict the prediction residuals of outliers in group f_count.
[0065] e) The final correction value for the outlier group f_count is
[0066] In practical applications, a k value of 48 is chosen, and least squares linear fitting is used to model the time difference data of cesium atomic clocks, while least squares quadratic fitting is used to model the time difference data of hydrogen atomic clocks, resulting in the best correction effect.
[0067] 3) For the outlier in step 3), the conventional least squares method is used to correct the gross errors. The correction process is as follows: Let the k sets of normal data points before the outlier be {(t1,y1),(t2,y2),…,(t…}. k ,y k We use least squares fitting to model these k sets of data, and use this model to calculate the predicted values corresponding to the abnormal times in the f_count group. As a result of the correction, in practical applications, a k value of 48 is chosen, and least squares linear fitting is used to model the time difference data of cesium atomic clocks, while least squares quadratic fitting is used to model the time difference data of hydrogen atomic clocks, resulting in the best correction effect.
[0068] 4) For the abnormal situation in step 3, step 4), the phase compensation method is used for anomaly correction. Let (t) i ,y i (t) is the starting point of the phase transition. i-1 ,y i-1 ) and (t i+1 ,y i+1 ) are two normal data points adjacent to each other before and after the phase-jumping data point, then
[0069]
[0070] Among them, y i,new This is the value after phase compensation at the phase jump point.
[0071] In the above embodiments, an improved median method is used to detect outliers in atomic clock alignment data. Based on the outlier, the type of outlier is determined and an appropriate correction algorithm is selected to correct the outlier. This solves the problem that traditional clock difference data outlier detection and correction methods cannot correct all outliers.
[0072] Example 2
[0073] Based on the same technical concept, this invention also provides a clock error detection and correction device for real-time atomic time calculation. Since the principle of the above device in solving the problem is similar to that of the clock error detection and correction method for real-time atomic time calculation, the implementation of the above device can refer to the implementation of the method, and the repeated parts will not be described again.
[0074] Figure 2The schematic diagram illustrates the composition of a clock error detection and correction device for real-time atomic time calculation according to an embodiment of this application, including:
[0075] The conversion module is used to convert clock difference data into frequency data;
[0076] The detection module is used to detect frequency data using the median detection method to obtain outliers;
[0077] The judgment module is used to determine the anomaly type of the time difference data based on the correspondence between the clock difference data and the frequency data;
[0078] The correction module is used to correct the abnormal value according to the abnormal type.
[0079] In summary, the embodiments of the present invention employ an improved median method to detect outliers in atomic clock alignment data. After detecting the location of an outlier, the specific phenomenon of the outlier is analyzed to determine its type of anomaly. Then, by combining the advantages of various correction algorithms, a suitable correction algorithm is flexibly selected. Its characteristics are accurate anomaly location detection, strong real-time detection, highly targeted correction algorithm, and excellent correction effect.
[0080] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0081] Those skilled in the art will understand that, in addition to implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, making the system and its various devices, modules, and units provided by this invention function as logic gates, switches, application-specific integrated circuits, programmable logic controllers, etc. Therefore, the system and its various devices, modules, and units provided by this invention can be regarded as either structures within hardware components or as software modules that implement the method.
[0082] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A clock error detection and correction method for real-time atomic time calculation, characterized in that, include: Convert clock bias data into frequency data; The median detection method is used to detect frequency data, outliers are obtained, and flag bits are used to mark the outliers; The frequency difference between the time difference data corresponding to the two non-abnormal flag bits before and after the abnormal flag bit is calculated to obtain the abnormal frequency difference. Based on the number of consecutive abnormal flag bits, determine whether the abnormal frequency difference is greater than the abnormal judgment threshold, so as to determine the abnormal type of the time difference data; If the number of consecutive abnormal flag bits is less than 10 and the abnormal frequency difference is not greater than the abnormal judgment threshold, then the time difference data corresponding to the abnormal flag bits is a gross error. If the number of consecutive abnormal flag bits is equal to 1 and the abnormal frequency difference is greater than the abnormal judgment threshold, then it is determined that a phase jump occurs at the time difference acquisition time corresponding to the abnormal flag bit. If the number of consecutive abnormal flag bits is greater than 1 and less than 10, and the abnormal frequency difference is greater than the abnormal judgment threshold, then the time difference data corresponding to the abnormal flag bit is determined to be a gross error, and a phase jump occurs after the time difference acquisition time corresponding to the abnormal flag bit. Based on the anomaly type, the abnormal value is corrected, specifically including: If the number of consecutive abnormal flag bits is less than 3 and the abnormal frequency difference is not greater than the abnormal judgment threshold, then the abnormal value is corrected by the linear difference method. If the number of consecutive abnormal flag bits is greater than 3 and less than 10 and the abnormal frequency difference is not greater than the abnormal judgment threshold, then the least squares combination model is used to correct the abnormal value. If the number of consecutive abnormal flag bits is greater than 1 and less than 10, and the abnormal frequency difference is greater than the abnormal judgment threshold, then the gross error is corrected by the conventional least squares method. If the number of consecutive abnormal flag bits is equal to 1 and the abnormal frequency difference is greater than the abnormal judgment threshold, then it is determined whether the number of consecutive normal clock errors is less than the second preset threshold. If so, it is determined to be a short-term phase jump, and the abnormal value is corrected by the phase compensation method. If the number of consecutive normal clock errors is not less than the second preset threshold, it is determined to be a long-term phase jump, and the abnormal value is corrected by the phase compensation method. If the number of consecutive abnormal flag bits is not less than 10, an alarm will be triggered to remind the user that the system clock difference acquisition is abnormal.
2. The method according to claim 1, characterized in that, The method of using the median detection method to detect frequency data and obtain outliers specifically includes: The median of the frequency data is obtained from the data sequence of the frequency data. The median of the frequency data is obtained based on the median of the frequency data. The outlier is obtained by detecting the median based on the frequency data.
3. The method according to claim 1, characterized in that, Convert clock bias data to frequency data using the following formula: in, Represents frequency data. Represents clock difference data, This indicates the acquisition time corresponding to the clock difference data.
4. A clock error detection and correction device for real-time atomic time calculation, characterized in that, include: The conversion module is used to convert clock difference data into frequency data; The detection module is used to detect frequency data using the median detection method, obtain outliers, and mark the outliers using a flag bit. The judgment module is used to calculate the frequency difference between the time difference data corresponding to the two non-abnormal flag bits before and after the abnormal flag bit, and obtain the abnormal frequency difference; Based on the number of consecutive abnormal flag bits, determine whether the abnormal frequency difference is greater than the abnormal judgment threshold, so as to determine the abnormal type of the time difference data; If the number of consecutive abnormal flag bits is less than 10 and the abnormal frequency difference is not greater than the abnormal judgment threshold, then the time difference data corresponding to the abnormal flag bits is a gross error. If the number of consecutive abnormal flag bits is equal to 1 and the abnormal frequency difference is greater than the abnormal judgment threshold, then it is determined that a phase jump occurs at the time difference acquisition time corresponding to the abnormal flag bit. If the number of consecutive abnormal flag bits is greater than 1 and less than 10, and the abnormal frequency difference is greater than the abnormal judgment threshold, then the time difference data corresponding to the abnormal flag bit is determined to be a gross error, and a phase jump occurs after the time difference acquisition time corresponding to the abnormal flag bit. The correction module is used to correct the abnormal value according to the abnormality type, specifically including: If the number of consecutive abnormal flag bits is less than 3 and the abnormal frequency difference is not greater than the abnormal judgment threshold, then the abnormal value is corrected by the linear difference method. If the number of consecutive abnormal flag bits is greater than 3 and less than 10 and the abnormal frequency difference is not greater than the abnormal judgment threshold, then the least squares combination model is used to correct the abnormal value. If the number of consecutive abnormal flag bits is greater than 1 and less than 10, and the abnormal frequency difference is greater than the abnormal judgment threshold, then the gross error is corrected by the conventional least squares method. If the number of consecutive abnormal flag bits is equal to 1 and the abnormal frequency difference is greater than the abnormal judgment threshold, then it is determined whether the number of consecutive normal clock errors is less than the second preset threshold. If so, it is determined to be a short-term phase jump, and the abnormal value is corrected by the phase compensation method. If the number of consecutive normal clock errors is not less than the second preset threshold, it is determined to be a long-term phase jump, and the abnormal value is corrected by the phase compensation method. If the number of consecutive abnormal flag bits is not less than 10, an alarm will be triggered to remind the user that the system clock difference acquisition is abnormal.
Citation Information
Patent Citations
Method and device for monitoring clock error data of atomic clock group
CN118118017A