Time synchronization method and device based on multi-channel time service signal, electronic equipment and medium
By performing performance evaluation and time deviation calculation of multi-channel timing signals, and time smooth correction combined with cubic spline interpolation method, the problem of reduced stability and reliability in the face of complex environments is solved, and efficient and stable time synchronization is achieved.
Patent Information
- Application Number
- CN202510060005.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-01-15
AI Technical Summary
When existing multi-channel timing systems face dynamic changes in signal quality, severe security threats, unsmooth channel switching and lack of a comprehensive channel evaluation mechanism, they are difficult to adapt to complex and changeable actual environments, resulting in reduced stability and reliability.
A time synchronization method based on multi-channel timing signal is proposed. By receiving and preprocessing multi-channel timing signals, performance evaluation is performed to determine the main channel timing signal, the current reference time of the system clock to be corrected is obtained, the time deviation amount is calculated, and the cubic spline interpolation method is used to perform time smooth correction to achieve time synchronization.
It realizes smooth time synchronization, improves the efficiency and stability of time synchronization, adapts to complex and changeable actual environments, and meets the increasingly stringent time synchronization needs.
Smart Images

Figure CN119966561A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of time synchronization, and in particular to a time synchronization method, device, electronic device and medium based on multi-channel timing signals. Background Art
[0002] In modern society, accurate time synchronization is essential for many critical infrastructures and high-precision applications. From the Global Navigation Satellite System (GNSS), 5G communication networks, financial trading systems to power smart grids, all rely on nanosecond or even picosecond time synchronization accuracy. In order to meet these stringent requirements, multi-channel timing systems have emerged. Such systems provide time synchronization services by simultaneously receiving and processing signals from multiple time sources, such as different GNSS systems such as GPS, Beidou, and GLONASS, as well as ground atomic clocks, optical fiber time transmission, etc.
[0003] However, with the increasing complexity of the application environment and the increase in malicious interference, the existing multi-channel timing system faces a series of severe challenges, such as dynamic changes in signal quality, increasingly severe security threats, uneven channel switching, and lack of a comprehensive channel evaluation mechanism. It is difficult to adapt to the complex and changeable actual environment, resulting in greatly reduced stability and reliability. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a time synchronization method, device, electronic device and medium based on a multi-channel timing signal, which can achieve smooth time synchronization and improve the efficiency and stability of time synchronization.
[0005] On the one hand, an embodiment of the present application proposes a time synchronization method based on a multi-channel timing signal, the method comprising the following steps:
[0006] Receive and pre-process multi-channel timing signals;
[0007] Performing performance evaluation on the multi-channel timing signal to determine the main channel timing signal;
[0008] The current reference time corresponding to the system clock to be corrected is obtained, the time deviation is determined according to the main channel timing signal and the current reference time, and the time smoothing correction is performed on the system clock to be corrected according to the time deviation to complete time synchronization.
[0009] In some embodiments, the receiving and preprocessing of the multi-channel timing signal specifically includes:
[0010] Receiving the multi-channel timing signal, wherein the multi-channel timing signal includes satellite signals corresponding to multiple navigation satellite systems;
[0011] Performing frequency down-conversion, analog-to-digital conversion, and demodulation processing on each of the satellite signals in sequence to obtain a satellite demodulated signal corresponding to each of the satellite signals;
[0012] Extracting information from each of the satellite demodulation signals to obtain pseudorange information and navigation messages corresponding to each of the satellite demodulation signals;
[0013] The navigation message corresponding to each of the satellite demodulation signals is decoded to obtain the satellite orbit parameters and clock correction parameters corresponding to each of the satellite demodulation signals.
[0014] In some embodiments, the performing performance evaluation on the multi-channel timing signals to determine the main channel timing signal specifically includes:
[0015] Obtaining performance evaluation items; the performance evaluation items include signal strength evaluation, signal security evaluation, signal time deviation evaluation and signal stability evaluation;
[0016] According to the performance evaluation item and the pseudorange information, the satellite orbit parameter and the clock correction parameter corresponding to each satellite demodulation signal, a performance evaluation is performed on each satellite demodulation signal to determine a comprehensive performance evaluation score corresponding to each satellite demodulation signal;
[0017] According to the comprehensive performance evaluation scores corresponding to the satellite demodulation signals, the main channel timing signal and multiple secondary channel timing signals are determined from the multiple satellite demodulation signals, wherein the main channel timing signal is the satellite demodulation signal with the highest comprehensive performance evaluation score, and the secondary channel timing signal is the remaining satellite demodulation signals except the main channel timing signal.
[0018] In some embodiments, the method further comprises the steps of:
[0019] Monitoring the time deviation between each of the secondary channel timing signals and the primary channel timing signal;
[0020] According to the time deviation amount corresponding to each of the secondary channel timing signals and a preset time deviation threshold, it is determined whether to switch the main channel timing signal and re-evaluate the performance of the multi-channel timing signal.
[0021] In some embodiments, determining whether to switch the main channel timing signal and re-evaluate the performance of the multi-channel timing signal according to the time deviation amount corresponding to each of the secondary channel timing signals and a preset time deviation threshold specifically includes:
[0022] When the time deviation corresponding to any of the secondary channel timing signals exceeds the time deviation threshold, an alternative channel timing signal is determined from the multiple secondary channel timing signals, and the alternative channel timing signal is acquired as the main channel timing signal. Then, the performance of the multi-channel timing signals is re-evaluated, and the alternative channel timing signal is the secondary channel timing signal with the highest comprehensive performance evaluation score.
[0023] In some embodiments, the obtaining of the current reference time corresponding to the system clock to be corrected, determining the time deviation according to the main channel timing signal and the current reference time, and performing time smoothing correction on the system clock to be corrected according to the time deviation to complete time synchronization specifically includes:
[0024] Obtaining the current satellite signal time, where the current satellite signal time is the time corresponding to the main channel timing signal at the current reference time;
[0025] Determine the time deviation according to the current satellite signal time and the current reference time;
[0026] According to the time deviation, a cubic spline interpolation method is used to perform time smoothing correction on the system clock to be corrected.
[0027] In some embodiments, the time smoothing correction of the system clock to be corrected is performed using a cubic spline interpolation method according to the time deviation, specifically including:
[0028] Constructing an interpolation formula according to the time deviation;
[0029] Acquire the current reference time as the interpolation start time, determine the interpolation end time according to a preset time interval and the current reference time, and determine the target interpolation time period according to the interpolation start time and the interpolation end time;
[0030] Selecting a plurality of interpolation data points from the target interpolation time period, and obtaining the time to be corrected corresponding to each of the interpolation data points in the system clock to be corrected;
[0031] According to the time to be corrected corresponding to each of the interpolation data points, the corrected time corresponding to each of the interpolation data points is calculated using the interpolation formula;
[0032] According to the corrected time corresponding to each of the interpolation data points, the system clock to be corrected is subjected to time smoothing correction to achieve time synchronization between the system clock to be corrected and the main channel timing signal after the interpolation end time.
[0033] On the other hand, an embodiment of the present application proposes a time synchronization device based on a multi-channel timing signal, the device comprising:
[0034] The first module is used to receive and pre-process multi-channel timing signals;
[0035] The second module is used to perform performance evaluation on the multi-channel timing signal and determine the main channel timing signal;
[0036] The third module is used to obtain the current reference time corresponding to the system clock to be corrected, determine the time deviation according to the main channel timing signal and the current reference time, and perform time smoothing correction on the system clock to be corrected according to the time deviation to complete time synchronization.
[0037] On the other hand, an embodiment of the present application provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the time synchronization method described above when executing the computer program.
[0038] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the time synchronization method described above is implemented.
[0039] The embodiments of the present application include at least the following beneficial effects: the present application provides a time synchronization method, device, electronic device and medium based on multi-channel timing signals, which receives and pre-processes multi-channel timing signals, performs performance evaluation on multi-channel timing signals, determines the main channel timing signal, obtains the current reference time corresponding to the system clock to be corrected, determines the time deviation amount according to the main channel timing signal and the current reference time, and performs time smoothing correction on the system clock to be corrected according to the time deviation amount to complete time synchronization. The present application can process multi-channel timing signals, realize smooth time synchronization, improve the efficiency and stability of time synchronization, adapt to complex and changeable actual environments, and meet increasingly stringent time synchronization requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0042] Figure 1 It is a flowchart of a time synchronization method based on a multi-channel timing signal provided in an embodiment of the present application;
[0043] Figure 2 It is a structural schematic diagram of a time synchronization device based on a multi-channel timing signal provided in an embodiment of the present application;
[0044] Figure 3 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0046] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0047] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0049] The existing multi-channel timing system faces a series of severe challenges:
[0050] 1) Dynamic changes in signal quality: In practical applications, the signal quality of different channels will continue to fluctuate due to factors such as atmospheric conditions, electromagnetic interference, and multipath effects. For example, in an urban canyon environment, GNSS signals may experience severe attenuation and multipath interference, resulting in a significant decrease in time synchronization accuracy. Existing systems often have difficulty in responding to such dynamic changes in real time, affecting the overall synchronization performance.
[0051] 2) Increasingly severe security threats: With the deepening of understanding of time synchronization attacks, deception and interference methods are also constantly upgrading. For example, advanced GNSS spoofers can simulate multiple satellite signals at the same time, making it difficult for traditional single defense mechanisms to work. This not only threatens the accuracy of the timing system, but is also likely to cause serious damage to critical infrastructure that relies on precise time.
[0052] 3) Channel switching is not smooth: In actual operation, when the quality of the main time source deteriorates and needs to be switched to the backup source, the existing system often cannot achieve a smooth transition. This sudden time jump may cause misoperation of downstream systems, causing serious consequences in time-sensitive applications such as financial transactions or power dispatching.
[0053] 4) Lack of comprehensive evaluation mechanism: Current multi-channel timing systems often rely on a single or limited number of indicators (such as signal strength) to select the optimal channel. However, in complex practical environments, this simple evaluation method cannot fully reflect the actual performance and reliability of each channel, which may lead to suboptimal channel selection decisions.
[0054] Based on this, the embodiments of the present application provide a time synchronization method, device, electronic device and medium based on multi-channel timing signals, which can realize intelligent fusion, dynamic evaluation and security protection of multi-source time signals, adapt to complex and changeable actual environments, resist advanced interference and deception attacks, provide smooth and stable time synchronization output, and have strong scalability and adaptability to meet increasingly stringent time synchronization requirements.
[0055] Reference Figure 1 , Figure 1 This is an optional flowchart of a time synchronization method based on a multi-channel timing signal provided in an embodiment of the present application. The method may include but is not limited to steps S101 to S103:
[0056] Step S101, receiving and preprocessing multi-channel timing signals;
[0057] Step S102, performing performance evaluation on the multi-channel timing signals to determine the main channel timing signal;
[0058] Step S103, obtaining the current reference time corresponding to the system clock to be corrected, determining the time deviation according to the main channel timing signal and the current reference time, and performing time smoothing correction on the system clock to be corrected according to the time deviation to complete time synchronization.
[0059] In some embodiments, step S101 may include but is not limited to steps S201 to S204:
[0060] Step S201, receiving a multi-channel timing signal, where the multi-channel timing signal includes satellite signals corresponding to multiple navigation satellite systems;
[0061] Step S202, performing frequency down-conversion, analog-to-digital conversion and demodulation processing on each satellite signal in sequence to obtain a satellite demodulated signal corresponding to each satellite signal;
[0062] Step S203, extracting information from each satellite demodulation signal to obtain pseudorange information and navigation messages corresponding to each satellite demodulation signal;
[0063] Step S204: Decode the navigation message corresponding to each satellite demodulation signal to obtain the satellite orbit parameters and clock correction parameters corresponding to each satellite demodulation signal.
[0064] In some embodiments, the main purpose of preprocessing is to convert satellite signals of multiple navigation satellite systems into digital information that can be subsequently processed. The preprocessing may include, but is not limited to, signal frequency reduction, analog-to-digital conversion, BPSK demodulation, pseudorange information extraction, navigation message decoding, data filtering, and time tagging, as follows:
[0065] 1) Signal downconversion: Convert high-frequency RF signals to intermediate frequency or baseband signals for subsequent digital processing;
[0066] 2) Analog-to-digital conversion: converting analog signals into digital signals so that subsequent digital signal processing can be performed;
[0067] 3) BPSK demodulation: For most GNSS signals, binary phase shift keying (BPSK) modulation is used. Therefore, BPSK demodulation is required to extract the navigation message information modulated on the carrier;
[0068] 4) Pseudorange information extraction: Extract pseudorange information from the demodulated signal. Pseudorange is the product of the time required for satellite signal transmission and reception and the speed of light, and is the basic data for positioning and timing.
[0069] 5) Navigation message decoding: parsing the satellite orbit parameters, clock correction parameters and other information contained in the navigation message, which is crucial for subsequent precise positioning and timing calculations;
[0070] 6) Data filtering: remove obviously abnormal data, such as signal strength that is too low or pseudorange measurements that are obviously unreasonable;
[0071] 7) Time stamp: Add an accurate timestamp to the data of each channel to facilitate subsequent synchronization and comparison of multi-channel data.
[0072] Through the above preprocessing, the multi-channel timing signal is converted into a series of structured digital data, including pseudorange measurement values, signal strength indicators, satellite orbits and clock information, etc.
[0073] In some embodiments, step S102 may include but is not limited to steps S301 to S303:
[0074] Step S301, obtaining performance evaluation items; the performance evaluation items include signal strength evaluation, signal security evaluation, signal time deviation evaluation and signal stability evaluation;
[0075] Step S302, performing performance evaluation on each satellite demodulation signal according to the performance evaluation item and the pseudorange information, satellite orbit parameters and clock correction parameters corresponding to each satellite demodulation signal, and determining a comprehensive performance evaluation score corresponding to each satellite demodulation signal;
[0076] Step S303, according to the comprehensive performance evaluation scores corresponding to the demodulated signals of each satellite, determine the main channel timing signal and multiple secondary channel timing signals from multiple satellite demodulated signals, wherein the main channel timing signal is the satellite demodulated signal with the highest comprehensive performance evaluation score, and the secondary channel timing signal is the remaining satellite demodulated signals except the main channel timing signal.
[0077] In some embodiments, the process of signal strength evaluation includes calculating a carrier-to-noise ratio (C / N0), where the carrier-to-noise ratio is calculated by the following formula:
[0078]
[0079] Among them, C / N0 is the carrier-to-noise ratio, P1 is the signal power of the satellite demodulation signal, P2 is the noise power density corresponding to the satellite demodulation signal, and B is the noise bandwidth corresponding to the satellite demodulation signal. In a multi-channel timing system, the C / N0 value is usually between 35dB-Hz and 55dB-Hz. The higher the C / N0 value, the better the signal strength. By comparing the C / N0 of the satellite demodulation signals corresponding to different channels, it is preliminarily determined which signals are more reliable. Optionally, the C / N0 value is divided into the following levels: below 35dB-Hz: determined as a weak signal; 35-40dB-Hz: determined as a usable signal; 40-45dB-Hz: determined as a good signal; above 45dB-Hz: determined as a high-quality signal.
[0080] Signal stability assessment involves the use of Allan analysis of variance, which is calculated using the formula:
[0081]
[0082] Among them, y is the normalized frequency measurement value of the current evaluation signal, τ is the sampling interval, and N is the number of samples. In a multi-channel timing system, a lower AVAR value indicates a more stable signal, which helps to provide more reliable time synchronization. The short-term and long-term stability of each channel signal is analyzed by calculating the AVAR at different time scales τ.
[0083] Specifically, y can be expressed as:
[0084]
[0085] Among them, y i is the normalized frequency measurement value in the i-th time interval, which is the relative frequency deviation obtained by measuring the frequency of the current evaluation signal, f i is the frequency measured in the i-th time interval, f0 is the nominal frequency (ideal frequency), and the normalized frequency measurement value y actually represents the deviation of the frequency from the nominal frequency. Oscillators in different frequency ranges can be directly compared.
[0086] A lower AVAR value indicates a more stable signal, which helps provide more reliable time synchronization. Different types of clocks have different AVAR values at different sampling intervals (τ). Different AVAR thresholds are set for different types of clock sources. For example, for a quartz crystal-based receiver, when τ = 1 second, the system expects an AVAR value less than 1e-11. For a rubidium-based receiver, when τ = 1 second, the system expects an AVAR value less than 1e-12. When analyzing a GNSS receiver based on a rubidium atomic clock, if the AVAR value measured at τ = 100 seconds is 3e-13, the receiver is judged to have good stability, as expected.
[0087] Signal time deviation assessment is the clock deviation assessment between the multi-channel timing signal and the system clock to be corrected, including the use of Kalman filter to estimate the clock deviation and drift, where the state vector contains the clock deviation and drift, and the measurement equation is:
[0088] z=Hx+v;
[0089] In the multi-channel timing system, z represents the observed time deviation, x is the state vector (including clock deviation and drift), v is the measurement noise, H is the observation matrix, and H is defined as [1 0].
[0090] Specifically, H = [1 0] means that the observed value z is only directly related to the first component (clock deviation) of the state vector x. This allows the clock deviation between the timing signals of different channels and the system clock to be corrected to be directly measured. At the same time, the clock drift can be estimated and tracked through the prediction and update cycle of the Kalman filter. For example, the state vector Where b is the clock deviation (unit: second), d is the clock drift (unit: second / second), then the observation equation z=Hx+v, is actually equivalent to z=b+v, that is, the observation value directly corresponds to the clock deviation plus the measurement noise. By way of example, different levels of time deviation thresholds are set: for high-precision GNSS receivers, the expected time deviation is set within ±20 nanoseconds; for ordinary GNSS receivers, the expected time deviation is set within ±100 nanoseconds. When it is detected that the time deviation of a high-precision GNSS receiver is 15 nanoseconds, the receiver is judged to be working normally and its data continues to be used. When it is detected that the time deviation of a channel timing signal suddenly increases to 200 nanoseconds, the channel is marked as abnormal and the re-evaluation process is triggered.
[0091] The state transfer equation is:
[0092] x k+1 =Φx k +w;
[0093] Where w is the process noise, Φ is the state transfer matrix, which describes how the clock deviation and drift change. The state transfer matrix Φ is preset to a 2×2 square matrix:
[0094]
[0095] Among them, Δt represents the time interval between two measurements. The design of the matrix is based on the following considerations: the new clock deviation is equal to the old clock deviation plus the clock drift multiplied by the time interval (Δt), corresponding to the first row of the matrix [1 Δt]; the change of clock drift: in a short time, it is assumed that the clock drift remains unchanged, corresponding to the second row of the matrix [0 1]. For example, if the current state is where b k is the current clock deviation, d k is the current clock drift, then the next state x k+1 It can be expressed as:
[0096]
[0097] The process noise w is usually modeled as zero-mean Gaussian white noise, and its corresponding covariance matrix Q can be determined according to the specific characteristics of the multi-channel timing system. The covariance matrix Q is as follows:
[0098]
[0099] in, and denote the process noise variance of clock bias and drift, respectively.
[0100] In some embodiments, signal security assessment may include, but is not limited to, transition detection, consistency checking, and signature analysis.
[0101] Transition detection includes the use of a cumulative sum (CUSUM) algorithm, and the corresponding calculation formula is:
[0102] S i =max(0,S i-1 +(x i -μ0)-k);
[0103] Among them, S i For x i The corresponding CUSUM value, μ0 is the target mean, and k is the reference value. i If the preset threshold is exceeded, a mutation is considered to have occurred, indicating that a channel is abnormal and needs to be re-evaluated. i It represents the time deviation observed between the timing signals of different channels and the system clock to be corrected at the i-th observation time. The time deviation x i It directly reflects the accuracy of the timing signal and is the basic data for the CUSUM algorithm to detect jumps. i , sensitively capturing abnormal changes in time synchronization, including sudden jumps and slow drifts.
[0104] Optionally, different detection thresholds are set according to different application scenarios. For second-level time synchronization, the detection threshold is set to 5 times the standard deviation of the observation value. For nanosecond-level high-precision time synchronization, the threshold is set to 3 times the standard deviation of the observation value. Assuming that the time deviation observation value sequence (unit: nanosecond) of a channel is [5,8,3,35,7,9], and the standard deviation is 10 nanoseconds, the system sets the detection threshold to 30 nanoseconds, and calculates the CUSUM sequence to [0,1,0,28,28,30]. When the CUSUM value reaches 30, it is determined that a jump occurs.
[0105] The consistency check involves calculating the Pearson correlation coefficient between channels, which is calculated as:
[0106]
[0107] Among them, r is the Pearson correlation coefficient between channels, X i and Y i Respectively represent the time values of the timing signals of two different channels at the same time. and Respectively represent X i and Y i The value range of the Pearson correlation coefficient r is [-1,1], where r close to 1 indicates that the two channels are highly positively correlated and have the same time variation trend; r close to -1 indicates that the two channels are highly negatively correlated and have opposite time variation trends; and r close to 0 indicates that there is almost no linear relationship between the two channels, indicating an abnormality.
[0108] Exemplarily, the value range of the Pearson correlation coefficient r is explained as follows: r is between 0.9 and 1.0: determined to be highly consistent; r is between 0.7 and 0.9: determined to be well consistent; r is between 0.5 and 0.7: determined to be moderately consistent; r is less than 0.5: determined to be low consistent. In actual operation, the time series of two GNSS receivers are compared: for example, X = [2, 4, 5, 4, 5] nanoseconds, Y = [1, 3, 6, 5, 7] nanoseconds, and the calculated Pearson correlation coefficient is approximately 0.95, which determines that the two receivers are highly consistent.
[0109] Feature analysis includes using support vector machine (SVM) to perform anomaly detection on timing signals of different channels. Feature selection data include signal strength, stability index and time deviation, etc. The support vector machine kernel function selects RBF kernel. Specifically, the trained support vector machine is used to input the feature selection data corresponding to the timing signal of each channel into the support vector machine, and the anomaly detection results corresponding to the timing signal of each channel are output.
[0110] In some embodiments, the comprehensive performance evaluation score is calculated using a weighted summation method. Specifically, the comprehensive performance evaluation score is calculated using the following formula:
[0111]
[0112] Among them, Sum is the comprehensive performance evaluation score, N is the number of performance evaluation items, and w i is the weight corresponding to the i-th performance evaluation item, S i is the performance evaluation score corresponding to the i-th performance evaluation item.
[0113] Exemplarily, the calculation method of the performance evaluation score corresponding to the performance evaluation item is as follows:
[0114] 1) Signal strength score: corresponds to the signal strength assessment, based on the previously calculated carrier-to-noise ratio (C / N0) value, normalized to a range of 0-100;
[0115] 2) Stability score: corresponds to the signal stability assessment, based on the Allan variance (AVAR) analysis results, which are inversely mapped to a score range of 0-100. Lower AVAR values will result in higher stability scores;
[0116] 3) Deviation score: corresponds to the signal time deviation assessment, based on the clock deviation and drift estimated by the Kalman filter, calculates the closeness to the ideal value and maps it to a score range of 0-100;
[0117] 4) Safety score: corresponds to the signal safety assessment, which comprehensively considers the results of jump detection, consistency check and feature analysis. If no anomaly is detected, a higher safety score is given; if a potential problem is detected, the score is reduced accordingly according to the severity of the problem.
[0118] In some embodiments, after calculating the comprehensive performance evaluation score corresponding to each channel timing signal, the main channel timing signal is selected according to the following steps:
[0119] Sorting: sort the timing signals of all channels from high to low according to the comprehensive performance evaluation scores;
[0120] Threshold screening: Set a minimum score threshold and remove channels whose comprehensive performance evaluation scores are lower than the minimum score threshold;
[0121] Determination of main channel timing signal: The timing signal of the channel with the highest comprehensive performance evaluation score is used as the main channel timing signal, and the timing signals of the remaining channels are determined as secondary channel timing signals;
[0122] Determination of the backup channel timing signal: Select the secondary channel timing signal with the highest comprehensive performance evaluation score from multiple secondary channel timing signals as the backup channel timing signal to prepare for rapid switching when problems occur in the main channel timing signal.
[0123] In some embodiments, step S103 may include but is not limited to steps S401 to S403:
[0124] Step S401, obtaining the current satellite signal time, where the current satellite signal time is the time corresponding to the main channel timing signal under the current reference time;
[0125] Step S402, determining a time deviation according to the current satellite signal time and the current reference time;
[0126] Step S403: Based on the time deviation, a cubic spline interpolation method is used to perform time smoothing correction on the system clock to be corrected.
[0127] In some embodiments, a weighted moving average filter is applied to perform preliminary smoothing on the system clock to be corrected; a Kalman filter is used to further optimize the time estimation, and when the channel is switched, a cubic spline interpolation algorithm is used to achieve a smooth transition of the system clock to be corrected.
[0128] In some embodiments, step S403 may include but is not limited to steps S501 to S505:
[0129] Step S501, constructing an interpolation formula according to the time deviation;
[0130] Step S502, obtaining the current reference time as the interpolation start time, determining the interpolation end time according to the preset time interval and the current reference time, and determining the target interpolation time period according to the interpolation start time and the interpolation end time;
[0131] Step S503, selecting a plurality of interpolation data points from the target interpolation time period, and obtaining the time to be corrected corresponding to each interpolation data point in the system clock to be corrected;
[0132] Step S504, according to the to-be-corrected time corresponding to each interpolation data point, using the interpolation formula to calculate the corrected time corresponding to each interpolation data point;
[0133] Step S505, performing time smoothing correction on the system clock to be corrected according to the corrected time corresponding to each interpolation data point, so as to achieve time synchronization between the system clock to be corrected and the main channel timing signal after the interpolation end time.
[0134] In some embodiments, when the system clock to be corrected needs to switch from a main channel timing signal to another channel timing signal, in order to avoid sudden changes in output time, a cubic spline interpolation algorithm is used for smooth transition.
[0135] Optionally, the interpolation function is as follows:
[0136] S(t)=a i +b i (tt i )+c i (tt i ) 2 +d i (tt i ) 3
[0137] Among them, t represents the independent variable, that is, time, t i represents the t value of a known data point, a i , b i 、c i and d i are all spline coefficients, which are determined by solving the equations. S(t) is the interpolation function, which is used to calculate the interpolation result at any time t.
[0138] In the cubic spline interpolation algorithm, (t i ,S(t i )) represents a known data point, where ti represents the t value of a known data point, S(t i ) represents the time value corresponding to that time point (usually the deviation relative to the current reference time). For example, the 0 in the data point (0,100ns) represents the current reference time corresponding to the system clock to be corrected, and 100ns represents the time deviation between the main channel timing signal and the system clock to be corrected at this moment. The standard time (t i = 0) is usually based on the system startup time, a predefined synchronization point or an external time standard. The system obtains and maintains this standard internal time through methods such as high-precision internal clocks, external time standard synchronization or multi-source time synthesis.
[0139] This interpolation method keeps the temporal output continuous and smooth, avoiding sudden changes that may cause misoperation of downstream systems.
[0140] Determine the spline coefficient a by solving the system of equations i , b i 、c i and d i , the equations are as follows:
[0141] Interpolation conditions:
[0142] S(t i )=T i ,S(t i+1 )=T i+1 ;
[0143] Continuity conditions:
[0144] S′(t i +) = S′(t i -),S″(t i +) = S″(t i -);
[0145] Boundary conditions: The system adopts natural boundary conditions, namely:
[0146] S′′(t0)=S′′(t n )=0;
[0147] Among them, S(t) is the interpolation function, which is used to calculate the interpolation result at any time t, T i represents the known time deviation value at the i-th interpolation point, t i represents the time coordinates of the i-th interpolation point, t0 and t n They represent the start and end time of the entire interpolation interval, S'(t) and S"(t) represent the first-order derivative of the interpolation function S(t), S"(t) represents the second-order derivative of the interpolation function S(t), and S'(t) represents the i +) indicates S(ti ) at node t i The first derivative value to the right, S′(t i -) indicates S(t i ) at node t i The first-order derivative value to the left, S″(t i +) indicates S(t i ) at node t i The second derivative value to the right, S″(t i -) indicates S(t i ) at node t i The second derivative value to the left.
[0148] Exemplarily, assuming that the system clock to be corrected needs to smoothly transition between two time points: time point 1 (such as the interpolation start time mentioned above): (0, 100ns), time point 2 (such as the interpolation end time mentioned above): (1, 150ns), perform the following steps: construct a set of equations and solve the spline coefficients; obtain the interpolation function: S(t) = 100 + 50t, use this function to calculate the interpolation result at any time when t is between 0 and 1, for example: when t = 0.5, the interpolation result is S(0.5) = 125ns.
[0149] In some embodiments, the quality of the interpolation result is evaluated by the following indicators: the first-order derivative is continuous at the interpolation point; the second-order derivative of the interpolation result is calculated; the interpolation result is compared with the actual observation value, and the error should be within an acceptable range, for example, for a nanosecond system, the error should be less than 1ns.
[0150] If an abnormal situation is encountered during the interpolation process, for example, there are too few data points resulting in an unsolvable system of equations, the following measures will be taken: degenerate to linear interpolation; mark the time period as a low-confidence interval; trigger a re-evaluation procedure to collect more data points.
[0151] In some embodiments, the processed time information is converted into a standard time format, such as UTC (Coordinated Universal Time) or TAI (International Atomic Time), and based on the processed time information, output signals in multiple formats are generated to meet the needs of different applications: digital time codes, such as IRIG-B codes, NTP (Network Time Protocol) packets, etc.; analog signals, such as 1PPS (pulse per second) signals; serial time information: time strings output through serial ports or other communication interfaces.
[0152] In some embodiments, the time synchronization method further includes steps S601 to S602:
[0153] Step S601, monitoring the time deviation between each secondary channel timing signal and the primary channel timing signal;
[0154] Step S602: Determine whether to switch the main channel timing signal and re-evaluate the performance of the multi-channel timing signal according to the time deviation corresponding to each secondary channel timing signal and a preset time deviation threshold.
[0155] In some embodiments, when the time deviation corresponding to any secondary channel timing signal exceeds the time deviation threshold, an alternative channel timing signal is determined from multiple secondary channel timing signals, the alternative channel timing signal is obtained as the main channel timing signal, and then the performance of the multiple channel timing signals is re-evaluated, and the alternative channel timing signal is the secondary channel timing signal with the highest comprehensive performance evaluation score.
[0156] Specifically, for each secondary channel timing signal, the time difference between each secondary channel timing signal and the main channel timing signal is calculated as follows:
[0157] Δt i =t main -t i ;
[0158] Among them, Δt i is the time difference, t main is the time of the main channel timing signal, t i is the time of the i-th secondary channel timing signal.
[0159] In order to eliminate possible outliers, median filtering is applied to the calculated time difference series. The window size of the median filter can be adjusted according to the sampling rate of the system and the expected response speed. The sliding window technology is used to continuously analyze the time difference data in the recent period to capture short-term and long-term change trends.
[0160] A dynamic threshold is used to determine whether the time difference is abnormal. The calculation formula of the dynamic threshold is:
[0161] Q = μ + k·σ;
[0162] Among them, Q is the dynamic threshold, μ represents the mean of the historical time difference, reflecting the average performance of the system to be corrected, σ represents the standard deviation of the historical time difference, reflecting the degree of fluctuation, and k is the adjustment factor used to control the sensitivity of the threshold. This dynamic threshold is adjusted over time and can adapt to the long-term changes and different working environments of the system to be corrected. μ and σ are recalculated regularly so that the dynamic threshold always reflects the current state of the system to be corrected.
[0163] The system to be corrected continuously observes the time difference Δt i Compared with the dynamic threshold Q, if the observed time difference Δt iIf the dynamic threshold Q is exceeded, the system will mark this time point as a potential anomaly. In order to avoid misjudgment due to instantaneous fluctuations, the correction system will repeat the check in a short period of time (such as several consecutive sampling cycles). Only when the anomaly persists will the re-evaluation process be triggered. Once the anomaly is confirmed, the system will immediately trigger the performance evaluation process of the multi-channel timing signal and complete the switching of the main channel timing signal.
[0164] In addition to sudden anomalies, the system to be corrected must also identify and respond to gradual anomalies. Such anomalies may not trigger a threshold alarm immediately, but long-term accumulation may lead to serious problems. To this end, linear regression or other time series analysis methods are used to regularly analyze the long-term trend of the time difference; calculate the rate of change of the time difference. If the rate of change exceeds the predetermined threshold, even if the observed time difference is still within an acceptable range, it will trigger the performance evaluation process of the multi-channel timing signal.
[0165] Reference Figure 2 , Figure 2 : is an optional structural diagram of a time synchronization device based on a multi-channel timing signal provided in an embodiment of the present application. The device is used to implement the above-mentioned time synchronization device based on a multi-channel timing signal. The device may include:
[0166] The first module is used to receive and pre-process multi-channel timing signals;
[0167] The second module is used to evaluate the performance of multi-channel timing signals and determine the main channel timing signal;
[0168] The third module is used to obtain the current reference time corresponding to the system clock to be corrected, determine the time deviation according to the main channel timing signal and the current reference time, and perform time smoothing correction on the system clock to be corrected according to the time deviation to complete time synchronization.
[0169] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0170] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned time synchronization method based on multi-channel timing signals when executing the computer program. The electronic device can be any smart terminal including a tablet computer.
[0171] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0172] See also Figure 3 , Figure 3 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0173] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0174] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the time synchronization method based on the multi-channel timing signal of the embodiment of the present application;
[0175] Input / output interface 903, used to implement information input and output;
[0176] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0177] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0178] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0179] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the time synchronization method based on the multi-channel timing signal is implemented.
[0180] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0181] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0182] The embodiments of the present application provide a time synchronization method, device, electronic device and medium based on multi-channel timing signals, which can process multi-channel timing signals, achieve smooth time synchronization, improve the efficiency and stability of time synchronization, adapt to complex and changeable actual environments, and meet increasingly stringent time synchronization requirements.
[0183] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0184] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0185] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0186] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0187] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0188] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0189] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0190] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A time synchronization method based on multi-channel timing signals, characterized in that: The method comprises the following steps: Receive and pre-process multi-channel timing signals; Performing performance evaluation on the multi-channel timing signal to determine the main channel timing signal; The current reference time corresponding to the system clock to be corrected is obtained, the time deviation is determined according to the main channel timing signal and the current reference time, and the time smoothing correction is performed on the system clock to be corrected according to the time deviation to complete time synchronization.
2. The time synchronization method according to claim 1, characterized in that: The receiving and preprocessing of the multi-channel timing signal specifically includes: Receiving the multi-channel timing signal, wherein the multi-channel timing signal includes satellite signals corresponding to multiple navigation satellite systems; Performing frequency down-conversion, analog-to-digital conversion, and demodulation processing on each of the satellite signals in sequence to obtain a satellite demodulated signal corresponding to each of the satellite signals; Extracting information from each of the satellite demodulation signals to obtain pseudorange information and navigation messages corresponding to each of the satellite demodulation signals; The navigation message corresponding to each of the satellite demodulation signals is decoded to obtain the satellite orbit parameters and clock correction parameters corresponding to each of the satellite demodulation signals.
3. The time synchronization method according to claim 2, characterized in that: The performing performance evaluation on the multi-channel timing signal to determine the main channel timing signal specifically includes: Obtaining performance evaluation items; the performance evaluation items include signal strength evaluation, signal security evaluation, signal time deviation evaluation and signal stability evaluation; According to the performance evaluation item and the pseudorange information, the satellite orbit parameter and the clock correction parameter corresponding to each satellite demodulation signal, a performance evaluation is performed on each satellite demodulation signal to determine a comprehensive performance evaluation score corresponding to each satellite demodulation signal; According to the comprehensive performance evaluation scores corresponding to the satellite demodulation signals, the main channel timing signal and multiple secondary channel timing signals are determined from the multiple satellite demodulation signals, wherein the main channel timing signal is the satellite demodulation signal with the highest comprehensive performance evaluation score, and the secondary channel timing signal is the remaining satellite demodulation signals except the main channel timing signal.
4. The time synchronization method according to claim 3, characterized in that: The method further comprises the steps of: Monitoring the time deviation between each of the secondary channel timing signals and the primary channel timing signal; According to the time deviation amount corresponding to each of the secondary channel timing signals and a preset time deviation threshold, it is determined whether to switch the main channel timing signal and re-evaluate the performance of the multi-channel timing signal.
5. The time synchronization method according to claim 4, characterized in that: The determining whether to switch the main channel timing signal and re-evaluate the performance of the multi-channel timing signal according to the time deviation amount corresponding to each of the secondary channel timing signals and a preset time deviation threshold specifically includes: When the time deviation corresponding to any of the secondary channel timing signals exceeds the time deviation threshold, an alternative channel timing signal is determined from the multiple secondary channel timing signals, and the alternative channel timing signal is acquired as the main channel timing signal. Then, the performance of the multi-channel timing signals is re-evaluated, and the alternative channel timing signal is the secondary channel timing signal with the highest comprehensive performance evaluation score.
6. The time synchronization method according to claim 1, characterized in that: The step of obtaining a current reference time corresponding to the system clock to be corrected, determining a time deviation according to the main channel timing signal and the current reference time, and performing time smoothing correction on the system clock to be corrected according to the time deviation to complete time synchronization specifically includes: Obtaining the current satellite signal time, where the current satellite signal time is the time corresponding to the main channel timing signal at the current reference time; Determine the time deviation according to the current satellite signal time and the current reference time; According to the time deviation, a cubic spline interpolation method is used to perform time smoothing correction on the system clock to be corrected.
7. The time synchronization method according to claim 6, characterized in that: The step of performing time smoothing correction on the system clock to be corrected according to the time deviation by using a cubic spline interpolation method specifically includes: Constructing an interpolation formula according to the time deviation; Acquire the current reference time as the interpolation start time, determine the interpolation end time according to a preset time interval and the current reference time, and determine the target interpolation time period according to the interpolation start time and the interpolation end time; Selecting a plurality of interpolation data points from the target interpolation time period, and obtaining the time to be corrected corresponding to each of the interpolation data points in the system clock to be corrected; According to the time to be corrected corresponding to each of the interpolation data points, the corrected time corresponding to each of the interpolation data points is calculated using the interpolation formula; According to the corrected time corresponding to each of the interpolation data points, the system clock to be corrected is subjected to time smoothing correction to achieve time synchronization between the system clock to be corrected and the main channel timing signal after the interpolation end time.
8. A time synchronization device based on multi-channel timing signals, characterized in that: The device comprises: The first module is used to receive and pre-process multi-channel timing signals; The second module is used to perform performance evaluation on the multi-channel timing signal and determine the main channel timing signal; The third module is used to obtain the current reference time corresponding to the system clock to be corrected, determine the time deviation according to the main channel timing signal and the current reference time, and perform time smoothing correction on the system clock to be corrected according to the time deviation to complete time synchronization.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the time synchronization method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the time synchronization method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Multichannel time service fitting method based on BeiDou satellite
CN103675854A
Multi-reference-source time synchronization method, system and module and medium
CN115987477A
Clock synchronization system and method for automatic driving multi-source fusion
CN118509100A
Terminal time service method, device, system and medium
CN119316081A
Clock synchronization method and apparatus, system, storage medium, and electronic device
WO2020043181A1
Cited By
Cross-running-level timestamp synchronization method and device, chip, network interface card, equipment, medium and program product
CN121193362A