Time data dual-drive-based 1PPS guard device and time data dual-drive-based 1PPS guard method
By using a 1PPS protection device driven by time data, and by using a clock unit and a dual-mode fusion computing module to monitor and switch trigger sources, the problem of 1PPS signal being susceptible to interference is solved, and high reliability and fault tolerance of power system time synchronization are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-14
AI Technical Summary
The existing 1PPS signal is susceptible to system interference, which can lead to execution delays or loss. It lacks a real-time and effective fault tolerance mechanism, making it difficult to ensure the reliability of power system measurement data.
The device employs a 1PPS protection device driven by time data. It receives TOD+1PPS information through the clock unit and combines dual-mode redundancy monitoring and dual-mode fusion computing modules to monitor and switch trigger sources in real time, ensuring the continuous operation of the clock unit.
It improves the reliability and fault tolerance of the time synchronization device, avoids 1PPS signal loss, and ensures the continuity and high reliability of power grid time synchronization.
Smart Images

Figure CN121864243A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of high-reliability time synchronization technology for power systems, and in particular to a 1PPS protection device and method based on dual-drive time data. Background Technology
[0002] With the accelerated construction of new power systems, the energy structure is undergoing profound changes. Under the "dual-high" power grid architecture characterized by a high proportion of renewable energy integration and a high proportion of power electronic equipment application, the new power system exhibits novel transient characteristics such as wide-frequency oscillations and microsecond-level operation of power electronic switches. These new characteristics of the power system place higher demands on the accuracy, safety, and reliability of time synchronization devices.
[0003] Currently, power system time synchronization devices have achieved sub-microsecond timing accuracy, which can reach the hundred-nanosecond level after calibration. They also possess robust and reliable functions such as multi-machine redundancy, mutual backup of time sources between ground and space, multi-source decision-making, and transitions not exceeding 200ns. The 1PPS signal of the device system serves as the foundation for time information in timing methods such as IRIG-B codes and network NTP messages; its reliability directly affects the stability of the entire time synchronization device. However, existing 1PPS time modules are susceptible to interference from system load fluctuations, task preemption, or logical timing issues, leading to execution delays or even missed signal detection, which can cause scheduling failures and abnormal 1PPS loss. Existing devices lack real-time and effective fault-tolerance mechanisms, making it difficult to ensure the reliability of power system measurement data.
[0004] To address the issues of 1PPS signal being susceptible to interference leading to second skipping and insufficient fault tolerance of a single drive mechanism in existing technologies, it is necessary to propose a 1PPS protection method based on dual time data drive. Summary of the Invention
[0005] Purpose of the invention: The purpose of this invention is to provide a 1PPS guardian device and method based on dual time data driving.
[0006] Technical solution: The 1PPS guardian device based on dual time data driving described in this invention includes a receiving unit, a clock unit, an output unit, a dual-mode redundant monitoring module, and a dual-mode fusion computing module;
[0007] The clock unit receives TOD+1PPS information, tames the local frequency source, and enables the system's 1PPS signal to track the receiving unit's 1PPS signal, thereby achieving the device's timing accuracy requirements.
[0008] The output unit expands various timing interfaces and outputs timing signals, status signals and alarm signals; the device outputs the timing information of the timing message, the part below the second comes from the 1PPS signal output by the receiving unit, and the part above the second comes from the TOD information output by the receiving unit. After operation, the second time information is accumulated by relying on the system 1PPS.
[0009] The dual-mode fusion computing module is used to monitor the validity of the first and second trigger signals in real time, and to switch the trigger source by prioritizing the first trigger signal as the primary signal and the second trigger signal as the backup signal. By analyzing the pulse interval standard deviation σ of the time-driven module, it adaptively adjusts the number of consecutive high-level detections n, and combines the message interval stability analysis of the data-driven module.
[0010] The 1PPS guardian method based on dual-drive time data described in this invention includes the following steps:
[0011] S1: The device generates a system 1PPS signal: a system 1PPS pulse signal with a width of 1 ms is generated using a clock frequency source;
[0012] S2: The time-driven module monitors the system's 1PPS status in real time and generates a signal to trigger the application to run.
[0013] S3: The data-driven module monitors the TOD statement information output by the satellite module in real time and generates a signal to trigger the application to run;
[0014] S4: The dual-mode fusion computing module uses signals generated by the time-driven module and the data-driven module to trigger the clock unit to run.
[0015] Furthermore, in step S1, k is greater than the product of the interruption time of the time-driven module and the number of consecutive high-level monitoring n times.
[0016] Further, step S2 includes:
[0017] S2-1: Configure an interrupt function for the runtime-driven module;
[0018] S2-2: The time-driven module monitors the status of the system's 1PPS pulse signal in real time and records the interval time of the most recent 1PPS pulses;
[0019] S2-3: The time-driven module monitors the status of the system's 1PPS pulse signal in real time and calculates the interval between the current time and the previous 1PPS reached by the system.
[0020] Furthermore, in step S2-2, the pulse interval time is stored in an array variable, and the standard deviation of the pulse interval time in the variable array is calculated each time the 1PPS pulse signal of the monitoring system is valid. This standard deviation is then used as the basis for dynamically adjusting the threshold.
[0021] Furthermore, in steps S2-3, if a high-level state is detected n times consecutively, where n is 3 times, the trigger signal is considered valid and used to trigger the clock unit application to run.
[0022] Furthermore, in steps S2-3, simultaneously, when a trigger signal is generated, the interval time of the first high level in the n consecutive high-level monitoring states is recorded as the current 1PPS pulse interval time.
[0023] Further, step (3) includes:
[0024] S3-1: Configure a cycle interrupt function for running the data driver module;
[0025] S3-2: The data-driven module reads the TOD messages output by the satellite module in real time through the serial port, records the time of the last 5 message acquisitions, stores the message interval time in an array variable, and calculates the standard deviation of the message interval time in the variable array each time the message signal is valid, which is then used for the exception handling process.
[0026] S3-3: The data-driven module reads the TOD messages output by the satellite module in real time via the serial port, and calculates the interval between the current time and the last time the TOD message was read each time it enters an interrupt. After all messages have been read, the validity of the statement is verified.
[0027] Further, step (4) includes:
[0028] S4-1: Configure a periodic interrupt function for real-time execution of the dual-mode fusion algorithm; define state variables: first_signal_valid is the validity flag of the 1PPS signal from the time-driven module; second_signal_valid is the validity flag of the TOD signal from the data-driven module; trigger_source records the current trigger source.
[0029] S4-2: In the dual-mode fusion calculation, the validity flags set in steps 2-3 and 3-3 are used to make decisions directly; when first_signal_valid is true, the clock unit application is immediately triggered to run; when first_signal_valid is false and second_signal_valid is true, the triggering is switched to the TOD signal; when both are false, the exception handling process is triggered.
[0030] S4-3: When an exception handling process is triggered, use the exception handling logic to restore the normal state;
[0031] S4-4: Real-time dual-mode fusion calculation results update system status information and record trigger source switching events;
[0032] S4-5: Based on the pulse interval standard deviation σ calculated by the time-driven module, dynamically adjust the threshold of the number of consecutive high-level detections n: when σ < 10ms, n = 2; when σ > 50ms, n = 4; default n = 3.
[0033] Further, the abnormal handling in step (4-3) includes: starting the device time continuity alarm, continuously monitoring whether the local output seconds are aligned with the external satellite signal TOD seconds, forcibly synchronizing once after timeout, setting the timeout threshold to 30 seconds to update the time of seconds and above with TOD messages, calibrating the time of seconds below with 1PPS signals, clearing the alarm after synchronization is completed, and restoring the local 1PPS accumulation mechanism.
[0034] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: Based on the traditional method of driving the clock using the 1PPS time of the device system, it adds a data-driven method using TOD statement information output by the satellite time relay message parsing module, constructing an independent data-driven module. The data-driven module, based on TOD statement information, assists the time-driven module in collaborative calculation to drive the clock. When the time-driven module detects an anomaly in the 1PPS signal, the data-driven module triggers a scheduling mechanism to drive the clock, ensuring the time continuity of key clock units and preventing the loss of the system's 1PPS and the occurrence of second skipping. Through dual-mode redundant monitoring and dual-mode fusion calculation mechanisms, the reliability and fault tolerance of the time synchronization device are improved, providing highly reliable time for the power grid and further providing high-quality data support for scheduling operations. Attached Figure Description
[0035] Figure 1 This is a flowchart of the time data dual-drive 1PPS protection method of the present invention;
[0036] Figure 2 This invention comprises a dual-drive 1PPS time data guardian clock device.
[0037] Figure 3 This invention comprises a dual-drive 1PPS guardian clock system for time data. Detailed Implementation
[0038] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0039] like Figure 1 As shown, the 1PPS guardian method based on time data dual-drive of the present invention includes a time-driven module, a data-driven module and a dual-mode fusion calculation module.
[0040] S1. The device generates a system 1PPS signal: a system 1PPS pulse signal with a width of k ms is generated using a clock frequency source, where k takes the value of [10, 200] ms, and the default value of k is 200ms.
[0041] S2, the time-driven module monitors the system's 1PPS status in real time and generates signals to trigger the application to run.
[0042] S2-1. Configure an interrupt function with a period of 1ms for the runtime-driven module.
[0043] S2-2, The time-driven module monitors the status of the 1PPS pulse signal of the system in real time and records the 1PPS pulse interval time of the last 5 times. The pulse interval time is stored in an array variable, assuming it is pps_interval_history[5], and the standard deviation (σ) of the pulse interval time in the variable array is calculated each time the 1PPS pulse signal of the monitoring system is valid. It is then used as one of the bases for dynamically adjusting the threshold.
[0044] S2-3: The time-driven module monitors the system's 1PPS pulse signal status in real time. Each time it enters an interrupt, it calculates the interval between the current time and the previous 1PPS occurrence as pps_interval. When n consecutive high-level states are detected (n = 3), the trigger signal is considered valid (first_signal_valid is true), and is used to trigger the clock unit application program. Simultaneously, when a trigger signal is generated, the pps_interval value at the first high level out of the n consecutive high-level monitoring is recorded as the current 1PPS pulse interval time, and the most recently valid value is recorded at that moment.
[0045] S3, the data-driven module monitors the TOD statement information output by the satellite module in real time and generates a signal to trigger the application to run.
[0046] S3-1. Configure an interrupt function with a period of 1ms to run the data driver module.
[0047] S3-2. The data-driven module reads the TOD message output by the satellite module in real time through the serial port. The message is a statement in the NMEA-0813 format. At the same time, the time of the last 5 message acquisitions is recorded, and the message interval time is stored in an array variable, assuming it is tod_interval_history[5]. The standard deviation of the message interval time in the variable array is calculated each time the message signal is valid, and it is used for the subsequent exception handling process.
[0048] S3-3: The data-driven module reads TOD messages output by the satellite module in real time via the serial port. Each time it enters an interrupt, it calculates the interval between the current time and the last TOD message read as `tod_interval`. After all messages have been read, the validity of the statement is verified. The result of the XOR operation of all characters between '$' and '*' (excluding '$' and '*') is compared with the checksum bit in the message. If the verification result matches, the trigger signal is considered valid (`second_signal_valid` is true), and it is used to trigger the clock unit application to run. If the verification fails, the TOD message is marked as invalid, and the trigger signal is considered invalid (`second_signal_valid` is false). Simultaneously, when a trigger signal is generated, the time of the interrupt where the first character '$' of the statement appears, `tod_interval`, is recorded as the current TOD message interval.
[0049] S4, the dual-mode fusion computing module uses signals generated by the time-driven module and the data-driven module to trigger the clock unit to run.
[0050] S4-1. Configure an interrupt function with a period of 1ms for real-time execution of the dual-mode fusion algorithm. Define the following state variables: first_signal_valid: validity flag of the 1PPS signal from the time-driven module; second_signal_valid: validity flag of the TOD signal from the data-driven module; trigger_source: records the current trigger source (1PPS or TOD).
[0051] S4-2. In the dual-mode fusion calculation, the validity flags set in steps 2-3 and 3-3 above are directly used for decision-making.
[0052] When first_signal_valid is true, the clock unit application is immediately triggered to run;
[0053] When first_signal_valid is false and second_signal_valid is true, switch to TOD signal triggering;
[0054] When both are false, the exception handling process is triggered.
[0055] S4-3. When an abnormal process is triggered, the abnormal handling logic is used to restore the normal state. The abnormal handling includes: starting the device time continuity alarm, continuously monitoring whether the local output seconds and the external satellite signal TOD seconds are aligned, and forcibly synchronizing once after a timeout (the timeout threshold is set to 30 seconds) to update the time of seconds and above with TOD messages, and calibrating the time of seconds below seconds (such as milliseconds or microseconds) with 1PPS signals. After the synchronization is completed, the alarm is cleared and the local 1PPS accumulation mechanism is restored.
[0056] S4-4. Update system status information with real-time dual-mode fusion calculation results and record trigger_source source switching events.
[0057] S4-5, Dynamic Threshold Adjustment: Based on the pulse interval standard deviation (σ) calculated by the time-driven module, dynamically adjust the threshold of the number of consecutive high-level detections n: when σ < 10ms, n = 2; when σ > 50ms, n = 4; default n = 3.
[0058] like Figure 2 As shown, the time data-based dual-drive 1PPS guardian clock device of the present invention includes a receiving unit, a clock unit, an output unit, a dual-mode redundancy monitoring module, and a dual-mode fusion calculation module.
[0059] The next receiving unit converts the external satellite signal into TOD+1PPS information;
[0060] The clock unit receives TOD+1PPS information, tames the local frequency source, and enables the system's 1PPS signal to track the receiving unit's 1PPS signal, thus achieving the device's timing accuracy requirements.
[0061] The output unit expands various time synchronization interfaces and outputs time synchronization signals, status signals, and alarm signals;
[0062] The device outputs time information of the synchronization message. The part below the second comes from the 1PPS signal output by the receiving unit, and the part above the second comes from the TOD information output by the receiving unit. However, considering the reliability of the clock unit receiving the TOD information, the external TOD time is only obtained in the initial stage of synchronization. After the device is running, the second time information is accumulated by relying on the system 1PPS.
[0063] The dual-mode redundancy monitoring module is a functional unit integrating a time-driven module and a data-driven module: the time-driven module is responsible for real-time monitoring of the system's 1PPS pulse signal, which serves as the first trigger signal to trigger the clock unit application to run and accumulate second-by-second time information. The data-driven module reads the TOD messages output by the satellite module in real time, utilizing its characteristic of sending one message per second as the second trigger signal. Both modules work in parallel to form dual-mode redundancy, and their output signals are all connected to the dual-mode fusion computing module for decision-making.
[0064] The dual-mode fusion computing module is used to monitor the validity of the first and second trigger signals in real time, and switches the trigger source by prioritizing the first trigger signal as the primary signal and the second trigger signal as the backup signal, ensuring continuous operation of the clock unit. By analyzing the pulse interval standard deviation σ of the time-driven module, the number of consecutive high-level detections n is adaptively adjusted (n=2 when σ<10ms, n=4 when σ>50ms, default n=3). At the same time, combined with the message interval stability analysis of the data-driven module, misjudgments caused by signal jitter or interference are reduced, improving the reliability of the dual-drive mechanism.
[0065] like Figure 3 As shown, the time data-based dual-drive 1PPS guardian clock system of the present invention includes a master clock, a slave clock, and a time-controlled device / system.
[0066] The system master clock integrates the aforementioned dual-drive 1PPS time data protection method, which synchronizes the slave clock by outputting a high-precision time synchronization signal to ensure the time consistency of the hierarchical clock network. After receiving the master clock signal, the slave clock distributes the synchronization signal to the time-synchronized device / system. The system master clock, combined with the dual-drive redundancy mechanism, quickly restores synchronization, ensuring high reliability of end-to-end time synchronization in critical areas such as power.
Claims
1. A 1PPS daemon device based on time data double drive, characterized in that, It includes a receiving unit, a clock unit, an output unit, a dual-mode redundancy monitoring module, and a dual-mode fusion computing module; The clock unit receives TOD+1PPS information, tames the local frequency source, and enables the system's 1PPS signal to track the receiving unit's 1PPS signal, thereby achieving the device's timing accuracy requirements. The output unit expands various timing interfaces and outputs timing signals, status signals, and alarm signals; the device outputs the time information of the timing messages, with the portion below the second originating from the 1PPS signal output by the receiving unit, and the portion above the second originating from the TOD information output by the receiving unit. After operation, the second time information is accumulated by relying on the system's 1PPS. The dual-mode fusion computing module is used to monitor the validity of the first and second trigger signals in real time, and to switch the trigger source by prioritizing the first trigger signal as the primary signal and the second trigger signal as the backup signal. By analyzing the pulse interval standard deviation σ of the time-driven module, the number of consecutive high-level detections n is adaptively adjusted, and the message interval stability analysis of the data-driven module is also combined.
2. A 1PPS daemon method based on time data double drive, realized by the device of claim 1, characterized in that, Includes the following steps: S1: The device generates a system 1PPS signal: a system 1PPS pulse signal with a width of 1 ms is generated using a clock frequency source; S2: The time-driven module monitors the system's 1PPS status in real time and generates a signal to trigger the application to run. S3: The data-driven module monitors the TOD statement information output by the satellite module in real time and generates a signal to trigger the application to run; S4: The dual-mode fusion computing module uses signals generated by the time-driven module and the data-driven module to trigger the clock unit to run.
3. The 1PPS guardian method based on dual-drive time data according to claim 2, characterized in that, In step S1, k is greater than the product of the interruption time of the time-driven module and the n consecutive high-level monitoring.
4. The 1PPS guardian method based on dual-drive time data according to claim 2, characterized in that, Step S2 includes: S2-1: Configure an interrupt function for the runtime-driven module; S2-2: The time-driven module monitors the status of the system's 1PPS pulse signal in real time and records the interval time of the most recent 1PPS pulses; S2-3: The time-driven module monitors the status of the system's 1PPS pulse signal in real time and calculates the interval between the current time and the previous 1PPS reached by the system.
5. The 1PPS guardian method based on dual-drive time data according to claim 4, characterized in that, In step S2-2, the pulse interval time is stored in an array variable, and the standard deviation of the pulse interval time in the variable array is calculated each time the 1PPS pulse signal of the monitoring system is valid. This standard deviation is then used as the basis for dynamically adjusting the threshold.
6. The 1PPS guardian method based on dual-drive time data according to claim 4, characterized in that, In steps S2-3, if a high-level state is detected n times consecutively, where n is 3 times, the trigger signal is considered valid and used to trigger the clock unit application program to run.
7. The 1PPS guardian method based on dual-drive time data according to claim 4, characterized in that, In steps S2-3, simultaneously, when a trigger signal is generated, the interval time of the first high level in the n consecutive high-level monitoring states is recorded as the current 1PPS pulse interval time.
8. The 1PPS guardian method based on dual-drive time data according to claim 2, characterized in that, Step (3) includes: S3-1: Configure a cycle interrupt function for running the data driver module; S3-2: The data-driven module reads the TOD messages output by the satellite module in real time through the serial port, and records the time of the last 5 message acquisitions. The message interval time is stored in an array variable, and the standard deviation of the message interval time in the variable array is calculated each time the message signal is valid. This standard deviation is then used in the exception handling process. S3-3: The data-driven module reads the TOD messages output by the satellite module in real time via the serial port, and calculates the interval between the current time and the last time the TOD message was read each time it enters an interrupt. After all messages have been read, the validity of the statement is verified.
9. The 1PPS guardian method based on dual-drive time data according to claim 2, characterized in that, Step (4) includes: S4-1: Configure a periodic interrupt function for real-time execution of the dual-mode fusion algorithm; define state variables: first_signal_valid is the validity flag of the 1PPS signal from the time-driven module; second_signal_valid is the validity flag of the TOD signal from the data-driven module; trigger_source records the current trigger source; S4-2: During dual-mode fusion calculation, the validity flags set in steps 2-3 and 3-3 are used to make a decision directly; when first_signal_valid is true, the clock unit application is immediately triggered; when first_signal_valid is false and second_signal_valid is true, the triggering is switched to the TOD signal; when both are false, the exception handling process is triggered. S4-3: When an exception handling process is triggered, use the exception handling logic to restore the normal state; S4-4: Real-time dual-mode fusion calculation results update system status information and record trigger source switching events; S4-5: Based on the pulse interval standard deviation σ calculated by the time-driven module, dynamically adjust the threshold of the number of consecutive high-level detections n: when σ < 10ms, n = 2; when σ > 50ms, n = 4; default n = 3.
10. The 1PPS guardian method based on dual-drive time data according to claim 9, characterized in that, The abnormal handling in step 4-3 includes: starting the device time continuity alarm, continuously monitoring whether the local output seconds are aligned with the external satellite signal TOD seconds, forcibly synchronizing once after timeout, setting the timeout threshold to 30 seconds to update the time of seconds and above with TOD messages, calibrating the time of seconds below with 1PPS signals, clearing the alarm after synchronization is completed, and restoring the local 1PPS accumulation mechanism.