A power distribution terminal time synchronization method and system based on clock drift prediction compensation
By receiving clock push information, obtaining abnormal timestamps and historical sequences in the power distribution terminal, calculating the deviation and making predictions based on network characteristics, the problem of traditional power distribution terminal time synchronization relying on external communication links is solved, achieving high-precision and reliable time synchronization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
- Filing Date
- 2025-11-24
- Publication Date
- 2026-06-16
AI Technical Summary
Traditional time synchronization methods for distribution terminals rely excessively on external communication links, which can easily lead to synchronization interruptions or decreased accuracy during network failures or congestion, failing to meet the high reliability requirements of smart distribution networks.
The system receives clock push information through a preset clock synchronization method, obtains abnormal timestamps and historical clock sequences, calculates clock deviation and fit, predicts clock deviation by combining network features, analyzes confidence using a machine learning model, and achieves clock synchronization through multi-model prediction sequence fusion.
High-precision time synchronization was achieved under abnormal network scenarios, avoiding the decrease in time synchronization accuracy caused by base station loss of lock or network jitter, thus improving the reliability and robustness of the smart distribution network.
Smart Images

Figure CN121193363B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power distribution time synchronization, and in particular to a method and system for power distribution terminal time synchronization based on clock drift prediction compensation. Background Technology
[0002] As smart distribution networks increasingly demand higher reliability in remote monitoring and control, precise time synchronization of distribution terminals has become a key foundation for ensuring equipment collaboration and effective data utilization.
[0003] Currently, traditional time synchronization methods for distribution terminals rely excessively on external communication links. When abnormal situations such as network failures or congestion occur, synchronization interruptions or accuracy degradation are likely to occur. This not only makes it difficult to guarantee the time consistency of terminal data, but also fails to meet the technical requirements for high-reliability operation of smart distribution networks. Summary of the Invention
[0004] This application provides a method and system for time synchronization of distribution terminals based on clock drift prediction compensation, which improves the current situation where traditional distribution terminal time synchronization relies too much on external communication links, and is prone to a decrease in synchronization accuracy when the network fails or is congested, thus failing to meet the high reliability remote monitoring and control requirements of smart distribution networks.
[0005] The embodiments of this application disclose the following technical solutions:
[0006] In a first aspect, embodiments of this application provide a time synchronization method for power distribution terminals based on clock drift prediction compensation, the method comprising:
[0007] The power distribution terminal clock is synchronized by receiving clock push information through a preset clock synchronization method. When a preset abnormal event occurs in the clock push information, the abnormal timestamp is obtained, and the clock push information sequence and local clock sequence are retrieved.
[0008] Based on the clock push information sequence and the local clock sequence, the first clock deviation is calculated and processed to obtain the clock deviation adaptation degree;
[0009] The network characteristics of the power distribution terminal are obtained, clock deviation is predicted, the predicted device clock deviation is obtained, and the clock deviation confidence level is analyzed.
[0010] Based on the clock deviation adaptation and clock deviation confidence, a first predicted clock push information sequence is obtained based on the clock push information sequence and the local clock sequence, and a second predicted clock push information sequence is calculated. The two sequences are then fused to obtain the predicted clock push information sequence for clock synchronization.
[0011] Secondly, embodiments of this application provide a power distribution terminal time synchronization system based on clock drift prediction compensation, the system comprising:
[0012] The clock synchronization anomaly reordering module is used to receive clock push information to synchronize the clock of the power distribution terminal through a preset clock synchronization method. When a preset abnormal event occurs in the clock push information, it obtains the abnormal timestamp and retrieves the clock push information sequence and the local clock sequence.
[0013] The deviation calculation and adaptation module is used to calculate the first clock deviation based on the clock push information sequence and the local clock sequence, and process it to obtain the clock deviation adaptation degree.
[0014] The network feature deviation confidence module is used to acquire the network features of the power distribution terminal, perform clock deviation prediction, obtain the predicted device clock deviation, and analyze to obtain the clock deviation confidence level.
[0015] The predictive sequence fusion synchronization module is used to predict and obtain a first predicted clock push information sequence based on the clock deviation adaptation and clock deviation confidence, and to calculate a second predicted clock push information sequence based on the clock push information sequence and the local clock sequence, and to perform clock synchronization by fusing the predicted clock push information sequence.
[0016] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0017] This application proposes a time synchronization method and system for power distribution terminals based on clock drift prediction compensation. By implementing clock synchronization anomaly response, deviation calculation and confidence analysis, multi-model prediction sequence generation, and dual-path prediction fusion in steps, it achieves high-precision time synchronization of power distribution terminals in network anomaly scenarios. First, clock push information is received through a preset clock synchronization method. When a preset abnormal event such as wireless link loss occurs, the abnormal timestamp is obtained, and the historical clock push information sequence and the local clock sequence are retrieved. Then, based on the two types of sequences, the first clock deviation and clock deviation fit are calculated. Combined with the characteristics of the power distribution terminal network, the pre-trained clock deviation predictor is input to obtain the predicted device clock deviation and clock deviation confidence. Subsequently, based on the clock deviation fit and clock deviation confidence, the fusion deviation instability coefficient and clock deviation prediction coefficient are calculated to determine the number of active networks in the clock prediction network group. The corresponding network is randomly selected to input the two types of sequences and output multiple prediction sequences, which are then fused to obtain the first predicted clock push information sequence. At the same time, the Holt-Winters algorithm is used to calculate the clock deviation sequence and the future local clock sequence to obtain the second predicted clock push information sequence. Next, the calculation weight and prediction weight are configured according to the clock deviation fit and clock deviation confidence, and the two types of prediction sequences are fused to obtain the final predicted clock push information sequence. Finally, the predicted clock push information sequence is used for power distribution terminal clock synchronization until the preset abnormal event ends.
[0018] The technical solution of this application solves the problems of excessive reliance on external communication links, decreased synchronization accuracy during network failures or congestion, and difficulty in adapting to complex deviation scenarios by a single prediction method in traditional power distribution terminal time synchronization. It avoids the decrease in time synchronization accuracy caused by base station lockout, missing SIB9 messages, or network jitter, and improves the reliability and robustness of power distribution terminal time synchronization in smart power distribution networks. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a power distribution terminal time synchronization method based on clock drift prediction compensation provided in an embodiment of this application;
[0021] Figure 2 This is a schematic diagram of a power distribution terminal time synchronization system based on clock drift prediction compensation, provided as an embodiment of this application.
[0022] The components represented by each number in the attached diagram are explained below:
[0023] Clock synchronization anomaly reordering module 01, deviation calculation and adaptation module 02, network feature deviation confidence module 03, prediction sequence fusion synchronization module 04. Detailed Implementation
[0024] This application provides a method and system for time synchronization of distribution terminals based on clock drift prediction compensation, which solves the technical problems in the prior art where the time synchronization of distribution terminals relies too much on external communication links, is prone to synchronization interruption and accuracy degradation when the network fails or is congested, and lacks effective response to local clock deviation, thus failing to meet the technical requirements of high reliability remote monitoring and control of smart distribution networks.
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0027] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0028] Example 1, as shown in the appendix Figure 1 As shown, this application provides a time synchronization method for power distribution terminals based on clock drift prediction compensation, the method comprising the following steps:
[0029] S110: The power distribution terminal clock is synchronized by receiving clock push information through a preset clock synchronization method. When a preset abnormal event occurs in the clock push information, the abnormal timestamp is obtained, and the clock push information sequence and local clock sequence are retrieved.
[0030] In this embodiment of the application, in order to achieve clock synchronization of the power distribution terminal under normal conditions and to quickly obtain historical data to support subsequent deviation compensation when synchronization is abnormal, it is necessary to first receive clock push information through a preset method to complete synchronization, and then capture key time nodes and retrieve historical sequences when an anomaly occurs, so as to lay the foundation for clock drift prediction and compensation.
[0031] Specifically, the preset clock synchronization method of the power distribution terminal is first determined, which can be either satellite synchronization or ground PTP synchronization. The clock push information is continuously received through the above method, and the local clock of the power distribution terminal is synchronized in real time according to the received information to ensure that the terminal clock is consistent with the standard time under normal conditions.
[0032] Furthermore, the transmission status of clock push information is monitored in real time. When a preset abnormal event is detected, the specific time of the abnormal event is recorded immediately, and the abnormal timestamp is obtained to identify the key node of the synchronization interruption.
[0033] Meanwhile, based on the acquired abnormal timestamp, all clock push information and local clock data of the power distribution terminal within a preset time range before the abnormal timestamp are retrieved. This information is then organized in chronological order to form complete clock push information sequences and local clock sequences, providing continuous and complete historical data support for subsequent calculation of clock deviation and analysis of drift patterns.
[0034] Step S110 in the method provided in this application embodiment includes:
[0035] The power distribution terminal receives clock push information to synchronize its clock via a preset clock synchronization method, which includes satellite synchronization or terrestrial PTP synchronization.
[0036] When a preset abnormal event occurs in the clock push information, obtain the abnormal timestamp, where the preset abnormal event includes wireless link loss;
[0037] Retrieve clock push information and local clock within a preset time range prior to the abnormal timestamp to obtain clock push information sequence and local clock sequence.
[0038] In this embodiment of the application, in order to ensure that the power distribution terminal maintains a stable time reference in the smart power distribution network operation scenario, a complete clock synchronization control step of regular synchronization, abnormal response, and data backtracking is required to achieve the continuity of time synchronization and the accuracy of subsequent deviation compensation.
[0039] Specifically, the power distribution terminal first receives clock push information through a preset clock synchronization method to complete the basic synchronization of the local clock. The preset clock synchronization method is set to two modes: satellite synchronization and ground PTP synchronization, which form a mutual backup mechanism to ensure the reliability of the clock source.
[0040] Specifically, in scenarios with good satellite signal coverage and no obstructions or interference, the power distribution terminal prioritizes obtaining a high-precision reference time through satellite synchronization methods such as BeiDou. This method does not rely on terrestrial communication links and is suitable for outdoor distributed power distribution terminals. However, in urban central power distribution network scenarios where satellite signals are easily obstructed by buildings or subject to electromagnetic interference, or when satellite signals are temporarily lost, the power distribution terminal automatically switches to terrestrial PTP synchronization mode, obtaining the reference time through a dedicated power PTP synchronization network to ensure uninterrupted clock synchronization.
[0041] Meanwhile, the clock push information received by the power distribution terminal is specifically the SIB9 information block periodically broadcast by the base station. This information block encapsulates key time parameters such as Coordinated Universal Time (UTC), daylight saving time offset, and leap seconds. The terminal can extract the standard timestamp by parsing the SIB9 information and complete the calibration with the local clock.
[0042] In addition, during the process of regular clock synchronization in the power distribution terminal based on the above method, if a preset abnormal event occurs in the transmission of clock push information, the abnormal timestamp must be obtained immediately.
[0043] Among them, the main preset abnormal event is wireless link loss. This situation often occurs when the base station signal fluctuates, the equipment temporarily fails, or the electromagnetic interference increases in the area where the power distribution terminal is located. At this time, the terminal cannot receive the SIB9 information sent by the base station normally. If it does not respond in time, the local clock will gradually deviate from the reference time, affecting the accuracy of services such as power distribution network traveling wave ranging and fault recording.
[0044] Therefore, when the terminal detects that it has not received SIB9 information for a preset number of consecutive times, or that the received SIB9 information fails to be verified, it is determined that the wireless link has lost lock. The current time is recorded synchronously as an abnormal timestamp to provide a time reference for subsequent data backtracking and deviation analysis.
[0045] Furthermore, after obtaining the abnormal timestamp, the clock push information and local clock within a preset time range prior to the abnormal timestamp are retrieved to form a clock push information sequence and a local clock sequence.
[0046] The setting of the preset time range needs to be determined by combining the clock drift characteristics of the power distribution terminal and the SIB9 information broadcasting period. For example, if the period for the base station to broadcast SIB9 information is 1 second, and the drift rate of the terminal's local clock without synchronization correction is about 1 μs / minute, then the preset time range can be set to the past 30 minutes. This duration can cover a sufficient number of SIB9 information samples to ensure the statistical validity of subsequent deviation calculations.
[0047] During the retrieval process, the clock push information sequence must completely include the timestamp data of all SIB9 information successfully received and verified by the terminal within the preset time range, while the local clock sequence records the actual display time of the terminal's local clock at the moment of receiving each SIB9 information. The two must correspond one-to-one in chronological order.
[0048] S120: Calculate the first clock deviation based on the clock push information sequence and the local clock sequence, and process it to obtain the clock deviation adaptation degree;
[0049] In this embodiment of the application, in order to clarify the basic deviation level between the local clock and the reference time, it is necessary to first calculate the core deviation index and analyze the deviation stability from the historical clock push information sequence and the local clock sequence, so as to provide reliable data support for subsequent accurate prediction of clock deviation and to ensure time synchronization accuracy.
[0050] Specifically, firstly, based on the acquired clock push information sequence and local clock sequence, the difference is calculated for the data at corresponding times in the two sequences one by one to obtain the deviation value between the local clock and the reference time in the clock push information at each time. These deviation values are then arranged in chronological order to form a complete clock deviation sequence.
[0051] After obtaining the clock deviation sequence, the arithmetic mean of all deviation values in the sequence is calculated, and the result is the first clock deviation. This first clock deviation can reflect the overall offset level between the local clock of the power distribution terminal and the reference time before the wireless link is lost, and is a reference for analyzing the trend of deviation changes.
[0052] Furthermore, based on the calculated first clock offset, clock offset fit is processed in conjunction with the complete clock offset sequence. During this process, the similarity between each offset value in the clock offset sequence and the first clock offset is calculated one by one. Then, all similarity results are averaged, and the final average value is the clock offset fit.
[0053] This step, by calculating the first clock deviation and the clock deviation fit, not only clarifies the basic offset of the local clock, but also distinguishes the main sources of deviation, laying the foundation for subsequent selection of a suitable deviation prediction model and improvement of prediction accuracy.
[0054] Step S120 in the method provided in this application embodiment includes:
[0055] Calculate the clock deviation between the clock push information sequence and the local clock sequence to obtain the clock deviation sequence;
[0056] Calculate the mean of the clock deviation sequence to obtain the first clock deviation;
[0057] Based on the first clock deviation and the clock deviation sequence, a clock deviation fit is obtained.
[0058] In this embodiment of the application, in order to accurately analyze the deviation between the local clock and the reference time when the power distribution terminal encounters a wireless link loss and is unable to receive new clock push information, it is necessary to calculate the deviation-related indicators step by step from the historical clock push information sequence and the local clock sequence and analyze the deviation stability to ensure the accuracy of subsequent clock drift prediction and compensation.
[0059] Specifically, the clock deviation between the clock push information sequence and the local clock sequence is first calculated to form a clock deviation sequence.
[0060] The clock push information sequence is a set of standard timestamps extracted from the SIB9 information received by the terminal within a preset time range before the wireless link is lost. The local clock sequence is a set of display times of the terminal's local clock at the corresponding time point. The two need to be calculated to correspond one-to-one in chronological order. That is, the clock deviation at each time point = the standard timestamp in the SIB9 information at that time point - the local clock display time at the corresponding time point. By arranging all the calculated deviation values in chronological order, a complete clock deviation sequence can be obtained. This clock deviation sequence completely records the changes in the deviation between the local clock and the reference time before the wireless link is lost.
[0061] After obtaining the clock skew sequence, the mean of the sequence is further calculated to obtain the first clock skew. In the calculation process, all skew values in the clock skew sequence need to be summed, and then the sum is divided by the number of skew values. The result is the first clock skew.
[0062] The first clock deviation reflects the overall offset level between the local clock and the reference time before the wireless link is lost. For example, if the clock deviation sequence contains 10 deviation values, namely 1μs, 2μs, 1μs, 2μs, 1μs, 2μs, 1μs, 2μs, 1μs, 2μs, 1μs, 2μs, and 2μs, the sum of which is 15μs and the average value is 1.5μs, then this 1.5μs is the first clock deviation, which can be used as the basic reference benchmark for subsequent analysis of deviation stability.
[0063] Furthermore, after obtaining the first clock deviation, the clock deviation fit is obtained by combining clock deviation sequence processing to clarify the overall stability of the clock deviation sequence.
[0064] The method provided in this application embodiment, based on the first clock offset and in conjunction with the clock offset sequence, processes to obtain a clock offset fit, including:
[0065] Calculate the similarity between each clock deviation in the clock deviation sequence and the first clock deviation to obtain a clock deviation similarity set;
[0066] Calculate the mean of the clock deviation similarity set to obtain the clock deviation fit.
[0067] Specifically, after determining that the first clock deviation is the mean of the clock deviation sequence, it is first necessary to calculate the similarity between each clock deviation in the clock deviation sequence and the first clock deviation. This is because each clock deviation corresponds to the instantaneous difference between the local clock of the distribution terminal and the reference clock at a certain moment, and the similarity between a single clock deviation and the first clock deviation is used to reflect whether the instantaneous deviation conforms to the overall deviation pattern.
[0068] For example, if a power distribution terminal has a clock deviation sequence calculated from the clock push information sequence and the local clock sequence of [0.7μs, 0.8μs, 0.9μs, 1.0μs, 1.1μs] during a stable communication period, the first clock deviation (average) can be calculated to be 0.9μs.
[0069] At this point, the similarity is calculated using the formula "1 - |single deviation - first clock deviation| / first clock deviation". The similarity values for each deviation are 0.92, 0.91, 1.0, 0.99, and 0.98, respectively. After organizing these values, the clock deviation similarity set is obtained as [0.92, 0.91, 1.0, 0.99, 0.98].
[0070] Furthermore, after obtaining the clock skew similarity set, it is necessary to calculate the mean of the set to obtain the clock skew fit. Since a single value in the similarity set can only reflect the stability of the corresponding instantaneous skew, while the mean can comprehensively reflect the overall stability of the entire clock skew sequence, this avoids individual extreme skew values interfering with the stability judgment.
[0071] For example, for the above similarity set [0.92, 0.91, 1.0, 0.99, 0.98], its mean is calculated to be (0.92+0.91+1.0+0.99+0.98) / 5=0.96, that is, the clock skew fit is 0.96.
[0072] The greater the clock deviation adaptability, the stronger the consistency between the instantaneous deviations within the clock deviation sequence and the overall deviation trend, and the more stable the deviation. Therefore, it can be judged that the clock deviation within this time period is more likely to be a deviation of the physical law of the atomic clock in the power distribution terminal.
[0073] Conversely, if a momentary deviation suddenly changes to 4.5μs due to a brief loss of wireless link lock, the corresponding similarity drops significantly, causing the average value of the similarity set (clock deviation fit) to drop to 0.55. This indicates that the clock deviation stability is poor at this time, and it is more likely caused by communication anomalies. When performing clock drift prediction compensation in the future, it is necessary to focus on eliminating such abnormal deviations to ensure that the compensation only applies to deviations in the physical laws of atomic clocks, thereby maintaining the microsecond-level time synchronization accuracy of the power distribution terminal.
[0074] S130: Obtain the network characteristics of the power distribution terminal, perform clock deviation prediction, obtain the predicted device clock deviation, and analyze to obtain the clock deviation confidence level.
[0075] In this embodiment of the application, in order to accurately distinguish whether the cause of the clock deviation is a network problem or a deviation of the physical law of the terminal atomic clock itself, it is necessary to predict the deviation caused by the network problem through network characteristics, and calculate the confidence level in combination with the actual deviation, so as to clarify the main source of the current deviation and provide a basis for subsequent adjustment of the local clock.
[0076] Specifically, the network characteristics of the power distribution terminal are first obtained and then input into the clock deviation predictor to obtain the predicted device clock deviation.
[0077] The clock skew predictor is built on machine learning. During its construction, it uses sample network features of power distribution terminals and corresponding sample device clock skew for supervised training to ensure that the predictor can effectively capture the correlation between network features and clock skew caused by network problems.
[0078] Furthermore, to obtain the actual device clock skew, the most frequently occurring clock skew needs to be selected from the clock skew sequence and used as the mode clock skew. Then, the stable clock skew under the preset clock synchronization method within the historical events is obtained. Subtracting the stable clock skew from the mode clock skew yields the actual device clock skew caused by the current network problem.
[0079] Finally, the similarity between the predicted device clock skew and the actual device clock skew is calculated, and this similarity is used as the confidence level of the clock skew.
[0080] The confidence level of clock skew directly reflects the likelihood that the current skew is caused by a network problem. The higher the confidence level of clock skew, the more closely the predicted network problem skew matches the actual network problem skew, and the more likely the current clock skew is caused by a device network problem; conversely, it is more likely to originate from a deviation in the physical laws of the atomic clock.
[0081] This step calculates confidence by comparing the predicted and actual deviations, providing a clear basis for subsequent judgments on whether to adjust the clock compensation strategy for network problems, and ensuring that clock synchronization adjustments are more targeted.
[0082] Step S130 in the method provided in this application embodiment includes:
[0083] The network characteristics of the power distribution terminal are obtained and input into a clock deviation predictor. The predicted output is used to obtain the predicted device clock deviation. The clock deviation predictor is built based on machine learning and is trained using sample network characteristics of the power distribution terminal and sample device clock deviation.
[0084] The clock deviation that appears most frequently in the clock deviation sequence is taken as the mode clock deviation.
[0085] Obtain the stable clock deviation within the preset clock synchronization method in historical events;
[0086] The actual device clock deviation is obtained by subtracting the stable clock deviation from the mode clock deviation.
[0087] Calculate the similarity between the predicted device clock deviation and the actual device clock deviation to obtain the clock deviation confidence level.
[0088] In this embodiment of the application, in order to avoid confusion of deviation types during subsequent clock drift prediction and compensation, which would cause the compensation strategy to fail, it is necessary to predict the deviation caused by network problems through network characteristics and calculate the confidence level in combination with the actual deviation, so as to clarify the dominant factor of the current deviation and ensure the pertinence and accuracy of clock synchronization adjustment.
[0089] Specifically, the network characteristics of the power distribution terminal are first obtained. These network characteristics may include parameters related to network transmission status, such as wireless link signal strength, network latency jitter, and packet retransmission rate. These parameters are then input into a clock skew predictor to output the predicted device clock skew.
[0090] In the method provided in this application embodiment, the step of obtaining the clock skew predictor includes:
[0091] Based on the clock synchronization records of the power distribution terminal over a historical period, a sample network feature set and a sample device clock deviation set are collected.
[0092] A clock skew predictor is built based on machine learning.
[0093] The clock skew predictor is trained in a supervised manner using the sample network feature set and the sample device clock skew set, and the acquisition is completed after convergence.
[0094] Specifically, firstly, based on the clock synchronization records of the power distribution terminal over a historical period, a sample network feature set and a sample device clock deviation set are collected.
[0095] During the sample collection process, it is necessary to cover a variety of network scenarios that the power distribution terminal may encounter in order to ensure the comprehensiveness and representativeness of the sample data. These network scenarios include both normal scenarios with stable wireless link signals and no congestion, and abnormal scenarios with weak signals, large latency jitter, and frequent data packet retransmissions.
[0096] In addition, the corresponding sample network characteristics may include parameters directly related to the network transmission status, such as wireless link signal strength, network latency jitter, and packet retransmission rate. For sample device clock deviation, deviation values caused solely by network problems in historical records must be selected.
[0097] For example, when a power distribution terminal is in a network environment with a signal strength of -85dBm and a latency jitter of 30μs in a certain historical record, if the atomic clock stability deviation is 0.2μs and the actual overall deviation is 1.5μs, then the sample device clock deviation in this scenario is 1.3μs (1.5μs-0.2μs). This network feature and the corresponding deviation value are respectively included in the sample network feature set and the sample device clock deviation set.
[0098] At the same time, the time span of sample collection needs to be long enough, such as covering clock synchronization records of the past 6-12 months, to include network status changes in different seasons and time periods, so as to avoid insufficient generalization ability of the predictor due to time limitations of sample data.
[0099] Furthermore, a network architecture for a clock skew predictor is constructed based on machine learning. Considering the mapping relationship between distribution terminal network characteristics and clock skew, a regression-based machine learning model, such as Gradient Boosting Tree (XGBoost) or Multilayer Perceptron (MLP), is selected as the basic architecture.
[0100] Among them, gradient boosting trees can effectively handle nonlinear feature associations and adapt to the complex relationship between network features and clock deviations; multilayer perceptrons can improve prediction accuracy by capturing deep interactions between features through hidden layers.
[0101] During the architecture setup process, model parameters need to be set reasonably according to the scale and feature dimensions of the sample data. If the sample network feature set contains 5-8 feature dimensions and the number of samples is 10,000-30,000, when choosing the gradient boosting tree architecture, the number of decision trees can be set to 100-200 and the tree depth to 5-8 layers to balance model complexity and training efficiency.
[0102] Furthermore, if the sample feature dimension exceeds 10 and the number of samples exceeds 50,000, when choosing the multilayer perceptron architecture, three hidden layers can be constructed (128 neurons in the first layer, 64 neurons in the second layer, and 32 neurons in the third layer). The input layer dimension is consistent with the sample feature dimension, and the output layer is one neuron (corresponding to the clock deviation prediction value). At the same time, the ReLU activation function is used to enhance the model's nonlinear fitting ability.
[0103] Furthermore, the constructed clock skew predictor is trained in a supervised manner using a sample network feature set and a sample device clock skew set. Before training, the sample data needs to be divided into a training set, a validation set, and a test set in a 7:2:1 ratio. The training set is used for iterative updates of the model parameters, the validation set is used to monitor the model performance during training to avoid overfitting, and the test set is used to finally evaluate the model's generalization ability.
[0104] During training, the network features of the training set samples are input into the clock skew predictor, which outputs the predicted clock skew value. The predicted value is then compared with the actual clock skew of the corresponding sample devices in the training set. The prediction error is quantified by calculating the mean squared error (MSE). The model parameters are continuously adjusted based on the gradient descent algorithm to gradually reduce the prediction error.
[0105] Meanwhile, after every 20 rounds of training, the model performance is tested using validation set data: if the mean squared error of the validation set no longer decreases or shows an upward trend for three consecutive rounds, it indicates that the model has reached convergence and training should be stopped; if the validation set error continues to rise, the training parameters should be adjusted in time, such as reducing the learning rate from 0.01 to 0.001 or adding a regularization term to suppress overfitting.
[0106] After training convergence, the clock skew predictor needs to be finalized using test set data to ensure stable generalization ability. For example, if the mean squared error on the test set differs from the error on the validation set by less than 0.005 μs... 2 If the similarity between the predicted deviation value and the actual value for different network scenarios exceeds 90%, it indicates that the predictor can accurately predict the clock deviation caused by network problems, thus completing the acquisition of the clock deviation predictor.
[0107] After obtaining the clock skew predictor, the clock skew of the predicted device and the confidence level of the calculated clock skew are further obtained. Specifically, the network characteristics of the power distribution terminal under the current operating state are first obtained. These network characteristics need to be consistent with the dimensions of the sample network characteristics when training the clock skew predictor to ensure that the clock skew predictor can accurately identify the correlation between features and skew.
[0108] For example, if the current terminal is in a network environment with a signal strength of -80dBm, a real-time network latency jitter of 25μs, and a packet retransmission rate of 1.2%, these real-time parameters are organized into a network feature vector and input into a trained clock skew predictor. The clock skew predictor calculates the possible device clock skew under the current network condition based on the mapping relationship between network features learned during training and network-induced skew, and finally outputs a predicted device clock skew. For example, for the network features mentioned above, the predictor outputs a predicted device clock skew of 1.1μs.
[0109] After obtaining the predicted device clock skew, it is necessary to further determine the actual device clock skew to calculate the clock skew confidence level. Specifically, firstly, from the previously retrieved clock skew sequence, the clock skew that appears most frequently is counted and taken as the mode clock skew.
[0110] Among them, the mode clock deviation can reflect the mainstream level of clock deviation in the current period and reduce the interference of individual extreme deviation values on the judgment of actual deviation. For example, if a clock deviation sequence is [1.2μs, 1.1μs, 1.2μs, 1.3μs, 1.2μs], where 1.2μs appears 3 times, it is the deviation with the most occurrences, then the mode clock deviation is 1.2μs.
[0111] Furthermore, the stable clock deviation of the preset clock synchronization method within the historical events is obtained. The stable clock deviation refers to the deviation of the power distribution terminal caused only by the physical law of atomic clocks when the network status is stable and there are no abnormalities during the same historical period and with the same preset synchronization method. The average clock deviation during normal network periods can be selected from the historical clock synchronization records as the stable clock deviation. For example, in the BeiDou synchronization history records of the past 6 months, the average clock deviation during stable network periods is selected as 0.2μs, and then 0.2μs is taken as the stable clock deviation.
[0112] Furthermore, by subtracting the stable clock deviation from the mode clock deviation, the result is the actual device clock deviation caused by network problems. This step can effectively isolate the influence of deviations in the physical laws of atomic clocks and focus on deviations caused by network factors.
[0113] For example, the actual device clock deviation is calculated to be 1.0 μs by subtracting the stable clock deviation of 0.2 μs from the above-mentioned mode clock deviation of 1.2 μs.
[0114] Finally, the similarity between the predicted device clock deviation and the actual device clock deviation is calculated. The similarity can be calculated using the formula "1 - |predicted deviation - actual deviation| / actual deviation". This calculation method quantifies the degree of agreement between the two. The closer the result is to 1, the more consistent the predicted deviation is with the actual deviation.
[0115] For example, by substituting the predicted device clock deviation of 1.1 μs and the actual device clock deviation of 1.0 μs into the formula, the similarity can be calculated as 1 - |1.1 - 1.0| / 1.0 = 0.9, that is, the confidence level of the clock deviation is 0.9.
[0116] The confidence level of clock skew directly reflects the likelihood that the current skew is caused by network problems. If the confidence level is high, it indicates that the current clock skew is more likely caused by equipment network problems, and subsequent clock drift compensation should focus on developing strategies targeting network factors. If the confidence level is low, it indicates that the predicted skew differs significantly from the actual skew, and the current skew may be affected by other non-network factors. Further investigation of the cause of the skew is needed to ensure the targeted nature of subsequent clock synchronization adjustments.
[0117] S140: Based on the clock deviation adaptation degree and clock deviation confidence degree, and based on the clock push information sequence and the local clock sequence, predict and obtain the first predicted clock push information sequence, calculate the second predicted clock push information sequence, fuse and process to obtain the predicted clock push information sequence, and perform clock synchronization.
[0118] In this embodiment of the application, in order to ensure that accurate clock push information can be output even during abnormal network conditions to maintain microsecond-level time synchronization, it is necessary to combine clock deviation adaptability and clock deviation confidence, obtain two types of prediction sequences through multi-network prediction and specific mathematical calculations, and then obtain the final prediction result through weighted fusion to ensure the reliability and accuracy of clock synchronization.
[0119] Specifically, the fusion deviation instability coefficient is first calculated based on the clock deviation fit and clock deviation confidence. The average of "1 - clock deviation fit" and clock deviation confidence is taken as the fusion deviation instability coefficient, and the obtained fusion deviation instability coefficient is directly used as the clock deviation prediction coefficient.
[0120] Further, a clock prediction network group is obtained. Based on the rounding result of the product of the clock deviation prediction coefficient and the total number of clock prediction networks, the number of clock prediction networks to be activated is determined. Then, a corresponding number of clock prediction networks are randomly selected, and the clock push information sequence and the local clock sequence are input into the activated clock prediction network group. Each network outputs a predicted clock push information sequence. These sequences are fused and calculated to obtain the first predicted clock push information sequence.
[0121] Furthermore, the Holt-Winters algorithm is employed to calculate a second predicted clock push information sequence based on the clock push information sequence and the local clock sequence. Then, based on the clock deviation fit and clock deviation confidence, corresponding calculation weights and prediction weights are calculated respectively. Finally, the two types of weights are used to fuse the second predicted clock push information sequence and the first predicted clock push information sequence to obtain the final predicted clock push information sequence.
[0122] Finally, the obtained predicted clock push information sequence is used to synchronize the clock of the power distribution terminal until the preset abnormal event ends.
[0123] This step, through a fusion of multi-network prediction and mathematical calculation, ensures the rationality of predictions based on historical patterns, provides support for clock synchronization during abnormal periods, and ensures that the smart distribution network's distribution terminals can maintain high-precision time synchronization even in complex operating environments.
[0124] Step S140 in the method provided in this application embodiment includes:
[0125] Based on the clock skew fit and clock skew confidence, the fusion skew instability coefficient is calculated and used as the clock skew prediction coefficient.
[0126] Obtain the clock prediction network group, and determine the number of activated networks based on the clock skew prediction coefficient and the total number of clock prediction networks;
[0127] Randomly select the number of clock prediction networks to activate, input the clock push information sequence and the local clock sequence, and obtain multiple predicted clock push information sequences from the prediction output;
[0128] The first predictive clock push information sequence is obtained by fusing and calculating the multiple predicted clock push information sequences.
[0129] The Holt-Winters algorithm is used to calculate the clock deviation sequence based on the clock push information sequence and the local clock sequence.
[0130] Based on the local clock sequence, the future local clock sequence is obtained, and combined with the calculated clock deviation sequence, the second predicted clock push information sequence is calculated.
[0131] Based on the clock skewness fit and clock skewness confidence, the calculation weights are calculated, and the prediction weights are calculated.
[0132] Using the calculated weights and predicted weights, the second predicted clock push information sequence and the first predicted clock push information sequence are fused to obtain a predicted clock push information sequence, and clock synchronization is performed until the preset abnormal event ends.
[0133] In this embodiment of the application, in order to maintain microsecond-level time synchronization accuracy when the power distribution terminal encounters a preset abnormal event and cannot receive clock push information normally, it is necessary to combine clock deviation adaptability and confidence, obtain the prediction sequence through a dual path of multi-model prediction and algorithm calculation, and then obtain reliable predicted clock push information through weighted fusion to ensure the robustness and accuracy of clock synchronization during abnormal periods.
[0134] Specifically, the fusion bias instability coefficient is first calculated based on the clock bias fit and clock bias confidence. The fusion bias instability coefficient is the average of "1 - clock bias fit" and clock bias confidence, and the obtained fusion bias instability coefficient is directly used as the clock bias prediction coefficient to quantify the overall instability of the current clock bias.
[0135] Among them, when the clock deviation fit is small and the clock deviation confidence is large, the fusion deviation instability coefficient and the clock deviation prediction coefficient increase, providing a basis for activating more prediction networks.
[0136] Furthermore, a clock prediction network group is obtained, and the number of activated networks is determined based on the clock deviation prediction coefficient and the total number of clock prediction networks. Multi-network prediction is used to adapt to scenarios with different deviation stability levels.
[0137] The method provided in this application embodiment involves obtaining a clock prediction network group and determining the number of activated networks based on the clock skew prediction coefficients and the total number of clock prediction networks, including:
[0138] Based on terminal clock synchronization data within a historical time period, a set of historical clock push information sequences and a set of historical local clock sequences are collected. The clock push information sequence following each historical clock push information sequence is also collected and labeled to obtain a set of predicted clock push information sequences.
[0139] The historical clock push information sequence set, the historical local clock sequence set, and the predicted clock push information sequence set are combined as a clock prediction training dataset, and then divided multiple times to obtain multiple sets of clock prediction training data.
[0140] Multiple clock prediction networks were constructed based on machine learning.
[0141] The multiple sets of clock prediction training data are used to supervise the training of multiple clock prediction networks, and a clock prediction network group is obtained after convergence.
[0142] The number of activated networks is determined by rounding down the product of the clock skew prediction coefficient and the total number of clock prediction networks.
[0143] Specifically, firstly, based on the terminal clock synchronization data within a historical time period, a set of historical clock push information sequences and a set of historical local clock sequences are collected.
[0144] The collected historical clock push information sequence set must cover clock push data received by the terminal under different network conditions, including sequences under normal and abnormal network scenarios. The historical local clock sequence set corresponds to the terminal's own clock data under the above scenarios and must correspond one-to-one with the historical clock push information sequence in the time dimension.
[0145] Simultaneously, the actual received clock push information sequence after each historical clock push information sequence is collected and used as labeled data to form a predicted clock push information sequence set. This predicted clock push information sequence set is equivalent to a real label, providing a basis for judging the prediction accuracy for subsequent network training.
[0146] Furthermore, the historical clock push information sequence set, the historical local clock sequence set, and the predicted clock push information sequence set are combined to form a complete clock prediction training dataset.
[0147] To ensure that subsequent networks can learn different data features, the clock prediction training dataset needs to be split multiple times to obtain multiple sets of clock prediction training data. During the splitting, each set of data must contain samples from different network scenarios and with varying degrees of bias to avoid a single set of data covering only a single scenario, which could lead to insufficient network generalization ability.
[0148] Furthermore, multiple clock prediction networks are constructed based on machine learning. Specifically, gradient boosting trees are selected as the basic architecture, taking into account the correlation between clock push information and local clock sequences.
[0149] Among them, gradient boosting trees can effectively fit the complex mapping relationship between network features and clock deviation through iterative integration of multiple decision trees. At the same time, they are highly robust to local fluctuations in time series data and are suitable for clock deviation fluctuations caused by unstable base station signals and interference of wireless links in power distribution networks.
[0150] During the construction process, the basic architecture of multiple clock prediction networks (all of which are gradient boosting trees) is kept consistent, but the core initial parameters need to be set differently to ensure that each network can learn the deviation patterns under different scenarios after subsequent training, and to avoid the convergence of prediction results of multiple networks.
[0151] Specifically, the number of decision trees is set to three gradients: 100, 150, and 200. The more trees there are, the stronger the model's fitting ability and the more complex the deviation changes it can adapt to. The tree depth is set to three layers: 5, 6, and 8. The greater the depth, the better it can capture the deep interactions between network features, such as the deviation patterns in scenarios with weak signals and high latency. The learning rate is set to three levels: 0.005, 0.01, and 0.02, to control the correction magnitude of each tree on the model error. A small learning rate needs to be combined with a large number of trees to ensure stable model convergence.
[0152] Furthermore, multiple clock prediction networks are trained under supervised supervision using multiple sets of clock prediction training data. Before training, each set of clock prediction training data needs to be labeled with the corresponding network scene features to ensure that the scene features of each network's training data are compatible with its own parameter configuration, enabling the network to learn the deviation patterns in the corresponding scene.
[0153] During training, the historical clock push information sequences and historical local clock sequences in each training dataset are fused to form features, and used as input to the clock prediction network. The corresponding labeled predicted clock push information sequences are used as the ground truth labels. The mean squared error between the network's predicted values and the ground truth labels is calculated to quantify the prediction error.
[0154] Secondly, based on the gradient descent optimization algorithm, the splitting threshold and weight parameters of the decision tree are adjusted in reverse according to the error magnitude after each iteration to gradually reduce the mean square error of the training set and optimize the prediction accuracy of the network.
[0155] Meanwhile, to avoid overfitting during network training, each set of clock prediction training data needs to be divided into a training set and a validation set in a 7:3 ratio. The training set is used for iterative updates of network parameters, while the validation set is used to monitor model performance during training.
[0156] During training, after every 20 iterations, the network's prediction error is tested using validation set data. If the mean squared error of the validation set no longer decreases or shows an upward trend for three consecutive iterations, it indicates that the network has reached convergence, and the training of the current network is stopped.
[0157] At this point, the network has fully learned the clock deviation prediction patterns for the scenarios covered by the corresponding training data. Once all clock prediction networks have completed training and converged, they together form a clock prediction network group, which can cover various network scenarios such as normal time synchronization, network anomalies, and precursors to base station lockout.
[0158] After the clock prediction network group is constructed, the clock skew prediction coefficients are further determined based on the previously calculated clock skew fit and clock skew confidence, so as to quantify the current skew state's demand for multi-network prediction.
[0159] Furthermore, the product of the clock skew prediction coefficient and the total number of clock prediction networks is calculated, and the result is rounded to determine the number of activated networks. When rounding, the result must be a positive integer. For example, when the clock skew prediction coefficient is 0.7 and the total number of networks is 18, the product is 12.6, and the number of activated networks after rounding is 13; when the clock skew prediction coefficient is 0.25 and the total number of networks is 20, the product is 5, and it is directly rounded to 5.
[0160] The above method allows for a precise match between the number of activated networks and the current bias characteristics. When the clock bias fit is small and the clock bias confidence is large, the clock bias prediction coefficient increases, and the number of activated networks increases, thus reducing errors through more model predictions. When the clock bias is stable and the clock bias confidence is small, the clock bias prediction coefficient decreases, and the number of activated networks decreases, thus balancing accuracy and computational efficiency, and providing a basis for selecting suitable networks from the network group for subsequent predictions.
[0161] Furthermore, from the constructed clock prediction network group, a clock prediction network with the same number of activated networks is randomly selected. This random selection avoids prediction bias caused by fixed selection of networks with certain parameter types, ensuring that the selected network can cover prediction capabilities for different scenarios.
[0162] Furthermore, the clock push information sequence of the current time period and the local clock sequence are input into the selected activation network. Each activation network will independently output the corresponding predicted clock push information sequence based on the scene deviation rules learned during its training, and finally obtain multiple differentiated predicted clock push information sequences.
[0163] Furthermore, the obtained multiple predicted clock push information sequences are fused to obtain the first predicted clock push information sequence. Specifically, during fusion, weights need to be allocated based on the training convergence performance of each activated network. For example, if the mean square error of a network on the validation set after training convergence is 0.03 μs... 2 The mean square error of the other network validation set was 0.05 μs. 2 If the former is assigned a higher weight (e.g., 0.6) and the latter a lower weight (e.g., 0.4), multiple prediction clock push information sequences are integrated by weighted averaging to reduce the impact of single network prediction errors on the results and ensure that the first prediction clock push information sequence can comprehensively reflect the prediction advantages of different network models.
[0164] Simultaneously, the Holt-Winters algorithm is employed to calculate the clock deviation sequence based on the clock push information sequence and the local clock sequence. The Holt-Winters algorithm is a time series prediction algorithm that captures the patterns of timing deviations by tracking the horizontal and slope components of the clock deviation. The horizontal component corresponds to the instantaneous offset between the SIB9 message timestamp and the terminal's local clock, while the slope component corresponds to the clock drift rate (unit: ppm).
[0165] Specifically, the difference between the clock push information of each timing node and the local clock is first calculated. For example, if the clock push information of a certain timing node is "10:00:00.000123" and the local clock is "10:00:00.000089", then the calculation deviation of this node is 0.000034 seconds (i.e. 34 microseconds). All timing nodes are traversed in the above manner to form a calculation clock deviation sequence that reflects the changes in historical deviations.
[0166] Furthermore, based on the uniform increasing characteristic of the local clock sequence, the future local clock sequence is derived and obtained, and the future local clock sequence is superimposed on the calculated clock deviation sequence, that is, the future local clock value plus the calculated deviation value at the corresponding time.
[0167] For example, if the local clock of a certain timing node is 1620000001.000000μs and the corresponding calculation deviation is 0.028μs, then the second predicted clock push information of that node is 1620000001.000028μs, and the complete second predicted clock push information sequence is obtained in this way.
[0168] Furthermore, calculation weights and prediction weights are configured according to clock deviation adaptability and clock deviation confidence, respectively, to clarify the fusion priority of the second predicted clock push information sequence and the first predicted clock push information sequence.
[0169] Specifically, the calculation weight corresponds to the reliability of the second predicted clock push information sequence. When the clock deviation adaptability is high, the calculation weight is increased accordingly. The prediction weight corresponds to the reliability of the first predicted clock push information sequence. When the clock deviation confidence is high, the prediction weight is increased accordingly. It is also necessary to ensure that the sum of the calculation weight and the prediction weight is 1 in order to achieve a reasonable fusion allocation.
[0170] Finally, by using calculated weights and predicted weights, the second prediction clock push information sequence and the first prediction clock push information sequence are fused to combine the advantages of the two prediction methods and improve the reliability in scenarios where deviations are caused by network factors.
[0171] Specifically, each time-series node value of the second prediction sequence is multiplied by a calculated weight, and the corresponding node value of the first prediction sequence is multiplied by a prediction weight. The results are then added together to obtain the final predicted clock push information sequence. This predicted clock push information sequence is used to adjust the local clock of the power distribution terminal to achieve clock synchronization.
[0172] Meanwhile, the clock synchronization process will continue until the preset abnormal event ends and normal clock push information reception resumes, so as to ensure that the power distribution terminal maintains stable time synchronization accuracy during the abnormal period, thereby ensuring the time consistency of electrical information such as line voltage and current collection, and providing a reliable time reference for key services such as traveling wave ranging and fault location.
[0173] The embodiments of this application, through the specific implementation methods described above, achieve the following technical effects:
[0174] The proposed time synchronization method for distribution terminals based on clock drift prediction compensation first uses satellite synchronization or terrestrial PTP synchronization as the preset clock synchronization mode, receiving clock push information such as SIB9 information blocks broadcast by the base station to achieve clock synchronization of the distribution terminal under normal conditions. The transmission status of clock push information is monitored in real time. If a preset abnormal event such as wireless link loss occurs, the abnormal timestamp is immediately recorded, and clock push information and local clock data within a preset range before that timestamp are retrieved and arranged in chronological order into a clock push information sequence and a local clock sequence. Next, the deviation values of corresponding time nodes of the two sequences are calculated to form a clock deviation sequence. The mean value of the clock deviation sequence is calculated to obtain the first clock deviation, and the clock deviation fit is determined by the mean similarity between each deviation value and the first clock deviation. Subsequently, the real-time network characteristics of the distribution terminal are acquired and input into a pre-trained clock deviation predictor to obtain the predicted device clock deviation. The mode clock deviation of the clock deviation sequence is extracted, and the actual device clock deviation is calculated by combining it with historical stable clock deviations. The clock deviation confidence is obtained by the similarity between the two. Next, the number of activated networks is determined based on clock skew fit and clock skew confidence. A corresponding number of clock prediction networks are randomly selected, and the two types of sequences are input and fused to obtain the first predicted clock push information sequence. Simultaneously, the Holt-Winters algorithm is used to calculate the second predicted clock push information sequence. Finally, the calculation weights and prediction weights are configured, and the two types of sequences are fused to obtain the final predicted clock push information sequence, which is used for terminal clock synchronization until the abnormal event ends.
[0175] The method provided in this application, through a technical solution of "normal synchronization - abnormal response - deviation analysis - dual-path prediction - weighted fusion", solves the problems of excessive reliance on external communication links, sharp drop in synchronization accuracy when the network is abnormal, and difficulty in adapting to complex deviation scenarios in traditional power distribution terminal time synchronization. It avoids time synchronization errors caused by network lockout and signal fluctuations, and ensures that the power distribution terminal maintains high-precision time synchronization during abnormal periods, providing a stable time reference for key scenarios such as traveling wave ranging and fault location in smart power distribution networks.
[0176] Example 2, as shown in the appendix Figure 2 As shown, based on the inventive concept of a distribution terminal time synchronization method based on clock drift prediction compensation provided in Embodiment 1, this application also provides a distribution terminal time synchronization system based on clock drift prediction compensation, specifically including:
[0177] The clock synchronization anomaly reordering module 01 is used to receive clock push information to synchronize the clock of the power distribution terminal through a preset clock synchronization method. When a preset abnormal event occurs in the clock push information, it obtains the abnormal timestamp and retrieves the clock push information sequence and the local clock sequence.
[0178] The deviation calculation and adaptation module 02 is used to calculate the first clock deviation based on the clock push information sequence and the local clock sequence, and process it to obtain the clock deviation adaptation degree.
[0179] The network feature deviation confidence module 03 is used to acquire the network features of the power distribution terminal, perform clock deviation prediction, obtain the predicted device clock deviation, and analyze to obtain the clock deviation confidence level.
[0180] The prediction sequence fusion synchronization module 04 is used to predict and obtain a first predicted clock push information sequence based on the clock deviation adaptation degree and clock deviation confidence degree, and to calculate a second predicted clock push information sequence based on the clock push information sequence and the local clock sequence, and to perform clock synchronization by fusion processing to obtain the predicted clock push information sequence.
[0181] In one embodiment, the clock synchronization anomaly reordering module 01 is further configured to:
[0182] The power distribution terminal receives clock push information to synchronize its clock via a preset clock synchronization method, which includes satellite synchronization or ground PTP synchronization. When a preset abnormal event occurs in the clock push information, an abnormal timestamp is obtained, where the preset abnormal event includes wireless link loss. The clock push information and local clock within a preset time range before the abnormal timestamp are retrieved to obtain a clock push information sequence and a local clock sequence.
[0183] In one embodiment, the deviation calculation and adaptation module 02 is further used for:
[0184] Calculate the clock deviation between the clock push information sequence and the local clock sequence to obtain a clock deviation sequence; calculate the mean of the clock deviation sequence to obtain a first clock deviation; based on the first clock deviation and the clock deviation sequence, process to obtain a clock deviation fit.
[0185] Furthermore, the deviation calculation and adaptation module 02 also includes:
[0186] Calculate the similarity between each clock deviation in the clock deviation sequence and the first clock deviation to obtain a clock deviation similarity set; calculate the mean of the clock deviation similarity set to obtain the clock deviation fit.
[0187] In one embodiment, the network feature bias confidence module 03 is further configured to:
[0188] The network characteristics of the power distribution terminal are obtained and input into a clock deviation predictor. The predicted device clock deviation is obtained by predicting the output. The clock deviation predictor is built based on machine learning and is trained using sample network characteristics and sample device clock deviations of the power distribution terminal. The most frequent clock deviation in the clock deviation sequence is obtained as the mode clock deviation. The stable clock deviation of the preset clock synchronization method in historical events is obtained. The actual device clock deviation is obtained by subtracting the stable clock deviation from the mode clock deviation. The similarity between the predicted device clock deviation and the actual device clock deviation is calculated to obtain the clock deviation confidence level.
[0189] Furthermore, the network feature bias confidence module 03 also includes:
[0190] Based on the clock synchronization records of the power distribution terminal over a historical period, a sample network feature set and a sample device clock deviation set are collected; a clock deviation predictor is constructed based on machine learning; the clock deviation predictor is trained in a supervised manner using the sample network feature set and the sample device clock deviation set, and the acquisition is completed after convergence.
[0191] In one embodiment, the prediction sequence fusion synchronization module 04 is further configured to:
[0192] Based on the clock skew fit and clock skew confidence, a fusion skew instability coefficient is calculated and used as a clock skew prediction coefficient. A clock prediction network group is obtained, and the number of active networks is determined based on the clock skew prediction coefficient and the total number of clock prediction networks. A clock prediction network of the specified number of active networks is randomly selected, and the clock push information sequence and local clock sequence are input. Multiple predicted clock push information sequences are predicted and output. Based on these multiple predicted clock push information sequences, a first predicted clock push information sequence is obtained through fusion calculation. Using the Holt-Winters algorithm, a calculated clock skew sequence is obtained based on the clock push information sequence and local clock sequence. A future local clock sequence is obtained based on the local clock sequence, and combined with the calculated clock skew sequence, a second predicted clock push information sequence is calculated. Calculation weights are obtained based on the clock skew fit and clock skew confidence, and prediction weights are also calculated. Using the calculation weights and prediction weights, the second predicted clock push information sequence and the first predicted clock push information sequence are fused to obtain a predicted clock push information sequence. Clock synchronization is then performed until a preset abnormal event ends.
[0193] Furthermore, the predictive sequence fusion synchronization module 04 also includes:
[0194] Based on terminal clock synchronization data within a historical time period, a set of historical clock push information sequences and a set of historical local clock sequences are collected. The clock push information sequences following each historical clock push information sequence are also collected and labeled to obtain a set of predicted clock push information sequences. The set of historical clock push information sequences, the set of historical local clock sequences, and the set of predicted clock push information sequences are combined as a clock prediction training dataset, and then divided multiple times to obtain multiple sets of clock prediction training data. Based on machine learning, multiple clock prediction networks are constructed. The multiple sets of clock prediction training data are used to supervise the training of each clock prediction network, and a clock prediction network group is obtained after convergence. The product of the clock deviation prediction coefficient and the total number of clock prediction networks is calculated and rounded to determine the number of activated networks.
[0195] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0196] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0197] This specification and accompanying drawings are merely illustrative examples of this application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Therefore, if such modifications and variations fall within the scope of this application and its equivalents, this application intends to include such modifications and variations.
Claims
1. A time synchronization method for power distribution terminals based on clock drift prediction compensation, characterized in that, The method includes: The power distribution terminal synchronizes its clock by receiving clock push information through a preset clock synchronization method. When a preset abnormal event occurs in the clock push information, the abnormal timestamp is obtained, and the clock push information sequence and local clock sequence are retrieved, including: The power distribution terminal receives clock push information to synchronize its clock via a preset clock synchronization method, which includes satellite synchronization or terrestrial PTP synchronization. When a preset abnormal event occurs in the clock push information, obtain the abnormal timestamp, where the preset abnormal event includes wireless link loss; Retrieve clock push information and local clock within a preset time range before the abnormal timestamp to obtain clock push information sequence and local clock sequence; Based on the clock push information sequence and the local clock sequence, a first clock offset is calculated, and a clock offset fit is obtained, including: Calculate the clock deviation between the clock push information sequence and the local clock sequence to obtain the clock deviation sequence; Calculate the mean of the clock deviation sequence to obtain the first clock deviation; Based on the first clock offset and the clock offset sequence, a clock offset fit is obtained through processing, including: Calculate the similarity between each clock deviation in the clock deviation sequence and the first clock deviation to obtain a clock deviation similarity set; Calculate the mean of the clock deviation similarity set to obtain the clock deviation fit. The network characteristics of the power distribution terminal are acquired, clock skew prediction is performed, the predicted device clock skew is obtained, and the clock skew confidence level is analyzed, including: The network characteristics of the power distribution terminal are obtained and input into a clock deviation predictor. The predicted output is used to obtain the predicted device clock deviation. The clock deviation predictor is built based on machine learning and is trained using sample network characteristics of the power distribution terminal and sample device clock deviation. The clock deviation that appears most frequently in the clock deviation sequence is taken as the mode clock deviation. Obtain the stable clock deviation within the preset clock synchronization method in historical events; The actual device clock deviation is obtained by subtracting the stable clock deviation from the mode clock deviation. Calculate the similarity between the predicted device clock deviation and the actual device clock deviation to obtain the clock deviation confidence level; Based on the clock skew fit and clock skew confidence, and using the clock push information sequence and the local clock sequence, a first predicted clock push information sequence is obtained, and a second predicted clock push information sequence is calculated. These are then fused to obtain the final predicted clock push information sequence for clock synchronization, including: Based on the clock skew fit and clock skew confidence, the fusion skew instability coefficient is calculated and used as the clock skew prediction coefficient. Obtain the clock prediction network group, and determine the number of activated networks based on the clock skew prediction coefficients and the total number of clock prediction networks, including: Based on terminal clock synchronization data within a historical time period, a set of historical clock push information sequences and a set of historical local clock sequences are collected, and a set of clock push information sequences following each historical clock push information sequence is collected and labeled to obtain a set of predicted clock push information sequences. The historical clock push information sequence set, the historical local clock sequence set, and the predicted clock push information sequence set are combined as a clock prediction training dataset, and then divided multiple times to obtain multiple sets of clock prediction training data. Multiple clock prediction networks were constructed based on machine learning. The multiple sets of clock prediction training data are used to supervise the training of multiple clock prediction networks, and a clock prediction network group is obtained after convergence. Calculate the integer value of the product of the clock skew prediction coefficient and the total number of clock prediction networks to determine the number of activated networks; Randomly select the number of clock prediction networks to activate, input the clock push information sequence and the local clock sequence, and obtain multiple predicted clock push information sequences from the prediction output; Based on the multiple predicted clock push information sequences, a first predicted clock push information sequence is obtained by fusion calculation. The Holt-Winters algorithm is used to calculate the clock deviation sequence based on the clock push information sequence and the local clock sequence. Based on the local clock sequence, the future local clock sequence is obtained, and combined with the calculated clock deviation sequence, the second predicted clock push information sequence is calculated. Based on the clock skewness fit and clock skewness confidence, the calculation weights are calculated, and the prediction weights are calculated. Using the calculated weights and predicted weights, the second predicted clock push information sequence and the first predicted clock push information sequence are fused to obtain a predicted clock push information sequence, and clock synchronization is performed until the preset abnormal event ends.
2. The distribution terminal time synchronization method based on clock drift prediction compensation according to claim 1, characterized in that, The steps for obtaining the clock skew predictor include: Based on the clock synchronization records of the power distribution terminal over a historical period, a sample network feature set and a sample device clock deviation set are collected. A clock skew predictor is built based on machine learning. The clock skew predictor is trained in a supervised manner using the sample network feature set and the sample device clock skew set, and the acquisition is completed after convergence.
3. A power distribution terminal time synchronization system based on clock drift prediction compensation, characterized in that, The system is used to execute the distribution terminal time synchronization method based on clock drift prediction compensation as described in any one of claims 1-2, the system comprising: The clock synchronization anomaly reordering module is used to receive clock push information for clock synchronization of the power distribution terminal through a preset clock synchronization method. When a preset anomaly event occurs in the clock push information, it obtains the anomaly timestamp and retrieves the clock push information sequence and the local clock sequence, including: The power distribution terminal receives clock push information to synchronize its clock via a preset clock synchronization method, which includes satellite synchronization or terrestrial PTP synchronization. When a preset abnormal event occurs in the clock push information, obtain the abnormal timestamp, where the preset abnormal event includes wireless link loss; Retrieve clock push information and local clock within a preset time range before the abnormal timestamp to obtain clock push information sequence and local clock sequence; The deviation calculation and adaptation module is used to calculate a first clock deviation based on the clock push information sequence and the local clock sequence, and to process and obtain the clock deviation adaptation degree, including: Calculate the clock deviation between the clock push information sequence and the local clock sequence to obtain the clock deviation sequence; Calculate the mean of the clock deviation sequence to obtain the first clock deviation; Based on the first clock offset and the clock offset sequence, a clock offset fit is obtained through processing, including: Calculate the similarity between each clock deviation in the clock deviation sequence and the first clock deviation to obtain a clock deviation similarity set; Calculate the mean of the clock deviation similarity set to obtain the clock deviation fit. The network feature deviation confidence module is used to acquire the network features of the power distribution terminal, perform clock deviation prediction, obtain the predicted device clock deviation, and analyze to obtain the clock deviation confidence level, including: The network characteristics of the power distribution terminal are obtained and input into a clock deviation predictor. The predicted output is used to obtain the predicted device clock deviation. The clock deviation predictor is built based on machine learning and is trained using sample network characteristics of the power distribution terminal and sample device clock deviation. The clock deviation that appears most frequently in the clock deviation sequence is taken as the mode clock deviation. Obtain the stable clock deviation within the preset clock synchronization method in historical events; The actual device clock deviation is obtained by subtracting the stable clock deviation from the mode clock deviation. Calculate the similarity between the predicted device clock deviation and the actual device clock deviation to obtain the clock deviation confidence level; The predictive sequence fusion synchronization module is used to predict and obtain a first predicted clock push information sequence based on the clock deviation adaptation and clock deviation confidence, and based on the clock push information sequence and the local clock sequence, and calculate a second predicted clock push information sequence, fuse them to obtain the predicted clock push information sequence, and perform clock synchronization, including: Based on the clock skew fit and clock skew confidence, the fusion skew instability coefficient is calculated and used as the clock skew prediction coefficient. Obtain the clock prediction network group, and determine the number of activated networks based on the clock skew prediction coefficients and the total number of clock prediction networks, including: Based on terminal clock synchronization data within a historical time period, a set of historical clock push information sequences and a set of historical local clock sequences are collected, and a set of clock push information sequences following each historical clock push information sequence is collected and labeled to obtain a set of predicted clock push information sequences. The historical clock push information sequence set, the historical local clock sequence set, and the predicted clock push information sequence set are combined as a clock prediction training dataset, and then divided multiple times to obtain multiple sets of clock prediction training data. Multiple clock prediction networks were constructed based on machine learning. The multiple sets of clock prediction training data are used to supervise the training of multiple clock prediction networks, and a clock prediction network group is obtained after convergence. Calculate the integer value of the product of the clock skew prediction coefficient and the total number of clock prediction networks to determine the number of activated networks; Randomly select the number of clock prediction networks to activate, input the clock push information sequence and the local clock sequence, and obtain multiple predicted clock push information sequences from the prediction output; Based on the multiple predicted clock push information sequences, a first predicted clock push information sequence is obtained by fusion calculation. The Holt-Winters algorithm is used to calculate the clock deviation sequence based on the clock push information sequence and the local clock sequence. Based on the local clock sequence, the future local clock sequence is obtained, and combined with the calculated clock deviation sequence, the second predicted clock push information sequence is calculated. Based on the clock skewness fit and clock skewness confidence, the calculation weights are calculated, and the prediction weights are calculated. Using the calculated weights and predicted weights, the second predicted clock push information sequence and the first predicted clock push information sequence are fused to obtain a predicted clock push information sequence, and clock synchronization is performed until the preset abnormal event ends.