Method and system for correcting time synchronization error of electric energy meter based on neural network

CN122430776BActive Publication Date: 2026-08-21YANGZHOU WANTAI ELECTRIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610882256.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-18
Publication Date
2026-08-21
Estimated Expiration
2046-06-18

AI Technical Summary

Technical Problem

[0005]为解决现有电能表时间同步方法因过度依赖外部授时源、缺乏时钟漂移持续监测与精准量化能力,且对缺失电能数据采用静态填补策略,导致分时电量计量精度不足,无法满足电力市场分时电价的高精度计量结算需求的问题,本发明在如下的多个方面中提供方案

Benefits of technology

1、本发明通过对电能表历史授时序列进行时序特征提取与聚类分类,结合LSTM模型实现对不同授时模式下时钟漂移特性的自主学习与精准预测,摆脱传统时间同步方法对外部授时源的强依赖,实现时钟偏差的持续感知、动态量化与自适应修正,从机制上解决外部授时失效或延迟带来的同步精度劣化问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122430776B_ABST
    Figure CN122430776B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electric energy metering, and more particularly to a neural network-based electric energy meter time synchronization error correction method and system, which comprises collecting and preprocessing the historical time correction data of electric energy meters in a region, constructing a training sample set through a sliding window to train an LSTM model; extracting the regular feature vector of the training sample time interval sequence and performing K-means clustering to identify the time interval mode and calculate the cluster fitness of each cluster; collecting the running data of the electric energy meter to be detected in real time, constructing a real-time two-dimensional sequence matrix to input the LSTM model to obtain the time service parameter, and extracting the real-time regular feature vector to match the cluster; obtaining two real-time error estimates through self-trend derivation and similar historical sample experience mapping, combining the cluster fitness to obtain the current real-time time synchronization error, and triggering the correction operation according to the error. The present application realizes high-precision and high-robustness real-time estimation and correction of errors by breaking away from external time service dependence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electricity metering technology. In particular, it relates to a method and system for correcting time synchronization errors in electricity meters based on neural networks. Background Technology

[0002] Against the backdrop of deepening electricity market reform, differentiated electricity pricing places stringent demands on the accuracy of electricity meter time period division. Time synchronization errors caused by clock drift can directly lead to mismatch of electricity consumption to different rate periods, resulting in deviations in electricity billing. Therefore, effectively correcting the time synchronization error of electricity meters is essentially to ensure that their time period division is consistent with the standard time benchmark, thereby eliminating market disputes and economic losses caused by metering distortion at the source.

[0003] Current mainstream methods for synchronizing electricity meters rely excessively on external time sources for hard synchronization. This approach has significant limitations and passivity: clock drift is a dynamic process that accumulates continuously during the operation of the electricity meter, and existing methods lack the ability to monitor this process in real time. Once the external time signal is interrupted, delayed, or interfered with, time deviations cannot be detected in time, and it is even more difficult to accurately quantify the magnitude of the error. As a result, when electricity meters are not supported by external time signals, time deviations will continue to widen, leading to gradual distortion of electricity consumption statistics for different time periods. This seriously affects the accuracy of time-of-use pricing and the fairness of electricity trade settlement.

[0004] Even after time synchronization error correction is completed, unexpected events such as clock jumps and communication interruptions can still cause missing electricity consumption data in actual operation. Current technologies often employ static filling strategies such as adjacent value interpolation and fixed value filling to address this missing data, completely ignoring the personalized patterns and time-of-day differences in electricity consumption behavior among different users. This simplistic approach cannot recreate the true electricity consumption status at the time of the missing data, easily leading to distortion in time-of-use electricity statistics, further affecting the accuracy of subsequent electricity bill calculations, weakening the actual effect of time synchronization error correction, and failing to meet the electricity market's demand for high-precision metering data. Summary of the Invention

[0005] To address the problems of existing electricity meter time synchronization methods, which rely excessively on external time sources, lack continuous monitoring and accurate quantification of clock drift, and employ static filling strategies for missing electricity data, resulting in insufficient time-of-use electricity metering accuracy and failing to meet the high-precision metering and settlement requirements of time-of-use pricing in the electricity market, this invention provides solutions in the following aspects.

[0006] In the first aspect, a neural network-based method for correcting time synchronization errors in electricity meters includes: acquiring and preprocessing historical time correction data of each electricity meter within a region, wherein the historical time correction data includes a correction timestamp, the time interval since the last time synchronization, and the time synchronization error; constructing a training sample set using a preset sliding window; training an LSTM model based on the training sample set; extracting a time interval sequence from each training sample, wherein the time interval sequence is a continuous time interval since the last time synchronization extracted from the preprocessed time correction time sequence by the preset sliding window; extracting regular feature vectors from the time interval sequence; clustering all regular feature vectors to obtain several time interval patterns; and calculating the cluster fitness of each cluster; acquiring real-time monitoring data of the electricity meter to be tested, wherein the real-time... The monitoring data includes the current timestamp and the most recent time synchronization timestamp of the energy meter under test, as well as the time synchronization interval and time synchronization error of historical correction points within the sliding window length before the current time of the energy meter under test. A real-time two-dimensional sequence matrix is ​​constructed and input into the trained LSTM model to output the next time synchronization parameters. Real-time regular feature vectors are extracted from the real-time two-dimensional sequence matrix and matched with each cluster to determine the matching cluster. Two real-time error estimates are obtained by the energy meter under test’s own trend derivation method and the similar historical sample empirical mapping method, respectively. The two real-time error estimates are weighted and fused by the cluster fitness of the matching cluster to obtain the real-time time synchronization error at the current time. It is then determined whether time correction is triggered to complete the energy meter time synchronization error correction.

[0007] Preferably, the steps for constructing the training sample set using a preset sliding window include: Set the sliding window length and sliding step size. From the preprocessed time-corrected time series sequence, extract correction points of consecutive window lengths in sequence. Arrange the normalized two-dimensional vectors of each correction point in columns to form a two-dimensional sequence matrix, which serves as the input features of the training samples. Use the normalized two-dimensional vector of the next correction point immediately adjacent to the window as the label of the corresponding training sample. Traverse the consecutive intervals in the time-corrected time series sequence that satisfy the sliding window length plus one correction point to generate the training sample set.

[0008] Preferably, the steps for training an LSTM model based on a training sample set include: The completed training sample set is divided into a training subset and a validation subset. An LSTM model containing an input layer, an LSTM hidden layer, a Dropout layer, a fully connected layer, and an output layer is constructed. A loss function and optimizer adapted to time series data prediction are selected to iteratively update the model parameters until the prediction error of the model on the validation subset tends to stabilize, thus obtaining the trained LSTM model.

[0009] Preferably, the steps for extracting regular feature vectors include: Normalized time interval sequences are extracted from the two-dimensional sequence matrix of the training sample set. Features of the sequence are extracted and normalized from the dimensions of trend change, numerical magnitude, and regularity. The features of each dimension are combined in order to obtain the regular feature vector of the time interval sequence morphology.

[0010] Preferably, the cluster fitness of each cluster is calculated, including: The average prediction error of the training samples within each cluster is calculated. The average prediction error is converted into cluster fitness with a value within a preset range through negative correlation mapping. Cluster fitness is used to quantify the model's ability to predict the time interval pattern of the corresponding cluster.

[0011] Preferably, the step of determining the corresponding matching cluster includes: Normalized timing interval sequences are extracted from the real-time two-dimensional sequence matrix. Real-time regular feature vectors are generated according to the method of obtaining regular feature vectors. The Euclidean distance between the real-time regular feature vectors and the centers of each cluster is calculated. The cluster with the smallest Euclidean distance is taken as the matching cluster of the energy meter to be tested.

[0012] Preferably, the self-trend derivation method constructs an extended sequence based on the real-time monitoring data of the energy meter under test, and obtains the first real-time error estimate by substituting the current time interval from the last time after trend determination and function fitting.

[0013] Preferably, the similar historical sample experience mapping method filters valid reference samples from the matching clusters, and obtains the second real-time error estimate after single-sample mapping error calculation and composite weighted fusion.

[0014] Preferably, the calculation method for the real-time time synchronization error of the energy meter under test at the current moment includes: The cluster fitness of the cluster matched by the energy meter under test is used as the weight of the first real-time error estimate, and the complement of the cluster fitness is used as the weight of the second real-time error estimate. The weighted fusion is then performed to obtain the real-time time synchronization error.

[0015] Secondly, a neural network-based time synchronization error correction system for electricity meters includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the aforementioned neural network-based time synchronization error correction method for electricity meters.

[0016] The present invention has the following effects: 1. This invention extracts and clusters the historical time synchronization sequences of electricity meters, and combines them with an LSTM model to achieve autonomous learning and accurate prediction of clock drift characteristics under different time synchronization modes. This breaks away from the strong dependence of traditional time synchronization methods on external time synchronization sources, and realizes continuous perception, dynamic quantification and adaptive correction of clock deviation. It solves the problem of synchronization accuracy degradation caused by external time synchronization failure or delay from a mechanism perspective.

[0017] 2. This invention uses a dual-path error estimation method that derives its own time-series trend and maps it with the experience of similar historical samples. It also achieves dynamic weighted fusion through cluster fitness, replacing the traditional static missing data filling and fixed compensation strategies. This method can capture the nonlinear and time-varying characteristics of the energy meter clock drift in real time, significantly improving the estimation accuracy and robustness of time synchronization error. Attached Figure Description

[0018] Figure 1 This is a flowchart of steps S1-S4 in the method for correcting the time synchronization error of an energy meter based on a neural network according to an embodiment of the present invention.

[0019] Figure 2 This is a structural block diagram of the time synchronization error correction system for electricity meters based on neural networks, according to an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0021] Reference Figure 1 The method for correcting the time synchronization error of electricity meters based on neural networks includes steps S1-S4, as detailed below: S1: Obtain historical time-corrected data of each electricity meter in the area and preprocess it. Construct a training sample set using a preset sliding window and train the LSTM model based on the training sample set.

[0022] Historical time correction data includes, but is not limited to: correction timestamp, and the interval since the last time synchronization. (Unit: seconds) Time synchronization error (Unit: seconds), Time synchronization error For signed real values, This indicates that the internal clock of the electricity meter is lagging behind the standard time. This indicates that the clock is ahead of standard time.

[0023] The preprocessing steps include: arranging the historical time correction data of each electricity meter in ascending order by correction timestamp to form a time-corrected time series sequence, where each element in the sequence is... The correction points are established. This applies to all correction points for all electricity meters. The value is subjected to global Min-Max normalization, mapping it to the [0,1] interval; The values ​​are normalized using a global mean-standard deviation (Z-score) method to obtain the normalized result for each correction point. Eliminating the difference in units provides a unified data foundation for subsequent model training.

[0024] The preset sliding window length and sliding step parameters need to be optimized and determined in conjunction with the change period of the electricity meter clock drift and the data acquisition frequency. The window length determines the range of the model's capture of the time series pattern and needs to cover the minimum change period of the clock drift to ensure that the evolution trend of the time interval can be fully presented. The sliding step takes into account the number of samples and redundancy. While ensuring the diversity of samples, it avoids repeated sampling and increases the training cost.

[0025] For example, the length of the sliding window The sliding step size is one correction point. Using the preprocessed time-corrected time series as the data source, correction points of consecutive window lengths are sequentially extracted according to the set sliding step size. The normalized two-dimensional vector of each correction point (representing the time interval from the previous synchronization and the time synchronization error) is arranged column-wise to construct a two-dimensional sequence matrix as the input features of the training samples. The normalized two-dimensional vector corresponding to the next correction point immediately adjacent to the sliding window is then used as the input feature. This serves as the label for the training sample. A training sample set is generated by traversing all continuous intervals that satisfy the sliding window length + 1 correction point. This transforms time-series prediction into a supervised learning task of predicting the next state based on historical window data, enabling the LSTM (Long Short-Term Memory) model to learn the temporal dependency between the timing interval and the time synchronization error.

[0026] The training sample set is divided into a training set and a validation set according to a preset ratio (for example, a preset ratio of 7:3). An LSTM model is then constructed, which includes an input layer, an LSTM hidden layer, a Dropout layer, a fully connected layer, and an output layer. The input layer is used to receive... Given a two-dimensional sequence matrix, the LSTM hidden layer is used to learn the two-dimensional vector of the correction points in the input matrix. The changing temporal dependencies and complex patterns are addressed by using the Dropout layer to suppress model overfitting and improve generalization ability, the fully connected layer to complete feature mapping, converting the features extracted by the hidden layer into the features required for the output dimension, and the output layer to output the predicted next-moment time-based state vector.

[0027] Using the mean absolute error as the loss function, the Adam (Adaptive Moment Estimation) optimizer is used to iteratively update the parameters of each layer of the model until the prediction error of the model on the validation set tends to stabilize. Then, training is stopped and the optimal LSTM model is saved.

[0028] S2: Extract timing interval sequences from each training sample, extract regular feature vectors from the timing interval sequences, cluster all regular feature vectors to obtain several timing interval patterns, and calculate the cluster fitness of each cluster.

[0029] Extract the normalized time intervals from the two-dimensional sequence matrix of each training sample. The sequence, analyzing the time interval sequence from the perspectives of trend change, numerical magnitude, and regularity stability, uses trend change characteristics to characterize the increasing or decreasing trend of the time interval, reflecting the rate of clock drift change; numerical magnitude characteristics to characterize the overall level of the time interval, reflecting the basic time synchronization characteristics of the energy meter; and regularity stability characteristics to characterize the degree of fluctuation of the time interval, reflecting the stability of clock drift. The specific operating steps are as follows: The original slope is obtained by performing univariate linear fitting on the normalized time interval sequence. The original slope is then normalized to obtain the slope trend feature. The arithmetic mean of the normalized time interval sequence is calculated to obtain the mean feature. The coefficient of determination is calculated during the univariate linear fitting process and normalized to obtain the linear trend feature. The slope trend feature, mean feature, and linear trend feature are combined to construct a regular feature vector, transforming the high-dimensional time series sequence into a low-dimensional essential feature vector. This achieves accurate characterization of the time interval pattern and provides a quantifiable basis for cluster analysis.

[0030] K-means clustering (or other unsupervised clustering algorithms) is employed, using the Euclidean distance between the regular feature vectors of any two training samples as the similarity metric. The number of clusters K is determined using the silhouette coefficient method. Clustering is performed on the regular feature vectors of all training samples to obtain several clusters corresponding to different time interval patterns. Each cluster represents a class of samples with similar time intervals. A subset of training samples with regular patterns, such as stable short intervals, gradually increasing long intervals, and irregular fluctuations.

[0031] The average prediction error of all training samples within each cluster is calculated to obtain the intra-cluster average prediction error. The product of the intra-cluster average prediction error and the adjustment coefficient is then mapped negatively using an exponential function to obtain the cluster fitness of each cluster. Higher cluster fitness indicates better model learning of the pattern and more reliable inferences based on the model's own trends; conversely, lower cluster fitness indicates higher weighting of results mapped from similar historical samples. The core logic of this step is to establish a correlation between model prediction ability and error fusion weights through cluster fitness, providing a quantitative standard for subsequent adaptive fusion of dual-path errors.

[0032] S3: Obtain real-time monitoring data of the energy meter under test. The real-time monitoring data includes the current time stamp of the energy meter under test, the most recent time synchronization time stamp, and the time synchronization interval and time synchronization error of the historical correction points within the sliding window length before the current time of the energy meter under test. Construct a real-time two-dimensional sequence matrix and input it into the trained LSTM model to output the next time synchronization parameters. Extract real-time regular feature vectors from the real-time two-dimensional sequence matrix and match them with each cluster to determine the matching cluster.

[0033] Acquire real-time monitoring data from the energy meter under test. This monitoring data includes, but is not limited to, the current timestamp, the most recent time synchronization timestamp, and the recent timestamp of the energy meter under test. A two-dimensional vector of historical correction points Data. Calculate the time difference between the current timestamp and the latest timestamp, define it as the current time interval, and characterize the running time of the energy meter under test from the most recent timestamp to the current time.

[0034] The data acquisition method for real-time monitoring is consistent with the format of historical data to ensure compatibility with the training samples. The historical correction point data within the sliding window length is used to construct a real-time two-dimensional sequence matrix with the same dimensions as the training samples. The specific operation steps are as follows: The electricity meters to be tested recently Historical correction points The data is normalized and sorted according to its sequence to construct... The system takes a two-dimensional sequence matrix as input, inputs the trained LSTM model, and outputs the timing parameters for the next time. It extracts the timing interval sequence from the real-time two-dimensional sequence matrix and generates a real-time regular feature vector according to the method of obtaining regular feature vectors.

[0035] The Euclidean distance between the real-time regular feature vector and the center of each cluster is calculated. The cluster with the smallest Euclidean distance is selected as the matching cluster. By calculating the similarity of the feature vectors, the current clock drift mode of the energy meter under test can be quickly located, so that the subsequent error estimation can be adapted to its unique regular features, thereby improving the targeting and accuracy of the error estimation.

[0036] After predicting the real-time timing parameters of the energy meter under test and matching them with its corresponding timing interval mode cluster, this scheme further designs a dual-path error estimation and adaptive weighted fusion implementation process to achieve high-precision, robust estimation and accurate correction of time synchronization errors under conditions without external real-time timing. By integrating the operating rules of the energy meter under test with the empirical rules of similar historical samples, and combining the fitness of the matching cluster, the real-time time synchronization error is calculated, and targeted clock correction operations are performed based on the error characteristics. The specific steps are as follows: S4: Two real-time error estimates are obtained by the trend derivation method of the energy meter under test and the empirical mapping method of similar historical samples, respectively. The two real-time error estimates are weighted and fused by the cluster fitness of the matching cluster to obtain the real-time time synchronization error at the current moment. It is then determined whether time correction is triggered to complete the time synchronization error correction of the energy meter.

[0037] An extended sequence is constructed based on the real-time monitoring data of the energy meter under test. The type of clock drift change is determined by trend analysis. The specific operation steps are as follows: The 2D prediction vector output by the LSTM model is denormalized to restore the physical value; combined with the recent data of the electricity meter under test... The original data values ​​of each historical correction point are arranged in chronological order to form a collection The extended sequence of points; calculate the ratio of the time synchronization error of each correction point in the extended sequence to the running time since the last time synchronization, which can quantify the clock error generated per second of operation and characterize the core indicator of clock drift; calculate the rate of change of adjacent ratios in the ratio sequence, if the rate of change is less than a preset threshold (for example, the preset threshold is 0.1 in this embodiment), it is determined that the real-time error and the time interval are linearly related, otherwise it is determined to be a non-linear trend.

[0038] By fitting the data using a corresponding function (such as a linear or exponential function) and substituting the current time interval from the last time into the fitting function, the first real-time error estimate is obtained. The core logic of this approach is to focus on the clock drift pattern of the energy meter under test and achieve personalized error trend derivation.

[0039] Valid reference samples are selected from the matching clusters. For example, the Euclidean distance between the regular feature vector of the reference sample and the real-time regular feature vector of the energy meter to be detected is calculated, and the inverse of the distance is converted into time series feature similarity. A preset similarity threshold is set (for example, the threshold is 0.7). Samples with time series feature similarity higher than the preset threshold are used as valid reference samples. The single sample mapping error is calculated based on the valid reference samples, and then all single sample mapping errors are weighted and fused by composite weights to obtain the second real-time error estimate. By drawing on historical experience under similar clock drift modes, the inference bias caused by the limited amount of data and incomplete time series patterns of a single energy meter is compensated.

[0040] The first real-time error estimate is accurately obtained based on its own trend derivation method. Specifically, it is implemented as follows: First, by combining the real-time monitoring data of the energy meter under test with the predicted value of the next timing parameter output by the LSTM model, an extended sequence containing historical correction points and prediction points is constructed. The dimension of this extended sequence matches the length of the sliding window, fully covering the recent timing interval and time synchronization error change patterns of the energy meter under test. The trend of the extended sequence is determined, and the correlation coefficient between the time synchronization error in the sequence and the timing interval from the last time is calculated. At the same time, linear and nonlinear fittings are performed on the sequence, and the determination coefficients of each fitting method are calculated. If the coefficient of determination of the linear fit If the value exceeds a preset threshold (for example, the threshold is 0.85), the clock drift is determined to be a linear trend; otherwise, it is determined to be a non-linear trend. Based on the trend determination result, a suitable fitting function is selected: a univariate linear regression function is selected for linear trends, and an exponential or polynomial function is selected for non-linear trends. The least squares method is used to fit the extended sequence to obtain a clock drift trend fitting model. The actual interval between the current time of the energy meter under test and the last time synchronization is extracted, and it is substituted into the above fitting model. The calculated output value is the first real-time error estimate. This value is completely derived based on the timing operation law of the energy meter under test and can accurately characterize its personalized clock drift characteristics.

[0041] The second real-time error estimate is accurately obtained based on the empirical mapping method using similar historical samples. Specifically, after selecting valid reference samples, a single-sample mapping error is calculated for each valid reference sample. The correspondence between the timing interval and time synchronization error of the reference sample is extracted. Interpolation is used to map the current timing interval of the energy meter under test to the time series interval of the reference sample, obtaining the mapping error value of the reference sample for the current state of the energy meter under test, i.e., the single-sample mapping error. To improve the reliability of the mapping results, a composite weight is introduced to weight and fuse all single-sample mapping errors. The composite weight includes two parts: time series similarity weight and sample reliability weight. The time series similarity weight is determined by the empirical mapping between the reference sample and the energy meter under test. The similarity of the time-series feature vectors is determined, and the higher the similarity, the greater the weight. The sample reliability weight is determined by the original data quality of the reference samples. Reference samples with outliers and missing values ​​are given higher weights. For example, reference samples without data defects are given a weight of 1, and reference samples with slight data fluctuations are given a weight of 0.8. After normalizing the two weights, a weighted sum is used to calculate the composite weight. Then, the single-sample mapping error of each valid reference sample is multiplied by the corresponding composite weight. The sum of all product results is used to obtain the second real-time error estimate. This value integrates the historical experience of multiple valid reference samples under the same clock drift mode, which can effectively avoid the random deviation of the time-series pattern of a single energy meter.

[0042] After obtaining the first and second real-time error estimates, the cluster fitness of the matching cluster is used as the weight of the first real-time error estimate, and the complement of the cluster fitness is used as the weight of the second real-time error estimate. The two real-time error estimates are weighted and fused using a weighted summation formula to obtain the final real-time time synchronization error, thus realizing the organic integration of its own trend and historical experience.

[0043] The above weight allocation method achieves dynamic adaptation between model prediction capability and historical experience reliability: when the cluster fitness is high, it indicates that the LSTM model has fully learned the timing interval mode of the current energy meter under test and has high prediction accuracy. At this time, the first real-time error estimate derived from its own trend has a higher weight, and the derivation result based on the energy meter's own pattern is given priority to ensure the personalization and accuracy of the error estimate; when the cluster fitness is low, it indicates that the model's prediction capability for this mode is limited and the reliability of its own trend derivation result is insufficient. At this time, the second real-time error estimate mapped from similar historical sample experience has a higher weight, and the historical experience result of the same mode is given priority to compensate for the limitations of model prediction; when the cluster fitness is in the middle range, a balanced integration of the two is achieved, taking into account the dual advantages of its own pattern and historical experience.

[0044] The real-time time synchronization error, calculated through weighted fusion, is compared with a preset correction threshold. This threshold is set according to the metering accuracy requirements of time-of-use pricing in the electricity market (for example, the preset threshold is 1 second, considering the accuracy of time-of-use segmentation). If the absolute value of the real-time time synchronization error exceeds the preset correction threshold, it indicates that the current time deviation of the electricity meter has affected the accuracy of time-of-use electricity metering. A time correction operation is immediately triggered, and the internal clock of the electricity meter is precisely calibrated and synchronized according to the next timing parameters (including timing interval and timing calibration value) output by the LSTM model. If the absolute value of the real-time time synchronization error does not exceed the preset correction threshold, it indicates that the current time deviation is within the metering allowable range. No correction operation is triggered, and the real-time acquisition and monitoring of the electricity meter's operating data continues, achieving continuous tracking of clock drift. This step, through quantified error judgment and precise correction execution, ultimately achieves continuous monitoring, precise quantification, and adaptive correction of the electricity meter's time synchronization error. It eliminates metering deviations caused by clock drift at the time reference level, ensuring the time accuracy of time-of-use electricity metering and meeting the high-precision and high-fairness settlement requirements of time-of-use pricing in the electricity market.

[0045] This invention also provides a time synchronization error correction system for electricity meters based on neural networks. For example... Figure 2 As shown, the system includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the neural network-based time synchronization error correction method for electricity meters according to the first aspect of the present invention. The system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface. Their configuration and functions are known in the art and will not be described further here.

[0046] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method for correcting time synchronization errors in electricity meters based on neural networks, characterized in that, include: Historical time correction data of each electricity meter in the area is acquired and preprocessed. The historical time correction data includes correction timestamp, time interval since the last time synchronization, and time synchronization error. A training sample set is constructed by pre-setting a sliding window, and an LSTM model is trained based on the training sample set. The timing interval sequence is extracted from each training sample. The timing interval sequence is a continuous timing interval from the previous time extracted from the preprocessed time-corrected time series sequence by a preset sliding window. Regular feature vectors are extracted from the timing interval sequence. Several timing interval patterns are obtained by clustering all regular feature vectors, and the cluster fitness of each cluster is calculated. The real-time monitoring data of the energy meter to be tested is obtained. The real-time monitoring data includes the current time stamp of the energy meter to be tested, the most recent time synchronization time stamp, and the time synchronization interval and time synchronization error of the historical correction points within the sliding window length before the current time of the energy meter to be tested. A real-time two-dimensional sequence matrix is ​​constructed and input into the trained LSTM model to output the next time synchronization parameters. Real-time regular feature vectors are extracted from the real-time two-dimensional sequence matrix and matched with each cluster to determine the matching cluster. Two real-time error estimates are obtained by the trend derivation method of the energy meter under test and the empirical mapping method of similar historical samples, respectively. The two real-time error estimates are weighted and fused by the cluster fitness of the matching cluster to obtain the real-time time synchronization error at the current moment. It is then determined whether time correction is triggered to complete the time synchronization error correction of the energy meter.

2. The method for correcting time synchronization error of an energy meter based on a neural network according to claim 1, characterized in that, The steps for constructing a training sample set using a pre-defined sliding window include: Set the sliding window length and sliding step size. From the preprocessed time-corrected time series sequence, extract correction points of consecutive window lengths in sequence. Arrange the normalized two-dimensional vectors of each correction point in columns to form a two-dimensional sequence matrix, which serves as the input features of the training samples. Use the normalized two-dimensional vector of the next correction point immediately adjacent to the window as the label of the corresponding training sample. Traverse the consecutive intervals in the time-corrected time series sequence that satisfy the sliding window length plus one correction point to generate the training sample set.

3. The method for correcting time synchronization error of an energy meter based on a neural network according to claim 1, characterized in that, The steps for training an LSTM model based on a training sample set include: The completed training sample set is divided into a training subset and a validation subset. An LSTM model containing an input layer, an LSTM hidden layer, a Dropout layer, a fully connected layer, and an output layer is constructed. A loss function and optimizer adapted to time series data prediction are selected to iteratively update the model parameters until the prediction error of the model on the validation subset tends to stabilize, thus obtaining the trained LSTM model.

4. The method for correcting time synchronization error of an energy meter based on a neural network according to claim 1, characterized in that, The steps for extracting regular feature vectors include: Normalized time interval sequences are extracted from the two-dimensional sequence matrix of the training sample set. Features of the time interval sequences are extracted and normalized from the dimensions of trend change, numerical magnitude, and regularity. The features of each dimension are combined in order to obtain the regular feature vector of the time interval sequence morphology.

5. The method for correcting time synchronization error of an energy meter based on a neural network according to claim 1, characterized in that, Calculate the cluster fitness of each cluster, including: The average prediction error of the training samples within each cluster is calculated. The average prediction error is converted into cluster fitness with a value within a preset range through negative correlation mapping. Cluster fitness is used to quantify the model's ability to predict the time interval pattern of the corresponding cluster.

6. The method for correcting time synchronization error of an energy meter based on a neural network according to claim 1, characterized in that, The steps to determine the corresponding matching clusters include: Normalized timing interval sequences are extracted from the real-time two-dimensional sequence matrix. Real-time regular feature vectors are generated according to the method of obtaining regular feature vectors. The Euclidean distance between the real-time regular feature vectors and the centers of each cluster is calculated. The cluster with the smallest Euclidean distance is taken as the matching cluster of the energy meter to be tested.

7. The method for correcting time synchronization errors of electricity meters based on neural networks according to claim 1, characterized in that, The self-trend derivation method constructs an extended sequence based on the real-time monitoring data of the energy meter under test. After trend determination and function fitting, the first real-time error estimate is obtained by inputting the current time interval from the last time.

8. The method for correcting time synchronization error of an energy meter based on a neural network according to claim 7, characterized in that, The similar historical sample experience mapping method filters valid reference samples from matching clusters, and obtains the second real-time error estimate after single-sample mapping error calculation and composite weighted fusion.

9. The method for correcting time synchronization error of an energy meter based on a neural network according to claim 8, characterized in that, The calculation methods for the real-time time synchronization error of the energy meter under test at the current moment include: The cluster fitness of the cluster matched by the energy meter under test is used as the weight of the first real-time error estimate, and the complement of the cluster fitness is used as the weight of the second real-time error estimate. The weighted fusion is then performed to obtain the real-time time synchronization error.

10. A time synchronization error correction system for electricity meters based on neural networks, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement the neural network-based time synchronization error correction method for electricity meters according to any one of claims 1-9.

Citation Information

Patent Citations

  • Gateway electric energy meter metering verification method and system

    CN121502486A

  • Electric energy meter abnormity monitoring method and system based on digital twinning

    CN121682645A