Ammeter adaptive error compensation method and system

By collecting environmental data and meter data in real time, building an error model and performing real-time correction, the problem of measuring error of meter under complex environmental conditions is solved, adaptive error compensation of meter is realized, and measurement accuracy and system reliability are improved.

CN119959857APending Publication Date: 2025-05-09JIANGSU TONGCHI POWER AUTOMATION

Patent Information

Application Number
CN202510438880.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

In complex environmental conditions, the measurement error problems caused by temperature, humidity, voltage fluctuations and other factors are difficult for the existing technology to achieve dynamic compensation for real-time environmental changes.

Method used

By calibrating the meter, collecting baseline data under different environmental conditions, collecting environmental data and meter data in real time, extracting key features, building an error model, predicting the error of the current meter data, and making real-time corrections and parameter adjustments based on the prediction error.

Benefits of technology

It realizes adaptive error compensation for the meter under complex environmental conditions, significantly improves measurement accuracy and system reliability, and reduces errors caused by environmental factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119959857A_ABST
    Figure CN119959857A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electricity meter metering, and discloses an electricity meter adaptive error compensation method and system, and the method comprises the steps: calibrating an electricity meter, collecting baseline data under different environment conditions, and recording a measurement error; environment data and ammeter data are collected in real time through an ammeter, and key features are extracted; constructing an error model, and predicting the error of the current ammeter data; and performing real-time correction and parameter adjustment according to the prediction error, and outputting the corrected measurement data. By introducing a real-time error prediction and dynamic compensation mechanism based on environmental data and combining a particle swarm optimization algorithm to optimize regularization parameters in a ridge regression model, the measurement precision of the electric meter under a complex environmental condition is effectively improved. The method can adaptively adjust the measurement data of the electric meter, reduces errors caused by environmental factors, improves the accuracy and stability of electric power measurement, and provides more reliable data support for an electric power management and monitoring system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of electric meter measurement, and in particular to an electric meter adaptive error compensation method and system. Background Art

[0002] With the rapid development of smart grids and smart homes, the electric energy metering system is gradually developing towards higher accuracy and higher reliability. In the process of electricity metering, the accuracy of the electric meter as a core device directly affects the effect of electricity metering and energy management. However, in actual operation, the electric meter is often interfered by a variety of external environmental factors, resulting in measurement errors. Environmental conditions such as temperature, humidity, voltage fluctuations, electromagnetic interference, etc. may affect the measurement accuracy of the electric meter, resulting in inaccurate electric energy metering, which not only affects the economic benefits of the power company, but may also cause customer dissatisfaction and disputes.

[0003] Traditional meter calibration and error compensation methods often rely on calibration under laboratory standard environments, which cannot fully consider the complex environmental conditions of meters in actual use. Moreover, many meters use static error compensation methods, which often ignore the impact of real-time environmental changes on meter measurements, resulting in limited error compensation effects. Therefore, how to accurately monitor environmental changes and dynamically adjust meter parameters during actual operation to compensate for measurement errors caused by environmental fluctuations has become an urgent problem to be solved in the field of meter technology.

[0004] In recent years, with the development of information technology and sensor technology, many studies have begun to try to combine environmental data with meter data, and use data fusion and machine learning methods for error prediction and compensation. By integrating multiple sensors, real-time monitoring of changes in the temperature, humidity, voltage fluctuations, etc. of the environment where the meter is located, and combining the meter measurement data, a more accurate basis can be provided for error compensation. However, most of the current methods still have some shortcomings: on the one hand, the error model is often too simple, lacks adaptive capabilities, and cannot cope with complex and changing environmental factors; on the other hand, many optimization algorithms such as ridge regression and support vector regression, although they can effectively reduce errors, still need to continuously adjust their key parameters such as regularization parameters to achieve the best prediction effect under different environmental conditions. Summary of the invention

[0005] In view of the above-mentioned problems, the present invention is proposed.

[0006] Therefore, the technical problem solved by the present invention is: the measurement error problem of the electric meter caused by factors such as temperature, humidity, voltage fluctuation, etc. under complex environmental conditions, and realizes adaptive error compensation based on real-time environmental data.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions: an electric meter adaptive error compensation method, comprising: Calibrate the meter, collect baseline data under different environmental conditions, and record the measurement error; Collect environmental data and meter data in real time through the meter and extract key features; Build an error model to predict the error of current meter data; Perform real-time correction and parameter adjustment based on the prediction error, and output the corrected measurement data.

[0008] As a preferred solution of the electric meter adaptive error compensation method described in the present invention, wherein: collecting baseline data under different environmental conditions includes collecting electric meter data and environmental data in an environment of 45°C through the electric meter and environmental sensors; collecting electric meter data and environmental data in an environment of -10°C through the electric meter and environmental sensors; collecting electric meter data and environmental data in an environment with a humidity of more than 90% through the electric meter and environmental sensors; collecting electric meter data and environmental data in an environment with a humidity of less than 20% through the electric meter and environmental sensors; collecting electric meter data and environmental data under the condition of a voltage fluctuation range of ±10% through the electric meter and environmental sensors; collecting electric meter data and environmental data under electromagnetic interference conditions through the electric meter and environmental sensors; collecting electric meter data and environmental data under conditions of rapid changes in power grid load through the electric meter and environmental sensors; The electric meter data includes voltage, current and power; The environmental data includes temperature and humidity; Integrate meter data and environmental data under different environmental conditions into one data set; Mark the environmental conditions corresponding to each data point and calculate the measurement error of the meter under different environmental conditions.

[0009] As a preferred solution of the electric meter adaptive error compensation method of the present invention, the key feature extraction includes denoising the environmental data and electric meter data collected in real time through a Kalman filter, and the formula is expressed as: ; in, Indicates time The state estimate of represents the Kalman gain, represents the actual measured value, is the measurement matrix, is the meter measurement error increment, Indicates time state estimation; Use the Network Time Protocol (NTP) to accurately time-stamp the environmental data and meter data collected in real time; Define a 1-second time window within which to pair the environmental data with the meter data.

[0010] As a preferred solution of the method for adaptive error compensation of electric meter described in the present invention, extracting key features also includes identifying environmental features highly correlated with the measurement error of the electric meter by calculating the correlation coefficient, and the formula is expressed as: ; in, Indicates the correlation coefficient between environmental data and meter measurement error Indicates the first values, Indicates the first values, represents the mean of environmental data, represents the mean value of the meter measurement data, Indicates the number of data in the time window; The value range of is [-1,1]; when When , it means that the environmental data is completely positively correlated with the meter measurement error. when When , it means that the environmental data is completely negatively correlated with the meter measurement error; when , it means that there is no linear correlation between the environmental data and the meter measurement error.

[0011] As a preferred solution of the meter adaptive error compensation method of the present invention, the error model is constructed by constructing a feature matrix using the environmental features highly correlated with the meter measurement error and inputting the meter data measured in real time into a prediction model constructed by a ridge regression algorithm. The formula is expressed as follows: ; in, represents the regression coefficient; Indicates the measurement data of the electric meter. represents the feature matrix extracted from the environmental data, is the regularization parameter for ridge regression.

[0012] As a preferred solution of the electric meter adaptive error compensation method of the present invention, the error model construction also includes randomly generating 50 particles, and the current position of each particle represents the parameter in the prediction model. value; The velocity of each particle represents the speed of change of the particle in the parameter space; For each particle Value, solve the regression coefficient through ridge regression , using the current particle's The value is used as the regularization parameter and the ridge regression algorithm is applied to the training data set. and The training model is expressed as: ; ; in, Indicates the measurement data of the electric meter. represents the feature matrix extracted from the environmental data, represents the regularization parameter of the current particle, represents the regression coefficient; represents the feature matrix of the validation set, represents the predicted target variable value; Represents the candidate value of the regularization parameter of the current particle in particle swarm optimization.

[0013] Calculate the corresponding mean square error as the fitness function value of the particle. The formula is expressed as: ; in, Indicates the validation set The actual measured value of samples, Indicates the validation set The predicted value of samples, Indicates the number of samples in the validation set.

[0014] As a preferred solution of the self-adaptive error compensation method for an electric meter of the present invention, wherein: constructing the error model further comprises, when the fitness value of the current particle is lower than the historical optimal fitness value, updating the historical optimal position of the particle; When the fitness value of the current particle is lower than the global optimal fitness, update the global optimal position; The speed update formula is expressed as: ; in, It is a particle In time speed, is the inertia weight, Indicates the tendency of controlling particles to move toward the historical optimal position, Indicates the tendency of controlling particles to move toward the global optimal position; is a random number between [0,1]; It is a particle The best in history value, represents the global optimal position of the particle swarm; The particle's current position update formula is: ; in, Represents particles In time The current position ; When the fitness value of the particle group does not change much in multiple iterations and the velocity variance is less than the preset threshold, it is converged.

[0015] When the particle group is too convergent, reinitialize some particles value to increase group diversity and avoid falling into local optimality; When the maximum number of iterations reaches 110, the optimization is stopped; When the fitness value changes less than the preset threshold, the optimization is stopped; Output the global best position corresponding to value.

[0016] An adaptive error compensation system for an electric meter, wherein: The meter calibration module with adaptive error compensation performs factory and field calibration on the meter to ensure the accuracy of the meter and its measuring unit; The meter adaptive error compensation baseline data acquisition module collects data from the meter and environmental sensors under different environmental conditions, records and analyzes the meter's measurement errors, and establishes the relationship between environmental factors and errors; Real-time data acquisition module, which collects meter data and environmental data in real time for error prediction and compensation; The data preprocessing module performs denoising, filtering and synchronization processing on the collected environmental data and electric meter data to ensure data quality and consistency; The feature extraction module extracts features related to meter measurement errors from real-time data and identifies key features through methods such as Kalman filtering or correlation analysis; The error prediction module builds an error prediction model based on environmental data and meter data, adopts the ridge regression algorithm, and optimizes the regularization parameters in the model through the particle swarm optimization algorithm; The error compensation and correction module corrects the meter's measurement data in real time or adjusts the meter's internal parameters for compensation based on the error prediction result, and outputs the corrected measurement data; The adaptive optimization module uses the particle swarm optimization algorithm to optimize the parameters in the error compensation process, improve the compensation effect, and adjust the diversity of the particle swarm when the particle swarm converges to avoid local optimal solutions; The data output and recording module outputs the corrected measurement data through the communication interface and records the environmental data, measurement data and error compensation results to support subsequent analysis and system optimization.

[0017] A computer device comprises: a memory and a processor; the memory stores a computer program, wherein the processor implements the steps of any one of the methods of the present invention when executing the computer program.

[0018] A computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of any one of the methods of the present invention.

[0019] Beneficial effects of the invention: The meter adaptive error compensation method provided by the invention effectively improves the measurement accuracy of the meter under complex environmental conditions by introducing a real-time error prediction and dynamic compensation mechanism based on environmental data and optimizing the regularization parameters in the ridge regression model with a particle swarm optimization algorithm. The method can adaptively adjust the meter measurement data, reduce the errors caused by environmental factors, improve the accuracy and stability of power metering, and provide more reliable data support for power management and monitoring systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0021] Figure 1 The present invention provides an overall flow chart of an electric meter adaptive error compensation method according to the first embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0023] Example 1, reference Figure 1 , is an embodiment of the present invention, and provides an electric meter adaptive error compensation method, comprising: S1: Calibrate the meter, collect baseline data under different environmental conditions, and record the measurement error.

[0024] The meter data and environmental data in an environment of 45°C are collected through the meter and environmental sensors; the meter data and environmental data in an environment of -10°C are collected through the meter and environmental sensors; the meter data and environmental data in an environment with a humidity of more than 90% are collected through the meter and environmental sensors; the meter data and environmental data in an environment with a humidity of less than 20% are collected through the meter and environmental sensors; the meter data and environmental data in a voltage fluctuation range of ±10% are collected through the meter and environmental sensors; the meter data and environmental data under electromagnetic interference conditions are collected through the meter and environmental sensors; the meter data and environmental data under conditions of rapid changes in grid load are collected through the meter and environmental sensors.

[0025] The electric meter data includes voltage, current and power.

[0026] The environmental data includes temperature and humidity.

[0027] Combine meter data and environmental data under different environmental conditions into one dataset.

[0028] Mark the environmental conditions corresponding to each data point and calculate the measurement error of the meter under different environmental conditions.

[0029] Furthermore, by collecting meter data and environmental data under different environmental conditions, a baseline data set for the meter is constructed, and the impact of different environmental factors on meter measurement is systematically recorded and analyzed. Through this data integration and annotation, the error characteristics of the meter in a changing environment can be accurately evaluated, providing reliable training data for subsequent error prediction and compensation. This process lays the foundation for the effective implementation of the meter adaptive error compensation method, ensuring the measurement accuracy and stability of the meter under various environmental changes.

[0030] S2: Collect environmental data and meter data in real time through the meter and extract key features.

[0031] The real-time collected environmental data and electric meter data are denoised through the Kalman filter, and the formula is expressed as: ; in, Indicates time The state estimate of represents the Kalman gain, represents the actual measured value, is the measurement matrix, is the meter measurement error increment, Indicates time state estimation.

[0032] Use the Network Time Protocol (NTP) to accurately time-stamp the environmental data and meter data collected in real time.

[0033] Define a 1-second time window within which to pair the environmental data with the meter data.

[0034] By calculating the correlation coefficient, we can identify the environmental features that are highly correlated with the meter measurement error. The formula is: ; in, Indicates the correlation coefficient between environmental data and meter measurement error Indicates the first values, Indicates the first values, represents the mean of environmental data, represents the mean value of the meter measurement data, Indicates the number of data in the time window.

[0035] The value range of is [-1,1].

[0036] when , it indicates that the environmental data is completely positively correlated with the meter measurement error.

[0037] when , it indicates that the environmental data is completely negatively correlated with the meter measurement error.

[0038] when , it means that there is no linear correlation between the environmental data and the meter measurement error.

[0039] Furthermore, the accuracy and consistency of the data are ensured by denoising, time synchronization and feature extraction of the real-time collected environmental data and meter data. The Kalman filter is used to reduce noise interference and enhance the accuracy of the signal, and the NTP timestamp ensures the time synchronization of the data. Through correlation coefficient analysis, environmental features that are highly correlated with meter measurement errors can be identified, providing an accurate data basis for the construction of subsequent error models, thereby achieving more accurate error prediction and compensation.

[0040] S3: Build an error model to predict the error of current meter data.

[0041] The environmental features that are highly correlated with the meter measurement errors are identified to construct a feature matrix and the real-time measured meter data is input into the prediction model constructed by the ridge regression algorithm. The formula is expressed as follows: ; in, represents the regression coefficient; Indicates the measurement data of the electric meter. represents the feature matrix extracted from the environmental data, is the regularization parameter for ridge regression.

[0042] 50 particles are randomly generated, and the current position of each particle represents the parameter in the prediction model. value.

[0043] The velocity of each particle represents the speed at which the particle changes in the parameter space.

[0044] For each particle Value, solve the regression coefficient through ridge regression , using the current particle's The value is used as the regularization parameter and the ridge regression algorithm is applied to the training data set. and The training model is expressed as: ; ; in, Indicates the measurement data of the electric meter. represents the feature matrix extracted from the environmental data, represents the regularization parameter of the current particle, represents the regression coefficient; represents the feature matrix of the validation set, represents the predicted target variable value; Represents the candidate value of the regularization parameter of the current particle in particle swarm optimization.

[0045] Calculate the corresponding mean square error as the fitness function value of the particle. The formula is expressed as: ; in, Indicates the validation set The actual measured value of samples, Indicates the validation set The predicted value of samples, Indicates the number of samples in the validation set.

[0046] When the fitness value of the current particle is lower than the historical optimal fitness, the historical optimal position of the particle is updated.

[0047] When the fitness value of the current particle is lower than the global optimal fitness, the global optimal position is updated.

[0048] The speed update formula is expressed as: ; in, It is a particle In time speed, is the inertia weight, Indicates the tendency of controlling particles to move toward the historical optimal position, Indicates the tendency of controlling particles to move toward the global optimal position; is a random number between [0,1]; It is a particle The best in history value, represents the global optimal position of the particle swarm.

[0049] The particle's current position update formula is: ; in, Represents particles In time The current position .

[0050] When the fitness value of the particle group does not change much in multiple iterations and the velocity variance is less than the preset threshold, it is converged.

[0051] When the particle group is too convergent, reinitialize some particles value to increase group diversity and avoid falling into local optimality.

[0052] When the maximum number of iterations, 110, is reached, the optimization is stopped.

[0053] When the fitness value changes less than the preset threshold, the optimization stops.

[0054] Output the global best position corresponding to value.

[0055] Furthermore, the particle swarm optimization algorithm (PSO) is used to optimize the regularization parameter (λ) in the ridge regression model, thereby improving the accuracy of meter error prediction. By introducing particle swarm optimization, the algorithm can automatically adjust and optimize the λ value in the high-dimensional parameter space, reduce the deviation of human intervention, and ensure that the model can better adapt to the meter measurement error under different environmental conditions. The adaptability and global search capabilities of particle swarm optimization enable the model to effectively avoid local optimality, improve the prediction effect, and provide a more reliable basis for real-time error compensation.

[0056] S4: Perform real-time correction and parameter adjustment based on the prediction error, and output the corrected measurement data.

[0057] The predicted error is subtracted from the meter measurement data to obtain the corrected measurement data.

[0058] Dynamically adjust the internal parameters of the meter such as gain and bias to reduce the impact of environmental factors on the measurement results.

[0059] Improve the accuracy of measurement data through state estimation and smoothing. Least Mean Square Error (LMS) Filtering: Dynamically adjust filter coefficients to minimize measurement errors and improve real-time response capabilities.

[0060] The corrected measurement data is output through the communication module MODBU for use by users or power management systems.

[0061] The corrected data and relevant environmental data are synchronously recorded in a local storage unit.

[0062] Support subsequent data analysis, model optimization, and system performance evaluation.

[0063] Real-time monitoring and automatic report generation are achieved for operation and maintenance personnel to track the accuracy and operating status of electricity meters.

[0064] Furthermore, through real-time correction and parameter adjustment, the measurement results of the meter under different environmental conditions are ensured to be more accurate and stable. By subtracting the predicted error and dynamically adjusting the gain and bias of the meter, the interference of environmental changes on the measurement data can be effectively reduced, and the real-time response capability of the system can be improved. Combining the minimum mean square error filtering and state estimation technology, it not only optimizes the accuracy of the measurement data, but also provides a basis for subsequent data analysis and model optimization, enhancing the reliability and maintainability of the power management system.

[0065] Embodiment 2 is an embodiment of the present invention, which provides an electric meter adaptive error compensation system, including: The meter calibration module with adaptive error compensation performs factory and field calibration on the meter to ensure the accuracy of the meter and its measuring unit; The meter adaptive error compensation baseline data acquisition module collects data from the meter and environmental sensors under different environmental conditions, records and analyzes the meter's measurement errors, and establishes the relationship between environmental factors and errors; Real-time data acquisition module, which collects meter data and environmental data in real time for error prediction and compensation; The data preprocessing module performs denoising, filtering and synchronization processing on the collected environmental data and electric meter data to ensure data quality and consistency; The feature extraction module extracts features related to meter measurement errors from real-time data and identifies key features through methods such as Kalman filtering or correlation analysis; The error prediction module builds an error prediction model based on environmental data and meter data, adopts the ridge regression algorithm, and optimizes the regularization parameters in the model through the particle swarm optimization algorithm; The error compensation and correction module corrects the meter's measurement data in real time or adjusts the meter's internal parameters for compensation based on the error prediction result, and outputs the corrected measurement data; The adaptive optimization module uses the particle swarm optimization algorithm to optimize the parameters in the error compensation process, improve the compensation effect, and adjust the diversity of the particle swarm when the particle swarm converges to avoid local optimal solutions; The data output and recording module outputs the corrected measurement data through the communication interface and records the environmental data, measurement data and error compensation results to support subsequent analysis and system optimization.

[0066] Embodiment 3, an embodiment of the present invention, is different from the first two embodiments in that: If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0067] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0068] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0069] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0070] Example 4 is an embodiment of the present invention, which provides an adaptive error compensation method and system for an electric meter. In order to verify the beneficial effects of the present invention, a scientific demonstration is carried out through simulation experiments. The experiment first calibrates the electric meter in a laboratory environment to ensure its measurement accuracy under ideal conditions. Subsequently, data collection is carried out under different environmental conditions, including seven environmental scenarios such as high temperature (45°C), low temperature (-10°C), high humidity (above 90%), low humidity (below 20%), voltage fluctuation (±10%), electromagnetic interference, and rapid changes in grid load.

[0071] Under each environmental condition, high-precision voltage sensors, current sensors and power sensors are used to collect the measurement data of the electric meter, and the corresponding temperature and humidity data are recorded at the same time. To ensure the accuracy and consistency of the data, all sensors are synchronized through the Network Time Protocol (NTP), recording data once a second, and the real-time collected data is denoised through the Kalman filter to eliminate high-frequency noise and random interference.

[0072] During the data collection process, the system automatically integrates the voltage, current and power data of the meter with the temperature and humidity data of the environmental sensor into a comprehensive data set. Each data point is marked with its corresponding environmental conditions, and the measurement error under different environmental conditions is calculated by comparing the difference between the meter measurement value and the known standard value. These error data provide a solid foundation for the subsequent error model construction.

[0073] After completing the baseline data collection, the real-time data processing and error compensation stage is entered. The system extracts key features that are highly correlated with measurement errors, such as temperature change rate and voltage fluctuation amplitude, by real-time monitoring of environmental data and meter measurement data. The extracted feature data is input into the error prediction model based on ridge regression. In order to optimize the regularization parameter λ in the ridge regression model, the present invention adopts the particle swarm optimization (PSO) algorithm to find the optimal λ value through iterative search, thereby minimizing the prediction error of the model.

[0074] During the specific implementation, 50 particles were randomly generated. The current position of each particle represents a potential λ value, and the initial speed is randomly distributed within the preset range. Each particle trains the model on the training data set by applying the ridge regression algorithm, and calculates the mean square error (MSE) on the validation set as its fitness value. The particles continuously adjust their speed and position according to the fitness value, gradually approaching the global optimal λ value. During the iteration process, when it is found that the velocity variance of the particle group is lower than the preset threshold, indicating that the particle group tends to converge, the system increases the group diversity by reinitializing the λ value of some particles to prevent falling into the local optimal solution. The optimization process continues until the maximum number of iterations reaches 110 or the fitness value changes less than the preset threshold, and finally outputs the global optimal λ value.

[0075] After obtaining the optimal λ value, the system applies this parameter to construct the final error prediction model, and performs error prediction and compensation in real-time operation. The predicted error value is directly subtracted from the measurement data of the meter to obtain the corrected measurement result. At the same time, the system dynamically adjusts the gain and bias parameters inside the meter to further reduce the impact of environmental factors on the measurement results. In addition, the minimum mean square error (LMS) filtering algorithm is used to adjust the filter coefficients in real time to further optimize the accuracy and stability of the measurement data. The corrected data is output through the MODBUS communication module for use by users and power management systems, and is synchronously recorded in the local storage unit to support subsequent data analysis and system performance evaluation. The entire system realizes real-time monitoring and automatic report generation, and operation and maintenance personnel can track the accuracy and operating status of the meter at any time.

[0076] Through the above implementation process, the measurement error data of the electric meter under different environmental conditions were collected and analyzed. After the error compensation was performed using the method of the present invention, the measurement error of the electric meter was significantly reduced, demonstrating the superiority of the method of the present invention. Specifically, under high temperature (45°C) environment, the original measurement error was 3.5%, the traditional compensation method reduced the error to 2.8%, and the method of the present invention further reduced the error to only 0.5%. Under low temperature (-10°C) conditions, the original error was 4.1%, the traditional method reduced it to 3.2%, and the method of the present invention controlled the error to 0.6%.

[0077] When the humidity is above 90%, the original error of the meter reaches 5.2%, while the traditional method can only reduce it to 4.5%. In contrast, the method of the present invention effectively compresses the error to 0.7%. Under low humidity (below 20%) conditions, the original error is 2.9%, while the traditional method reduces it to 2.4%, and the method of the present invention reduces the error to 0.4%. Faced with the challenge of voltage fluctuation (±10%), the original error is 3.8%, while the traditional method reduces it to 3.0%, and the method of the present invention reduces the error to 0.6%. Under electromagnetic interference environment, the original error is as high as 6.5%, while the traditional method can only reduce it to 5.4%, while the method of the present invention significantly reduces the error to 1.0%. Finally, under the condition of rapid changes in grid load, the original error is 4.3%, while the traditional method reduces it to 3.5%, and the method of the present invention further reduces the error to 0.8%.

[0078] These data show that the adaptive error compensation method of the present invention has excellent error reduction capabilities under various extreme and changing environmental conditions, far exceeding the effect of traditional error compensation methods. This not only proves the effectiveness of the present invention in error prediction and compensation, but also highlights its adaptability and robustness under changing environmental conditions.

[0079] The present invention effectively solves the measurement error problem of electric meters under complex environmental conditions by combining the ridge regression algorithm with the particle swarm optimization (PSO) algorithm, and significantly improves the accuracy and reliability of electric energy measurement. Traditional error compensation methods mostly rely on static calibration and simple error adjustment, which cannot adapt to the dynamic changes of environmental factors, resulting in limited error compensation effects under extreme or rapidly changing environmental conditions. The method of the present invention can dynamically predict and compensate for measurement errors in real time by collecting environmental data in real time and combining advanced signal processing and optimization algorithms, thereby realizing adaptive error compensation for electric meter measurement.

[0080] First, the Kalman filter is used to denoise the real-time collected data to ensure the high accuracy and stability of the data, providing a reliable basis for the construction of the error model. Through the calculation of the correlation coefficient, the environmental characteristics that are highly correlated with the measurement error, such as the temperature change rate and the voltage fluctuation amplitude, are accurately identified, making the error model more in line with the actual situation. The ridge regression algorithm is used to build the error prediction model, and the particle swarm optimization algorithm is used to automatically adjust the regularization parameter λ to further optimize the prediction accuracy of the model. This combined method not only improves the generalization ability of the model and avoids overfitting, but also effectively avoids the problem of falling into the local optimal solution through the global search capability of the PSO algorithm.

[0081] The experimental data clearly demonstrates the significant advantages of the method of the present invention. Under all test environmental conditions, the method of the present invention can reduce the measurement error of the meter to near zero, while the compensation effect of the traditional method is limited in a high-error environment and cannot meet the needs of high-precision measurement. This result proves the innovation and practicality of the present invention in the field of error compensation, especially when dealing with complex and changing environmental conditions, showing unparalleled superiority over traditional methods.

[0082] In addition, the method of the present invention not only improves the measurement accuracy, but also realizes the adaptive control of the meter through real-time correction and parameter adjustment, and enhances the real-time response capability and stability of the system. Combined with the minimum mean square error (LMS) filtering algorithm, the accuracy and consistency of the measurement data are further optimized, ensuring the reliable operation of the system in various dynamic environments. Through the continuous optimization of the ridge regression parameters by the particle swarm optimization algorithm, the system has the ability of self-learning and adaptation, and can continuously improve the compensation effect as the environmental conditions change, extending the service life of the meter and reducing the maintenance cost.

[0083] In summary, the meter adaptive error compensation method of the present invention significantly improves the measurement accuracy and system reliability of the meter under different environmental conditions through advanced algorithms and comprehensive data processing, overcomes the limitations of traditional methods in dynamic environments, and has significant technical innovation and broad application prospects.

[0084] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for adaptive error compensation of an electric meter, characterized in that: include: Calibrate the meter, collect baseline data under different environmental conditions, and record the measurement error; Collect environmental data and meter data in real time through the meter and extract key features; Build an error model to predict the error of current meter data; Perform real-time correction and parameter adjustment based on the prediction error, and output the corrected measurement data.

2. The method for adaptive error compensation of an electric meter according to claim 1, characterized in that: Collecting baseline data under different environmental conditions includes collecting meter data and environmental data in a 45°C environment through the meter and environmental sensors; collecting meter data and environmental data in a -10°C environment through the meter and environmental sensors; collecting meter data and environmental data in an environment with a humidity of more than 90% through the meter and environmental sensors; collecting meter data and environmental data in an environment with a humidity of less than 20% through the meter and environmental sensors; collecting meter data and environmental data under a voltage fluctuation range of ±10% through the meter and environmental sensors; collecting meter data and environmental data under electromagnetic interference conditions through the meter and environmental sensors; collecting meter data and environmental data under conditions of rapid changes in grid load through the meter and environmental sensors; The electric meter data includes voltage, current and power; The environmental data includes temperature and humidity; Integrate meter data and environmental data under different environmental conditions into one data set; Mark the environmental conditions corresponding to each data point and calculate the measurement error of the meter under different environmental conditions.

3. The method for adaptive error compensation of an electric meter as claimed in claim 2, characterized in that: Extracting key features includes denoising the real-time collected environmental data and meter data through a Kalman filter. The formula is: ; in, Indicates time The state estimate of represents the Kalman gain, represents the actual measured value, is the measurement matrix, is the meter measurement error increment, Indicates time state estimation; Use the Network Time Protocol (NTP) to accurately time-stamp the environmental data and meter data collected in real time; Define a 1-second time window within which to pair the environmental data with the meter data.

4. The method for adaptive error compensation of an electric meter as claimed in claim 3, characterized in that: Extracting key features also includes identifying environmental features that are highly correlated with meter measurement errors through correlation coefficient calculation, which is expressed as: ; in, Indicates the correlation coefficient between environmental data and meter measurement error Indicates the first values, Indicates the first values, represents the mean of environmental data, represents the mean value of the meter measurement data, Indicates the number of data in the time window; The value range of is [-1,1]; when When , it means that the environmental data is completely positively correlated with the meter measurement error. when When , it means that the environmental data is completely negatively correlated with the meter measurement error; when , it means that there is no linear correlation between the environmental data and the meter measurement error.

5. The method for adaptive error compensation of an electric meter as claimed in claim 4, characterized in that: The error model is constructed by constructing a feature matrix using the environmental features that are highly correlated with the meter measurement error and inputting the real-time measured meter data into a prediction model constructed by a ridge regression algorithm. The formula is expressed as follows: ; in, represents the regression coefficient; Indicates the measurement data of the electric meter. represents the feature matrix extracted from the environmental data, is the regularization parameter for ridge regression.

6. The method for adaptive error compensation of an electric meter as claimed in claim 5, characterized in that: Building the error model also includes randomly generating 50 particles, and the current position of each particle represents the parameter in the prediction model. value; The velocity of each particle represents the speed of change of the particle in the parameter space; For each particle Value, solve the regression coefficient through ridge regression , using the current particle's The value is used as the regularization parameter and the ridge regression algorithm is applied to the training data set. and The training model is expressed as: ; ; in, Indicates the measurement data of the electric meter. represents the feature matrix extracted from the environmental data, represents the regularization parameter of the current particle, represents the regression coefficient; represents the feature matrix of the validation set, represents the predicted target variable value; Represents the candidate value of the regularization parameter of the current particle in particle swarm optimization; Calculate the corresponding mean square error as the fitness function value of the particle. The formula is expressed as: ; in, Indicates the validation set The actual measured value of samples, Indicates the validation set The predicted value of samples, Indicates the number of samples in the validation set.

7. The method for adaptive error compensation of an electric meter as claimed in claim 6, characterized in that: The error model construction also includes updating the historical best position of the particle when the fitness value of the current particle is lower than the historical best fitness value; When the fitness value of the current particle is lower than the global optimal fitness, update the global optimal position; The speed update formula is expressed as: ; in, It is a particle In time speed, is the inertia weight, Indicates the tendency of controlling particles to move toward the historical optimal position, Indicates the tendency of controlling particles to move toward the global optimal position; is a random number between [0,1]; It is a particle The best in history value, represents the global optimal position of the particle swarm; The particle's current position update formula is: ; in, Represents particles In time The current position ; When the fitness value of the particle group does not change much in multiple iterations and the velocity variance is less than the preset threshold, it is converged; When the particle group is too convergent, reinitialize some particles value to increase group diversity and avoid falling into local optimality; When the maximum number of iterations reaches 110, the optimization is stopped; When the fitness value changes less than the preset threshold, the optimization is stopped; Output the global best position corresponding to value.

8. An electric meter adaptive error compensation system using the method according to any one of claims 1 to 7, characterized in that: The meter calibration module with adaptive error compensation performs factory and field calibration on the meter to ensure the accuracy of the meter and its measuring unit; The meter adaptive error compensation baseline data acquisition module collects data from the meter and environmental sensors under different environmental conditions, records and analyzes the meter's measurement errors, and establishes the relationship between environmental factors and errors; Real-time data acquisition module, which collects meter data and environmental data in real time for error prediction and compensation; The data preprocessing module removes noise, filters and synchronizes the collected environmental data and electric meter data to ensure data quality and consistency; The feature extraction module extracts features related to meter measurement errors from real-time data and identifies key features through methods such as Kalman filtering or correlation analysis; The error prediction module builds an error prediction model based on environmental data and meter data, adopts the ridge regression algorithm, and optimizes the regularization parameters in the model through the particle swarm optimization algorithm; The error compensation and correction module corrects the meter's measurement data in real time or adjusts the meter's internal parameters for compensation based on the error prediction result, and outputs the corrected measurement data; The adaptive optimization module uses the particle swarm optimization algorithm to optimize the parameters in the error compensation process, improve the compensation effect, and adjust the diversity of the particle swarm when the particle swarm converges to avoid local optimal solutions; The data output and recording module outputs the corrected measurement data through the communication interface and records the environmental data, measurement data and error compensation results to support subsequent analysis and system optimization.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the electric meter adaptive error compensation method described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the electric meter adaptive error compensation method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Large-data-based error analysis method for metering equipment

    CN106443557A

  • Hollow coil current transformer error compensation method based on elastic network

    CN112014785A

  • Electric energy meter metering error analysis method based on self-adaptive contraction ridge regression

    CN112180316A

  • Electric energy meter metering error prediction method, system and device based on multi-stress influence

    CN113447879A

  • Electricity meter error correlation factor analysis method and system based on'pearson correlation coefficient '

    CN114692061A

Cited By

  • Data processing method of self-contained temperature-salinity-depth instrument without dismounting bin

    CN120449071A

  • Data processing method for a self-contained temperature, salt and depth instrument without disassembly chamber

    CN120449071B

  • Electric energy metering method, system and device and storage medium

    CN120577587A

  • Self-adaptive electric energy metering algorithm and system based on dynamic environment compensation

    CN120804748A

  • An adaptive electric energy metering algorithm and system based on dynamic environment compensation

    CN120804748B