A Smart Error Correction Method for Electricity Meters

By collecting and analyzing historical electricity consumption data, dynamically adjusting regularization parameters, and using an MLP model to correct electricity meter errors, the problem of electricity meter accuracy is solved, and intelligent error correction is achieved.

CN120448173BActive Publication Date: 2025-10-31GUANGZHOU HOKO ELECTRIC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510613268.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-10-31
Estimated Expiration
2045-05-13

AI Technical Summary

Technical Problem

In the current technology for correcting errors in electricity meters, the fixed regularization parameters cannot adapt to different fluctuations in the load curve, which reduces the model's ability to correct electricity meter errors and affects metering accuracy.

Method used

By collecting historical energy consumption data from each workshop in the factory, calculating calibration anomaly scores and anomaly impact factors, dynamically adjusting the regularization intensity, training with an MLP model, and outputting energy consumption compensation values ​​to correct measurement errors.

Benefits of technology

It improves the metering accuracy of electricity meters, can identify and analyze anomalies, reduce the impact of noise, adapt to load curve fluctuations, and achieve intelligent error correction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448173B_ABST
    Figure CN120448173B_ABST
Patent Text Reader

Abstract

This invention relates to the field of data processing, specifically to an intelligent error correction method for electricity meters. The method includes: collecting historical electricity consumption data from each workshop in a factory; calculating the calibration anomaly score for each workshop at each historical moment; multiplying the standard anomaly score by a preset basic regularization parameter for the workshop as the optimal regularization parameter for that workshop; training a Multilayer Perceptron (MLP) model using the optimal regularization parameter; inputting the real-time electricity consumption data of each workshop into the trained MLP model; and outputting real-time compensation values ​​for the electricity consumption of each workshop to achieve error correction of the electricity meter. This invention achieves intelligent error correction of electricity meter readings and improves reading accuracy by dynamically calculating the optimal regularization parameter and then training it using an MLP model to output real-time electricity consumption compensation values.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing. More specifically, this invention relates to a smart error correction method for electricity meters. Background Technology

[0002] Smart meters are a new type of electricity meter that integrates modern communication, computer, and measurement technologies. They are capable of accurately measuring, processing, and exchanging information about electrical energy. In factory workshops, smart meters, with their powerful functions, provide strong support for energy management, production scheduling, and cost control. Factory workshops involve complex production lines and diverse electrical equipment. Energy management is a key factor, and smart meters, by monitoring the energy consumption of each production stage in real time, provide managers with detailed and accurate energy consumption data. This helps to promptly identify energy consumption anomalies and pinpoint energy waste, thereby enabling targeted measures to save energy and reduce consumption.

[0003] However, as the service life of electricity meters increases, the aging of internal components can easily lead to measurement deviations. Existing technologies typically use multilayer perceptron neural networks to model and learn the errors of electricity meters, thereby improving the metering accuracy of electricity meters.

[0004] However, during the intelligent error correction process of electricity meters, the degree of abnormal fluctuations in the load curve varies. Some fluctuations are slight, while others are sudden and severe. For example, a sudden start-up or malfunction of equipment in a workshop, or interference from the external power grid, can cause abnormal peaks or troughs in the load curve. Traditional fixed regularization parameters cannot adapt to such changes, leading to overfitting of the model to abnormal fluctuations, reducing the model's ability to correct electricity meter errors, and ultimately affecting the accuracy of electricity meter readings. Summary of the Invention

[0005] To address the technical problem of reduced error correction accuracy of electricity meters using the aforementioned model, this invention provides the following technical solution.

[0006] A smart error correction method for electricity meters, comprising:

[0007] Collect historical electricity consumption data for each workshop in the factory;

[0008] Calculate the calibration anomaly score for each workshop at each historical moment;

[0009] The product of the standard outlier score and the preset basic regularization parameter of the workshop is used as the optimal regularization parameter for the workshop. The MLP model is trained using the optimal regularization parameter to obtain the trained MLP model. The real-time power consumption of each workshop is input into the trained MLP model, and the real-time power consumption compensation value of each workshop is output to realize the error correction of the power meter.

[0010] Specifically, the abnormal impact factor and initial abnormal score of the power consumption of 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 the calibration abnormal score of the workshop at each historical moment. When the abnormal impact factor is within a second preset interval, the initial abnormal score is increased to obtain the calibration abnormal score of the workshop at each historical moment.

[0011] This invention first calculates initial anomaly scores and anomaly impact factors, which 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 processing methods are adopted (reducing the initial anomaly score in the first preset interval and increasing the initial anomaly score in the second preset interval), thereby obtaining more accurate calibration anomaly scores for each moment in the workshop's history.

[0012] By further combining calibration anomaly scores and basic regularization parameters, the regularization strength is dynamically adjusted, enabling the model to capture the main features of the data while reducing the impact of noise during training. Real-time energy consumption data from each workshop is input into the trained MLP model, which outputs real-time energy consumption compensation values ​​to correct potential metering errors or abnormal data, thereby improving the accuracy of the energy meter.

[0013] Preferably, the process of obtaining the initial anomaly score includes:

[0014] Historical energy consumption in the workshop was constructed into a data sequence according to the time sequence of collection. A time window size was preset, and a subsequence of length equal to the time window size was selected as the initial window. The initial window was slid across the data sequence of the workshop until it covered the data sequence. For any energy consumption in the data sequence, the mean of all energy consumption within its time window was calculated. The least squares method was used to fit the energy consumption within the time window to which the energy consumption belonged to obtain a fitting slope value. The sum of the mean of all energy consumption within the time window to which the energy consumption belonged and the fitting slope value was normalized to obtain the initial anomaly score of energy consumption.

[0015] For any given energy consumption, the mean of all energy consumption within its corresponding time window is calculated. Then, the least squares method is used to fit the energy consumption within that time window, resulting in a fitting slope value. The mean reflects the average level of energy consumption within the time window, while the fitting slope reflects the trend of energy consumption changes. These two indicators together constitute an important basis for judging whether energy consumption is abnormal.

[0016] Preferably, the process of obtaining the abnormal influencing factor includes:

[0017] Obtain the fitting slope values ​​corresponding to all data collection times in each workshop.

[0018] The cosine similarity formula is used to calculate the similarity between the fitted slope values ​​of the historical energy consumption of any two workshops under the same number of seconds;

[0019] For each workshop, calculate the maximum similarity between it and all other workshops, and normalize it to obtain the abnormal influence factor of that workshop at the corresponding time.

[0020] For each workshop, the maximum similarity score between it and all other workshops is calculated and normalized to obtain the workshop's anomaly impact factor at the corresponding time point. This process transforms the workshop's similarity into a specific numerical value (anomaly impact factor), used to quantify the degree to which the workshop's energy consumption pattern deviates from that of other workshops at a specific time point. The higher the anomaly impact factor, the greater the difference in the workshop's energy consumption pattern compared to other workshops at the corresponding time point, potentially indicating the existence of some anomaly or special situation.

[0021] Preferably, when the abnormal influence factor is within a first preset interval, the calibration abnormality scores at each historical moment in the workshop satisfy the following relationship:

[0022] In the formula, For the workshop The calibration anomaly score, For the workshop The initial abnormal score, For the workshop Abnormal influencing factors.

[0023] Preferably, when the abnormal influence factor is within a second preset interval, the calibration abnormality scores at each historical moment in the workshop satisfy the following relationship:

[0024] In the formula, For the workshop The calibration anomaly score, For the workshop The initial abnormal score, For the workshop Abnormal influencing factors.

[0025] Initial anomaly scores may contain errors due to various factors (such as data noise, equipment status fluctuations, etc.). By introducing anomaly impact factors and adjusting the initial anomaly scores to different degrees based on their values ​​within different preset ranges, the actual anomaly situation in the workshop can be reflected more effectively, thereby improving the accuracy of anomaly scoring.

[0026] Preferably, the mean squared error is used as the loss function during model training.

[0027] Preferably, the hyperparameters of the model are optimized using cross-validation.

[0028] Preferably, after outputting the compensation value for the real-time power consumption of each workshop, the method further includes:

[0029] If the compensation value for power consumption exceeds the preset threshold, an anomaly occurs in the corresponding workshop.

[0030] Preferably, the optimal regularization parameter can also be expressed by the following relational formula:

[0031] In the formula, For the workshop The optimal regularization parameter, For the workshop The calibration anomaly score, For the workshop Preset basic regularization parameters, , All are weighting coefficients.

[0032] Preferably, the optimal regularization parameter further includes:

[0033] In the formula, For the workshop The optimal regularization parameter, For the workshop The calibration anomaly score, For the workshop Preset basic regularization parameters, This is the preset power exponent.

[0034] Power index The introduction of this increases the flexibility of formula adjustment. By changing... The value can be adjusted. For optimal regularization parameters The degree of influence. When When it is large, Changes The impact is more significant; when When smaller, right The changes are relatively insensitive. This flexibility allows the formula to be fine-tuned according to different application scenarios and needs.

[0035] Preferably, the process of collecting historical energy consumption data from each workshop in the factory also includes preprocessing the historical energy consumption data.

[0036] The beneficial effects of this invention are:

[0037] This invention collects historical energy consumption data from each workshop, further analyzes the data to calculate calibration anomaly scores, and dynamically calculates the optimal regularization parameters by combining the workshop's preset basic regularization parameters. Then, it uses an MLP (Multilayer Perceptron) model for training to output real-time energy consumption compensation values, thereby achieving intelligent error correction of energy meter readings and improving the accuracy of readings. Attached Figure Description

[0038] Figure 1 This is a flowchart of steps S1-S3 in an intelligent error correction method for an electricity meter according to an embodiment of the present invention. Detailed Implementation

[0039] 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.

[0040] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0041] Reference Figure 1 A smart error correction method for electricity meters includes steps S1-S3, as detailed below:

[0042] S1: Collect historical power consumption data for each workshop in the factory.

[0043] Specifically, smart meters are installed in each workshop of the factory to monitor the energy consumption of each workshop in real time. The data from these sub-meters can be used to identify peak and off-peak energy consumption periods.

[0044] For example, the past 24 hours of factory production are selected as the time range for analysis, and the historical energy consumption of each energy meter is collected every second.

[0045] Since the collected historical power consumption data may include noise caused by the heating of internal electronic components of the sensor or interference from the external environment, filtering techniques (such as median filtering) and filling methods (such as mean filling and interpolation) are used to preprocess the collected historical power consumption data.

[0046] S2: Calculate the calibration anomaly score for each workshop at each historical moment.

[0047] In one embodiment, a time window is typically used to segment time series data. By setting a time window, a continuous data stream can be divided into multiple discrete time periods, which facilitates subsequent analysis and processing.

[0048] Specifically, the historical power consumption of the workshop is constructed into a data sequence according to the time sequence of collection; a fixed time window size is selected, such as 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 over the data sequence of the workshop, moving forward by 1 time unit each time, until the data sequence is covered.

[0049] Specifically, for any data point in the data sequence, the mean of all energy consumption within its time window is calculated, and the least squares method is used to fit the energy consumption within the time window to which the data point belongs to obtain a fitting slope value. The sum of the mean of all energy consumption within the time window to which the data point belongs and the fitting slope value is normalized to obtain the initial outlier score of the data point, which is the initial outlier score of the corresponding energy consumption.

[0050] It should be added that some of the energy consumption in the data sequence may belong to different time windows because the initial window keeps sliding, and the data is updated each time the window slides.

[0051] Therefore, for the energy consumption belonging to different time windows, the corresponding initial anomaly scores satisfy the following relationship:

[0052]

[0053] In the formula, For the workshop The initial anomaly score for energy consumption per second. For the workshop Energy consumption per second For the workshop The energy consumption per second belongs to the first The average of all electrical energy consumption within a time window. For the workshop The variance of the fitted slope values ​​for all time windows encompassing the energy consumption per second. For the workshop The total number of time windows in which energy is consumed per second. This indicates normalization processing.

[0054] The formula above calculates the difference between the current second's energy consumption and the average energy consumption within each time window, which can identify whether there are any abnormalities in the current second's energy consumption. By introducing the variance of the fitted slope value, the overall trend of energy consumption over time can be taken into account, and the abnormal situation can be assessed more accurately.

[0055] Based on the above operations, the initial anomaly score corresponding to each second of historical power consumption collected by the workshop can be obtained. Similarly, the initial anomaly score corresponding to each second of historical power consumption collected by all workshops can be obtained.

[0056] In one embodiment, by comparing the energy consumption trends of different workshops, it is possible to identify which workshops perform well in terms of energy consumption and which workshops have significant energy-saving potential. If the energy consumption trend of a certain workshop differs significantly from that of other workshops, it may indicate an anomaly or problem in that workshop. For example, equipment failure, improper operation, or other problems in the production process can all lead to abnormal energy consumption.

[0057] First, obtain the fitted slope values ​​corresponding to all collection times in each workshop, and sort them according to the collection time to obtain the slope sequence corresponding to each workshop.

[0058] Next, the cosine similarity formula is used to calculate the similarity between the fitted slope values ​​of the historical energy consumption of the two workshops under the same number of seconds, that is, the relationship is:

[0059]

[0060] In the formula, For the workshop and workshop The degree of similarity between the fitted slope values ​​of historical energy consumption over the same number of seconds. For the workshop The fitting slope value of the historical energy consumption at the corresponding time point. For the workshop The fitting slope value of the historical energy consumption at the corresponding time point. This represents an exponential function with the natural number e as its base.

[0061] Cosine similarity can reflect the directional consistency between two vectors, and therefore can reflect the similarity between two workshops in terms of energy consumption trends to a certain extent.

[0062] It should be noted that since the energy consumption of the workshop at different times may belong to multiple time windows, for the energy consumption at certain times, what is obtained is the average of the fitting slopes of all time windows to which the energy consumption at that time belongs.

[0063] Finally, for each workshop, the maximum similarity between it and all other workshops is calculated, and normalized to obtain the abnormal influence factor of that workshop at the corresponding time, which satisfies the following relationship:

[0064]

[0065] In the formula, For the workshop Abnormal influencing factors, For the workshop With all other workshops A set of similarities. Indicates the maximum value. This represents an exponential function with the natural number e as its base.

[0066] This will allow you to obtain the workshop. The larger the abnormal influence factor at each data collection time, the more significant the abnormal influence factor in the workshop at that time. The greater the difference in energy consumption trends between the workshop and other workshops, the more likely it is to be affected by anomalies.

[0067] In one embodiment, the degree of abnormality in the workshop's historical energy consumption at different times is comprehensively assessed based on the initial abnormality score and abnormality impact factor of the workshop's energy consumption at each time point calculated above.

[0068] First, based on the aforementioned abnormal influencing factors, a first preset interval and a second preset interval are set; for example, the first preset interval is 0 < ≤0.5, the second preset interval is 0.5 < ≤1.

[0069] Next, when the workshop When the abnormal influence factor meets the first preset interval, reduce the workshop The initial anomaly score was obtained from the workshop. The calibration anomaly score at the corresponding time point satisfies the following relationship:

[0070]

[0071] When the workshop When the abnormal influence factor meets the second preset interval, increase the workshop The initial anomaly score was obtained from the workshop. The calibration anomaly score at the corresponding time point satisfies the following relationship:

[0072]

[0073] In the formula, For the workshop The calibration anomaly score, For the workshop The initial abnormal score, For the workshop Abnormal influencing factors.

[0074] Further workshops can be obtained Furthermore, the calibration anomaly scores corresponding to all acquisition times can be obtained, and the calibration anomaly scores corresponding to all acquisition times in all workshops can be obtained.

[0075] S3: The product of the standard outlier score and the preset basic regularization parameter of the workshop is used as the optimal regularization parameter for the workshop. The MLP model is trained using the optimal regularization parameter to obtain the trained MLP model. The real-time power consumption of each workshop is input into the trained MLP model, and the real-time power consumption compensation value of each workshop is output to realize the error correction of the power meter.

[0076] In machine learning models, regularization parameters (such as the λ value in L1 or L2 regularization) are used to control the complexity of the model and avoid overfitting. The larger the regularization parameter, the less sensitive the model is to noise, but it may underfit; the smaller the regularization parameter, the stronger the model's ability to fit the data, but it may overfit.

[0077] When the calibration anomaly score of the workshop calculated by S2 is high, it indicates that there may be a lot of noise or anomalies in the data. In this case, increasing the regularization parameter can make the model more "conservative," reducing overfitting to outlier data and preventing the model from learning incorrect patterns. When the calibration anomaly score of the workshop calculated by S2 is low, it indicates that the data quality is good and there is less noise. In this case, decreasing the regularization parameter can make the model fit the data more flexibly, improving the model's fitting ability and better capturing patterns in the data.

[0078] First, in one embodiment, the product of the standard anomaly score of each workshop at all times and the preset basic regularization parameter of the workshop is used as the optimal regularization parameter for each workshop at the corresponding time.

[0079] In another embodiment, the standard outlier score and the basic regularization parameter can be assigned different weights, and then a weighted average can be performed, satisfying the following relationship:

[0080]

[0081] In the formula, For the workshop The optimal regularization parameter, For the workshop The calibration anomaly score, For the workshop Preset basic regularization parameters, , Both are weighting coefficients, and their values ​​can be adjusted according to the actual situation.

[0082] In another embodiment, the workshop The optimal regularization parameter also satisfies the following relation:

[0083]

[0084] In the formula, For the workshop The optimal regularization parameter, For the workshop The calibration anomaly score, For the workshop Preset basic regularization parameters; As a power exponent, different methods such as cross-validation are used to evaluate the power exponent. Choose the model that best performs under the given conditions. value.

[0085] Next, a multilayer perceptron (MLP) model is constructed with at least 5 hidden layers, each containing 32 neurons. The model is trained using all the optimal regularization parameters mentioned above, with mean squared error (MSE) used as the loss function during training. The hyperparameters of the model are optimized through methods such as cross-validation.

[0086] After the model training is completed, the real-time energy consumption data collected by the energy meters in each workshop is preprocessed and input into the trained model. The model will output a compensation value for energy consumption every second. The energy meter readings are corrected by the compensation value output by the model to correct any possible errors, thereby achieving intelligent error correction for the energy meters.

[0087] Furthermore, a real-time monitoring mechanism can be established. When the compensation value of the workshop's power consumption exceeds the preset threshold, it indicates that an abnormality has occurred in the corresponding workshop, which will immediately trigger an alarm and notify relevant personnel to conduct inspections and handle the situation.

[0088] 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 smart error correction method for electricity meters, characterized in that, include: Collect historical electricity consumption data for each workshop in the factory; Calculate the calibration anomaly score for each workshop at each historical moment; The product of the calibration anomaly score and the preset basic regularization parameter of the workshop is used as the optimal regularization parameter for the workshop. The MLP model is trained using the optimal regularization parameter to obtain the trained MLP model. The real-time power consumption of each workshop is input into the trained MLP model, and the real-time power consumption compensation value of each workshop is output to realize the error correction of the power meter. Specifically, the abnormal impact factor and initial abnormal score of the power consumption of 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 the calibration abnormal score of the workshop at each historical moment. When the abnormal impact factor is within a second preset interval, the initial abnormal score is increased to obtain the calibration abnormal score of the workshop at each historical moment. The process of obtaining the initial anomaly score includes: Historical energy consumption in the workshop was constructed into a data sequence according to the time sequence of collection. A time window size was preset, and a subsequence of length equal to the time window size was selected as the initial window. The initial window was slid across the data sequence of the workshop until it covered the data sequence. For any energy consumption in the data sequence, the mean of all energy consumption within its time window was calculated. The least squares method was used to fit the energy consumption within the time window to which the energy consumption belonged to obtain a fitting slope value. The sum of the mean of all energy consumption within the time window to which the energy consumption belonged and the fitting slope value was normalized to obtain the initial anomaly score of energy consumption. The process of obtaining the abnormal influence factors includes: Obtain the fitting slope values ​​corresponding to all data collection times in each workshop. The cosine similarity formula is used to calculate the similarity between the fitted slope values ​​of the historical energy consumption of any two workshops under the same number of seconds; For each workshop, calculate the maximum similarity between it and all other workshops, and normalize it to obtain the abnormal influence factor of that workshop at the corresponding time.

2. The intelligent error correction method for an electricity meter according to claim 1, characterized in that, When the abnormal influence factor is within the first preset interval, the calibration anomaly scores at each historical moment in the workshop satisfy the following relationship: In the formula, For the workshop The calibration anomaly score, For the workshop The initial abnormal score, For the workshop Abnormal influencing factors.

3. The intelligent error correction method for an electricity meter according to claim 2, characterized in that, When the abnormal influence factor is within the second preset interval, the calibration abnormality scores at each historical moment in the workshop satisfy the following relationship: In the formula, For the workshop The calibration anomaly score, For the workshop The initial abnormal score, For the workshop Abnormal influencing factors.

4. The intelligent error correction method for an electricity meter according to claim 3, characterized in that, Mean squared error is used as the loss function during model training.

5. The intelligent error correction method for an electricity meter according to claim 1, characterized in that, After outputting the real-time compensation values ​​for the power consumption of each workshop, the system also includes: If the compensation value for power consumption exceeds the preset threshold, an anomaly occurs in the corresponding workshop.

6. The intelligent error correction method for an electricity meter according to claim 5, characterized in that, The optimal regularization parameter can also be expressed by the following relation: In the formula, For the workshop The optimal regularization parameter, For the workshop The calibration anomaly score, For the workshop Preset basic regularization parameters, , All are weighting coefficients.

7. The intelligent error correction method for an electricity meter according to claim 1, characterized in that, The optimal regularization parameter also includes: In the formula, For the workshop The optimal regularization parameter, For the workshop The calibration anomaly score, For the workshop Preset basic regularization parameters, This is the preset power exponent.

8. The intelligent error correction method for an electricity meter according to claim 1, characterized in that, The collection of historical power consumption data from each workshop in the factory also includes preprocessing of the historical power consumption data.

Citation Information

Patent Citations

  • Electric power marketing management system and method based on Internet of Things

    CN118644268A

  • Electrical energy meter having record of meter calibration data therein and method of recording calibration data

    US5495167A