Time synchronization method and device based on multi-channel time signal, electronic equipment and medium
By evaluating the performance of multi-channel time synchronization signals and correcting them using cubic spline interpolation, the problems of dynamic changes in signal quality and security threats in multi-channel time synchronization systems were solved, achieving stable time synchronization and adapting to the needs of complex environments.
Patent Information
- Application Number
- CN202510060005.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-01-15
AI Technical Summary
Existing multi-channel time synchronization systems face dynamic changes in signal quality, increasingly severe security threats, uneven channel switching, and a lack of comprehensive evaluation mechanisms, resulting in reduced time synchronization stability and reliability, making them difficult to adapt to complex and ever-changing real-world environments.
By receiving and preprocessing multi-channel timing signals, performing performance evaluation, determining the main channel timing signal, obtaining the current reference time of the system clock to be corrected, and using cubic spline interpolation to perform time smoothing correction, time synchronization is achieved.
It improves the efficiency and stability of time synchronization, adapts to complex and changing actual environments, resists interference and deception attacks, and provides smooth and stable time synchronization output.
Smart Images

Figure CN119966561B_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 and device based on multi-channel time signal, electronic equipment and medium. BACKGROUND
[0002] In modern society, accurate time synchronization is crucial for numerous critical infrastructures and high-precision applications. From global navigation satellite systems (GNSS), 5G communication networks, financial transaction systems to power smart grids, all rely on nanosecond-level or even picosecond-level time synchronization accuracy. To meet these stringent requirements, multi-channel time systems have emerged. Such systems provide time synchronization services by simultaneously receiving and processing signals from multiple time sources, such as different GNSS systems like GPS, Beidou, GLONASS, as well as ground atomic clocks, optical fiber time transmission, etc.
[0003] However, with the increasing complexity of application environments and malicious interference, existing multi-channel time systems face a series of severe challenges, such as dynamic changes in signal quality, increasing security threats, non-smooth channel switching, and lack of comprehensive channel evaluation mechanisms, making it difficult to adapt to complex and variable actual environments, resulting in greatly reduced stability and reliability. SUMMARY
[0004] The main purpose of the embodiments of the present application is to provide a time synchronization method and device based on multi-channel time signal, electronic equipment and medium, which can realize smooth time synchronization and improve the efficiency and stability of time synchronization.
[0005] In one aspect, the present application provides a time synchronization method based on multi-channel time signal, which comprises the following steps:
[0006] receiving and preprocessing multi-channel time signals;
[0007] performing performance evaluation on the multi-channel time signals to determine the main channel time signal;
[0008] obtaining the current reference time corresponding to the system clock to be corrected, determining the time deviation amount according to the main channel time signal and the current reference time, and performing time smoothing correction on the system clock to be corrected according to the time deviation amount to complete time synchronization.
[0009] In some embodiments, the receiving and preprocessing of the multi-channel time signal specifically comprises:
[0010] receiving the multi-channel time signal, wherein the multi-channel time signal includes satellite signals corresponding to multiple navigation satellite systems;
[0011] The satellite signals are sequentially subjected to frequency reduction processing, analog-to-digital conversion and demodulation processing to obtain satellite demodulation signals corresponding to the satellite signals;
[0012] Information is extracted from the satellite demodulation signals to obtain pseudo-range information and navigation messages corresponding to the satellite demodulation signals;
[0013] The navigation messages corresponding to the satellite demodulation signals are subjected to decoding processing to obtain satellite orbit parameters and clock correction parameters corresponding to the satellite demodulation signals.
[0014] In some embodiments, the performance evaluation of the multi-channel time service signal to determine the main channel time service signal specifically includes:
[0015] A performance evaluation item is obtained; the performance evaluation item includes signal strength evaluation, signal security evaluation, signal time deviation evaluation and signal stability evaluation;
[0016] According to the performance evaluation item and the pseudo-range information, the satellite orbit parameters and the clock correction parameters corresponding to each satellite demodulation signal, the performance of each satellite demodulation signal is evaluated to determine a comprehensive performance evaluation score corresponding to each satellite demodulation signal;
[0017] According to the comprehensive performance evaluation score corresponding to each satellite demodulation signal, the main channel time service signal and multiple secondary channel time service signals are determined from multiple satellite demodulation signals, wherein the main channel time service signal is the satellite demodulation signal with the highest comprehensive performance evaluation score, and the secondary channel time service signal is the remaining satellite demodulation signal except the main channel time service signal.
[0018] In some embodiments, the method further includes the steps of:
[0019] The time deviation amount between each secondary channel time service signal and the main channel time service signal is monitored;
[0020] According to the time deviation amount corresponding to each secondary channel time service signal and a preset time deviation threshold, it is determined whether to switch the main channel time service signal and re-evaluate the performance of the multi-channel time service signal.
[0021] In some embodiments, according to the time deviation amount corresponding to each secondary channel time service signal and a preset time deviation threshold, it is determined whether to switch the main channel time service signal and re-evaluate the performance of the multi-channel time service signal, specifically including:
[0022] When the time deviation amount corresponding to any of the sub-channel timing signals exceeds the time deviation threshold, a candidate channel timing signal is determined from the plurality of sub-channel timing signals, the candidate channel timing signal is obtained as the main channel timing signal, and then the performance evaluation of the multi-channel timing signal is re-performed, and the candidate channel timing signal is the sub-channel timing signal with the highest comprehensive performance evaluation score.
[0023] In some embodiments, the current reference time corresponding to the system clock to be corrected is obtained, the time deviation amount is determined according to the main channel timing signal and the current reference time, and the time synchronization is completed by performing time smoothing correction on the system clock to be corrected according to the time deviation amount, and specifically includes:
[0024] The current satellite signal time corresponding to the main channel timing signal at the current reference time is obtained.
[0025] The time deviation amount is determined according to the current satellite signal time and the current reference time.
[0026] According to the time deviation amount, the system clock to be corrected is time-smoothly corrected by using a cubic spline interpolation method.
[0027] In some embodiments, the system clock to be corrected is time-smoothly corrected by using a cubic spline interpolation method according to the time deviation amount, and specifically includes:
[0028] The interpolation formula is constructed according to the time deviation amount.
[0029] The current reference time is obtained as an interpolation start time, an interpolation end time is determined according to a preset time interval and the current reference time, and a target interpolation time period is determined according to the interpolation start time and the interpolation end time.
[0030] A plurality of interpolation data points are selected from the target interpolation time period, and the corresponding to-be-corrected time of each interpolation data point in the system clock to be corrected is obtained.
[0031] According to the to-be-corrected time corresponding to each interpolation data point, the corrected time corresponding to each interpolation data point is calculated by using the interpolation formula.
[0032] According to the corrected time corresponding to each interpolation data point, the system clock to be corrected is time-smoothly corrected to realize the time synchronization of the system clock to be corrected and the main channel timing signal after the interpolation end time.
[0033] In another aspect, the embodiments of the present application provide a time synchronization device based on a multi-channel timing signal, and the device comprises:
[0034] a first module configured to receive and pre-process a multi-channel time signal;
[0035] a second module configured to evaluate performance of the multi-channel time signal and determine a main channel time signal;
[0036] a third module configured to obtain a current reference time corresponding to a system clock to be corrected, determine a time deviation amount based on the main channel time signal and the current reference time, and perform time smoothing correction on the system clock to be corrected based on the time deviation amount to complete time synchronization.
[0037] In another aspect, an electronic device is provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the time synchronization method described above when executing the computer program.
[0038] In another aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program implements the time synchronization method described above when executed by a processor.
[0039] The embodiments of the present application at least have the following beneficial effects: The time synchronization method, device, electronic device and medium based on a multi-channel time signal provided by the present application can process the multi-channel time signal, achieve smooth time synchronization, improve the efficiency and stability of time synchronization, adapt to complex and variable actual environments, and meet the increasingly stringent time synchronization requirements. BRIEF DESCRIPTION OF DRAWINGS
[0040] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows: Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
[0042] Figure 1 is a flowchart of the time synchronization method based on a multi-channel time signal provided by the embodiments of the present application;
[0043] Figure 2 is a structural schematic diagram of a time synchronization device based on a multi-channel time signal provided by an embodiment of the present application;
[0044] Figure 3 is a hardware structural schematic diagram of an electronic device. 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 combination with the drawings and embodiments. 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 relates to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementation described in the following exemplary embodiments does not represent all the implementations consistent with the embodiments of the present application, but is only an example of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.
[0046] It can be understood that the terms "first", "second", and the like used in the present application can be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "when" or "in response to determining".
[0047] The terms "at least one", "multiple", "each", "any" and the like used in the present application include one, two or more than two, multiple includes two or more than two, 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 understood by those skilled in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0049] The existing multi-channel time service system is facing a series of severe challenges:
[0050] 1) Signal quality dynamic changes: In practical applications, the signal quality of different channels fluctuates continuously due to factors such as atmospheric conditions, electromagnetic interference, and multipath effects. For example, in urban canyon environments, GNSS signals may experience severe attenuation and multipath interference, leading to a significant decrease in time synchronization accuracy. Existing systems often struggle to respond to such dynamic changes in real-time, affecting overall synchronization performance.
[0051] 2) Increasingly severe security threats: As the understanding of time synchronization attacks deepens, deception and interference methods are constantly evolving. For example, advanced GNSS spoofers can simulate multiple satellite signals simultaneously, making traditional single defense mechanisms ineffective. This not only threatens the accuracy of time service systems but also can cause severe 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 decreases and needs to be switched to a backup source, existing systems often cannot achieve smooth transition. This sudden time jump can cause misoperation of downstream systems, causing serious consequences in time-sensitive applications such as financial transactions or power scheduling.
[0053] 4) Lack of comprehensive evaluation mechanism: Current multi-channel time service systems often rely on a single or limited number of indicators (such as signal strength) to select the optimal channel. However, in complex real-world environments, this simple evaluation method cannot fully reflect the true performance and reliability of each channel, potentially leading to suboptimal channel selection decisions.
[0054] Based on this, the embodiments of the present application provide a time synchronization method, device, electronic equipment and medium based on multi-channel time signal, which can realize intelligent fusion, dynamic evaluation and security protection of multi-source time signal, adapt to complex and variable actual environment, resist advanced interference and deception attacks, provide smooth and stable time synchronization output, and have strong expansibility and adaptability, meet the increasingly stringent time synchronization requirements.
[0055] Reference Figure 1 , Figure 1 is an optional flowchart of a time synchronization method based on multi-channel time signal provided by the embodiments of the present application, which can include but is not limited to steps S101 to S103:
[0056] Step S101, receiving and preprocessing multi-channel time signals;
[0057] Step S102, performance evaluation of multi-channel time signals, determination of main channel time signals;
[0058] Step S103, obtaining a current reference time corresponding to the system clock to be corrected, determining a time deviation amount according to the main channel time signal and the current reference time, and performing time smoothing correction on the system clock to be corrected according to the time deviation amount to complete time synchronization.
[0059] In some embodiments, step S101 can include but is not limited to steps S201 to S204:
[0060] Step S201, receiving a multi-channel time signal, the multi-channel time signal including satellite signals corresponding to multiple navigation satellite systems;
[0061] Step S202, sequentially performing frequency reduction processing, analog-to-digital conversion and demodulation processing on each satellite signal to obtain satellite demodulation signals corresponding to each satellite signal;
[0062] Step S203, performing information extraction on each satellite demodulation signal to obtain pseudorange information and navigation messages corresponding to each satellite demodulation signal;
[0063] Step S204, decoding the navigation messages corresponding to each satellite demodulation signal to obtain 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 the satellite signals of multiple navigation satellite systems into digital information that can be processed subsequently, and the preprocessing can 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 marking, as follows:
[0065] 1) Signal frequency reduction: converting high-frequency radio frequency signals into intermediate frequency or baseband signals to facilitate subsequent digital processing;
[0066] 2) Analog-to-digital conversion: converting analog signals into digital signals to enable subsequent digital signal processing;
[0067] 3) BPSK demodulation: for most GNSS signals, a binary phase shift keying (BPSK) modulation method is used. Therefore, BPSK demodulation is needed to extract the navigation message information modulated on the carrier;
[0068] 4) Pseudorange information extraction: extracting 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 time service;
[0069] 5) Navigation message decoding: analyzing satellite orbit parameters, clock correction parameters and other information contained in the navigation message, which are crucial for subsequent precise positioning and time service calculation;
[0070] 6) Data filtering: remove obviously abnormal data, such as measurement values with too low signal strength or obviously unreasonable pseudo-range;
[0071] 7) Time tagging: add precise time stamp to the data of each channel for 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 pseudo-range measurement values, signal strength indicators, satellite orbit and clock information, etc.
[0073] In some embodiments, step S102 can 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 safety evaluation, signal time deviation evaluation and signal stability evaluation;
[0075] Step S302, according to the performance evaluation items and the pseudo-range information, satellite orbit parameters and clock correction parameters corresponding to each satellite demodulation signal, performing performance evaluation on each satellite demodulation signal to determine the comprehensive performance evaluation score corresponding to each satellite demodulation signal;
[0076] Step S303, according to the comprehensive performance evaluation score corresponding to each satellite demodulation signal, determining the main channel timing signal and the plurality of secondary channel timing signals from the plurality of 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 signal except the main channel timing signal.
[0077] In some embodiments, the process of signal strength evaluation includes calculating the carrier-to-noise ratio (C / N0), which is calculated by the following formula:
[0078]
[0079] Wherein, 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 the multi-channel timing system, the value of C / N0 is usually between 35 dB-Hz and 55 dB-Hz. The higher the value of C / N0, the better the signal strength. By comparing the C / N0 of the satellite demodulation signals corresponding to different channels, it can be preliminarily judged which signals are more reliable. Optionally, the value of C / N0 can be divided into the following levels: 35 dB-Hz or less: determined as weak signal; 35-40 dB-Hz: determined as usable signal; 40-45 dB-Hz: determined as good signal; 45 dB-Hz or more: determined as high-quality signal.
[0080] The signal stability evaluation includes using Allan variance analysis, whose calculation formula is:
[0081]
[0082] wherein y is a normalized frequency measurement value of a current evaluation signal, τ is a sampling interval, and N is a sample number. In the multi-channel time service system, a lower AVAR value indicates that the signal is more stable, which helps to provide more reliable time synchronization. The short-term and long-term stability of the channel signals is analyzed by calculating the AVAR at different time scales τ.
[0083] Specifically, y can be expressed as:
[0084]
[0085] wherein y i is a normalized frequency measurement value in the ith time interval, is a relative frequency deviation obtained by frequency measurement on the current evaluation signal, f i is a measured frequency in the ith time interval, and f0 is a nominal frequency (ideal frequency). The normalized frequency measurement value y actually represents the deviation of the frequency relative to the nominal frequency, and oscillators in different frequency ranges can be directly compared.
[0086] A lower AVAR value indicates that the signal is more stable, which helps to 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 receiver based on a quartz crystal oscillator, the system expects an AVAR value less than 1e-11 at τ=1 second. For a receiver based on a rubidium atomic clock, the system expects an AVAR value less than 1e-12 at τ=1 second. When analyzing a certain GNSS receiver based on a rubidium atomic clock, if the AVAR value measured at τ=100 seconds is 3e-13, it is determined that the stability of the receiver is good and meets the expectations.
[0087] The signal time deviation evaluation is the clock deviation evaluation between the multi-channel time service signal and the system clock to be corrected, which includes using a Kalman filter to estimate the clock deviation and drift, wherein the state vector contains the clock deviation and drift, and the measurement equation is:
[0088] z=Hx+v;
[0089] wherein in the multi-channel time service system, z represents the observed time deviation, x is the state vector (containing the 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] indicates that the observation z is only directly related to the first component (clock bias) of the state vector x, so that the clock bias between the different channel time signals and the system clock to be corrected can be directly measured, and the clock drift is estimated and tracked through the prediction and update cycles of the Kalman filter, for example, the state vector where b is the clock bias (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 bias plus the measurement noise, and different levels of time deviation thresholds are set, for example, for a high-precision GNSS receiver, the expected time deviation is set to be within ± 20 nanoseconds; for a general GNSS receiver, the expected time deviation is set to be within ± 100 nanoseconds, when the time deviation of a certain high-precision GNSS receiver is detected to be 15 nanoseconds, it is determined that the receiver is working normally, and the data thereof continues to be used, and when the time deviation of a certain channel time signal is suddenly increased to 200 nanoseconds, the channel is marked as abnormal, and a re-evaluation process is triggered.
[0091] The state transition equation is:
[0092] x k+1 = Φx k +w;
[0093] where w is the process noise, and Φ is the state transition matrix, which describes how the clock bias and drift change, and the state transition matrix Φ is preset to be a 2x2 square matrix:
[0094]
[0095] where Δt represents the time interval between two measurements, and the matrix is designed based on the following considerations: the new clock bias is equal to the old clock bias plus the clock drift multiplied by the time interval (Δt), which corresponds to the first row [1 Δt] of the matrix; the change of the clock drift: in a short time, it is assumed that the clock drift remains unchanged, which corresponds to the second row [0 1] of the matrix, for example, if the current state is where b k is the current clock bias, and d k is the current clock drift, then the next state x k+1 can be represented as:
[0096]
[0097] The process noise w is usually modeled as zero-mean Gaussian white noise, and the corresponding covariance matrix Q can be determined according to the specific characteristics of the multi-channel time system, and the covariance matrix Q is specifically 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 involves the use of a cumulative sum (CUSUM) algorithm, which is calculated using the following formula:
[0102] S i =max(0,S i-1 +(x i -μ0)-k);
[0103] Among them, S i is x i The corresponding CUSUM value, μ0 is the target mean, and k is the reference value. i If the preset threshold is exceeded, it is considered that a sudden change has occurred, indicating that a channel has become 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 moment. 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. By continuously monitoring these time deviation values x 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. Assume that the time deviation observation value sequence (unit: nanosecond) of a channel is [5, 8, 3, 35, 7, 9], with a standard deviation of 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 has occurred.
[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 moment, and respectively, the average value of X i and Y i , the Pearson correlation coefficient r ranges from -1 to 1, where r approaches 1 indicates that the two channels are highly positively correlated, the time variation trend is consistent, r approaches -1 indicates that the two channels are highly negatively correlated, the time variation trend is opposite, and r approaches 0 indicates that there is almost no linear relationship between the two channels, indicating an anomaly.
[0108] Exemplarily, the value range of the Pearson correlation coefficient r is explained as follows: r is in the range of 0.9 to 1.0: determined to be highly consistent; r is in the range of 0.7 to 0.9: determined to be good consistency; r is in the range of 0.5 to 0.7: determined to be medium consistency; r is less than 0.5: determined to be low consistency. 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 about 0.95, which is determined to be highly consistent.
[0109] The feature analysis includes using a support vector machine (SVM) to perform anomaly detection on the time signal of different channels, the feature selection data includes signal strength, stability index and time deviation, etc., the support vector machine kernel function is selected as an RBF kernel, and specifically, the trained support vector machine is used, the feature selection data corresponding to the time signal of each channel is input into the support vector machine, and an anomaly detection result corresponding to the time signal of each channel is output.
[0110] In some embodiments, a weighted summation method is used to calculate the comprehensive performance evaluation score, and specifically, the comprehensive performance evaluation score is calculated by the following formula:
[0111]
[0112] wherein Sum is the comprehensive performance evaluation score, N is the number of performance evaluation items, w i is the weight corresponding to the i-th performance evaluation item, and 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: corresponding to signal strength evaluation, based on the previously calculated carrier-to-noise ratio (C / N0) value, it is normalized to the range of 0-100;
[0115] 2) Stability score: corresponding to signal stability evaluation, based on the Allan variance (AVAR) analysis result, it is inversely proportional to the score range of 0-100. A lower AVAR value will get a higher stability score;
[0116] 3) Bias Score: Corresponding to the signal time bias evaluation, based on the clock bias and drift estimated by the Kalman filter, the closeness to the ideal value is calculated and mapped to a score range of 0-100;
[0117] 4) Security Score: Corresponding to the signal security evaluation, the results of jump detection, consistency check and feature analysis are comprehensively considered. If no abnormality is detected, a higher security score is given; if potential problems are 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 will be selected according to the following steps:
[0119] Ranking: Rank the timing signals of all channels according to the comprehensive performance evaluation score from high to low;
[0120] Threshold screening: Set a minimum score threshold, and eliminate channels with a comprehensive performance evaluation score below the minimum score threshold;
[0121] Main channel timing signal determination: The timing signal of the channel with the highest comprehensive performance evaluation score is selected as the main channel timing signal, and the timing signals of the remaining channels are determined as secondary channel timing signals;
[0122] Alternative channel timing signal determination: From the multiple secondary channel timing signals, select the secondary channel timing signal with the highest comprehensive performance evaluation score as the alternative channel timing signal, to be used for quick switching in case of problems with the main channel timing signal.
[0123] In some embodiments, step S103 can include but is not limited to steps S401 to S403:
[0124] Step S401, obtain the current satellite signal time, which is the time corresponding to the main channel timing signal at the current reference time;
[0125] Step S402, determine the time deviation amount according to the current satellite signal time and the current reference time;
[0126] Step S403, according to the time deviation amount, using cubic spline interpolation method, the time smoothing correction is carried out to the system clock to be corrected.
[0127] In some embodiments, a weighted moving average filter is applied to the system clock to be corrected for preliminary smoothing; a Kalman filter is used to further optimize the time estimation, and a cubic spline interpolation algorithm is used to realize the smooth transition of the system clock to be corrected when the channel is switched.
[0128] In some embodiments, step S403 can include but is not limited to steps S501-S505:
[0129] Step S501, constructing an interpolation formula according to the time deviation amount;
[0130] Step S502, taking the current reference time as an interpolation start time, determining an interpolation end time according to a preset time interval and the current reference time, and determining a 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 corresponding to-be-corrected times of each interpolation data point in the to-be-corrected system clock;
[0132] Step S504, calculating the corresponding corrected times of each interpolation data point by using the interpolation formula according to the corresponding to-be-corrected times of each interpolation data point;
[0133] Step S505, performing time smoothing correction on the to-be-corrected system clock according to the corresponding corrected times of each interpolation data point, so as to realize time synchronization between the to-be-corrected system clock and the main channel time signal after the interpolation end time.
[0134] In some embodiments, when the to-be-corrected system clock needs to be switched from one main channel time signal to another channel time 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 specifically as follows:
[0136] S(t)=a i +b i (t-t i )+c i (t-t i ) 2 +d i (t-t i ) 3
[0137] Wherein, t represents an independent variable, i.e. 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 an equation group, and S(t) is an 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, wherein ti t value representing known data points, S(t i ) represents the time value corresponding to this time point (usually the deviation relative to the current reference time). For example, 0 in data point (0, 100ns) represents the current reference time corresponding to the system clock to be corrected, and 100ns represents the amount of time deviation between the master channel time signal and the system clock to be corrected at this time. The selection of the standard time point (t i = 0) is usually based on system startup time, predefined synchronization point or external time standard. The system obtains and maintains this standard internal time through high-precision internal clock, external time standard synchronization or multi-source time synthesis, etc.
[0139] This interpolation method makes the time output continuous and smooth, avoiding sudden changes that may cause misoperation of downstream systems.
[0140] The spline coefficients a i , b i , c i and d i are determined by solving the equation set 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, i.e.:
[0146] S"(t0) = S"(t n ) = 0;
[0147] Where S(t) is the interpolation function 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 coordinate of the i-th interpolation point, t0 and t n represent the start and end times of the entire interpolation interval respectively, S'(t) and S"(t) represent the first and second derivatives of the interpolation function S(t), S"(t) represents the second derivative of the interpolation function S(t), S'(t i +) represents 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] For example, assuming that the system clock to be corrected needs to transition smoothly 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: at 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, according to the time deviation amount corresponding to each sub-channel time signal and the preset time deviation threshold, determine whether to switch the main channel time signal and re-evaluate the performance of the multi-channel time signal.
[0155] In some embodiments, when the time deviation amount corresponding to any sub-channel time signal exceeds the time deviation threshold, determine the alternative channel time signal from the plurality of sub-channel time signals, obtain the alternative channel time signal as the main channel time signal, and then re-evaluate the performance of the multi-channel time signal, the alternative channel time signal is the sub-channel time signal with the highest comprehensive performance evaluation score.
[0156] Specifically, for each sub-channel time signal, calculate the time difference between each sub-channel time signal and the main channel time signal, specifically as follows:
[0157] Δt i = t main -t i ;
[0158] Where, Δt i is the time difference, t main is the time of the main channel time signal, and t i is the time of the i-th sub-channel time signal.
[0159] In order to eliminate possible outliers, the calculated time difference sequence is applied to the median filter, and the window size of the median filter can be adjusted according to the sampling rate of the system and the expected response speed. Using the sliding window technique, the time difference data in the recent period of time is continuously analyzed to capture short-term and long-term trends.
[0160] A dynamic threshold is used to determine whether the time difference is abnormal, and the calculation formula of the dynamic threshold is:
[0161] Q = μ + kσ;
[0162] Where 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 volatility, and k is the adjustment factor, used to control the sensitivity of the threshold. This dynamic threshold adjusts with time, which can adapt to the long-term changes of the system to be corrected and different working environments, and regularly recalculates μ and σ, so that the dynamic threshold always reflects the current state of the system to be corrected.
[0163] The observed time difference Δt i is compared with the dynamic threshold Q, and if the observed time difference Δt iWhen the dynamic threshold Q is exceeded, the system marks this time point as a potential anomaly, in order to avoid false positives due to transient fluctuations, the system under revision will repeatedly check within a short period of time (such as several consecutive sampling periods), only when the anomaly persists, the re-evaluation process will be triggered, once the anomaly is confirmed, the system will immediately trigger the performance evaluation process of the multi-channel time signal and complete the switching of the main channel time signal.
[0164] In addition to sudden anomalies, the system under revision also needs to identify and respond to gradual anomalies, which may not immediately trigger a threshold alert, but long-term accumulation can lead to serious problems. For this purpose, linear regression or other time series analysis methods are used to periodically 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 the acceptable range, the performance evaluation process of the multi-channel time signal will be triggered.
[0165] Reference Figure 2 , Figure 2 is an optional structure diagram of a time synchronization device based on a multi-channel time signal provided by an embodiment of the present application, the device is used to implement the above-mentioned time synchronization device based on a multi-channel time signal, and the device can include:
[0166] The first module is configured to receive and preprocess the multi-channel time signal.
[0167] The second module is configured to perform performance evaluation on the multi-channel time signal to determine the main channel time signal.
[0168] The third module is configured to obtain a current reference time corresponding to the system under revision clock, determine a time deviation amount according to the main channel time signal and the current reference time, and perform time smoothing correction on the system under revision clock according to the time deviation amount to complete time synchronization.
[0169] It can be understood that the contents in the above method embodiments are all applicable to the present device embodiment, the present device embodiment specifically implements the same functions as the above method embodiments, and achieves the same beneficial effects as the above method embodiments.
[0170] The present application also provides an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned time synchronization method based on a multi-channel time signal when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer.
[0171] It can be understood that the contents in the above method embodiments are all applicable to the present device embodiment, the present device embodiment specifically implements the same functions as the above method embodiments, and achieves the same beneficial effects as the above method embodiments.
[0172] Referring to Figure 3 , Figure 3 Fig. 1 illustrates a hardware structure of an electronic device according to another embodiment, and the electronic device includes:
[0173] The processor 901 can be implemented in a manner of a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, and is configured to execute a related program to implement the technical solutions provided by the embodiments of the present application.
[0174] The memory 902 can be implemented in a form of a ROM (Read Only Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory), and the like. The memory 902 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are stored in the memory 902 and are called and executed by the processor 901 to implement the time synchronization method based on the multi-channel time signal according to the embodiments of the present application.
[0175] The input / output interface 903 is configured to implement information input and output.
[0176] The communication interface 904 is configured to implement the communication interaction between the device and other devices, and can implement the communication in a wired manner (for example, a USB, a network cable, or the like) or in a wireless manner (for example, a mobile network, WIFI, Bluetooth, or the like).
[0177] The bus 905 is configured to transmit information between the components (for example, the processor 901, the memory 902, the input / output interface 903, and the communication interface 904) of the device.
[0178] The processor 901, the memory 902, the input / output interface 903, and the communication interface 904 are connected to each other in the device through the bus 905.
[0179] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the time synchronization method based on the multi-channel time signal.
[0180] It can be understood that the contents in the above method embodiments are all applicable to the present storage medium embodiments, the present storage medium embodiments specifically implement the functions same as those of the above method embodiments, and achieve the same beneficial effects as those of the above method embodiments.
[0181] The memory, as a non-transitory computer readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0182] The embodiment of the present application provides a time synchronization method and device based on a multi-channel time signal, an electronic device and a medium, which can process the multi-channel time signal, realize smooth time synchronization, improve the efficiency and stability of time synchronization, adapt to complex and variable actual environment, and meet the increasingly strict time synchronization demand.
[0183] The embodiments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. It can be understood by those skilled in the art that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0184] It can be understood by those skilled in the art that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.
[0185] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, that is, can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment.
[0186] It can be understood by those skilled in the art that all or some steps in the above disclosed method, the functions of the modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.
[0187] The terms "first", "second", "third", "fourth" and the like in the description of this application and in the claims, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of these terms herein is to be construed to cover the embodiments of this application in any order. Furthermore, the terms "comprise", "comprising", "include", "including", and the like, when used in the present specification, are used to specify the presence of stated features, integers, steps or components but do not preclude the presence or addition of one or more other features, integers, steps, components, or groups thereof. It is also to be understood that the use of the terms "and / or", "one or more", and "at least one", are used to include the possibilities of a single element, a plurality of elements, or any combination of these elements, unless otherwise indicated.
[0188] It should be understood that, in the application, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" is used to describe the relationship between the associated objects, which means that there can be three relationships, for example, "A and / or B" can represent three cases: 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 represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including single or multiple combinations. 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, and c can be single or multiple.
[0189] In several embodiments provided in the 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, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed objects can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0190] The preferred embodiments of the application are described above with reference to the accompanying drawings, and the scope of the right of the application is not limited to this. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the application should be within the scope of the right of the application.
Claims
1. A time synchronization method based on multi-channel timing signals, characterized in that: The method comprises the following steps: receiving the multi-channel timing signal, where the multi-channel timing signal includes satellite signals corresponding to a plurality of 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; Decoding the navigation message corresponding to each of the satellite demodulation signals to obtain satellite orbit parameters and clock correction parameters corresponding to each of the satellite demodulation signals; Obtaining performance evaluation items; the performance evaluation items include signal strength evaluation, signal security evaluation, signal time deviation evaluation, and signal stability evaluation; performing a performance evaluation on each of the satellite demodulation signals according to the performance evaluation items and the pseudorange information, the satellite orbit parameters, and the clock correction parameters corresponding to each of the satellite demodulation signals, to determine a comprehensive performance evaluation score corresponding to each of the satellite demodulation signals; Determining a primary channel timing signal and a plurality of secondary channel timing signals from the plurality of satellite demodulation signals according to the comprehensive performance evaluation scores corresponding to the respective satellite demodulation signals, wherein the primary channel timing signal is the satellite demodulation signal with the highest comprehensive performance evaluation score, and the secondary channel timing signals are the remaining satellite demodulation signals except the primary channel timing signal; 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.
2. The time synchronization method according to claim 1, wherein: 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 corresponding to each of the secondary channel timing signals and a preset time deviation threshold, it is determined whether to switch the primary channel timing signal and re-evaluate the performance of the multi-channel timing signal.
3. The time synchronization method according to claim 2, characterized in that: The determining, based on the time deviation corresponding to each of the secondary channel timing signals and a preset time deviation threshold, whether to switch to the primary channel timing signal and re-evaluate the performance of the multi-channel timing signal 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 obtained 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.
4. The time synchronization method according to claim 1, wherein: 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 a 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.
5. The time synchronization method according to claim 4, characterized in that: The method of performing time smoothing correction on the system clock to be corrected by using a cubic spline interpolation method according to the time deviation 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 a 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 a time to be corrected corresponding to each of the interpolation data points in the system clock to be corrected; Calculating the corrected time corresponding to each interpolation data point using the interpolation formula according to the time to be corrected corresponding to each interpolation data point; According to the corrected time corresponding to each interpolation data point, a time smoothing correction is performed on the system clock to be corrected, so as to achieve time synchronization between the system clock to be corrected and the main channel timing signal after the interpolation end time.
6. A time synchronization device based on multi-channel timing signals, characterized in that: The device comprises: A first module is configured to receive the multi-channel timing signal, the multi-channel timing signal including satellite signals corresponding to multiple navigation satellite systems, sequentially perform frequency down-conversion, analog-to-digital conversion, and demodulation on each of the satellite signals to obtain a satellite demodulated signal corresponding to each of the satellite signals, extract information from each of the satellite demodulated signals to obtain pseudorange information and a navigation message corresponding to each of the satellite demodulated signals, and decode the navigation message corresponding to each of the satellite demodulated signals to obtain satellite orbit parameters and clock correction parameters corresponding to each of the satellite demodulated signals; A second module is used to obtain performance evaluation items, where the performance evaluation items include signal strength evaluation, signal security evaluation, signal time deviation evaluation, and signal stability evaluation; perform performance evaluation on each satellite demodulation signal according to the performance evaluation items and the pseudorange information, the satellite orbit parameters, and the clock correction parameters corresponding to each satellite demodulation signal; determine a comprehensive performance evaluation score corresponding to each satellite demodulation signal; and determine a main channel timing signal and multiple secondary channel timing signals from multiple satellite demodulation signals according to the comprehensive performance evaluation scores corresponding to each satellite demodulation signal, 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; 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.
7. An electronic device, characterized in that: The electronic device includes 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 5 when executing the computer program.
8. 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 5 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