Multi-time-source lossless switching method and system and storage medium

By using a multi-time source lossless switching method, the problem of single time source being susceptible to interference is solved, and the system can quickly switch to the backup time source when the primary time source is invalid, thereby improving the reliability and stability of the time system equipment.

CN120934670APending Publication Date: 2025-11-11CHENGDU JINNUOXIN HIGH-TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511105216.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-07
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Single-time-source time synchronization devices are susceptible to signal interference, spoofing, or geofencing limitations, and lack multi-time-source fusion calibration mechanisms, resulting in time synchronization interruptions and limited long-term timekeeping stability.

Method used

A multi-time-source lossless switching method is adopted. The time source signals from various external time sources are processed by the time synchronization equipment, the time source with the highest priority is selected as the main time source, and the time difference is fitted and predicted by the least squares method. Lossless switching is performed based on the preset switching threshold value, and the time source is locked after the switching is completed.

Benefits of technology

It enables a rapid and smooth switch to the backup time source when the primary time source is invalid, improving the reliability and stability of the time synchronization equipment and overcoming the limitations of a single signal source.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120934670A_ABST
    Figure CN120934670A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-time-source lossless switching method and system and a storage medium, and belongs to the technical field of time unification. The method comprises the following steps: a reference time source management stage: performing time source signal processing on various external time source signals through timing equipment to obtain a time source state and reporting the time source state; in the time source selection stage, a manual mode or an automatic mode is selected based on user configuration, and if the mode is the manual mode, a main time source is directly appointed; if the mode is the automatic mode, performing priority ranking on the effective reference time sources according to the time source time service precision, and selecting the time source with the highest priority as a main time source; in the time source switching stage, time difference information between the main time source and the standby time source is measured, time difference fitting and prediction are carried out through a least square method, lossless switching of the main time source and the standby time source is carried out based on a prediction result and a preset switching threshold value G, and time source locking is carried out after switching is completed. According to the invention, the limitation of a single signal source is solved, the standby time source can be rapidly and stably switched, and the reliability of timing equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of time unification technology, and in particular to a method, system and storage medium for lossless switching of multiple time sources. Background Technology

[0002] In this era of rapid technological advancement, accurate time synchronization is crucial for the operation of fields such as aerospace, communications, power, and finance. Time synchronization equipment generates stable time signals through a high-precision clock source. These signals are processed and converted by a time synchronization module and transmitted via communication networks to various devices requiring time synchronization, according to specific protocols and formats. Upon receiving the time synchronization signal, these devices adjust their own clocks based on the time information in the signal to maintain synchronization with the master clock source. Therefore, time synchronization equipment with high-precision time synchronization capabilities, strong anti-interference performance, high reliability, and stability is of profound significance for achieving accurate time synchronization of devices within a system and improving the overall operational efficiency and reliability of the system.

[0003] Timekeeping devices that rely on a single time source (such as GPS alone) are susceptible to signal interference, spoofing, or geofencing, which may lead to time synchronization interruptions. In addition, when a single time source lacks a multi-time source fusion calibration mechanism, its long-term timekeeping stability is limited. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a multi-time source lossless switching method, system and storage medium.

[0005] The objective of this invention is achieved through the following technical solution: The first aspect of this invention provides a multi-time-source lossless switching method, comprising the following steps: During the reference time source management phase, the time source status is obtained and reported by the time synchronization equipment by processing various external time source signals. During the time source selection phase, users can choose between manual or automatic mode based on their configuration. If it is manual mode, the primary time source is directly specified. If it is automatic mode, the valid reference time sources are prioritized according to their timing accuracy, and the time source with the highest priority is selected as the primary time source. During the time source switching phase, the time difference information between the primary time source and the backup time source is measured, and the least squares method is used to fit and predict the time difference. Based on the prediction results and the preset switching threshold G, the primary and backup time sources are switched without loss. After the switching is completed, the time source is locked.

[0006] Preferably, the external time source signals include: BeiDou satellite signals, 1PPS+TOD signals, IRIG-B(DC) code signals, and PTP network signals.

[0007] Preferably, a backup time source signal processing procedure is used to process the BeiDou satellite signal, 1PPS+TOD signal, and IRIG-B (DC) code signal; the backup time source signal processing procedure includes the following steps: In the time source type identification stage, based on the input time source signals of each interface, various time source information is analyzed and the type of time source is determined; In the 1PPS validity determination stage of the time source, the time synchronization device uses the local frequency source as a reference and measures the time difference between the 1PPS signal of the external time source and the local frequency source every second. Based on the time difference between two seconds before and after, the validity of the 1PPS signal of the external time source is determined. During the TOD validity determination phase, TOD verification is performed by comparing the TOD time information of two seconds before and after to determine whether the TOD time is continuous. If the TOD is invalid, the time synchronization device enters the timekeeping mode; if the TOD is valid, the device is synchronized. During the time jump detection phase, when the local time is valid, the external time source reference TOD time is detected in real time. If the external time source reference TOD time is inconsistent with the local time, a time jump log and alarm are generated, and the system automatically enters the timekeeping state. If the external time source reference TOD time is consistent with the local time, the time source information of the time source signal in the time source information data pool is updated and the time source status is reported, waiting to be selected.

[0008] Preferably, for the IRIG-B(DC) code signal, before the previous backup time source signal processing procedure, the IRIG-B(DC) code signal is first decoded according to the data characteristics of the IRIG-B(DC) code signal to obtain the demodulated second signal, thereby obtaining the 1PPS information and TOD time information of the IRIG-B(DC) code signal.

[0009] Preferably, when performing time source signal processing on PTP network signals, hardware timestamps are used to achieve time and frequency synchronization between master and slave devices, specifically including the following steps: The master clock periodically publishes the PTP time synchronization protocol and time information. The slave clock receives the timestamp information sent by the master clock port. Based on the timestamp information, the master-slave line time delay and master-slave time difference are calculated. The local time is adjusted using the master-slave time difference to keep the slave device time consistent with the master device time in terms of frequency and phase. The phase difference between the FPGA second signal and the local second signal is measured in real time. When the phase difference exceeds a preset threshold continuously, the output position of the FPGA second signal is adjusted to align the two signals. At the same time, the value of the FPGA's current time register is obtained and compared with the local second time. If the two are inconsistent, the FPGA time register is adjusted to synchronize with the local time.

[0010] Preferably, the master-slave line time delay and master-slave time difference are obtained through the following steps: The master clock sends a Sync message and records the sending time t1; after receiving the Sync message from the slave clock, it records the receiving time t2. After the master clock finishes sending the Sync message, it immediately sends a Follow_Up message carrying the sending time t1; The slave clock actively sends a Delay_Req message to the master clock to initiate the calculation of the transmission delay and records the sending time t3 of the Delay_Req message; After the master clock receives the Delay_Req message, it records the reception time t4 of the Delay_Req message and replies with a Delay_Resp message carrying t4. Calculate the one-way delay between master and slave clocks Delay Obtain the master-slave line time delay: ; Calculate the clock offset of the slave clock relative to the master clock. Offset Obtain the master-slave time difference: .

[0011] Preferably, a TDC chip is used to measure the time difference information between the primary time source and the backup time source.

[0012] Preferably, the time source switching stage further includes the following steps: The least squares method is used to fit and predict the time difference between the main time source and the backup time source, the time difference between the main time source and the digital phase-locked loop, and the time difference between the backup time source and the digital phase-locked loop. The count value curve over a period of time is fitted and the count value at the next moment is predicted. Then, phase-locked control is performed based on the predicted count value. When the absolute value of the difference between the predicted time difference and the measured time difference between the primary time source and the backup time source is less than the preset switching threshold G, the primary time source and the backup time source do not switch, and the current time difference data is saved; when the absolute value of the difference between the predicted time difference and the measured time difference between the primary time source and the backup time source is greater than the preset switching threshold G, the primary time source and the backup time source switch.

[0013] A second aspect of the present invention provides: a multi-time-source lossless switching system, characterized in that: for implementing any of the above-mentioned multi-time-source lossless switching methods, comprising: The reference time source management module is used to process various external time source signals through time synchronization equipment to obtain the time source status and report it. The time source selection module is used to select manual or automatic mode based on user configuration. If it is manual mode, the main time source is directly specified; if it is automatic mode, the valid reference time sources are prioritized according to the time source synchronization accuracy, and the time source with the highest priority is selected as the main time source. The time source switching module is used to measure the time difference information between the primary time source and the backup time source. It uses the least squares method to fit and predict the time difference, and performs lossless switching between the primary and backup time sources based on the prediction results and the preset switching threshold G. After the switching is completed, the time source is locked.

[0014] A third aspect of the present invention provides: a computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are loaded and executed by a processor, any of the above-described lossless switching methods for multiple time sources are implemented.

[0015] The beneficial effects of this invention are: 1) It overcomes the limitations of a single signal source. Employing lossless multi-time source switching technology, it can achieve adaptive time / positioning using satellite signals, 1PP+TOD, IRIG-B(DC) codes, and PTP. When the current primary time source reference becomes invalid, it can quickly and smoothly switch to a backup time source, improving the reliability of the time synchronization equipment. Attached Figure Description

[0016] Figure 1 This is a flowchart of the method of the present invention; Figure 2 Flowchart for backup time source signal processing; Figure 3 Here is a flowchart for determining the validity of Time-Based TOD (Transit-Oriented Development). Figure 4 Here is a flowchart for time jump detection; Figure 5 Flowchart for decoding IRIG-B (DC) code signals; Figure 6 PTP time synchronization flowchart; Figure 7 FPGA time synchronization flowchart; Figure 8 Flowchart for selecting multiple time sources; Figure 9 Block diagram illustrating the principle of primary / backup time source switching; Figure 10 This is a schematic diagram illustrating the principle of time difference measurement. Figure 11 Flowchart of primary / backup time source switching. Detailed Implementation

[0017] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] See Figures 1-11 The first aspect of this invention provides: a lossless switching method for multiple time sources, comprising the following steps: During the reference time source management phase, the time source status is obtained and reported by the time synchronization equipment by processing various external time source signals. During the time source selection phase, users can choose between manual or automatic mode based on their configuration. If it is manual mode, the primary time source is directly specified. If it is automatic mode, the valid reference time sources are prioritized according to their timing accuracy, and the time source with the highest priority is selected as the primary time source. During the time source switching phase, the time difference information between the primary time source and the backup time source is measured, and the least squares method is used to fit and predict the time difference. Based on the prediction results and the preset switching threshold G, the primary and backup time sources are switched without loss. After the switching is completed, the time source is locked.

[0019] In this embodiment, based on the characteristics of the time source signal, the time synchronization device software has a built-in data pool for recording the time source, which stores the basic information and time difference data of the time source. The content of the time source information data pool mainly includes the following elements: time source type: Beidou, 1PPS + TOD, PTP, IRIG-B(DC); time and time zone information; location information; 1PPS time difference data; the time synchronization device receives the TOD information of the time source every second, updates the basic information in the time source data pool, and adopts high-precision measurement technology based on the hardware platform to measure the 1PPS time difference between the high-precision spatiotemporal reference device and each time source in real time, and updates the 1PPS time difference data in the time source information data pool.

[0020] In the time source selection phase, such as Figure 8 As shown, after manually selecting a reference source, the selected reference source is directly switched to the primary time source for tracking. In automatic selection mode, all valid reference sources are sorted in descending order of priority, and the reference source with the highest priority is selected as the primary time source. Manual time source selection is done by the user through the control panel, allowing them to choose a specific reference time source. If the primary time source malfunctions, the system automatically switches to the specified reference time source signal. Automatic time source selection can be pre-configured according to user needs or prioritized based on the timing accuracy of reference time sources such as satellite signals, 1PPS+TOD, IRIG-B(DC) codes, and PTP. Reference time source signals with higher timing accuracy have the highest priority, and so on. This prioritization of multiple reference time source signals ensures that when the primary time source signal malfunctions, the system switches according to priority.

[0021] In some embodiments, the external time source signal includes: BeiDou satellite signal, 1PPS+TOD signal, IRIG-B(DC) code signal and PTP network signal.

[0022] In some embodiments, a backup time source signal processing procedure is used to perform time source signal processing on BeiDou satellite signals, 1PPS+TOD signals, and IRIG-B (DC) code signals; the backup time source signal processing procedure includes the following steps: In the time source type identification stage, based on the input time source signals of each interface, various time source information is analyzed and the type of time source is determined; In the 1PPS validity determination stage of the time source, the time synchronization device uses the local frequency source as a reference and measures the time difference between the 1PPS signal of the external time source and the local frequency source every second. Based on the time difference between two seconds before and after, the validity of the 1PPS signal of the external time source is determined. During the TOD validity determination phase, TOD verification is performed by comparing the TOD time information of two seconds before and after to determine whether the TOD time is continuous. If the TOD is invalid, the time synchronization device enters the timekeeping mode; if the TOD is valid, the device is synchronized. During the time jump detection phase, when the local time is valid (synchronous output or timekeeping output), the external time source reference TOD time is detected in real time. If the external time source reference TOD time is inconsistent with the local time, a time jump log and alarm are generated, and the system automatically enters the timekeeping state. If the external time source reference TOD time is consistent with the local time, the time source information of the time source signal in the time source information data pool is updated and the time source status is reported, waiting to be selected.

[0023] In this embodiment, BeiDou satellite signals, 1PPS+TOD, and IRIG-B(DC) can be uniformly treated as follows: Figure 2 The process shown is as follows. External time source signal processing mainly includes functions such as time source type identification, time source 1PPS validity judgment, time source TOD validity judgment, time jump detection, time source information data pool update, and time source status reporting.

[0024] During the 1PPS validity judgment stage of the time source, based on the characteristics of BeiDou time source, if the time difference between the current and next 2 seconds is greater than 80ns, the 1PPS of the external BeiDou time source is determined to be abnormal, and the device enters the autonomous timekeeping mode to avoid abnormal situations under poor signal or strong interference conditions.

[0025] In some embodiments, for the IRIG-B(DC) code signal, before the previous backup time source signal processing procedure, the IRIG-B(DC) code signal is first decoded according to the data characteristics of the IRIG-B(DC) code signal to obtain the demodulated second signal, thereby obtaining the 1PPS information and TOD time information of the IRIG-B(DC) code signal.

[0026] In this embodiment, for IRIG-B(DC) time source information, since IRIG-B(DC) modulates 1PPS information and TOD time information using pulse width coding, when processing IRIG-B(DC) time source information, it is first necessary to decode IRIG-B(DC) according to its data characteristics to obtain the 1PPS information and TOD time information contained in IRIG-B(DC). The IRIG-B(DC) decoding process is shown in Figure 5. The resulting demodulated second signal is then... Figure 2 The backup time source signal processing procedure processes the IRIG-B(DC) time source information to obtain the IRIG-B(DC) time source information.

[0027] In some embodiments, when performing time-source signal processing on PTP network signals, hardware timestamps are used to achieve time and frequency synchronization between master and slave devices, specifically including the following steps: The master clock periodically publishes the PTP time synchronization protocol and time information. The slave clock receives the timestamp information sent by the master clock port. Based on the timestamp information, the master-slave line time delay and master-slave time difference are calculated. The local time is adjusted using the master-slave time difference to keep the slave device time consistent with the master device time in terms of frequency and phase. The phase difference between the FPGA second signal and the local second signal is measured in real time. When the phase difference exceeds a preset threshold continuously, the output position of the FPGA second signal is adjusted to align the two signals. At the same time, the value of the FPGA's current time register is obtained and compared with the local second time. If the two are inconsistent, the FPGA time register is adjusted to synchronize with the local time.

[0028] In this embodiment, as Figure 7 As shown, the phase difference between the FPGA output second signal and the local second signal is measured in real time. When the difference continuously exceeds a certain threshold, the FPGA second signal output position is adjusted to achieve basic alignment. Simultaneously, the value of the FPGA's current time register is acquired and compared with the local second time. If they are inconsistent, the FPGA time register is adjusted to synchronize with the local time. In this way, when using the FPGA timestamp function, the obtained timestamp can truly reflect the time deviation between the master and slave.

[0029] In some embodiments, the master-slave line time delay and master-slave time difference are obtained through the following steps: The master clock sends a Sync message and records the sending time t1; after receiving the Sync message from the slave clock, it records the receiving time t2. After the master clock finishes sending the Sync message, it immediately sends a Follow_Up message carrying the sending time t1; The slave clock actively sends a Delay_Req message to the master clock to initiate the calculation of the transmission delay and records the sending time t3 of the Delay_Req message; After the master clock receives the Delay_Req message, it records the reception time t4 of the Delay_Req message and replies with a Delay_Resp message carrying t4. Calculate the one-way delay between master and slave clocks Delay Obtain the master-slave line time delay: ; Calculate the clock offset of the slave clock relative to the master clock. Offset Obtain the master-slave time difference: .

[0030] In some embodiments, a TDC chip is used to measure the time difference between the primary time source and the backup time source.

[0031] In this embodiment, a high-precision TDC chip is used to achieve high-precision time difference measurement. The basic principle diagram of the time difference measurement of this invention is shown in Figure 10. The time interval to be measured can be expressed as follows: T = n / Fs + T1 – T2; where Fs is the frequency of the fill clock, n is the number of fill clock pulses between the START pulse and the STOP pulse, T1 is the time interval from the START pulse to the first clock pulse thereafter, and T2 is the time interval from the STOP pulse to the first clock pulse thereafter. This invention uses a dedicated TDC (Time to Digital Converter) chip to achieve a high-precision time interval counter, with a time difference measurement accuracy better than 20ps. The START and STOP pulses of the two 1PPS signals, after passing through impedance matching and signal isolation circuits, are sent to the dedicated TDC chip. The time interval to be quantized between the START and STOP pulses and the first rising edge of the reference clock is sent to the dedicated TDC chip, and the smaller time intervals T1 and T2 are measured. Then, the time difference information between the main time source and the backup time source is calculated according to the formula T = n / Fs + T1 – T2.

[0032] In some embodiments, the time source switching stage further includes the following steps: The least squares method is used to fit and predict the time difference between the main time source and the backup time source, the time difference between the main time source and the digital phase-locked loop, and the time difference between the backup time source and the digital phase-locked loop. The count value curve over a period of time is fitted and the count value at the next moment is predicted. Then, phase-locked control is performed based on the predicted count value. When the absolute value of the difference between the predicted time difference and the measured time difference between the primary time source and the backup time source is less than the preset switching threshold G, the primary time source and the backup time source do not switch, and the current time difference data is saved; when the absolute value of the difference between the predicted time difference and the measured time difference between the primary time source and the backup time source is greater than the preset switching threshold G, the primary time source and the backup time source switch.

[0033] In this embodiment, the time difference between the primary and backup time sources is obtained through a high-precision time-determined differential converter (TDC). Since the TDC counts a fixed beat signal, the count value can be considered to change linearly with time. Therefore, the time differences between the primary and backup time sources, between the primary time source and the digital phase-locked loop (DPLL), and between the backup time source and the DPLL can be fitted and predicted using the least squares method. This fits a count value curve over a period and predicts the count value at the next moment. The predicted count value is then used for phase-locked control, and these values ​​are used as criteria for seamless digital switching. After switching between the primary and backup time sources, the time difference between the backup time source and the DPLL, plus the time difference between the primary and backup time sources, is used to generate the input control quantity for the crystal oscillator (OCXO).

[0034] A second aspect of the present invention provides: a multi-time-source lossless switching system, characterized in that: for implementing any of the above-mentioned multi-time-source lossless switching methods, comprising: The reference time source management module is used to process various external time source signals through time synchronization equipment to obtain the time source status and report it. The time source selection module is used to select manual or automatic mode based on user configuration. If it is manual mode, the main time source is directly specified; if it is automatic mode, the valid reference time sources are prioritized according to the time source synchronization accuracy, and the time source with the highest priority is selected as the main time source. The time source switching module is used to measure the time difference information between the primary time source and the backup time source. It uses the least squares method to fit and predict the time difference, and performs lossless switching between the primary and backup time sources based on the prediction results and the preset switching threshold G. After the switching is completed, the time source is locked.

[0035] A third aspect of the present invention provides: a computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are loaded and executed by a processor, any of the above-described lossless switching methods for multiple time sources are implemented.

[0036] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. A lossless switching method for multiple time sources, characterized in that: Includes the following steps: During the reference time source management phase, the time source status is obtained and reported by the time synchronization equipment by processing various external time source signals. During the time source selection phase, users can choose between manual or automatic mode based on their configuration. If it is manual mode, the primary time source is directly specified. If it is automatic mode, the valid reference time sources are prioritized according to their timing accuracy, and the time source with the highest priority is selected as the primary time source. During the time source switching phase, the time difference information between the primary time source and the backup time source is measured, and the least squares method is used to fit and predict the time difference. Based on the prediction results and the preset switching threshold G, the primary and backup time sources are switched without loss. After the switching is completed, the time source is locked.

2. The multi-time-source lossless switching method according to claim 1, characterized in that: The external time source signals include: BeiDou satellite signals, 1PPS+TOD signals, IRIG-B(DC) code signals, and PTP network signals.

3. The multi-time-source lossless switching method according to claim 2, characterized in that: The backup time source signal processing procedure is used to process the BeiDou satellite signal, 1PPS+TOD signal, and IRIG-B (DC) code signal; the backup time source signal processing procedure includes the following steps: In the time source type identification stage, based on the input time source signals of each interface, various time source information is analyzed and the type of time source is determined; In the 1PPS validity determination stage of the time source, the time synchronization device uses the local frequency source as a reference and measures the time difference between the 1PPS signal of the external time source and the local frequency source every second. Based on the time difference between two seconds before and after, the validity of the 1PPS signal of the external time source is determined. During the TOD validity determination phase, TOD verification is performed by comparing the TOD time information of two seconds before and after to determine whether the TOD time is continuous. If the TOD is invalid, the time synchronization device enters the timekeeping mode; if the TOD is valid, the device is synchronized. During the time jump detection phase, when the local time is valid, the external time source reference TOD time is detected in real time. If the external time source reference TOD time is inconsistent with the local time, a time jump log and alarm are generated, and the system automatically enters the timekeeping state. If the external time source reference TOD time is consistent with the local time, the time source information of the time source signal in the time source information data pool is updated and the time source status is reported, waiting to be selected.

4. The multi-time-source lossless switching method according to claim 3, characterized in that: For IRIG-B(DC) code signals, before the backup time source signal processing procedure, the IRIG-B(DC) code signals are first decoded according to the data characteristics of the IRIG-B(DC) code signals to obtain demodulated second signals, thereby obtaining the 1PPS information and TOD time information of the IRIG-B(DC) code signals.

5. The multi-time-source lossless switching method according to claim 2, characterized in that: When performing time source signal processing on PTP network signals, hardware timestamps are used to achieve time and frequency synchronization between master and slave devices. This specifically includes the following steps: The master clock periodically publishes the PTP time synchronization protocol and time information. The slave clock receives the timestamp information sent by the master clock port. Based on the timestamp information, the master-slave line time delay and master-slave time difference are calculated. The local time is adjusted using the master-slave time difference to keep the slave device time consistent with the master device time in terms of frequency and phase. The phase difference between the FPGA second signal and the local second signal is measured in real time. When the phase difference exceeds a preset threshold continuously, the output position of the FPGA second signal is adjusted to align the two signals. At the same time, the value of the FPGA's current time register is obtained and compared with the local second time. If the two are inconsistent, the FPGA time register is adjusted to synchronize with the local time.

6. The multi-time-source lossless switching method according to claim 5, characterized in that: The master-slave line time delay and master-slave time difference are obtained through the following steps: The master clock sends a Sync message and records the sending time t1; after receiving the Sync message from the slave clock, it records the receiving time t2. After the master clock finishes sending the Sync message, it immediately sends a Follow_Up message carrying the sending time t1; The slave clock actively sends a Delay_Req message to the master clock to initiate the calculation of the transmission delay and records the sending time t3 of the Delay_Req message; After the master clock receives the Delay_Req message, it records the reception time t4 of the Delay_Req message and replies with a Delay_Resp message carrying t4. Calculate the one-way delay between master and slave clocks Delay Obtain the master-slave line time delay: ; Calculate the clock offset of the slave clock relative to the master clock. Offset Obtain the master-slave time difference: 。 7. The multi-time-source lossless switching method according to claim 1, characterized in that: The TDC chip is used to measure the time difference between the primary time source and the backup time source.

8. The multi-time-source lossless switching method according to claim 1, characterized in that: The time source switching stage also includes the following steps: The least squares method is used to fit and predict the time difference between the main time source and the backup time source, the time difference between the main time source and the digital phase-locked loop, and the time difference between the backup time source and the digital phase-locked loop. The count value curve over a period of time is fitted and the count value at the next moment is predicted. Then, phase-locked control is performed based on the predicted count value. When the absolute value of the difference between the predicted time difference and the measured time difference between the primary time source and the backup time source is less than the preset switching threshold G, the primary time source and the backup time source do not switch, and the current time difference data is saved; when the absolute value of the difference between the predicted time difference and the measured time difference between the primary time source and the backup time source is greater than the preset switching threshold G, the primary time source and the backup time source switch.

9. A multi-time-source lossless switching system, characterized in that: To implement the multi-time-source lossless switching method as described in any one of claims 1-8, comprising: The reference time source management module is used to process various external time source signals through time synchronization equipment to obtain the time source status and report it. The time source selection module is used to select manual or automatic mode based on user configuration. If it is manual mode, the main time source is directly specified; if it is automatic mode, the valid reference time sources are prioritized according to the time source synchronization accuracy, and the time source with the highest priority is selected as the main time source. The time source switching module is used to measure the time difference information between the primary time source and the backup time source. It uses the least squares method to fit and predict the time difference, and performs lossless switching between the primary and backup time sources based on the prediction results and the preset switching threshold G. After the switching is completed, the time source is locked.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the multi-time-source lossless switching method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Lossless switching clock source equipment

    CN105511255A