Intelligent error correction method for electric energy meter
By collecting and analyzing historical power consumption data, dynamically adjusting regularization parameters, and using the MLP model to correct the reading of the power meter, solving the measurement accuracy problem of smart power meter when the load curve fluctuates, achieving higher reading accuracy and abnormal identification.
Patent Information
- Application Number
- CN202510613268.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-05-13
AI Technical Summary
In the prior art, when smart power meters face abnormal fluctuations in the load curve, the use of fixed regularization parameters leads to the model's ability to correct the error of the power meters, affecting the measurement accuracy.
By collecting historical power consumption data from each workshop of the factory, calibrating the abnormality score and abnormal impact factor, dynamically adjusting regularization parameters, using the MLP model for training, and outputting the power consumption compensation value to correct the power meter reading.
It improves the accuracy of the reading of the electricity meter, can identify and correct metering errors, reduce noise impact, adapt to load curve fluctuations, and achieve intelligent error correction.
Smart Images

Figure CN120448173A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and more particularly to an intelligent error correction method for an electric energy meter. Background Art
[0002] Smart meters are a new type of meter that integrates modern communications, computing, and measurement technologies. They enable precise measurement, data processing, and information exchange. In factory workshops, smart meters, with their powerful functionality, provide strong support for energy management, production scheduling, and cost control. Factories involve complex production lines and diverse electrical equipment, and energy management is a key factor. Smart meters monitor energy consumption at every stage of production in real time, providing managers with detailed and accurate energy consumption data. This helps to promptly identify energy anomalies and wasteful processes, allowing for targeted measures to reduce energy consumption.
[0003] However, as the electricity meter ages, the aging of internal components can easily lead to measurement deviations. Existing technologies usually use multi-layer perceptron neural networks to model and learn the errors of the electricity meter, thereby improving the metering accuracy of the electricity meter.
[0004] However, during the intelligent error correction process for electricity meters, the degree of abnormal fluctuations in the load curve varies, ranging from mild to sudden and dramatic. For example, the sudden startup or failure of equipment in a workshop, or interference from the external power grid, can cause abnormal peaks or valleys in the load curve. Using traditional fixed regularization parameters cannot adapt to these variations, causing the model to overfit abnormal fluctuations, reducing its ability to correct meter errors and ultimately affecting meter accuracy. Summary of the Invention
[0005] In order to solve the technical problem of reduced error correction accuracy of the electric energy meter using the above-mentioned model, the present invention provides the following technical solution.
[0006] An intelligent error correction method for an electric energy meter, comprising: Collect historical electricity consumption of each workshop in the factory; Calculate the calibration anomaly score for each workshop at each moment in history; The product of the standard anomaly score and the basic regularization parameter preset by the workshop is used as the optimal regularization parameter corresponding to the workshop. The MLP model is trained using the optimal regularization parameter to obtain a trained MLP model. The real-time power consumption of each workshop is input into the trained MLP model, and the real-time compensation value of the power consumption of each workshop is output to achieve error correction of the power meter; Among them, the abnormal impact factor and initial abnormal score of the power consumption corresponding to the workshop at each historical moment are calculated. When the abnormal impact factor is within a first preset interval, the initial abnormal score is reduced to obtain a calibrated abnormal score for each historical moment of the workshop; when the abnormal impact factor is within a second preset interval, the initial abnormal score is increased to obtain a calibrated abnormal score for each historical moment of the workshop.
[0007] By first calculating the initial anomaly score and anomaly impact factor, this method not only identifies anomalies in historical data that do not conform to normal energy consumption patterns, but also further analyzes the specific circumstances of these anomalies. For example, when the anomaly impact factor falls within different preset intervals, different treatment methods are adopted (reducing the initial anomaly score within the first preset interval and increasing it within the second preset interval), thereby obtaining a more accurate calibrated anomaly score for each moment in the workshop's history. The calibration anomaly score and basic regularization parameters are further combined to dynamically adjust the regularization strength, so that the model can capture the main features of the data while reducing the impact of noise during training. The real-time electricity consumption data of each workshop is input into the trained MLP model, and the model will output real-time electricity consumption compensation values to correct possible metering errors or abnormal data, thereby improving the accuracy of the electricity meter.
[0008] Preferably, the process of obtaining the initial anomaly score includes: The historical electricity consumption of the workshop is constructed into a data sequence according to the chronological order of collection; a time window size is preset, and a subsequence with a length equal to the time window size is selected as the initial window. The initial window is slid on the data sequence of the workshop until the data sequence is covered. For any electricity consumption in the data sequence, the mean of all electricity consumption in the time window to which it belongs is calculated; and the least squares method is used to fit the electricity consumption in the time window to which the electricity consumption belongs to obtain a fitting slope value; the sum of the mean of all electricity consumption in the time window to which the electricity consumption belongs and the fitting slope value is normalized to obtain the initial anomaly score of the electricity consumption.
[0009] For any energy consumption, we calculate the mean of all energy consumption within the time window to which it belongs. We then use the least squares method to fit the energy consumption within that time window to obtain a fitted slope. The mean reflects the average level of energy consumption within the time window, while the fitted slope reflects the trend of energy consumption. Together, these two indicators provide important evidence for determining whether energy consumption is abnormal.
[0010] Preferably, the process of obtaining the abnormal impact factor includes: Get the fitting slope values corresponding to all collection moments of each workshop, The cosine similarity formula is used to calculate the similarity between the fitted slope values of the historical power consumption of any two workshops at the same second; For each workshop, the maximum value of its similarity with all other workshops is calculated and normalized to obtain the abnormal impact factor of the workshop at the corresponding moment.
[0011] For each workshop, the maximum value of its similarity with all other workshops is calculated and normalized to obtain the workshop's abnormal impact factor at that moment. This process converts workshop similarity into a specific value (the abnormal impact factor), which quantifies the degree to which the workshop's energy consumption pattern at a specific moment deviates from that of other workshops. A higher abnormal impact factor indicates a greater difference in the workshop's energy consumption pattern at that moment compared to other workshops, potentially indicating an abnormality or special situation.
[0012] Preferably, when the abnormal impact factor is within the first preset interval, the calibration abnormality score at each moment in the workshop history satisfies the relationship: Where, For the workshop The calibrated anomaly score, For the workshop The initial anomaly score of For the workshop Abnormal impact factor.
[0013] Preferably, when the abnormal impact factor is within the second preset interval, the calibration abnormality score at each moment in the workshop history satisfies the relationship: Where, For the workshop The calibrated anomaly score, For the workshop The initial anomaly score of For the workshop Abnormal impact factor.
[0014] The initial anomaly score may contain errors due to various factors (such as data noise and equipment status fluctuations). By introducing anomaly influencing factors and adjusting the initial anomaly score to varying degrees based on their values within different preset ranges, we can more effectively reflect the actual abnormal conditions in the workshop and thus improve the accuracy of the anomaly score.
[0015] Preferably, the mean square error is used as the loss function during model training. The mean square error is used as the loss function during model training.
[0016] Preferably, the hyperparameters of the model are optimized by cross-validation.
[0017] Preferably, after outputting the real-time compensation value of the power consumption of each workshop, the method further includes: If the compensation value of the power consumption is greater than the preset threshold, an abnormality occurs in the corresponding workshop.
[0018] Preferably, the optimal regularization parameter can also be expressed as: Where, For the workshop The optimal regularization parameter of For the workshop The calibrated anomaly score, For the workshop The default basic regularization parameter, 、 are all weight coefficients.
[0019] Preferably, the optimal regularization parameter further includes: Where, For the workshop The optimal regularization parameter of For the workshop The calibrated anomaly score, For the workshop The default basic regularization parameter, The preset power exponent.
[0020] Power index The introduction of increases the flexibility of formula adjustment. The value can be adjusted For the optimal regularization parameter The degree of influence. When it is larger, The changes in The impact is more significant when When smaller, right This flexibility allows the formula to be fine-tuned according to different application scenarios and requirements.
[0021] Preferably, collecting the historical power consumption of each workshop in the factory also includes pre-processing the historical power consumption.
[0022] The beneficial effects of the present invention are: The present invention collects historical electricity consumption data from each workshop, further analyzes the data to calculate the calibration anomaly score, and dynamically calculates the optimal regularization parameter based on the basic regularization parameter preset by the workshop. It then uses the MLP (Multi-Layer Perceptron) model for training and outputs real-time electricity consumption compensation values, thereby achieving intelligent error correction of electricity meter readings and improving reading accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a method flow chart of steps S1 to S3 in an intelligent error correction method for an electric energy meter according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0025] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0026] Reference Figure 1 , an intelligent error correction method for an electric energy meter includes steps S1 to S3, specifically as follows: S1: Collect historical electricity consumption of each workshop in the factory.
[0027] Specifically, smart electricity meters are installed in each workshop of the factory to monitor the electricity consumption of each workshop in real time. The data from these sub-meters can be used to identify peak and low-peak energy consumption periods.
[0028] For example, the past 24 hours of factory production are selected as the time range for analysis, and the historical power consumption of each power meter corresponding to each second is collected.
[0029] Since the collected historical power consumption may contain noise caused by heating of electronic components inside the sensor or external environmental interference, filtering techniques (such as median filtering) and filling methods (such as mean filling and interpolation) are used to preprocess the collected historical power consumption.
[0030] S2: Calculate the calibration anomaly score at each moment in the history of each workshop.
[0031] In one embodiment, a time window is generally used to segment time series data. By setting a time window, a continuous data stream can be divided into multiple discrete time periods, thereby facilitating subsequent analysis and processing.
[0032] Specifically, the historical electricity consumption of the workshop is constructed into a data sequence according to the time sequence of collection; a fixed time window size is selected, for example, 5 seconds, and a subsequence with a length equal to the time window size is used as the initial window. The initial window is slid on the data sequence of the workshop, sliding forward 1 time unit each time until the data sequence is covered.
[0033] Among them, for any data point in the data sequence, the mean of all power consumption in the time window to which it belongs is calculated, and the power consumption in the time window to which the data point belongs is fitted using the least squares method to obtain a fitting slope value. The sum of the mean of all power consumption in the time window to which the data point belongs and the fitting slope value is normalized to obtain the initial anomaly score of the data point, that is, the initial anomaly score of the corresponding power consumption.
[0034] It should be added that part of the power consumption in the data sequence may belong to time windows at different positions. This is because the initial window continues to slide and the data in each sliding window will be updated.
[0035] Therefore, for the energy consumption in time windows belonging to different locations, the corresponding initial anomaly scores satisfy the relationship:
[0036] Where, For the workshop The initial abnormality score of the power consumption in seconds, For the workshop Seconds of power consumption, For the workshop The energy consumption per second belongs to The average value of all power consumption in a time window, For the workshop The variance of the fitted slope values of all time windows to which the energy consumption per second belongs, For the workshop The total number of time windows to which the energy consumption in seconds belongs, Indicates normalization processing.
[0037] The above formula calculates the difference between the current second's power consumption and the average power consumption in each time window to identify whether there is an anomaly in the current second's power consumption. Introducing the variance of the fitted slope value can take into account the overall trend of power consumption over time and further accurately assess anomalies.
[0038] According to the above operation, the initial anomaly score corresponding to the historical power consumption of each second collected by the workshop can be obtained. Similarly, the initial anomaly score corresponding to the historical power consumption of each second collected by all workshops can be obtained.
[0039] In one embodiment, by comparing the energy consumption trends of different workshops, it is possible to identify which workshops perform better in terms of energy consumption and which workshops have greater energy-saving potential. If the energy consumption trend of a workshop is significantly different from that of other workshops, this may indicate an anomaly or problem in that workshop. For example, equipment failure, improper operation, or other problems in the production process may cause abnormal energy consumption.
[0040] First, the fitting slope values corresponding to all acquisition times of each workshop are obtained, and the slope sequence corresponding to each workshop is obtained by sorting them according to the acquisition time.
[0041] Next, the cosine similarity formula is used to calculate the similarity between the fitting slope values of the historical power consumption of the two workshops at the same number of seconds, that is, the relationship is satisfied:
[0042] Where, For the workshop and workshop The similarity between the fitted slope values of historical energy consumption at the same second, For the workshop The fitting slope value of the historical power consumption at the corresponding moment, For the workshop The fitting slope value of the historical power consumption at the corresponding moment, Represents an exponential function with the natural number e as its base.
[0043] Cosine similarity can reflect the directional consistency between two vectors, and therefore can reflect the similarity between the energy consumption trends of the two workshops to a certain extent.
[0044] It should be noted that, since the power consumption of the workshop at each moment may belong to multiple time windows, for the power consumption at some moments, what is obtained is the mean of the fitting slopes of all time windows to which the power consumption at that moment belongs.
[0045] Finally, for each workshop, the maximum value of its similarity with all other workshops is calculated and normalized to obtain the abnormal impact factor of the workshop at the corresponding time, that is, the relationship is satisfied:
[0046] Where, For the workshop The abnormal impact factor of For the workshop As with all other workshops The set of similarities, Indicates the maximum value, Represents an exponential function with the natural number e as its base.
[0047] Then you can get a workshop The abnormal impact factors corresponding to all the collection moments, the larger the abnormal impact factor, the more the workshop The more the energy consumption trend of a workshop differs from that of other workshops, the more likely it is to be affected by abnormalities.
[0048] In one embodiment, the abnormality degree of the historical power consumption of the workshop at different moments is comprehensively evaluated based on the initial abnormality score and abnormality impact factor of the power consumption of the workshop at each moment obtained by the above calculation.
[0049] First, a first preset interval and a second preset interval are set based on the above abnormal impact factor; for example, the first preset interval is 0< ≤0.5, the second preset interval is 0.5< ≤1.
[0050] Then, when the workshop When the abnormal impact factor of the workshop meets the first preset range, reduce the The initial anomaly score is obtained from the workshop The calibration anomaly score at the corresponding moment satisfies the relationship:
[0051] When the workshop When the abnormal impact factor meets the second preset range, increase the workshop The initial anomaly score is obtained from the workshop The calibration anomaly score at the corresponding moment satisfies the relationship:
[0052] Where, For the workshop The calibrated anomaly score, For the workshop The initial anomaly score of For the workshop Abnormal impact factor.
[0053] Further workshops available The calibration anomaly scores corresponding to all collection moments can be obtained. Furthermore, the calibration anomaly scores corresponding to all collection moments in all workshops can be obtained.
[0054] S3: The product of the standard anomaly score and the basic regularization parameter preset by the workshop is used as the optimal regularization parameter corresponding to the workshop. The MLP model is trained using the optimal regularization parameter to obtain a trained MLP model. The real-time electricity consumption of each workshop is input into the trained MLP model, and the real-time compensation value of the electricity consumption of each workshop is output to achieve error correction of the electricity meter.
[0055] In machine learning models, regularization parameters (such as the lambda value in L1 or L2 regularization) are used to control model complexity and avoid overfitting. Larger regularization parameters reduce the model's sensitivity to noise, but may result in underfitting. Smaller regularization parameters improve the model's ability to fit the data, but may result in overfitting.
[0056] If the calibration anomaly score for a workshop calculated using S2 is high, it indicates that there may be a lot of noise or anomalies in the data. Increasing the regularization parameter can make the model more conservative, reduce overfitting to abnormal data, and prevent the model from learning incorrect patterns. If the calibration anomaly score for a workshop calculated using S2 is low, it indicates good data quality and less noise. In this case, decreasing the regularization parameter can allow the model to fit the data more flexibly, improve the model's fitting ability, and better capture patterns in the data.
[0057] First, in one embodiment, the product of the standard anomaly score of each workshop at all times and the basic regularization parameter preset by the workshop is used as the optimal regularization parameter of each workshop at the corresponding time.
[0058] In another embodiment, different weights may be assigned to the standard anomaly score and the basic regularization parameter, and then weighted averaged, so as to satisfy the following relationship:
[0059] Where, For the workshop The optimal regularization parameter of For the workshop The calibrated anomaly score, For the workshop The default basic regularization parameter, 、 Both are weight coefficients, and their values can be adjusted according to actual conditions.
[0060] In another embodiment, the workshop The optimal regularization parameter also satisfies the relationship:
[0061] Where, For the workshop The optimal regularization parameter of For the workshop The calibrated anomaly score, For the workshop The default basic regularization parameter; is the power index, and different methods such as cross-validation are used to evaluate The model performance under value.
[0062] Next, we constructed a multilayer perceptron (MLP) model with at least five hidden layers, each containing 32 neurons. We used all the above-mentioned optimal regularization parameters for model training, used the mean squared error (MSE) as the loss function during training, and optimized the model's hyperparameters through methods such as cross-validation.
[0063] After the model training is completed, the real-time electricity consumption collected by the electricity meters in each workshop is pre-processed and input into the trained model. The model will output the compensation value of electricity consumption every second. The electricity meter readings are corrected by the compensation value output by the model to correct possible errors, thereby realizing intelligent error correction of the electricity meter.
[0064] Furthermore, a real-time monitoring mechanism can be established. When the compensation value of the power consumption of a workshop is greater than a preset threshold, it indicates that an abnormality has occurred in the corresponding workshop, and an alarm is immediately triggered to notify relevant personnel to conduct inspection and processing.
[0065] It should be noted that those skilled in the art may make various modifications and improvements without departing from the scope of the present invention, and these modifications and improvements fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be based on the appended claims.
Claims
1. An intelligent error correction method for an electric energy meter, characterized in that: include: Collect historical electricity consumption of each workshop in the factory; Calculate the calibration anomaly score for each workshop at each moment in history; The product of the standard anomaly score and the basic regularization parameter preset by the workshop is used as the optimal regularization parameter corresponding to the workshop. The MLP model is trained using the optimal regularization parameter to obtain a trained MLP model. The real-time power consumption of each workshop is input into the trained MLP model, and the real-time compensation value of the power consumption of each workshop is output to achieve error correction of the power meter; Among them, the abnormal impact factor and initial abnormal score of the power consumption corresponding to the workshop at each historical moment are calculated. When the abnormal impact factor is within a first preset interval, the initial abnormal score is reduced to obtain a calibrated abnormal score for each historical moment of the workshop; when the abnormal impact factor is within a second preset interval, the initial abnormal score is increased to obtain a calibrated abnormal score for each historical moment of the workshop.
2. The intelligent error correction method for electric energy meters according to claim 1, characterized in that: The process of obtaining the initial anomaly score includes: The historical electricity consumption of the workshop is constructed into a data sequence according to the chronological order of collection; a time window size is preset, and a subsequence with a length equal to the time window size is selected as the initial window. The initial window is slid on the data sequence of the workshop until the data sequence is covered. For any electricity consumption in the data sequence, the mean of all electricity consumption in the time window to which it belongs is calculated; and the least squares method is used to fit the electricity consumption in the time window to which the electricity consumption belongs to obtain a fitting slope value; the sum of the mean of all electricity consumption in the time window to which the electricity consumption belongs and the fitting slope value is normalized to obtain the initial anomaly score of the electricity consumption.
3. The intelligent error correction method for electric energy meters according to claim 2, characterized in that: The process of obtaining the abnormal impact factor includes: Get the fitting slope values corresponding to all collection moments of each workshop, The cosine similarity formula is used to calculate the similarity between the fitted slope values of the historical power consumption of any two workshops at the same second; For each workshop, the maximum value of its similarity with all other workshops is calculated and normalized to obtain the abnormal impact factor of the workshop at the corresponding moment.
4. The intelligent error correction method for electric energy meters according to claim 3, characterized in that: When the abnormal impact factor is within the first preset range, the calibration abnormality score at each moment in the workshop history satisfies the relationship: Where, For the workshop The calibrated anomaly score, For the workshop The initial anomaly score of For the workshop Abnormal impact factor.
5. The intelligent error correction method for electric energy meters according to claim 4, characterized in that: When the abnormal impact factor is within the second preset range, the calibration abnormality score at each moment in the workshop history satisfies the relationship: Where, For the workshop The calibrated anomaly score, For the workshop The initial anomaly score of For the workshop Abnormal impact factor.
6. The intelligent error correction method for electric energy meters according to claim 5, characterized in that: The mean square error is used as the loss function during model training.
7. The intelligent error correction method for electric energy meters according to claim 1, characterized in that: After outputting the real-time compensation value of the power consumption of each workshop, the method further includes: If the compensation value of the power consumption is greater than the preset threshold, an abnormality occurs in the corresponding workshop.
8. The intelligent error correction method for electric energy meters according to claim 7, characterized in that: The optimal regularization parameter can also be expressed as: Where, For the workshop The optimal regularization parameter of For the workshop The calibrated anomaly score, For the workshop The default basic regularization parameter, 、 are all weight coefficients.
9. The intelligent error correction method for electric energy meters according to claim 1, characterized in that: The optimal regularization parameter also includes: Where, For the workshop The optimal regularization parameter of For the workshop The calibrated anomaly score, For the workshop The default basic regularization parameter, The preset power exponent.
10. The intelligent error correction method for electric energy meters according to claim 1, characterized in that: The collecting of historical power consumption of each workshop in the factory also includes pre-processing the historical power consumption.
Citation Information
Patent Citations
Electric power marketing management system and method based on Internet of Things
CN118644268A
Online calibration control method for communication module of intelligent electric meter
CN119357874A
Electrical energy meter having record of meter calibration data therein and method of recording calibration data
US5495167A
Method for improving early-warning advance performance and accuracy of evaluation model
WO2024077983A1