A time synchronization drift self-correction method for dedicated transformer acquisition terminals
By building a self-correction mechanism in the dedicated transformer acquisition terminal and utilizing the grid zero-crossing count and local clock data to dynamically correct time drift, the time synchronization problem caused by timing interruption is solved, and the time consistency and stability of the terminal in the loss of timing state are achieved.
Patent Information
- Application Number
- CN202510863862.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-06-26
AI Technical Summary
During long-term operation, the dedicated transformer acquisition terminal causes local clock drift due to timing interruption, affecting data integrity and system reliability. Existing technology makes it difficult to achieve accurate time synchronization in the loss of timing state.
By acquiring conditional information and identifying the triggering of the self-correction mechanism, the time drift is dynamically monitored and corrected by combining the grid zero-crossing count and local clock data. The grid frequency is used as a reference to build a self-correction mechanism to synchronize time when timing is unavailable.
It realizes active identification and accurate modeling of time offset risks in non-timing state, ensures terminal time consistency, avoids time jumps and over-corrections, and improves the correction accuracy and stability of the system.
Smart Images

Figure CN120378039B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dedicated transformer acquisition terminals, and in particular to a time synchronization drift self-correction method for dedicated transformer acquisition terminals. Background Art
[0002] Dedicated transformer data collection terminals, edge-side sensing devices deployed on the low-voltage side of dedicated transformers, are responsible for collecting critical power consumption information, monitoring power quality, uploading load data, and providing abnormality alerts. Their data integrity and accuracy are highly dependent on the consistent stability of the terminal's local time. These terminals typically rely on master station timing, Beidou, or GPS signals for time synchronization. However, due to factors such as environmental obstruction, electromagnetic interference, and communication interruptions, these terminals often experience timing interruptions during extended operation, causing persistent local clock drift and becoming a significant constraint on system reliability.
[0003] Currently, common time synchronization methods include master station timing, GPS, or external Beidou timing modules. However, in actual operational scenarios, discontinuities in the timing link, such as interrupted communication between the master station and the terminal or obstruction of the satellite timing signal, can cause the terminal to lose synchronization, making it difficult to obtain the standard time signal in a timely manner. For example, a dedicated data acquisition terminal's local RTC system relies on a low-power crystal oscillator, such as one running continuously at 32.768kHz. While low power and cost-effective, this system suffers from frequency drift over time, leading to cumulative system time drift. For example, a crystal oscillator frequency drift of ±20ppm could result in a daily error exceeding ±1.7 seconds. After several days of continuous operation, this would result in significant clock drift. If this loss of synchronization persists, it would severely impact the timing consistency of terminal data reporting, fault tracing, and system event response. Summary of the Invention
[0004] In view of the deficiencies in the prior art, the present invention provides a time synchronization drift self-correction method for a dedicated transformer acquisition terminal, which solves the problems in the above-mentioned background technology.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: a time synchronization drift self-correction method for a dedicated transformer acquisition terminal, comprising the following steps:
[0006] S1: Based on the dedicated transformer acquisition terminal, condition information is obtained. Based on the size relationship between the parameters in the condition information, judgment conditions are generated to identify the triggering of the self-correction mechanism.
[0007] S2: Real-time monitoring of the operating status data within the dedicated transformer acquisition terminal. After correlation analysis, a preliminary assessment of the local clock drift value of the current dedicated transformer acquisition terminal is made. Combined with historical data and progressive regression, this method enables trend tracking and updating of variable time series.
[0008] S3: Determine the remaining drift residual and perform dynamic self-correction on the time synchronization drift of the dedicated transformer acquisition terminal.
[0009] Preferably, the last successful timing moment in the dedicated transformer acquisition terminal is determined according to the valid timing packet and timing status received by the dedicated transformer acquisition terminal, wherein the timing status includes timing failure and timing success;
[0010] By extracting and counting the instantaneous points where the AC signal waveform of the power grid crosses 0 volts, the number of zero crossings of the power grid from the last successful timing to the current time is counted, and the number of zero crossings of the power grid counted is obtained;
[0011] Access the real-time clock module inside the dedicated transformer acquisition terminal to obtain the local clock time of the dedicated transformer acquisition terminal;
[0012] The current reference time can be inferred from the zero crossing point of the power grid to obtain supplementary information, including:
[0013] According to the number of zero crossing points of the power grid counted, the equivalent power grid operation time is obtained;
[0014] Determine the equivalent grid timestamp by combining the equivalent grid operation time with the last successful timing moment;
[0015] The equivalent grid timestamp is used as supplementary information, and combined with the last successful time synchronization time, the local clock time of the dedicated transformer acquisition terminal, and the number of grid zero crossings counted, to generate conditional information;
[0016] According to the size relationship between the parameters in the condition information, a judgment condition is generated to identify the triggering of the self-correction mechanism.
[0017] Preferably, based on the magnitude relationship between the parameters in the condition information, a judgment condition is generated to identify the triggering of the self-correction mechanism, including:
[0018] Determine the maximum allowable timing cycle based on the preset maximum tolerable time error;
[0019] Estimate whether the time granted has expired, specifically: , the estimated time has expired, among which, To allow the maximum timing period, is the equivalent grid timestamp, The time of last successful time granting;
[0020] Is the local clock time drifting abnormally? , indicating that the local clock time has drift anomaly, where The local clock time of the dedicated acquisition terminal. is the preset drift threshold;
[0021] Estimate whether the time grant has expired and whether the local clock time has drifted abnormally to obtain the judgment condition;
[0022] like ,and , it indicates that the timing status of this round is timing failure, and the self-correction mechanism is automatically triggered.
[0023] Preferably, a self-correction mechanism is started to monitor the operating status data in the dedicated transformer acquisition terminal in real time, and the operating status data is used as candidate feature data;
[0024] Simultaneously record the actual drift value of the local clock of the dedicated transformer acquisition terminal in multiple time periods as the target dependent variable, with each time period as one sample;
[0025] Use the Pearson correlation coefficient calculation method to analyze the correlation between each feature in the candidate feature data and the actual drift value of the local clock of the dedicated transformer acquisition terminal to obtain the corresponding correlation coefficient. If the correlation coefficient does not exceed the preset correlation threshold, the corresponding feature is removed from the candidate feature data; otherwise, it is retained.
[0026] Obtain updated candidate feature data;
[0027] The updated candidate feature data is preprocessed, including noise removal, missing value filling, and data smoothing. The updated candidate feature data is scaled using dimensionless processing technology so that the feature range falls between 0 and 1.
[0028] By correlating the features in the updated candidate feature data and performing weighted summation, the local clock drift value of the current dedicated transformer acquisition terminal is preliminarily evaluated.
[0029] Preferably, historical data within a historical period is retrieved, and the actual measured clock drift at different times and the preliminarily estimated local clock drift value are extracted from the historical data. Combined with the preliminarily estimated local clock drift value at the current time, trend tracking and dynamic fitting of the variable time series are achieved, specifically as follows: Where, is the time offset prediction correction value after fusion residual, is the local clock drift value preliminarily estimated at the current moment, is the historical residual feedback factor, N is the historical window length, i is the time point number in the historical window length, is the actual clock drift measured at time ti, is the local clock drift value initially evaluated at time ti.
[0030] Preferably, according to the mechanism that the local clock time in the dedicated transformer acquisition terminal gradually returns from the deviated state to the steady state, the time offset prediction correction value after the residual fusion is updated, which is specifically performed as follows: ,in, is the local clock correction value, To suppress the over-correction factor, is the cumulative running time since the last successful timing. is the drift expansion adjustment factor, is the frequency deviation of the crystal oscillator, and e is the natural base.
[0031] Preferably, the grid error is fused with the local clock correction value obtained in the self-correction mechanism to compensate the local clock correction value to obtain the local clock correction compensation value, specifically: ,in, Correction compensation value for the local clock, is the weight value, Counts the error in local time.
[0032] Preferably, the remaining drift residual is determined based on the time offset prediction correction value and the local clock correction value after the residual is fused, specifically: , is the residual drift residual; the residual drift residual reflects the uncorrected difference between the predicted value and the actual correction amount, and is used to measure the prediction confidence;
[0033] Based on the remaining drift residual value, the weight value is dynamically adjusted, specifically:
[0034] ,in, is the dynamic weight value, 、 are the lower and upper limits of the fusion factor, 、 are the lower and upper thresholds of the prediction error, respectively. The English semantics is otherwise.
[0035] Preferably, the dynamic weight value is substituted into the local clock correction compensation value acquisition formula to perform a self-correction operation on the time synchronization drift of the dedicated transformer acquisition terminal.
[0036] The present invention provides a time synchronization drift self-correction method for a dedicated transformer acquisition terminal, which has the following beneficial effects:
[0037] The time synchronization drift self-correction trigger judgment mechanism constructed by this step can realize the active identification and accurate modeling of the time offset risk of the dedicated transformer acquisition terminal in the non-timing state. Specifically, the effective timing package and timing status recorded inside the terminal are used to reliably track the last successful timing moment, establishing a stable benchmark for subsequent time judgment; by combining the number of grid zero crossings with the standard grid frequency, the equivalent grid operation time is accurately derived, and combined with the last timing information, the current equivalent grid timestamp is further inverted to provide an alternative reference time that is independent of the crystal oscillator and does not rely on the master station timing; in the conditional information, the time span relationship and offset difference relationship between the parameters are constructed, which can be used to determine whether the boundary conditions for triggering the self-correction mechanism are met, thereby ensuring that the self-correction mechanism is triggered only when the offset risk is obvious and timing is unavailable, effectively suppressing miscorrection and over-frequency calibration behavior, and improving the accuracy, stability and security of the system correction behavior.
[0038] Through the actual drift trajectories and evaluation errors observed in multiple historical time periods, a time series model integrating residual feedback is constructed, which realizes the dynamic regression of variable time series and the predictability modeling of future trends; the introduction of historical residual feedback mechanism in the time series model can make the model maintain the coexistence of sensitivity and robustness to long-term trend stability and short-term disturbance changes, thereby forming the ability to accurately track drift behavior; finally, the correction value is adjusted for convergence through the exponential suppression function, combined with the crystal oscillator frequency offset characteristics and time lag effect, to achieve progressive repair control of the local time from the deviation state to the steady state process, effectively avoiding the occurrence of timing anomalies such as time jumps, overcorrection or call back.
[0039] A calculation mechanism for fusion residuals is introduced to explicitly quantify the remaining error between the model prediction offset and the actual correction effect, providing a dynamic evaluation indicator for measuring the confidence of the current drift model and the effect of bias compensation. A segmented fusion factor adjustment mechanism is designed for different residual intensity intervals, which enables the system to automatically adjust its dependence on the grid error according to the drift risk level, thereby achieving responsive suppression of the prediction error. The introduction of dynamic weights gives the correction logic the characteristics of convergence, elasticity, and upper and lower limit constraints. When the model prediction is highly reliable, the weights will guide the system to rely more on the internal drift model. When the prediction error is large, the system will automatically increase its dependence on the external grid reference, thereby forming an adaptive switching capability between prediction dominance and reference compensation. Ultimately, it effectively prevents the further accumulation of time correction errors caused by drift prediction model distortion or external interference, and avoids time jumps or time call-back anomalies caused by over-correction, so that the dedicated transformer acquisition terminal can still maintain a high degree of time consistency and calibration robustness in long-term operation and loss of access environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flow chart of a time synchronization drift self-correction method for a dedicated transformer acquisition terminal according to the present invention;
[0041] Figure 2 This is a logic diagram of a time synchronization drift self-correction method for a dedicated transformer acquisition terminal according to the present invention; DETAILED DESCRIPTION
[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0043] See also Figure 1 and Figure 2 The present invention provides a time synchronization drift self-correction method for a dedicated variable acquisition terminal, comprising the following steps:
[0044] S1: Based on the dedicated transformer acquisition terminal, condition information is obtained. Based on the size relationship between the parameters in the condition information, judgment conditions are generated to identify the triggering of the self-correction mechanism.
[0045] Specifically, according to the valid timing packet and timing status received by the dedicated transformer acquisition terminal, the last successful timing moment in the dedicated transformer acquisition terminal is determined, wherein the timing status includes timing failure and timing success;
[0046] When the terminal receives a valid timing packet (master station / GPS, etc.), it parses the timing time, calibrates the local RTC time, and writes the last successful timing moment to a non-volatile memory such as EEPROM or Flash when the RTC calibration is completed. The system then records and updates the last successful timing moment as a subsequent comparison benchmark.
[0047] By extracting and counting the instantaneous points at which the AC signal waveform of the power grid crosses 0V, the number of zero-crossing points of the power grid from the last successful timing to the current point is calculated, and the number of zero-crossing points of the power grid is obtained. The number of zero-crossing points can be obtained through a zero-crossing detector. The zero-crossing point of the power grid is the instantaneous point at which the AC voltage waveform crosses 0V within a cycle.
[0048] Access the real-time clock module (RTC module) inside the dedicated transformer acquisition terminal to obtain the local clock time of the dedicated transformer acquisition terminal;
[0049] The local clock time is the local timestamp of the dedicated transformer acquisition terminal;
[0050] The current reference time can be inferred from the zero crossing point of the power grid to obtain supplementary information, including:
[0051] According to the number of zero crossing points of the power grid counted, the equivalent power grid operation time is obtained;
[0052] Determine the equivalent grid timestamp by combining the equivalent grid operation time with the last successful timing moment;
[0053] The specific method of obtaining the equivalent power grid timestamp is as follows: ,in, is the equivalent grid timestamp, The last successful time granting time. is the number of zero crossing points in the power grid that have been counted, is the standard grid frequency, In the calculation of equivalent grid time, since each AC cycle has two grid zero crossing points, it is necessary to ; There are 2 zero crossing points in each cycle: crossing 0V from positive to negative, and crossing 0V from negative to positive.
[0054] The equivalent grid timestamp is used as supplementary information, and combined with the last successful time synchronization time, the local clock time of the dedicated transformer acquisition terminal, and the number of grid zero crossings counted, to generate conditional information;
[0055] Grid frequency refers to the periodic rate at which the AC voltage and current in the power system change over time. The standard grid frequency is 50 Hz, meaning the voltage changes between positive and negative 50 times per second, or 50 cycles per second.
[0056] According to the size relationship between the parameters in the condition information, a judgment condition is generated to identify the triggering of the self-correction mechanism.
[0057] In dedicated transformer acquisition terminals (i.e., power data acquisition equipment for dedicated transformer users), time synchronization drift refers to the offset change over time between the terminal's internal clock and a standard time source, such as GPS, Beidou, or the master station clock. This drift is a gradual accumulation of time errors that can lead to inaccurate data timestamps, affecting data quality and power system operation judgment. Specifically, it can cause data reporting times to be inconsistent with the master station time, resulting in a "time misalignment" phenomenon. If multiple terminals have different time drifts, data cannot be correctly sorted, making aggregate analysis difficult. This can seriously affect fault identification and location for event record data, such as fault waveform records.
[0058] In this embodiment, in step S1, a multi-dimensional conditional perception and triggering mechanism is constructed around the time synchronization status of the dedicated transformer acquisition terminal. By integrating multiple source parameters such as the master station timing status, grid zero crossing statistics, local RTC time, and grid-derived timestamps, an autonomous and identifiable trigger judgment condition set is formed. Compared with the traditional mode of passively waiting for timing signals, this mechanism records the last successful timing time and calculates the number of grid zero crossings currently counted. It can calculate the actual operating time experienced by the terminal based on the standard grid frequency, that is, the equivalent grid operating time, and thus infer the current reference timestamp. By comparing this with the terminal's local clock time, it can determine whether it is currently in a timing failure state. If a traditional terminal is out of timing for a long time, it will gradually accumulate drift due to crystal oscillator frequency errors. However, the present invention introduces the grid frequency as a natural time reference, which can be used to derive the expected time in the absence of an external timing signal, forming a reference comparison basis. By determining whether the maximum allowable timing period has been exceeded and whether the local clock time has drifted abnormally, the system can automatically determine whether to enter the time self-correction process, reducing human intervention and improving system autonomy.
[0059] For example, consider a dedicated transformer acquisition terminal installed in a distribution station. Its last received timing packet from the master station was 2025 / 06 / 08 / 12:00:00, or 12:00 on June 8, 2025. Assume that network communication is subsequently interrupted, and the terminal relies on its own crystal oscillator for timing. After 24 hours, the terminal receives no further timing packets. However, the voltage zero-crossing detection module counts a total of 8,640,000 grid zero-crossings (50 Hz x 2 x 24 hours x 3,600 seconds). Based on a 50 Hz grid frequency, the current time can be inferred to be: , which is 12:00 on June 9, 2025; but the current RTC reading of the terminal is 2025 / 06 / 09 / 12:05:30, which means that the terminal time is 330 seconds fast. If the system determines that the deviation has exceeded the preset drift tolerance value (such as 60 seconds) and also exceeded the maximum timing period (such as 12 hours), the time self-correction mechanism will be automatically triggered without waiting for the master station to provide time, ensuring time continuity and the accuracy of collected data.
[0060] Among them, the valid timing packet is a time synchronization signal with a timestamp and complete structure provided by the master station or GPS, which is used to record the last successful timing;
[0061] The grid zero crossing is the event when the grid AC voltage waveform crosses the 0V point (twice per cycle), which is used for counting to derive the due grid time;
[0062] The local clock time is the current timestamp recorded by the RTC module inside the terminal, representing the current time perceived by the terminal itself;
[0063] The equivalent grid timestamp is the theoretical current time derived from the grid zero crossing point and is used as the standard reference time to compare drift.
[0064] The RTC module is a hardware module dedicated to providing stable and continuously running real-time time. It is widely used in embedded systems, metering terminals, and acquisition devices.
[0065] Condition information is a parameter set formed by combining multiple time information and count values, which is used to evaluate whether to enter the self-correction process;
[0066] The judgment condition is a logical rule formed based on the relationship between the parameters in the condition information, which is used to trigger the decision criteria for whether to enter the self-correction process;
[0067] Specifically, based on the magnitude relationship between the parameters in the condition information, a judgment condition is generated to identify the triggering of the self-correction mechanism, including:
[0068] Based on the preset maximum tolerable time error, the maximum allowable timing period is determined; specifically: ,in, To allow the maximum timing period, is the maximum tolerable time error, The crystal oscillator frequency deviation rate of the dedicated acquisition terminal; for example, if the terminal wants to control the maximum time error within ±2 seconds, the crystal oscillator deviation is 20ppm (one millionth): 2 seconds (20 ) = 100,000 seconds = 27.8 hours; where the frequency offset of the crystal oscillator is 20 ppm, which means the offset ratio = 20 1000000=0.002%, that is, for every 1000000 seconds of operation, the time error is 20 seconds.
[0069] The crystal oscillator frequency deviation rate of the dedicated transformer acquisition terminal is obtained by subtracting the ideal frequency from the actual operating frequency of the crystal oscillator and dividing the difference by the ideal frequency. The crystal oscillator uses the quartz oscillation principle to oscillate stably and is used to provide a basic clock signal.
[0070] The preset maximum tolerable time error is used to define the acceptable upper limit of system time drift, indicating how long the terminal can be without time synchronization before its RTC error is still tolerable.
[0071] Estimate whether the time granted has expired, specifically: , the estimated time has expired, among which, To allow the maximum timing period, is the equivalent grid timestamp, The time of last successful time granting;
[0072] Is the local clock time drifting abnormally? , indicating that the local clock time has drift anomaly, where The local clock time of the dedicated acquisition terminal. is the preset drift threshold;
[0073] Estimate whether the time grant has expired and whether the local clock time has drifted abnormally to obtain the judgment condition;
[0074] like ,and , it indicates that the timing status of this round is timing failure, and the self-correction mechanism is automatically triggered. Otherwise, it does not indicate that the timing status of this round is timing failure.
[0075] Timing failure refers to the process in which the acquisition terminal fails to successfully obtain and apply the standard time signal within the predetermined time window during the planned external timing process, resulting in the terminal failing to complete effective clock calibration.
[0076] Whether the local clock time drifts abnormally is used to indicate whether the terminal has experienced significant drift during the period without time service.
[0077] In this embodiment, the logical judgment mechanism based on the size relationship of the conditional information parameters constructed in this step realizes the accurate identification and automatic decision-making of whether the dedicated variable acquisition terminal needs to trigger the time self-correction process. First, by setting the maximum tolerable time error and combining it with the crystal oscillator frequency deviation rate, the maximum allowable timing period is calculated to ensure that the correction mechanism is triggered only when the system has actually lost the standard timing capability and enters a potential drift state, effectively preventing interference caused by frequent or excessive correction of the system.
[0078] Secondly, by judging the time difference between the current grid reference timestamp and the last time synchronization moment, a mechanism for determining whether the time has expired is established, enabling the system to promptly determine the timing failure status before the timing link is restored, providing a basis for subsequent autonomous correction. Furthermore, by obtaining the time deviation between the current local clock time and the grid reference time and comparing it with the preset drift threshold, quantitative identification of whether the local time has drifted abnormally is achieved, and the degree of RTC crystal oscillator drift can be dynamically perceived. In addition, by combining the two judgment results of whether the timing has expired and the local clock drift is abnormal, a comprehensive judgment condition is constructed, so that the self-correction process is triggered only when there is a real drift risk and the external timing is invalid, effectively avoiding misjudgment, missed judgment and over-correction problems. Ultimately, the entire time synchronization system has high robustness and intelligent triggering characteristics with controllable boundaries, perceptible drift, interruptible behavior and traceable process, further improving the self-stability, data consistency and control system security of the dedicated transformer acquisition terminal in abnormal timing scenarios. In summary, this logical judgment method introduces multi-layer variable constraints such as time window, offset, and reference fusion in the setting of correction trigger criteria, which solves the problems of difficulty in judging the correction timing and uncontrollable timing status in the existing technology, and has clear engineering adaptability and deployment effectiveness.
[0079] Furthermore, S2 monitors the operating status data in the dedicated transformer acquisition terminal in real time. After correlation analysis, it preliminarily estimates the local clock drift value of the current dedicated transformer acquisition terminal. Combined with historical data and progressive regression, it implements trend tracking and updating of the variable time series.
[0080] Specifically, the self-correction mechanism is activated to monitor the operating status data in the dedicated transformer collection terminal in real time, and the operating status data is used as candidate feature data;
[0081] Simultaneously record the actual drift value of the local clock of the dedicated transformer acquisition terminal in multiple time periods as the target dependent variable, with each time period as one sample;
[0082] Use the Pearson correlation coefficient calculation method to analyze the correlation between each feature in the candidate feature data and the actual drift value of the local clock of the dedicated transformer acquisition terminal to obtain the corresponding correlation coefficient. If the correlation coefficient does not exceed the preset correlation threshold, the corresponding feature is removed from the candidate feature data; otherwise, it is retained.
[0083] Obtain updated candidate feature data;
[0084] The updated candidate feature data is preprocessed, including noise removal, missing value filling, and data smoothing. The missing value filling methods include mean filling, median filling, interpolation filling, and regression filling. The updated candidate feature data is scaled using dimensionless processing technology so that the feature range falls between 0 and 1.
[0085] By correlating the features in the updated candidate feature data and performing weighted summation, the local clock drift value of the current dedicated transformer acquisition terminal is preliminarily evaluated.
[0086] Retrieve historical data from a historical period, extract the actual measured clock drift at different times and the preliminarily estimated local clock drift value from the historical data, and combine it with the preliminarily estimated local clock drift value at the current time to achieve trend tracking and dynamic fitting of the variable time series. Specifically, the following is performed: Where, is the time offset prediction correction value after fusion residual, is the local clock drift value preliminarily estimated at the current moment, is the historical residual feedback factor, which is used to control the degree of historical correction. The larger the value, the more sensitive the model is. N is the length of the historical window, and i is the time point number in the historical window length. is the actual clock drift measured at time ti, The local clock drift value preliminarily assessed at time ti. The historical residual feedback factor can be empirically determined in the range of 0.1 to 0.5, and is typically set in the range of 0.2 to 0.3, suitable for terminal applications that prioritize stability.
[0087] Variables refer to various dynamic parameters that affect local clock drift;
[0088] Historical data includes various parameters collected in the dedicated transformer acquisition terminal during the historical period and parameters obtained by calculation;
[0089] According to the mechanism by which the local clock time in the dedicated transformer acquisition terminal gradually returns from a deviated state to a steady state, the time offset prediction correction value after the residual fusion is updated, specifically as follows: ,in, is the local clock correction value, To suppress the over-correction factor, it is used to control over-correction, and the value range is between 0.01 and 0.1. is the cumulative running time since the last successful timing. is the drift expansion adjustment factor, which is used to introduce the second-order compensation of the frequency trend. is the frequency deviation of the crystal oscillator, and e is the natural base.
[0090] The drift expansion adjustment factor uses the least squares regression principle to model the relationship between frequency change and time offset, and automatically derives the optimal value of the drift expansion adjustment factor, so that the model has the ability to adapt to frequency trends. Specifically: ,in, is the crystal oscillator frequency deviation sequence (the change of the crystal frequency measured in each time period relative to the nominal value), is the actual drift value of the local clock measured in the corresponding time period, for and The covariance of reflects the consistency and linkage of the change directions of the two. for The variance of the frequency deviation of the crystal oscillator indicates the fluctuation range of the crystal oscillator frequency offset. This formula is essentially the calculation method of the slope term in linear regression, that is, observing the frequency changes in multiple time periods. Clock drift the extent of the impact; The larger the value, the more directly the frequency offset affects the clock drift, and the more the model relies on the frequency trend for second-order compensation.
[0091] This part is the attenuation control item of the main correction amount. It is the deviation that should be corrected in this round estimated by the model. However, since excessive correction will cause system time jump, the system needs gradual convergence rather than instantaneous adjustment, so it is not possible to directly correct all of it at this time. ; Among them, the attenuation factor is introduced Indicates that with As the value increases, the exponential term gradually decreases, indicating that the longer the operation lasts, the less likely one is to make too many adjustments at once. The closer to the next expected timing point, the more likely one is to prioritize stability. Used to control the attenuation speed. The larger the value, the more conservative the correction, and vice versa.
[0092] This part is the nonlinear compensation of the trend term. Indicates the frequency deviation of the crystal oscillator, which is used to indicate whether the terminal's internal oscillator is too fast or too slow. Generally, the greater the deviation, the more serious the future drift trend will be. Therefore, it is necessary to pre-offset the trend error that may increase rapidly in the future. It is used when the frequency error is small, the compensation is small, and when the frequency error becomes larger, the compensation value increases exponentially, and early intervention is carried out;
[0093] In this embodiment, by introducing a variable timing modeling method with clock drift prediction as the core, in a scenario where an external timing interruption occurs in the dedicated transformer acquisition terminal and the timing failure state cannot be restored immediately, it is possible to rely on the operating status data and historical drift records in the terminal to achieve accurate estimation and trend update of the local clock state. Specifically, first, by real-time collection of terminal operating status parameters, such as crystal oscillator temperature, voltage, current, ambient humidity, etc., and using them as candidate feature data, a variable data set affecting the local clock offset is constructed; then, the Pearson correlation coefficient is used to quantitatively analyze the statistical correlation strength between the candidate features and the actual clock drift values recorded in multiple time periods, effectively filtering out irrelevant or noise features, so that subsequent model training focuses on high-correlation input variables, thereby improving the model prediction efficiency and stability.
[0094] During the feature data processing phase, the system performs preprocessing operations on the data, including missing value filling, denoising, and normalization and scaling. Interpolation or regression methods are used to improve the accuracy of missing sample completion, and dimensionless processing is used to compress each feature data to a uniform scale, helping to avoid weighted offsets caused by inconsistent feature dimensions. After feature processing is completed, the local clock drift assessment value at the current moment is preliminarily calculated by weighted summation of the retained features. This value reflects the deviation trend of the local clock in the current state of the terminal compared to the standard time. At the same time, the system retrieves data from the historical sliding window and performs residual feedback dynamic regression updates. That is, the difference between the actual drift and the predicted drift is used as a correction factor to dynamically update the offset trend forecast for the next moment, giving the system the ability to adaptively fit and correct trends.
[0095] Furthermore, based on the physical behavior mechanism of the terminal's local clock gradually approaching stability from a deviated state, an exponential decay correction function is introduced. The first term reflects the natural decay of the correction amplitude over time, and the second term is expanded to compensate according to the crystal oscillator frequency deviation. This strategy effectively suppresses the time rollback phenomenon caused by misjudgment or short-term interference, and ensures the continuity and directionality of the correction.
[0096] Candidate feature data are variables from terminal state parameters that may affect clock drift, which serve as modeling inputs to guide drift assessment;
[0097] The Pearson correlation coefficient is used to determine the statistical strength between the feature and the target, and to filter out low-correlation features;
[0098] Weighted summation assigns different weights to the eigenvalues and synthesizes the evaluation value to achieve quantitative prediction of the drift degree;
[0099] Variable time series is a set of multidimensional parameters that changes dynamically over time, reflecting the time-varying characteristics of the system and is used for trend modeling;
[0100] Attenuation adjustment is to reduce the correction strength exponentially to avoid short-term large corrections causing time jumps or dial-backs;
[0101] In summary, this step introduces variable feature drive, sliding residual regression and exponential control correction mechanism, so that the dedicated transformer acquisition terminal has the ability to self-perceive, self-model and self-regulate the local time drift trend in the non-timing state. It not only improves the system prediction accuracy and response timeliness, but also enhances the autonomous robustness, anti-interference and intelligent controllability of the terminal timing behavior in a complex power grid environment, laying a stable foundation for subsequent precise calibration.
[0102] Furthermore, S3: determining the remaining drift residual, and performing a dynamic self-correction operation on the time synchronization drift of the dedicated transformer acquisition terminal.
[0103] Specifically, the grid error is integrated with the local clock correction value obtained from the self-correction mechanism to compensate the local clock correction value, thereby obtaining the local clock correction compensation value, specifically: ,in, Correction compensation value for the local clock, is the weight value, is the local time counting error. The grid error here refers to the analysis and calculation of the local time counting error;
[0104] The remaining drift residual is determined based on the predicted time offset correction value and the local clock correction value after the residual fusion, specifically: , is the remaining drift residual;
[0105] The residual drift residual reflects the uncorrected difference between the predicted value and the actual correction amount. The residual drift residual exists to avoid over-correction that may cause system time jumps or dial-backs. It is usually corrected conservatively, but its value is used to measure the confidence of the prediction.
[0106] Based on the remaining drift residual value, the weight value is dynamically adjusted, specifically:
[0107] ,in, is the dynamic weight value, 、 are the lower and upper limits of the fusion factor, 、 are the lower and upper thresholds of the prediction error, respectively. The English semantics of is otherwise, which means that the default rule will be executed if the first two conditions are not met. It is to map the residual Rs to the interval from 0 to 1; Indicates the adjustable range of weight changes between the worst and best prediction situations; This means that if the model is very accurate (small residual), then η tends to , if the model is very inaccurate (large residual), then η tends to If the model is medium, then linearly from Towards Smooth transitions;
[0108] Substitute the dynamic weight value into the local clock correction compensation value acquisition formula to perform self-correction operations on the time synchronization drift of the dedicated transformer acquisition terminal.
[0109] If the residual drift is large, it means that the model prediction is inaccurate and the ability to predict the current terminal clock drift is poor. At this time, the influence of the grid frequency reference should be increased and the frequency should be increased. If the residual is small, it means the model is effective and the dependence on the grid signal should be reduced. , to prevent the system from being misled.
[0110] In this embodiment, the dynamic fusion self-correction mechanism driven by residual perception in this step can realize confidence-based error compensation and progressive correction of the local time drift of the dedicated acquisition terminal during the time failure period, thereby improving the intelligence level and stability of time synchronization. Specifically: the system first calculates the difference between the time offset prediction correction value after fusion residual and the current calculated local clock correction value to obtain the remaining drift residual Rs. This residual reflects the offset that is still not covered or absorbed between the current prediction model output and the actual correction behavior. The smaller the value, the higher the prediction credibility; the larger the value, the more it indicates that the current model deviates from the real trend and the trust level should be reduced. The system sets the upper and lower threshold intervals ( and ), adaptively calculating the weights for this round of corrections. When Rs is small (accurate prediction), the grid time weight is reduced; when Rs is large (inaccurate prediction), the grid correction weight is increased. Linear interpolation is used for smooth transitions in the intermediate interval to avoid system time jumps caused by sudden weight changes. Dynamic weights are used to control the balance between the model prediction and the grid reference in the correction process. The model prediction correction value in this round of corrections is combined with the local time count error calculated based on the grid zero-crossing count error to obtain the final compensated correction value. This approach leverages the long-term stability of the grid to correct deviations when the model prediction is distorted, while mitigating grid reference interference when the model prediction is accurate, achieving true trust-driven self-correction. The ultimate goal is that even in the event of external timing failure, GPS unreachability, or loss of connection to the master station, the terminal can rely on internal offset predictions and terminal statistics of sampling point changes per unit time (based on the long-term stability of the grid frequency) to autonomously adjust the local clock, keeping the terminal time within an acceptable error range and ensuring the reliability of timestamp data.
[0111] Assume that a dedicated transformer acquisition terminal has not received time synchronization for 5 days: the model predicts that the current local drift is +3.2 seconds; the actual correction mechanism calculates that it should be corrected to +2.9 seconds; then Rs=3.2−2.9=0.3 seconds, which is in the medium error range; the system then calculates η≈0.6, and decides to include the grid reference value; if the current grid zero crossing error = +0.5 seconds, final correction value: =(2.9+0.6×0.5) 1.6=2 seconds, realizing integrated compensation for the difference between grid stability and model prediction.
[0112] In summary, the dynamic residual feedback mechanism enables the system to quantify the degree of prediction deviation in real time, the weight self-adjustment mechanism can dynamically balance the dominance between the two types of time sources (prediction model and grid signal), and the final compensation correction scheme ensures that the correction behavior will not get out of control due to short-term model errors, nor will it excessively intervene in the system due to grid anomalies. The entire process is run independently locally by the acquisition terminal, and a certain degree of time offset recovery can be performed without relying on the master station or GPS timing.
[0113] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A time synchronization drift self-correction method for a dedicated transformer acquisition terminal, characterized by: The following steps are included: S1: Based on the dedicated transformer acquisition terminal, condition information is obtained. Based on the size relationship between the parameters in the condition information, judgment conditions are generated to identify the triggering of the self-correction mechanism. S2: Real-time monitoring of the operating status data within the dedicated transformer acquisition terminal. After correlation analysis, a preliminary assessment of the local clock drift value of the current dedicated transformer acquisition terminal is made. Combined with historical data and progressive regression, this method enables trend tracking and updating of variable time series. S3: Determine the remaining drift residual and perform dynamic self-correction on the time synchronization drift of the dedicated transformer acquisition terminal; Determine the last successful timing moment in the dedicated transformer acquisition terminal based on the valid timing packet and timing status received by the dedicated transformer acquisition terminal, where the timing status includes timing failure and timing success; By extracting and counting the instantaneous points where the AC signal waveform of the power grid crosses 0 volts, the number of zero crossings of the power grid from the last successful timing to the current time is counted, and the number of zero crossings of the power grid is obtained; Access the real-time clock module inside the dedicated transformer acquisition terminal to obtain the local clock time of the dedicated transformer acquisition terminal; The current reference time can be inferred from the zero crossing point of the power grid to obtain supplementary information, including: According to the number of zero crossing points of the power grid counted, the equivalent power grid operation time is obtained; Determine the equivalent grid timestamp by combining the equivalent grid operation time with the last successful timing. The equivalent grid timestamp is used as supplementary information, and combined with the last successful time synchronization time, the local clock time of the dedicated transformer acquisition terminal, and the number of grid zero crossings counted, to generate conditional information; Based on the size relationship between the parameters in the condition information, a judgment condition is generated to identify the triggering of the self-correction mechanism; Based on the size relationship between the parameters in the condition information, a judgment condition is generated to identify the triggering of the self-correction mechanism, including: Determine the maximum allowable timing cycle based on the preset maximum tolerable time error; Estimate whether the time granted has expired, specifically: , the estimated time has expired, among which, To allow the maximum timing period, is the equivalent grid timestamp, The time of last successful time granting; Is the local clock time drifting abnormally? , indicating that the local clock time has drift anomaly, where The local clock time of the dedicated acquisition terminal. is the preset drift threshold; Estimate whether the time grant has expired and whether the local clock time has drifted abnormally to obtain the judgment condition; like ,and , it indicates that the timing status of this round is timing failure, and the self-correction mechanism is automatically triggered.
2. The time synchronization drift self-correction method for a dedicated transformer acquisition terminal according to claim 1, characterized in that: Start the self-correction mechanism to monitor the operating status data in the dedicated transformer collection terminal in real time and use the operating status data as candidate feature data; Simultaneously record the actual drift value of the local clock of the dedicated transformer acquisition terminal in multiple time periods as the target dependent variable, with each time period as one sample; Use the Pearson correlation coefficient calculation method to analyze the correlation between each feature in the candidate feature data and the actual drift value of the local clock of the dedicated transformer acquisition terminal to obtain the corresponding correlation coefficient. If the correlation coefficient does not exceed the preset correlation threshold, the corresponding feature is removed from the candidate feature data; otherwise, it is retained. Obtain updated candidate feature data; The updated candidate feature data is preprocessed, including noise removal, missing value filling, and data smoothing. The updated candidate feature data is scaled using dimensionless processing technology so that the feature range falls between 0 and 1. By correlating the features in the updated candidate feature data and performing weighted summation, the local clock drift value of the current dedicated transformer acquisition terminal is preliminarily evaluated.
3. The time synchronization drift self-correction method for a dedicated transformer acquisition terminal according to claim 2, characterized in that: Retrieve historical data from a historical period, extract the actual measured clock drift at different times and the preliminarily estimated local clock drift value from the historical data, and combine it with the preliminarily estimated local clock drift value at the current time to achieve trend tracking and dynamic fitting of the variable time series. Specifically, the following is performed: Where, is the time offset prediction correction value after fusion residual, is the local clock drift value preliminarily estimated at the current moment, is the historical residual feedback factor, N is the historical window length, i is the time point number in the historical window length, is the actual clock drift measured at time ti, is the local clock drift value initially evaluated at time ti.
4. The time synchronization drift self-correction method for a dedicated transformer acquisition terminal according to claim 3, characterized in that: According to the mechanism by which the local clock time in the dedicated transformer acquisition terminal gradually returns from a deviated state to a steady state, the time offset prediction correction value after the residual fusion is updated, specifically as follows: ,in, is the local clock correction value, To suppress the over-correction factor, is the cumulative running time since the last successful timing. is the drift expansion adjustment factor, is the frequency deviation of the crystal oscillator, and e is the natural base.
5. The time synchronization drift self-correction method for a dedicated transformer acquisition terminal according to claim 4, characterized in that: The grid error is combined with the local clock correction value obtained from the self-correction mechanism to compensate the local clock correction value to obtain the local clock correction compensation value, specifically: ,in, Correction compensation value for the local clock, is the weight value, Counts the error in local time.
6. The time synchronization drift self-correction method for a dedicated transformer acquisition terminal according to claim 5, characterized in that: The remaining drift residual is determined based on the predicted time offset correction value and the local clock correction value after the residual fusion, specifically: , is the residual drift residual; the residual drift residual reflects the uncorrected difference between the predicted value and the actual correction amount, and is used to measure the prediction confidence; Based on the remaining drift residual value, the weight value is dynamically adjusted, specifically: ,in, is the dynamic weight value, 、 are the lower and upper limits of the fusion factor, 、 are the lower and upper thresholds of the prediction error, respectively. The English semantics is otherwise.
7. The time synchronization drift self-correction method for a dedicated transformer acquisition terminal according to claim 6, characterized in that: Substitute the dynamic weight value into the local clock correction compensation value acquisition formula to perform self-correction operations on the time synchronization drift of the dedicated transformer acquisition terminal.
Citation Information
Patent Citations
Frequency switching method and device for embedded power terminal
CN119788477A