Self-adaptive error correction method for dynamic electric energy metering
By constructing an adaptive error prediction model and hardware acceleration technology, combined with digital signatures and blockchain notarization, the error correction problem of electricity metering devices in complex environments has been solved, achieving high-precision, real-time error correction and secure transmission, thus improving the robust operation of the electricity market.
Patent Information
- Application Number
- CN202511477025.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-01-16
AI Technical Summary
In complex and ever-changing power field environments, existing power metering devices are subject to the gradual amplification or dynamic introduction of error sources, leading to metering deviations that affect the fairness and robust operation of the power market. Existing correction methods are insufficient in terms of accuracy, timeliness, reliability, convenience, and security.
An adaptive error prediction model is constructed. By acquiring historical operating data for preprocessing and labeling, and combining a feature extraction layer, an adaptive fusion layer, and a prediction output layer, hardware acceleration technology is used for real-time error prediction and correction. Digital signatures, blockchain notarization, and quantum key encryption are employed to achieve secure end-to-end transmission and correction.
It achieves high-precision, real-time error correction, improves the accuracy, timeliness, reliability and security of measurement, reduces operation and maintenance costs, adapts to equipment aging and environmental changes, and builds a reliable calibration solution for the entire chain.
Smart Images

Figure CN121348210A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interdisciplinary technology of artificial intelligence and power metering, and in particular to an adaptive error correction method for dynamic power metering. Background Technology
[0003] In recent years, driven by the comprehensive construction of smart grids and the deepening of power market reforms, the demand for electricity metering devices for dedicated lines and transformers participating in power market transactions has exploded. These devices are deployed on a large scale, widely distributed geographically, and operate in complex and ever-changing power field environments, often exposed to extreme conditions such as high temperature, low temperature, high humidity, strong electromagnetic interference, dust, and vibration. Furthermore, due to the wide range of their operational lifespan—from newly installed equipment to equipment exceeding its service life—their internal key components inevitably age, experience parameter drift, and even sudden failures over time.
[0004] The harshness and diversity of the environment in which the equipment operates, coupled with the effects of long-term operation, together lead to a severe technical challenge: during continuous electricity metering, various error sources are gradually amplified or dynamically introduced, ultimately forming systematic metering deviations. These errors include systematic errors caused by limitations in sampling accuracy, insufficient A / D conversion resolution, and inherent algorithmic defects, as well as random errors caused by sudden increases in electromagnetic interference, abrupt changes in temperature and humidity, instantaneous component failures, or gradual parameter drift. In the context of electricity market transactions, even minor metering deviations, after accumulating and amplifying over time, will significantly distort the fairness of trade settlements, leading to an imbalance of interests between electricity buyers and sellers, and subsequently inducing metering disputes and transaction conflicts, seriously threatening the sound operation of the electricity market and the foundation of the credit system. To address the problem of electricity metering errors, the following correction methods are currently the primary reliance: 1. Periodic manual on-site calibration and verification: According to the verification procedures, professional personnel are dispatched with standard equipment to perform offline testing and calibration on a regular basis. While this method can partially correct foreseeable systematic errors, it has inherent limitations: 1.1 Limitations in accuracy: The calibration results only characterize the instantaneous state of the verification and cannot capture error drift or real-time fluctuations caused by sudden disturbances (such as lightning strikes or inrush currents), gradual aging of components, and dynamic changes in the environment during the calibration cycle. It is difficult to guarantee the long-term continuous accuracy of the measurement results.
[0005] 1.2 Lack of Timeliness: Fixed-cycle calibration suffers from severe lag. When the error increases significantly between two calibrations or an anomaly occurs, the device is still operating with a "faulty" state, and the accumulated error has already caused substantial losses. Equipment operating under harsh conditions or nearing the end of its service life has a higher risk of sudden error changes, and traditional cycle modes cannot achieve real-time or near-real-time error capture.
[0006] 1.3 Reliability risks: On-site calibration relies on the standardization and experience of manual operation, which may lead to human risks such as wiring errors and parameter setting mistakes; portable standard devices are easily affected by bumps and temperature changes during transportation, which may cause them to become inaccurate, and it is difficult to effectively verify their working status on-site, introducing additional traceability uncertainties.
[0007] 1.4 Low Convenience: Requires significant manpower, long-distance travel, and cumbersome on-site operations (opening cabinets, disconnecting cables, and shutting down equipment), resulting in high costs and disruption to users' normal power supply. Faced with a massive number of dispersed metering points, this method suffers from fundamental bottlenecks in coverage and execution efficiency.
[0008] 2. Remote verification based on fixed periods or events: This method utilizes wireless communication modules for data acquisition or to trigger simple self-tests. Its limitations include: 2.1 Insufficient Accuracy: Existing remote diagnostics largely rely on pre-set simple models (such as power curve rationality checks, over-limit alarms, and load change detection), lacking the ability to deeply, multi-dimensionally, and with high precision trace the source of errors (current transformer ratio difference, angle difference, metering chip misalignment, ADC nonlinearity, etc.). Model mismatch with actual complex operating conditions is common, making it difficult to accurately quantify error values and even more impossible to achieve targeted compensation.
[0009] 2.2 Timeliness and reliability deficiencies: Error response relies on fixed communication time slots or single event thresholds (such as power freezing), which cannot support high-frequency on-demand monitoring; under complex operating conditions (communication delay, network congestion), the transmission of abnormal information is blocked, resulting in processing delays; the stability, anti-interference ability and security of the communication link constitute a single vulnerable point in the reliable operation of the system.
[0010] 2.3 Lack of correction capability: Most solutions only provide alarms or status indications and lack the ability to remotely or locally automatically perform parameter adjustments. After the error is confirmed, manual intervention is still required to complete the correction.
[0011] 3. Static Correction Coefficient Method: This method involves pre-setting a fixed error correction coefficient library for a specific equipment model and compensating during data acquisition or subsequent calculations. Its core limitation is: 3.1 Weak accuracy assurance: Static coefficients cannot adapt to individual equipment differences, dynamic environmental changes, and continuous aging processes. They are a "one-size-fits-all" compensation. When operating conditions deviate from the preset reference environment, the correction effect is drastically reduced or even reversed.
[0012] Furthermore, existing technical approaches have systemic security vulnerabilities. Whether it is on-site calibration or remote verification, both involve reading and writing critical metrological parameters. Traditional methods have loopholes in communication encryption strength, remote command authentication, parameter protection mechanisms, and version security management. This allows attackers to potentially tamper with parameters, implant backdoors, or forge data through remote penetration or physical contact, directly jeopardizing the integrity, confidentiality, and non-repudiation of metrological data.
[0013] In summary, existing power metering error correction methods generally suffer from five major defects: a) Accuracy defects: Insufficient response to dynamic environments and equipment drift, lacking high-precision real-time error tracing and fine compensation mechanisms; b) Timeliness defects: Relying on fixed periods or manual intervention, making it difficult to capture transient errors in a timely manner; c) Reliability defects: Inconsistent manual operation standards, fragile communication links, and questionable reliability of the calibration process itself; d) Convenience defects: Cumbersome on-site operation, high costs, interference with users, and poor maintainability for large-scale deployment; e) Security defects: Weak parameter protection, facing risks of data tampering and unauthorized access.
[0014] Therefore, how to provide an adaptive error correction method for dynamic energy metering to improve the accuracy, timeliness, reliability, convenience, and security of energy metering error correction has become an urgent technical problem to be solved. Summary of the Invention
[0015] The technical problem to be solved by the present invention is to provide an adaptive error correction method for dynamic energy metering, thereby improving the accuracy, timeliness, reliability, convenience and security of energy metering error correction.
[0016] This invention is implemented as follows: an adaptive error correction method for dynamic energy metering, comprising the following steps: Step S1: Obtain a large amount of historical operating data from electricity metering devices, preprocess and label the historical operating data to construct a dataset; Step S2: Create an adaptive error prediction model based on the feature extraction layer, adaptive fusion layer, and prediction output layer, and set the loss function of the adaptive error prediction model; Step S3: Divide the dataset into a training set, a validation set, and a test set. Train the adaptive error prediction model using the training set and the loss function. Validate the trained adaptive error prediction model using the validation set. Test the validated adaptive error prediction model using the test set. Step S4: After compressing and verifying the performance of the tested adaptive error prediction model, deploy it to the electricity metering device and perform drift compensation training on the adaptive error prediction model deployed on the electricity metering device. Step S5: The electricity metering device collects real-time operating data, preprocesses the real-time operating data, and inputs it into the deployed adaptive error prediction model. The adaptive error prediction model performs inference based on hardware acceleration technology and dynamically outputs real-time error prediction results. Based on the real-time error prediction results, adaptive error correction is performed to obtain the corrected metering value. Step S6: The power metering device digitally signs and encrypts the real-time error prediction result and the corrected metering value to obtain a metering data packet, and after storing it on the blockchain, transmits the metering data packet to the server. Step S7: The server decrypts and verifies the received metering data packet to obtain the error prediction result and the corrected metering value, encrypts and stores the corrected metering value, and triggers the retraining of the adaptive error prediction model based on the error prediction result.
[0017] Furthermore, step S1 specifically includes: Acquire a large amount of historical operating data from electricity metering devices installed in different environments and with different service durations. The historical operating data includes metering data, environmental condition data, error correlation characteristic data, equipment status data, and equipment identification data. The historical operational data undergoes preprocessing including data cleaning, data integration, data transformation, and data dimensionality reduction. Data cleaning includes handling missing values, outlier handling, and data consistency checks. Data integration includes time alignment and data merging. Data transformation includes data normalization, feature extraction, and feature transformation. The dataset is constructed by annotating each of the preprocessed historical running data with at least the actual error.
[0018] Furthermore, the metering data includes at least voltage, current, power, and energy values; the environmental condition data includes at least physical environment parameters and electromagnetic environment parameters; the physical environment parameters include at least temperature, humidity, dust concentration, and vibration intensity; the electromagnetic environment parameters include at least power frequency magnetic field strength and high-frequency interference spectrum; the error correlation characteristic data includes at least load characteristic data and time correlation data; the load characteristic data includes at least load rate, power factor change curve, and harmonic content; the time correlation data includes at least seasonal cycle markers and intraday time period tags; the equipment status data includes at least lifespan indicators, key component parameters, and abnormal event markers; and the equipment identification data includes at least device ID, production batch number, component model, and software version number.
[0019] Furthermore, in step S2, the feature extraction layer is constructed based on the metering data processing module, the environmental condition data processing module, the error correlation feature data processing module, the equipment status data processing module, and the equipment identity data processing module; The metering data processing module is used to extract metering features from the metering data through a long short-term memory unit and a first fully connected layer; The environmental condition data processing module is used to extract environmental features from environmental condition data through a multilayer sensor. The error correlation feature data processing module is constructed based on the load characteristic submodule and the time correlation submodule; the load characteristic submodule is used to extract load pattern features from the error correlation feature data through a convolutional neural network; the time correlation submodule is used to extract time context features from the error correlation feature data through a first embedding layer and a second fully connected layer. The device status data processing module is used to extract device status features from device status data through the third fully connected layer; The device identity data processing module is used to extract identity features from device identity data through the second embedding layer and the fourth fully connected layer; The adaptive fusion layer is used to adaptively fuse metering features, environmental features, load pattern features, time context features, device status features, and identity features through a multi-head attention unit and a fifth fully connected layer to obtain a comprehensive feature representation. The prediction output layer is used to output the error prediction result based on the comprehensive feature representation through the sixth fully connected layer and the regression output unit; The loss function used is the mean squared error loss function.
[0020] Furthermore, step S3 specifically includes: Based on the time series partitioning method, the dataset is divided into a training set, a validation set, and a test set in an 8:1:1 ratio. The adaptive error prediction model is trained using the training set and a loss function. During training, the hyperparameters of the adaptive error prediction model, including at least the learning rate, batch size, network depth, and network width, are continuously optimized using Bayesian optimization until the loss value of the loss function is less than a preset loss threshold. The prediction accuracy is calculated using the validation set to validate the trained adaptive error prediction model, and the confidence score is calculated using the test set to test the validated adaptive error prediction model.
[0021] Furthermore, step S4 specifically includes: The tested adaptive error prediction model is compressed using quantization and dynamic pruning techniques. The root mean square error, mean absolute error, mean absolute percentage error, Pearson correlation coefficient, coefficient of determination, and F1 score of the compressed adaptive error prediction model are calculated for performance verification. After the performance verification is passed, the adaptive error prediction model is deployed to the electricity metering device using containerization technology, and actual operating data is collected to perform drift compensation training on the adaptive error prediction model deployed on the electricity metering device.
[0022] Furthermore, step S5 specifically includes: The electricity metering device collects real-time operating data, including metering data, environmental condition data, error correlation feature data, equipment status data, and equipment identification data. After preprocessing the real-time operating data by calling the Kalman filter algorithm through a streaming engine, the data is input into a deployed adaptive error prediction model. The adaptive error prediction model performs inference based on hardware acceleration technology and dynamically outputs error prediction results in real time. Based on the error prediction results, the metering data in the real-time operating data is compensated to perform adaptive error correction and obtain the corrected metering value.
[0023] Furthermore, step S6 specifically includes: The electricity metering device concatenates the real-time error prediction result and the corrected metering value into first concatenated data. It then digitally signs the first concatenated data using a preset private key to obtain a signature value, acquires the current timestamp, and concatenates the first concatenated data and the timestamp into second concatenated data. The device calculates the hash value of the second concatenated data using the SHA-256 algorithm, uploads the hash value to the blockchain for notarization, and acquires the quantum key issued by the server through a secondary communication channel based on quantum communication. It then encrypts the first concatenated data, the signature value, and the timestamp into a metering data packet using the quantum key, and transmits the metering data packet to the server through the main communication channel.
[0024] Furthermore, the private key is generated based on the DCDSA algorithm, and the public key matching the private key is pre-set on the server; the quantum key is generated based on a quantum key distribution device; the main communication channel and the secondary communication channel are two independent channels, and both the main communication channel and the secondary communication channel adopt encrypted communication.
[0025] Furthermore, step S7 specifically includes: The server receives the metering data packets in real time, decrypts the metering data packets using the generated quantum key to obtain the first concatenated data, the signature value, and the timestamp, concatenates the first concatenated data and the timestamp to form the second concatenated data, verifies the integrity of the second concatenated data using the hash value of the blockchain notarization, verifies the timeliness using the timestamp, verifies the signature value using the preset public key, and then parses the first concatenated data to obtain the error prediction result and the corrected metering value. The calibration measurement value is encrypted and stored using the SM9 algorithm. The mean error of the error prediction result of each power metering device is calculated. When the mean error is greater than the preset error, a retraining command is sent to each power metering device. Each electricity metering device constructs an incremental dataset based on the received retraining instruction, the real-time operating data, and the acquired error feedback. The deployed adaptive error prediction model is then iteratively optimized by calling the incremental dataset through a federated learning mechanism.
[0026] The advantages of this invention are: 1. A dataset is constructed by acquiring a large amount of historical operating data from electricity metering devices. An adaptive error prediction model is created based on a feature extraction layer, an adaptive fusion layer, and a prediction output layer, and a loss function is set for the adaptive error prediction model. The dataset is then divided into training, validation, and test sets. The adaptive error prediction model is trained using the training set and the loss function. The trained adaptive error prediction model is validated using the validation set. The validated adaptive error prediction model is tested using the test set. After compression and performance verification, the tested adaptive error prediction model is deployed to the electricity metering device, and drift compensation training is performed on the deployed adaptive error prediction model. Next, the electricity metering device collects real-time operating data. After preprocessing the real-time operating data, it is input into the deployed adaptive error prediction model. The adaptive error prediction model performs inference based on hardware acceleration technology, dynamically outputting real-time error prediction results. Adaptive error correction is performed based on the real-time error prediction results to obtain the corrected metering value. The error prediction results and corrected metering values are digitally signed and encrypted to obtain metering data packets. After being stored on the blockchain, the metering data packets are transmitted to the server. The received metering data packets are decrypted and verified to obtain the error prediction results and corrected metering values. The corrected metering values are encrypted and stored. Based on the error prediction results, the adaptive error prediction model is retrained. That is, by deploying an AI-based adaptive error prediction model to the electricity metering device, combined with hardware acceleration, millisecond-level real-time error prediction and dynamic correction are achieved, accurately quantifying and compensating for complex errors caused by environmental changes, component aging, etc. The model drift compensation training and server-triggered retraining mechanism continuously adapt to changes in equipment parameters, ensuring long-term accuracy. The closed-loop automated processing at the edge eliminates manual on-site intervention, greatly improving operation and maintenance efficiency. At the same time, digital signatures, encrypted transmission, and blockchain storage are used to build an end-to-end secure trust chain to ensure data integrity and non-repudiation of operations, ultimately greatly improving the accuracy, timeliness, reliability, convenience, and security of electricity metering error correction.
[0027] 2. By dynamically outputting real-time error prediction results through an adaptive error prediction model and using hardware acceleration technology for inference, it can quickly respond to changes in real-time operating data. Combined with a feature extraction layer and an adaptive fusion layer, the adaptive error prediction model can efficiently process complex data features, reduce the accumulated error in traditional methods, thereby improving the accuracy of electricity metering (such as errors caused by current and voltage fluctuations), achieving the effect of dynamic correction, and is suitable for high-frequency changing power grid environments.
[0028] 3. By compressing and verifying the performance of the adaptive error prediction model before deployment, the problem of computational resource limitations in embedded devices (such as power metering devices) is solved. At the same time, drift compensation training adapts to device aging or environmental changes, maintaining long-term accuracy, which can effectively reduce deployment costs (such as reducing hardware upgrade needs), extend device life, and improve system maintenance efficiency.
[0029] 4. By constructing an adaptive error prediction model and embedding it into the power metering device, combined with hardware acceleration, high-precision real-time dynamic error correction is achieved, significantly improving metering accuracy and timeliness. The compression optimization, drift compensation training, and server-triggered closed-loop retraining mechanism of the adaptive error prediction model ensure its efficient operation in resource-constrained equipment while continuously adapting to environmental changes and equipment aging, greatly reducing operation and maintenance costs. The combination of data encryption, digital signature, and blockchain notarization ensures the tamper-proof, traceability, and audit reliability of metering results, providing a reliable adaptive correction solution for the entire chain of smart grids, effectively breaking through the limitations of traditional static calibration.
[0030] 5. By acquiring a large amount of historical operating data from electricity metering devices installed in different environments and with different service durations, the collected data covers a "large amount" of historical data from electricity metering devices in "different environments" (physical environment, electromagnetic environment) and with "different service durations," ensuring the diversity and representativeness of the sample. This broad coverage helps to establish an adaptive error prediction model applicable to various actual operating conditions, significantly improving the generalization ability and adaptability of the adaptive error prediction model.
[0031] 6. By collecting extremely detailed data types (metering data, environmental condition data, error correlation characteristic data, equipment status data, and equipment identification data), and further refining specific parameters (such as: physical environmental parameters such as temperature, humidity, and vibration; electromagnetic environmental parameters such as power frequency magnetic field strength and high-frequency interference spectrum; load characteristic data such as load rate, power factor change curve, and harmonic content; and time correlation data), this in-depth data acquisition can capture various complex and dynamic internal and external factors (environmental interference, load changes, aging degree, etc.) that lead to power metering errors, laying a solid data foundation for subsequent accurate modeling.
[0032] 7. Through systematic and professional preprocessing of historical operational data, including data cleaning (missing values, outliers, consistency), data integration (time alignment, merging), data transformation (normalization, feature extraction / conversion), and data dimensionality reduction, data cleaning and integration effectively solve common data problems in actual power systems (missing data, noise, inconsistent timestamps, etc.), ensuring the reliability, integrity, and consistency of the data. Data transformation (especially normalization and feature extraction / conversion) transforms data of different dimensions and scales to a unified scale, facilitating model processing and extracting more effective features from the original data, thus improving model efficiency. Data dimensionality reduction reduces data dimensionality while minimizing information loss, reducing the computational complexity of subsequent models, improving training efficiency, and helping to eliminate redundant or noisy features.
[0033] 8. By explicitly requiring that historical running data be labeled with "at least the actual error" after data preprocessing, this labeling directly provides a supervision signal (label) for model learning, making the constructed dataset usable for training and evaluating the adaptive error prediction model, and making the learning objective of the adaptive error prediction model clear and explicit.
[0034] 9. By linking the collected operational data (especially equipment identification data such as production batch number, component model, software version number, and equipment status data such as key component parameters and abnormal event markers) with error labels, it becomes easier to trace the specific cause of the error (design defects, component aging, software vulnerabilities, etc.) when analyzing model results (e.g., identifying certain batches, specific components, or software versions with high error rates). This provides a basis for subsequent product improvement, precise maintenance, and risk warning.
[0035] 10. By systematically collecting diverse operational data from electricity metering devices covering different environmental conditions and service years, and deeply integrating high-dimensional features (including dynamic metering parameters, physical / electromagnetic environmental factors, load characteristics, time-related markers, equipment status, and identification), a high-quality labeled dataset is constructed through professional cleaning, alignment, transformation, and dimensionality reduction preprocessing. This lays a solid foundation for the adaptive error prediction model. Its core advantages lie in its ability to accurately capture the error evolution patterns under complex operating conditions, support individualized equipment status tracking, enhance the model's robustness to aging effects and environmental interference, and empower AI-based dynamic correction algorithms to achieve high-precision and highly adaptive electricity metering compensation.
[0036] 11. By setting up a feature extraction layer containing multiple dedicated modules (processing modules for measurement data, environmental condition data, error correlation feature data, equipment status data, and equipment identity data) to process different types of data respectively, comprehensive data coverage is ensured. For example, LSTM is used to process time series measurement data (capturing dynamic changes), multilayer perceptron is used to process environmental condition data (modeling nonlinear relationships), CNN is used to extract load pattern features (identifying complex patterns), and the embedding layer is used to process category data (such as equipment identity). This modular division of labor optimizes the feature extraction process, avoids information loss, significantly improves the accuracy and completeness of feature representation, and thus reduces the overall measurement error.
[0037] 12. By employing various AI technologies (such as LSTM, CNN, multilayer perceptron and embedding layer), customized processing is carried out for different data types. For example, LSTM unit effectively captures the time dependence of measurement data, CNN extracts local pattern features in the load characteristic submodule, and multi-head attention mechanism realizes adaptive fusion. The combination of these technologies makes error prediction more accurate and meets the industry needs of high-precision dynamic measurement.
[0038] 13. Through the adaptive fusion layer (based on multi-head attention units and fully connected layers), different features (such as metering features, environmental features, load pattern features, etc.) can be dynamically weighted and fused. The weights are adaptively adjusted according to real-time data, which improves the robustness to variable operating conditions (such as temperature changes and load fluctuations) and maintains stable performance in complex environments (such as peak grid load). The multi-head attention mechanism is particularly innovative because it processes features in parallel, reduces computational overhead, and improves the model's generalization ability and fault tolerance.
[0039] 14. By setting up a multi-level abstract structure for the feature extraction layer: a) Bottom layer: CNN captures local spatial patterns of load data (such as sudden current changes); b) Middle layer: LSTM models long-term dependencies of measurement data (such as electricity consumption trends); c) High layer: Multi-head attention dynamically fuses cross-domain features. This multi-level abstract structure forms a "local → global" feature pyramid, making the model more robust to noise and local perturbations, and its generalization ability far exceeds that of a single model.
[0040] 15. By integrating multi-source heterogeneous data (metering, environment, load, equipment status, and identity information) through modular design, and utilizing advanced AI technologies (such as LSTM to capture time-series dynamics, CNN to extract load patterns, and embedding layers to process discrete features) to achieve high-precision feature extraction, a multi-head attention mechanism is innovatively introduced to adaptively fuse multi-dimensional features and dynamically optimize weight allocation, thereby significantly improving the accuracy and robustness of dynamic energy metering error correction. At the same time, by combining a lightweight architecture (parallel processing and embedding dimensionality reduction) and domain knowledge embedding (such as a physics-driven error correlation feature data processing module), while ensuring real-time response capabilities, the system enhances adaptability and scalability to complex operating conditions, ultimately achieving the goal of high-efficiency, low-error intelligent metering, combining technological advancement with engineering practical value.
[0041] 16. By employing Bayesian optimization to automatically optimize hyperparameters such as learning rate, batch size, network depth, and network width, the time-consuming process of traditional manual parameter tuning is avoided. This method uses a probabilistic model to guide the search for the optimal parameter combination and quickly converges to a state where the loss value is below a preset threshold, thereby saving computing resources and time and effectively improving the efficiency of industrial deployment.
[0042] 17. During the training of the adaptive error prediction model, a loss threshold is set as the stopping condition (the loss value is lower than the loss threshold). This forces the adaptive error prediction model to reach a predefined accuracy, avoiding underfitting or premature stopping, and ensuring the output stability of the adaptive error prediction model. In particular, when predicting errors, it can reduce the model error rate and improve the overall prediction accuracy.
[0043] 18. By processing the dataset using a time series partitioning method (8:1:1 ratio), the temporal characteristics of the data are preserved, future information leakage is avoided, and the model's generalization ability on real-world time series data (such as sensor data or stock market data) is improved. At the same time, the validation set is used to calculate the prediction accuracy to test the model's performance, and the test set is used to calculate the confidence score to evaluate the model's stability in practical applications, providing multi-level reliability assurance and reducing the risk of overfitting.
[0044] 19. By strictly preserving data causality through time series partitioning (8:1:1), and combining Bayesian optimization to dynamically adjust core hyperparameters such as learning rate, batch size, network depth and width, the model significantly improves accuracy and generalization ability while ensuring efficient training convergence (loss value pre-threshold control). Its unique dual-stage verification-testing mechanism (prediction accuracy → confidence assessment) constructs a complete quality assurance chain, which not only achieves quantitative control of model reliability (such as 95% confidence interval) but also avoids overfitting risk, ultimately forming an industrial-grade prediction solution that balances automation, resource efficiency and cross-scenario adaptability.
[0045] 20. By integrating quantization and dynamic pruning techniques, the adaptive error prediction model is efficiently compressed, significantly reducing model size and computational resource consumption, thus achieving efficient resource utilization. Subsequently, multi-index performance verification (including root mean square error, mean absolute error, mean absolute percentage error, Pearson correlation coefficient, coefficient of determination, and F1 score) is used to ensure the accuracy and robustness of the compressed model. Containerized deployment enhances portability and maintainability, enabling seamless integration of the model into electricity metering devices. Drift compensation training is used to continuously optimize the model to maintain long-term adaptability and stability, ultimately providing end-to-end deployment advantages in the field of electricity metering, characterized by high efficiency, energy saving, high precision, reliability, and continuous improvement.
[0046] 21. By collecting multi-dimensional real-time operational data (including environmental conditions, error characteristics, and equipment status), dynamic data preprocessing is achieved using a streaming engine and Kalman filter algorithm. Combined with a hardware-accelerated adaptive error prediction model, millisecond-level inference is performed, dynamically outputting high-precision error prediction results. Based on this, real-time compensation and closed-loop correction are performed on the metering data. Its core advantages lie in the deep integration of real-time data processing (streaming computing), high prediction accuracy (adaptive model and environmental parameter linkage), resource efficiency (hardware acceleration), and strong system robustness (dynamic self-correction mechanism), which significantly improves the accuracy of electricity metering, reduces manual maintenance costs, and supports lightweight deployment at the edge.
[0047] 22. The data security and reliability of dynamic energy metering are significantly improved through multi-level security mechanisms: the integrity and tamper-proof nature of data are guaranteed by digital signature (DCDSA algorithm) and blockchain notarization (SHA-256 hash value), ensuring the authenticity and traceability of metering results; absolute secure key management and data encryption are achieved through quantum key distribution (secondary communication channel) and dual-channel independent encrypted transmission (main communication channel), effectively resisting eavesdropping and man-in-the-middle attacks; at the same time, timestamp and signature mechanisms enhance non-repudiation and auditing efficiency, building a full-link trusted, attack-resistant protection system for energy metering error correction data that meets industrial regulatory requirements.
[0048] 23. By combining quantum key decryption and blockchain hash verification at the data receiving end (server), a dual security guarantee against tampering and attacks is constructed, while real-time control is achieved using timestamps. At the data processing end, SM9 encrypted storage and an automatic diagnostic mechanism based on the mean error are adopted to achieve accurate metering and proactive maintenance. In particular, distributed model iteration of the power metering device is achieved through federated learning, which not only protects user privacy but also improves the adaptive capability of the adaptive error prediction model. The overall solution forms a power metering solution that integrates high security, strong real-time performance, intelligent self-optimization, and privacy protection, significantly reducing operation and maintenance costs and meeting the reliable operation requirements of the smart grid.
[0049] 24. By constructing and continuously optimizing an AI model based on multi-source feature adaptive fusion, high-precision real-time error prediction and dynamic compensation were achieved, significantly improving metering accuracy and reliability. Model compression and hardware acceleration technologies ensured the efficiency and feasibility of real-time computation at the power metering device, while drift compensation and federated learning-based model retraining mechanisms ensured the system's long-term adaptability and stability. Simultaneously, by employing blockchain notarization, quantum key encryption, and multi-digital signature verification mechanisms, the integrity, immutability, and confidentiality of metering data were comprehensively guaranteed throughout the entire transmission and storage process. This resulted in a smart metering technology solution integrating high precision, strong adaptability, high execution efficiency, long-term stability, and data security, providing reliable technical support for smart grid construction. Attached Figure Description
[0050] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0051] Figure 1 This is a flowchart of an adaptive error correction method for dynamic energy metering according to the present invention. Detailed Implementation
[0052] The overall approach of the technical solution in this application is as follows: By deploying an AI-based adaptive error prediction model to the electricity metering device, combined with hardware acceleration, millisecond-level real-time error prediction and dynamic correction are achieved, accurately quantifying and compensating for complex errors caused by environmental changes, component aging, etc.; by utilizing model drift compensation training and server-triggered retraining mechanisms to continuously adapt to changes in equipment parameters, ensuring long-term accuracy; by eliminating manual on-site intervention through closed-loop automated processing at the edge, significantly improving operation and maintenance efficiency; and by employing digital signatures, encrypted transmission, and blockchain notarization to construct an end-to-end secure trust chain, ensuring data integrity and operational non-repudiation, thereby improving the accuracy, timeliness, reliability, convenience, and security of electricity metering error correction.
[0053] Please refer to Figure 1 As shown, a preferred embodiment of the adaptive error correction method for dynamic energy metering according to the present invention includes the following steps: Step S1: Obtain a large amount of historical operating data from electricity metering devices, preprocess and label the historical operating data to construct a dataset; Step S2: Create an adaptive error prediction model based on the feature extraction layer, adaptive fusion layer, and prediction output layer, and set the loss function of the adaptive error prediction model; Step S3: Divide the dataset into a training set, a validation set, and a test set. Train the adaptive error prediction model using the training set and the loss function. Validate the trained adaptive error prediction model using the validation set. Test the validated adaptive error prediction model using the test set. Step S4: After compressing and verifying the performance of the tested adaptive error prediction model, deploy it to the electricity metering device and perform drift compensation training on the adaptive error prediction model deployed on the electricity metering device. By compressing and verifying the performance of the adaptive error prediction model before deployment, the problem of computational resource limitations in embedded devices (such as power metering devices) is solved. At the same time, by training with drift compensation to adapt to device aging or environmental changes, long-term accuracy is maintained, which can effectively reduce deployment costs (such as reducing hardware upgrade needs), extend device life, and improve system maintenance efficiency.
[0054] Step S5: The electricity metering device collects real-time operating data, preprocesses the real-time operating data, and inputs it into the deployed adaptive error prediction model. The adaptive error prediction model performs inference based on hardware acceleration technology and dynamically outputs real-time error prediction results. Based on the real-time error prediction results, adaptive error correction is performed to obtain the corrected metering value. By dynamically outputting real-time error prediction results through an adaptive error prediction model and using hardware acceleration technology for inference, it can quickly respond to changes in real-time operating data. Combined with a feature extraction layer and an adaptive fusion layer, the adaptive error prediction model can efficiently process complex data features, reduce the accumulated errors in traditional methods, thereby improving the accuracy of electricity metering (such as errors caused by current and voltage fluctuations), achieving a dynamic correction effect, and is suitable for high-frequency changing power grid environments.
[0055] Step S6: The power metering device digitally signs and encrypts the real-time error prediction result and the corrected metering value to obtain a metering data packet, and after storing it on the blockchain, transmits the metering data packet to the server. Step S7: The server decrypts and verifies the received metering data packet to obtain the error prediction result and the corrected metering value, encrypts and stores the corrected metering value, and triggers the retraining of the adaptive error prediction model based on the error prediction result.
[0056] By constructing an adaptive error prediction model and embedding it into the power metering device, combined with hardware acceleration, high-precision real-time dynamic error correction is achieved, significantly improving metering accuracy and timeliness. The compression optimization, drift compensation training, and server-triggered closed-loop retraining mechanism of the adaptive error prediction model ensure its efficient operation in resource-constrained equipment while continuously adapting to environmental changes and equipment aging, greatly reducing operation and maintenance costs. The combination of data encryption, digital signatures, and blockchain notarization ensures the tamper-proof, traceability, and audit reliability of metering results, providing a reliable adaptive correction solution for the entire chain of smart grids, effectively breaking through the limitations of traditional static calibration.
[0057] Step S1 specifically involves: Acquire a large amount of historical operating data from electricity metering devices installed in different environments and with different service durations. The historical operating data includes metering data, environmental condition data, error correlation characteristic data, equipment status data, and equipment identification data. By acquiring a large amount of historical operating data from electricity metering devices installed in different environments and with different service durations, the collected data covers a "large amount" of historical data from electricity metering devices from "different environments" (physical environment, electromagnetic environment) and with "different service durations," ensuring the diversity and representativeness of the sample. This broad coverage helps to establish an adaptive error prediction model that is applicable to various actual operating conditions, significantly improving the generalization ability and adaptability of the adaptive error prediction model.
[0058] The historical operational data undergoes preprocessing including data cleaning, data integration, data transformation, and data dimensionality reduction. Data cleaning includes handling missing values, outlier handling, and data consistency checks. Data integration includes time alignment and data merging. Data transformation includes data normalization, feature extraction, and feature transformation. Principal component analysis is used for data dimensionality reduction. By performing systematic and professional preprocessing operations on historical operational data, including data cleaning (missing values, outliers, consistency), data integration (time alignment, merging), data transformation (normalization, feature extraction / conversion), and data dimensionality reduction, data cleaning and integration effectively solve common data problems in actual power systems (missing data, noise, inconsistent timestamps, etc.), ensuring the reliability, integrity, and consistency of the data. Data transformation (especially normalization and feature extraction / conversion) transforms data of different dimensions and scales to a unified scale, facilitating model processing and extracting more effective features from the original data, thereby improving model efficiency. Data dimensionality reduction reduces data dimensionality while minimizing information loss, reducing the computational complexity of subsequent models, improving training efficiency, and helping to eliminate redundant or noisy features.
[0059] Missing value handling involves statistically analyzing missing values across all data fields to determine the extent of the missing data: a) Metered data (voltage, current, power, energy values): If there are few missing values, interpolation methods (such as linear interpolation) can be used to fill them; if there are many missing values, consider deleting the relevant records; b) Environmental condition data (temperature, humidity, dust concentration, vibration intensity, power frequency magnetic field strength, high-frequency interference spectrum): For missing environmental data, data from adjacent time points can be used for filling, or statistical values such as mean and median can be used; c) Error-related characteristic data (load rate, power factor change curve, harmonic content, seasonal cycle markers, etc.). (d) Intraday period label: Load rate and other data can be estimated from other relevant data (such as power and current); when seasonal cycle labels and intraday period labels are missing in small amounts, they can be inferred from the timestamp; (e) Equipment status data (lifespan indicators, key component parameters, abnormal event labels): When lifespan indicators and key component parameters are missing, they can be filled by referring to the initial values or average values of the equipment; when abnormal event labels are missing, they can be determined based on other data; (f) Equipment identity data (device ID, production batch number, component model, software version number): If these data are missing, they may affect subsequent analysis, so it is recommended to fill them in first.
[0060] Outlier handling involves detecting outliers through visualization (such as box plots) or statistical methods (such as Z-scores and IQR): a) Measurement data: Outliers may be due to equipment malfunctions or measurement errors. They can be filtered or corrected by setting reasonable thresholds (such as the normal range of voltage and current); b) Environmental condition data: For data such as temperature and humidity that exceed the normal range, historical data can be used to determine if they are outliers. If so, they can be corrected or deleted; c) Error-related characteristic data: Outliers in data such as load rate and power factor change curves can be judged by comparing them with other data. For example, when the power factor change curve is abnormal, changes in power and current can be used as a reference for correction; d) Equipment status data: Outliers in life indicators and key component parameters can be judged by the normal operating range of the equipment. Outliers marked by abnormal events need to be corrected based on the actual operating conditions of the equipment; e) Equipment identity data: Equipment identity data generally does not have outliers, but if errors occur, the original records need to be checked and corrected.
[0061] Data consistency checks are used to ensure logical consistency between different data fields, such as the relationship between power and voltage / current, or the relationship between equipment status and abnormal event markers. If inconsistent data is found, it needs to be corrected or deleted according to the actual situation.
[0062] Time alignment aligns all data according to timestamps, ensuring complete metering data, environmental condition data, error correlation characteristic data, equipment status data, and equipment identification data at each point in time. Inconsistent timestamps can be resolved through interpolation or deletion of inconsistent time points. Data merging combines data from different sources (such as metering data and environmental condition data) into a single table for easier subsequent analysis. Specifically, timestamps and equipment identification data (device ID) are used as keys to merge all data fields into one table. Data normalization converts data of different dimensions and ranges to the same scale for easier analysis. For metering data (such as voltage, current, power, and energy values) and environmental condition data (such as temperature, humidity, dust concentration, vibration intensity, power frequency magnetic field strength, and high-frequency interference spectrum), Min-Max normalization or Z-score normalization methods can be used. Feature extraction extracts new features, such as power factor, equipment runtime, load volatility, and comprehensive environmental indicators. Feature transformation, for seasonal cycle markers and intraday time period labels: convert seasonal cycle markers and intraday time period labels into numerical data, such as labeling "spring" as 1 and "summer" as 2, etc.; for device identity data: encode the categorical variables (such as component model and software version number) in the device identity data, for example, by using one-hot encoding.
[0063] The dataset is constructed by annotating each of the preprocessed historical running data with at least the actual error.
[0064] By explicitly requiring that historical operational data be labeled with "at least the actual error" after data preprocessing, this labeling directly provides a supervisory signal (label) for model learning, making the constructed dataset usable for training and evaluating adaptive error prediction models, and making the learning objectives of adaptive error prediction models clear and explicit.
[0065] The metering data includes at least voltage, current, power, and energy values. The waveforms of voltage and current can be used to analyze nonlinear errors such as harmonics and distortion. Power and energy values, including instantaneous power (active / reactive) and cumulative energy values, serve as the fundamental true values for error calculation. The environmental condition data includes at least physical environment parameters and electromagnetic environment parameters. The physical environment parameters include at least temperature (chip, transformer, environment), humidity, dust concentration (affecting insulation performance), and vibration intensity (such as mechanical vibration in industrial settings). The electromagnetic environment parameters include at least power frequency magnetic field strength and high-frequency interference spectrum (such as switching operations and frequency converter interference). The error correlation characteristic data includes at least load characteristic data and time correlation data. The load characteristic data... The data should include at least the load factor (light / heavy load ratio), power factor variation curve, and harmonic content (THD); the time-related data should include at least seasonal cycle markers (temperature drift differences between summer and winter) and intraday time period labels (peak / off-peak electricity consumption); the equipment status data should include at least life indicators (running time (years / hours), number of start-stop cycles (reflecting component fatigue)), key component parameters (current transformer (CT) ratio / angle drift, metering chip reference voltage offset record, ADC sampling nonlinearity historical value), and abnormal event markers (lightning strike record, power sag / interruption event, overcurrent / overvoltage protection trigger log); the equipment identification data should include at least the device ID, production batch number, component model, and software version number.
[0066] By collecting extremely detailed data types (metering data, environmental condition data, error correlation characteristic data, equipment status data, and equipment identification data), and further refining specific parameters (such as: physical environmental parameters such as temperature, humidity, and vibration; electromagnetic environmental parameters such as power frequency magnetic field strength and high-frequency interference spectrum; load characteristic data such as load rate, power factor change curve, and harmonic content; and time correlation data), this in-depth data acquisition can capture various complex and dynamic internal and external factors (environmental interference, load changes, aging degree, etc.) that lead to power metering errors, laying a solid data foundation for subsequent accurate modeling.
[0067] In step S2, the feature extraction layer is constructed based on the metering data processing module, the environmental condition data processing module, the error correlation feature data processing module, the equipment status data processing module, and the equipment identity data processing module. By setting up a feature extraction layer that includes multiple dedicated modules (processing modules for measurement data, environmental condition data, error correlation feature data, equipment status data, and equipment identity data) to handle different types of data respectively, comprehensive data coverage is ensured. For example, LSTM is used to process time series measurement data (capturing dynamic changes), multilayer perceptron is used to process environmental condition data (modeling nonlinear relationships), CNN is used to extract load pattern features (identifying complex patterns), and the embedding layer is used to process category data (such as equipment identity). This modular division of labor optimizes the feature extraction process, avoids information loss, significantly improves the accuracy and completeness of feature representation, and thus reduces overall measurement error.
[0068] The metering data processing module is used to extract metering features from metering data through a Long Short-Term Memory (LSTM) unit and a first fully connected layer. The LSTM unit processes metering data (time series data such as voltage, current, power, and energy value), and the sequence length is dynamically adjusted by the data acquisition cycle. The first fully connected layer is used to compress the feature dimensions to obtain metering features (i.e., time-dependent features, capturing dynamic behaviors such as voltage fluctuations and current abrupt changes to reflect the short-term trend of metering errors). The environmental condition data processing module is used to extract environmental features from environmental condition data through a multilayer sensor. The inputs to the environmental condition data processing module include physical environmental parameters (temperature, humidity, dust concentration, vibration intensity) and electromagnetic environmental parameters (power frequency magnetic field strength, high-frequency interference spectrum), all processed as numerical scalars. The environmental condition data processing module comprises two sub-modules: a fully connected physical environment sub-module and a fully connected electromagnetic environment sub-module, which are then merged and output through a splicing unit. The environmental condition data processing module is used to quantify the impact of the environment on measurement errors, such as quantifying the impact of temperature changes on component drift or the interference of high-frequency interference on measurement accuracy. The error correlation feature data processing module is constructed based on the load characteristic submodule and the time correlation submodule. The load characteristic submodule is used to extract load pattern features (such as error nonlinearity caused by load rate) from the error correlation feature data through a convolutional neural network (CNN), that is, to process time series data such as power factor change curves and harmonic content. The time correlation submodule is used to extract time context features (such as the periodic impact of seasonal changes on long-term errors) from the error correlation feature data through a first embedding layer and a second fully connected layer, that is, to process seasonal cycle markers and intraday time period labels (categorical data), and output the categories after mapping them to continuous vectors. The device status data processing module is used to extract device status features (health status features) from device status data through the third fully connected layer, which is used to quantify the systematic impact of device aging or component abnormalities on errors (such as error offset caused by capacitor decay). The input of the device status data processing module includes life indicators, key component parameters (numerical scalars) and abnormal event markers (binary data, processed by binarization). After the abnormal event markers are converted into feature vectors by the embedding layer, they are concatenated with the scalar data and input into the third fully connected layer. The device identity data processing module is used to extract identity features from device identity data through the second embedding layer and the fourth fully connected layer, capture the inherent differences between different individual devices or batches (such as error deviations caused by component suppliers), and realize personalized error modeling; the second embedding layer processes classification data such as device ID, production batch number, component model, and software version number, and maps each category to a high-dimensional vector; the fourth fully connected layer is used for dimensionality reduction and feature integration. By employing a variety of AI technologies (such as LSTM, CNN, multilayer perceptron, and embedding layers), customized processing is carried out for different data types. For example, LSTM units effectively capture the time dependence of measurement data, CNN extracts local pattern features in the load characteristic submodule, and multi-head attention mechanism achieves adaptive fusion. The combination of these technologies makes error prediction more accurate and meets the industry demand for high-precision dynamic measurement.
[0069] The adaptive fusion layer is used to adaptively fuse metering features, environmental features, load pattern features, temporal context features, equipment status features, and identity features through a multi-head attention unit and a fifth fully connected layer (for feature dimension normalization) to obtain a comprehensive feature representation. The adaptive fusion layer is used to adaptively fuse features from different sources. The attention mechanism automatically learns the weight matrix (e.g., reducing the weight of environmental features in noisy environments or increasing the weight of load features during peak loads) and outputs a comprehensive feature representation. This structure is optimized for electricity metering scenarios and can handle data distribution drift (such as seasonal changes or equipment updates), improving model robustness. Through the adaptive fusion layer (based on multi-head attention units and fully connected layers), different features (such as metering features, environmental features, load pattern features, etc.) can be dynamically weighted and fused. The weights are adaptively adjusted according to real-time data, which improves the robustness to variable operating conditions (such as temperature changes and load fluctuations) and maintains stable performance in complex environments (such as peak grid load). The multi-head attention mechanism is particularly innovative because it processes features in parallel, reduces computational overhead, and improves the model's generalization ability and fault tolerance.
[0070] The prediction output layer is used to output the error prediction result based on the comprehensive feature representation through the sixth fully connected layer and the regression output unit (linear activation); the prediction output layer is used to map the comprehensive feature representation output by the adaptive fusion layer to the error prediction result (continuous value), such as predicting the relative error percentage of the current electricity meter. The loss function adopted is the Mean Squared Error (MSE) loss function, which measures the deviation between the prediction error and the actual error, and optimizes the prediction accuracy with the regression problem as the objective.
[0071] The adaptive error prediction model has the following advantages: a) Dynamic adaptive mechanism: Through the multi-head attention unit of the adaptive fusion layer, the weights are dynamically adjusted according to the input features (such as environmental parameters or equipment status) during runtime to adapt to different operating conditions (such as sudden temperature changes or electromagnetic interference), solving the generalization problem of traditional models under varying operating conditions; b) Multi-source data integration: The feature extraction layer uses a dedicated sub-module to process heterogeneous data (such as LSTM for time series and the embedding layer for classification data), and reduces the impact of inconsistent data scales on fusion and improves feature expressiveness through standardized output; c) Efficiency optimization: The model is designed to be lightweight (such as LSTM and CNN units can be parallelized), adapting to the deployment of edge computing devices and reducing prediction latency.
[0072] By integrating multi-source heterogeneous data (metering, environment, load, equipment status, and identity information) through modular design, and utilizing advanced AI technologies (such as LSTM to capture time-series dynamics, CNN to extract load patterns, and embedding layers to process discrete features) to achieve high-precision feature extraction, a multi-head attention mechanism is innovatively introduced to adaptively fuse multi-dimensional features and dynamically optimize weight allocation, thereby significantly improving the accuracy and robustness of dynamic energy metering error correction. At the same time, by combining a lightweight architecture (parallel processing and embedding dimensionality reduction) and domain knowledge embedding (such as a physics-driven error correlation feature data processing module), while ensuring real-time response capabilities, the adaptability and scalability to complex operating conditions are enhanced, ultimately achieving the goal of high-efficiency, low-error intelligent metering, combining technological advancement with engineering practical value.
[0073] Step S3 specifically involves: Based on the time series partitioning method, the dataset is divided into a training set, a validation set, and a test set in an 8:1:1 ratio. The adaptive error prediction model is trained using the training set and a loss function. During training, Bayesian optimization is used to continuously optimize the hyperparameters of the adaptive error prediction model, including at least the learning rate, batch size, network depth (number of stacked layers (e.g., number of LSTM layers, number of CNN convolutional layers)) and network width (number of neurons per convolutional kernel), until the loss value of the loss function is less than a preset loss threshold. The prediction accuracy is calculated using the validation set to validate the trained adaptive error prediction model, and the confidence score is calculated using the test set to test the validated adaptive error prediction model.
[0074] By strictly preserving data causality through time series partitioning (8:1:1), and combining it with Bayesian optimization to dynamically adjust core hyperparameters such as learning rate, batch size, network depth, and width, the model significantly improves accuracy and generalization ability while ensuring efficient training convergence (loss value pre-threshold control). Its unique dual-stage verification-testing mechanism (prediction accuracy → confidence assessment) constructs a complete quality assurance chain, which not only achieves quantitative control of model reliability (such as 95% confidence interval) but also avoids overfitting risks, ultimately forming an industrial-grade prediction solution that balances automation, resource efficiency, and cross-scenario adaptability.
[0075] Step S4 specifically involves: The adaptive error prediction model that passed the test was compressed by combining quantization technology and dynamic pruning technology. The root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), Pearson correlation coefficient, coefficient of determination (R²), and F1 score of the compressed adaptive error prediction model were calculated for performance verification. After the performance verification was passed, the adaptive error prediction model was deployed to the electricity metering device by containerization technology, and actual operating data was collected to perform drift compensation training on the adaptive error prediction model deployed on the electricity metering device.
[0076] By integrating quantization and dynamic pruning techniques, the adaptive error prediction model is efficiently compressed, significantly reducing model size and computational resource consumption, thus achieving efficient resource utilization. Subsequently, multi-index performance verification (including root mean square error, mean absolute error, mean absolute percentage error, Pearson correlation coefficient, coefficient of determination, and F1 score) is used to ensure the accuracy and robustness of the compressed model. Containerized deployment enhances portability and maintainability, enabling seamless integration of the model into electricity metering devices. Drift compensation training continuously optimizes the model to maintain long-term adaptability and stability, ultimately providing end-to-end deployment advantages in the field of electricity metering, characterized by high efficiency, energy saving, high precision, reliability, and continuous improvement.
[0077] Step S5 specifically involves: The electricity metering device collects real-time operating data, including metering data, environmental condition data, error correlation feature data, equipment status data, and equipment identification data. After preprocessing the real-time operating data by calling the Kalman filter algorithm through a streaming engine, the data is input into a deployed adaptive error prediction model. The adaptive error prediction model performs inference based on hardware acceleration technology and dynamically outputs error prediction results in real time. Based on the error prediction results, the metering data in the real-time operating data is compensated to perform adaptive error correction and obtain the corrected metering value.
[0078] Step S6 specifically involves: The electricity metering device concatenates the real-time error prediction result and the corrected metering value into first concatenated data. It then digitally signs the first concatenated data using a preset private key to obtain a signature value, acquires the current timestamp, and concatenates the first concatenated data and the timestamp into second concatenated data. The device calculates the hash value of the second concatenated data using the SHA-256 algorithm, uploads the hash value to the blockchain for notarization, and acquires the quantum key issued by the server through a secondary communication channel based on quantum communication. It then encrypts the first concatenated data, the signature value, and the timestamp into a metering data packet using the quantum key, and transmits the metering data packet to the server through the main communication channel.
[0079] The private key is generated based on the DCDSA algorithm, and the public key matching the private key is pre-set on the server; the quantum key is generated based on a quantum key distribution device; the main communication channel and the secondary communication channel are two independent channels, and both the main communication channel and the secondary communication channel adopt encrypted communication.
[0080] The multi-level security mechanism significantly enhances the data security and reliability of dynamic electricity metering: digital signatures (DCDSA algorithm) and blockchain notarization (SHA-256 hash value) provide dual protection for data integrity and tamper-proofness, ensuring the authenticity and traceability of metering results; quantum key distribution (secondary communication channel) and dual-channel independent encrypted transmission (main communication channel) achieve absolutely secure key management and data encryption, effectively resisting eavesdropping and man-in-the-middle attacks; at the same time, timestamp and signature mechanisms enhance non-repudiation and auditing efficiency, building a full-link trusted, attack-resistant protection system for electricity metering error correction data that meets industrial regulatory requirements.
[0081] Step S7 specifically involves: The server receives the metering data packets in real time, decrypts the metering data packets using the generated quantum key to obtain the first concatenated data, the signature value, and the timestamp, concatenates the first concatenated data and the timestamp to form the second concatenated data, verifies the integrity of the second concatenated data using the hash value of the blockchain notarization, verifies the timeliness using the timestamp, verifies the signature value using the preset public key, and then parses the first concatenated data to obtain the error prediction result and the corrected metering value. The calibration measurement value is encrypted and stored using the SM9 algorithm. The mean error of the error prediction result of each power metering device is calculated. When the mean error is greater than the preset error, a retraining command is sent to each power metering device. Each electricity metering device constructs an incremental dataset based on the received retraining instruction, the real-time operating data, and the acquired error feedback. The deployed adaptive error prediction model is then iteratively optimized by calling the incremental dataset through a federated learning mechanism.
[0082] By combining quantum key decryption and blockchain hash verification at the data receiving end (server), a dual security guarantee against tampering and attacks is constructed, while real-time control is achieved using timestamps. At the data processing end, SM9 encrypted storage and an automatic diagnostic mechanism based on the mean error are adopted to achieve accurate metering and proactive maintenance. In particular, distributed model iteration of the power metering device is achieved through federated learning, which not only protects user privacy but also improves the adaptive capability of the adaptive error prediction model. The overall solution forms a power metering solution that integrates high security, strong real-time performance, intelligent self-optimization, and privacy protection, significantly reducing operation and maintenance costs and meeting the reliable operation requirements of the smart grid.
[0083] In summary, the advantages of this invention are: 1. A dataset is constructed by acquiring a large amount of historical operating data from electricity metering devices. An adaptive error prediction model is created based on a feature extraction layer, an adaptive fusion layer, and a prediction output layer, and a loss function is set for the adaptive error prediction model. The dataset is then divided into training, validation, and test sets. The adaptive error prediction model is trained using the training set and the loss function. The trained adaptive error prediction model is validated using the validation set. The validated adaptive error prediction model is tested using the test set. After compression and performance verification, the tested adaptive error prediction model is deployed to the electricity metering device, and drift compensation training is performed on the deployed adaptive error prediction model. Next, the electricity metering device collects real-time operating data. After preprocessing the real-time operating data, it is input into the deployed adaptive error prediction model. The adaptive error prediction model performs inference based on hardware acceleration technology, dynamically outputting real-time error prediction results. Adaptive error correction is performed based on the real-time error prediction results to obtain the corrected metering value. The error prediction results and corrected metering values are digitally signed and encrypted to obtain metering data packets. After being stored on the blockchain, the metering data packets are transmitted to the server. The received metering data packets are decrypted and verified to obtain the error prediction results and corrected metering values. The corrected metering values are encrypted and stored. Based on the error prediction results, the adaptive error prediction model is retrained. That is, by deploying an AI-based adaptive error prediction model to the electricity metering device, combined with hardware acceleration, millisecond-level real-time error prediction and dynamic correction are achieved, accurately quantifying and compensating for complex errors caused by environmental changes, component aging, etc. The model drift compensation training and server-triggered retraining mechanism continuously adapt to changes in equipment parameters, ensuring long-term accuracy. The closed-loop automated processing at the edge eliminates manual on-site intervention, greatly improving operation and maintenance efficiency. At the same time, digital signatures, encrypted transmission, and blockchain storage are used to build an end-to-end secure trust chain to ensure data integrity and non-repudiation of operations, ultimately greatly improving the accuracy, timeliness, reliability, convenience, and security of electricity metering error correction.
[0084] 2. By dynamically outputting real-time error prediction results through an adaptive error prediction model and using hardware acceleration technology for inference, it can quickly respond to changes in real-time operating data. Combined with a feature extraction layer and an adaptive fusion layer, the adaptive error prediction model can efficiently process complex data features, reduce the accumulated error in traditional methods, thereby improving the accuracy of electricity metering (such as errors caused by current and voltage fluctuations), achieving the effect of dynamic correction, and is suitable for high-frequency changing power grid environments.
[0085] 3. By compressing and verifying the performance of the adaptive error prediction model before deployment, the problem of computational resource limitations in embedded devices (such as power metering devices) is solved. At the same time, drift compensation training adapts to device aging or environmental changes, maintaining long-term accuracy, which can effectively reduce deployment costs (such as reducing hardware upgrade needs), extend device life, and improve system maintenance efficiency.
[0086] 4. By constructing an adaptive error prediction model and embedding it into the power metering device, combined with hardware acceleration, high-precision real-time dynamic error correction is achieved, significantly improving metering accuracy and timeliness. The compression optimization, drift compensation training, and server-triggered closed-loop retraining mechanism of the adaptive error prediction model ensure its efficient operation in resource-constrained equipment while continuously adapting to environmental changes and equipment aging, greatly reducing operation and maintenance costs. The combination of data encryption, digital signature, and blockchain notarization ensures the tamper-proof, traceability, and audit reliability of metering results, providing a reliable adaptive correction solution for the entire chain of smart grids, effectively breaking through the limitations of traditional static calibration.
[0087] 5. By acquiring a large amount of historical operating data from electricity metering devices installed in different environments and with different service durations, the collected data covers a "large amount" of historical data from electricity metering devices in "different environments" (physical environment, electromagnetic environment) and with "different service durations," ensuring the diversity and representativeness of the sample. This broad coverage helps to establish an adaptive error prediction model applicable to various actual operating conditions, significantly improving the generalization ability and adaptability of the adaptive error prediction model.
[0088] 6. By collecting extremely detailed data types (metering data, environmental condition data, error correlation characteristic data, equipment status data, and equipment identification data), and further refining specific parameters (such as: physical environmental parameters such as temperature, humidity, and vibration; electromagnetic environmental parameters such as power frequency magnetic field strength and high-frequency interference spectrum; load characteristic data such as load rate, power factor change curve, and harmonic content; and time correlation data), this in-depth data acquisition can capture various complex and dynamic internal and external factors (environmental interference, load changes, aging degree, etc.) that lead to power metering errors, laying a solid data foundation for subsequent accurate modeling.
[0089] 7. Through systematic and professional preprocessing of historical operational data, including data cleaning (missing values, outliers, consistency), data integration (time alignment, merging), data transformation (normalization, feature extraction / conversion), and data dimensionality reduction, data cleaning and integration effectively solve common data problems in actual power systems (missing data, noise, inconsistent timestamps, etc.), ensuring the reliability, integrity, and consistency of the data. Data transformation (especially normalization and feature extraction / conversion) transforms data of different dimensions and scales to a unified scale, facilitating model processing and extracting more effective features from the original data, thus improving model efficiency. Data dimensionality reduction reduces data dimensionality while minimizing information loss, reducing the computational complexity of subsequent models, improving training efficiency, and helping to eliminate redundant or noisy features.
[0090] 8. By explicitly requiring that historical running data be labeled with "at least the actual error" after data preprocessing, this labeling directly provides a supervision signal (label) for model learning, making the constructed dataset usable for training and evaluating the adaptive error prediction model, and making the learning objective of the adaptive error prediction model clear and explicit.
[0091] 9. By linking the collected operational data (especially equipment identification data such as production batch number, component model, software version number, and equipment status data such as key component parameters and abnormal event markers) with error labels, it becomes easier to trace the specific cause of the error (design defects, component aging, software vulnerabilities, etc.) when analyzing model results (e.g., identifying certain batches, specific components, or software versions with high error rates). This provides a basis for subsequent product improvement, precise maintenance, and risk warning.
[0092] 10. By systematically collecting diverse operational data from electricity metering devices covering different environmental conditions and service years, and deeply integrating high-dimensional features (including dynamic metering parameters, physical / electromagnetic environmental factors, load characteristics, time-related markers, equipment status, and identification), a high-quality labeled dataset is constructed through professional cleaning, alignment, transformation, and dimensionality reduction preprocessing. This lays a solid foundation for the adaptive error prediction model. Its core advantages lie in its ability to accurately capture the error evolution patterns under complex operating conditions, support individualized equipment status tracking, enhance the model's robustness to aging effects and environmental interference, and empower AI-based dynamic correction algorithms to achieve high-precision and highly adaptive electricity metering compensation.
[0093] 11. By setting up a feature extraction layer containing multiple dedicated modules (processing modules for measurement data, environmental condition data, error correlation feature data, equipment status data, and equipment identity data) to process different types of data respectively, comprehensive data coverage is ensured. For example, LSTM is used to process time series measurement data (capturing dynamic changes), multilayer perceptron is used to process environmental condition data (modeling nonlinear relationships), CNN is used to extract load pattern features (identifying complex patterns), and the embedding layer is used to process category data (such as equipment identity). This modular division of labor optimizes the feature extraction process, avoids information loss, significantly improves the accuracy and completeness of feature representation, and thus reduces the overall measurement error.
[0094] 12. By employing various AI technologies (such as LSTM, CNN, multilayer perceptron and embedding layer), customized processing is carried out for different data types. For example, LSTM unit effectively captures the time dependence of measurement data, CNN extracts local pattern features in the load characteristic submodule, and multi-head attention mechanism realizes adaptive fusion. The combination of these technologies makes error prediction more accurate and meets the industry needs of high-precision dynamic measurement.
[0095] 13. Through the adaptive fusion layer (based on multi-head attention units and fully connected layers), different features (such as metering features, environmental features, load pattern features, etc.) can be dynamically weighted and fused. The weights are adaptively adjusted according to real-time data, which improves the robustness to variable operating conditions (such as temperature changes and load fluctuations) and maintains stable performance in complex environments (such as peak grid load). The multi-head attention mechanism is particularly innovative because it processes features in parallel, reduces computational overhead, and improves the model's generalization ability and fault tolerance.
[0096] 14. By setting up a multi-level abstract structure for the feature extraction layer: a) Bottom layer: CNN captures local spatial patterns of load data (such as sudden current changes); b) Middle layer: LSTM models long-term dependencies of measurement data (such as electricity consumption trends); c) High layer: Multi-head attention dynamically fuses cross-domain features. This multi-level abstract structure forms a "local → global" feature pyramid, making the model more robust to noise and local perturbations, and its generalization ability far exceeds that of a single model.
[0097] 15. By integrating multi-source heterogeneous data (metering, environment, load, equipment status, and identity information) through modular design, and utilizing advanced AI technologies (such as LSTM to capture time-series dynamics, CNN to extract load patterns, and embedding layers to process discrete features) to achieve high-precision feature extraction, a multi-head attention mechanism is innovatively introduced to adaptively fuse multi-dimensional features and dynamically optimize weight allocation, thereby significantly improving the accuracy and robustness of dynamic energy metering error correction. At the same time, by combining a lightweight architecture (parallel processing and embedding dimensionality reduction) and domain knowledge embedding (such as a physics-driven error correlation feature data processing module), while ensuring real-time response capabilities, the system enhances adaptability and scalability to complex operating conditions, ultimately achieving the goal of high-efficiency, low-error intelligent metering, combining technological advancement with engineering practical value.
[0098] 16. By employing Bayesian optimization to automatically optimize hyperparameters such as learning rate, batch size, network depth, and network width, the time-consuming process of traditional manual parameter tuning is avoided. This method uses a probabilistic model to guide the search for the optimal parameter combination and quickly converges to a state where the loss value is below a preset threshold, thereby saving computing resources and time and effectively improving the efficiency of industrial deployment.
[0099] 17. During the training of the adaptive error prediction model, a loss threshold is set as the stopping condition (the loss value is lower than the loss threshold). This forces the adaptive error prediction model to reach a predefined accuracy, avoiding underfitting or premature stopping, and ensuring the output stability of the adaptive error prediction model. In particular, when predicting errors, it can reduce the model error rate and improve the overall prediction accuracy.
[0100] 18. By processing the dataset using a time series partitioning method (8:1:1 ratio), the temporal characteristics of the data are preserved, future information leakage is avoided, and the model's generalization ability on real-world time series data (such as sensor data or stock market data) is improved. At the same time, the validation set is used to calculate the prediction accuracy to test the model's performance, and the test set is used to calculate the confidence score to evaluate the model's stability in practical applications, providing multi-level reliability assurance and reducing the risk of overfitting.
[0101] 19. By strictly preserving data causality through time series partitioning (8:1:1), and combining Bayesian optimization to dynamically adjust core hyperparameters such as learning rate, batch size, network depth and width, the model significantly improves accuracy and generalization ability while ensuring efficient training convergence (loss value pre-threshold control). Its unique dual-stage verification-testing mechanism (prediction accuracy → confidence assessment) constructs a complete quality assurance chain, which not only achieves quantitative control of model reliability (such as 95% confidence interval) but also avoids overfitting risk, ultimately forming an industrial-grade prediction solution that balances automation, resource efficiency and cross-scenario adaptability.
[0102] 20. By integrating quantization and dynamic pruning techniques, the adaptive error prediction model is efficiently compressed, significantly reducing model size and computational resource consumption, thus achieving efficient resource utilization. Subsequently, multi-index performance verification (including root mean square error, mean absolute error, mean absolute percentage error, Pearson correlation coefficient, coefficient of determination, and F1 score) is used to ensure the accuracy and robustness of the compressed model. Containerized deployment enhances portability and maintainability, enabling seamless integration of the model into electricity metering devices. Drift compensation training is used to continuously optimize the model to maintain long-term adaptability and stability, ultimately providing end-to-end deployment advantages in the field of electricity metering, characterized by high efficiency, energy saving, high precision, reliability, and continuous improvement.
[0103] 21. By collecting multi-dimensional real-time operational data (including environmental conditions, error characteristics, and equipment status), dynamic data preprocessing is achieved using a streaming engine and Kalman filter algorithm. Combined with a hardware-accelerated adaptive error prediction model, millisecond-level inference is performed, dynamically outputting high-precision error prediction results. Based on this, real-time compensation and closed-loop correction are performed on the metering data. Its core advantages lie in the deep integration of real-time data processing (streaming computing), high prediction accuracy (adaptive model and environmental parameter linkage), resource efficiency (hardware acceleration), and strong system robustness (dynamic self-correction mechanism), which significantly improves the accuracy of electricity metering, reduces manual maintenance costs, and supports lightweight deployment at the edge.
[0104] 22. The data security and reliability of dynamic energy metering are significantly improved through multi-level security mechanisms: the integrity and tamper-proof nature of data are guaranteed by digital signature (DCDSA algorithm) and blockchain notarization (SHA-256 hash value), ensuring the authenticity and traceability of metering results; absolute secure key management and data encryption are achieved through quantum key distribution (secondary communication channel) and dual-channel independent encrypted transmission (main communication channel), effectively resisting eavesdropping and man-in-the-middle attacks; at the same time, timestamp and signature mechanisms enhance non-repudiation and auditing efficiency, building a full-link trusted, attack-resistant protection system for energy metering error correction data that meets industrial regulatory requirements.
[0105] 23. By combining quantum key decryption and blockchain hash verification at the data receiving end (server), a dual security guarantee against tampering and attacks is constructed, while real-time control is achieved using timestamps. At the data processing end, SM9 encrypted storage and an automatic diagnostic mechanism based on the mean error are adopted to achieve accurate metering and proactive maintenance. In particular, distributed model iteration of the power metering device is achieved through federated learning, which not only protects user privacy but also improves the adaptive capability of the adaptive error prediction model. The overall solution forms a power metering solution that integrates high security, strong real-time performance, intelligent self-optimization, and privacy protection, significantly reducing operation and maintenance costs and meeting the reliable operation requirements of the smart grid.
[0106] 24. By constructing and continuously optimizing an AI model based on multi-source feature adaptive fusion, high-precision real-time error prediction and dynamic compensation were achieved, significantly improving metering accuracy and reliability. Model compression and hardware acceleration technologies ensured the efficiency and feasibility of real-time computation at the power metering device, while drift compensation and federated learning-based model retraining mechanisms ensured the system's long-term adaptability and stability. Simultaneously, by employing blockchain notarization, quantum key encryption, and multi-digital signature verification mechanisms, the integrity, immutability, and confidentiality of metering data were comprehensively guaranteed throughout the entire transmission and storage process. This resulted in a smart metering technology solution integrating high precision, strong adaptability, high execution efficiency, long-term stability, and data security, providing reliable technical support for smart grid construction.
[0107] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. An adaptive error correction method for dynamic energy metering, characterized by: The method comprises the following steps: Step S1, obtaining a large amount of historical operation data of electric energy metering devices, pre-processing each of the historical operation data, and constructing a data set after labeling; Step S2, creating an adaptive error prediction model based on a feature extraction layer, an adaptive fusion layer, and a prediction output layer, and setting a loss function of the adaptive error prediction model; Step S3, dividing the data set into a training set, a validation set, and a test set, training the adaptive error prediction model through the training set and the loss function, verifying the trained adaptive error prediction model through the validation set, and testing the adaptive error prediction model that passes the verification through the test set; Step S4, after compressing and performance verifying the adaptive error prediction model that passes the test, deploying the adaptive error prediction model to an electric energy metering device, and performing drift compensation training on the adaptive error prediction model deployed to the electric energy metering device; Step S5, the electric energy metering device collects real-time operation data, inputs the pre-processed real-time operation data into the deployed adaptive error prediction model, the adaptive error prediction model performs inference based on a hardware acceleration technology, dynamically outputs a real-time error prediction result, performs adaptive error correction based on the real-time error prediction result, and obtains a corrected metering value; Step S6, the electric energy metering device digitally signs and encrypts the real-time error prediction result and the corrected metering value to obtain a metering data packet, stores the metering data packet in a block chain, and transmits the metering data packet to a server; Step S7, the server decrypts and verifies the received metering data packet to obtain an error prediction result and a corrected metering value, encrypts and stores the corrected metering value, and triggers retraining of the adaptive error prediction model based on the error prediction result.
2. A self-adapting error correction method for dynamic energy metering as claimed in claim 1, characterized in that: The step S1 specifically comprises: Obtaining a large amount of historical operation data of electric energy metering devices installed in different environments and serving for different lengths of time, wherein the historical operation data comprises metering data, environmental working condition data, error correlation feature data, device state data, and device identity data; Pre-processing each of the historical operation data, including data cleaning, data integration, data conversion, and data dimension reduction; the data cleaning comprises missing value processing, abnormal value processing, and data consistency checking; the data integration comprises time alignment and data merging; the data conversion comprises data normalization, feature extraction, and feature conversion; Constructing a data set after labeling each of the pre-processed historical operation data, including at least actual error.
3. A self-adapting error correction method for dynamic energy metering as claimed in claim 2, characterized in that: The metering data at least includes voltage, current, power and energy values; the environmental working condition data at least includes physical environmental parameters and electromagnetic environmental parameters; the physical environmental parameters at least include temperature, humidity, dust concentration and vibration intensity; the electromagnetic environmental parameters at least include power frequency magnetic field intensity and high frequency interference spectrum; the error correlation characteristic data at least includes load characteristic data and time correlation data; the load characteristic data at least includes load rate, power factor variation curve and harmonic content rate; the time correlation data at least includes seasonal cycle mark and intra-day time period label; the equipment state data at least includes life index, key component parameter and abnormal event mark; and the equipment identity data at least includes device ID, production batch number, component model and software version number.
4. A self-adapting error correction method for dynamic energy metering as claimed in claim 1, characterized in that: In the step S2, the feature extraction layer is constructed based on a metering data processing module, an environmental working condition data processing module, an error correlation characteristic data processing module, an equipment state data processing module and an equipment identity data processing module; The metering data processing module is configured to extract metering features from the metering data through a long short-term memory unit and a first full connection layer; The environmental working condition data processing module is configured to extract environmental features from the environmental working condition data through a multi-layer perception machine; The error correlation characteristic data processing module is constructed based on a load characteristic sub-module and a time correlation sub-module; the load characteristic sub-module is configured to extract load pattern features from the error correlation characteristic data through a convolutional neural network; and the time correlation sub-module is configured to extract time context features from the error correlation characteristic data through a first embedding layer and a second full connection layer; The equipment state data processing module is configured to extract equipment state features from the equipment state data through a third full connection layer; The equipment identity data processing module is configured to extract identity identification features from the equipment identity data through a second embedding layer and a fourth full connection layer; The adaptive fusion layer is configured to perform adaptive fusion on the metering features, the environmental features, the load pattern features, the time context features, the equipment state features and the identity identification features through a multi-head attention unit and a fifth full connection layer to obtain comprehensive feature representation; The prediction output layer is configured to output error prediction results based on the comprehensive feature representation through a sixth full connection layer and a regression output unit; The loss function adopts a mean square error loss function.
5. A self-adapting error correction method for dynamic energy metering as claimed in claim 1, characterized in that: The step S3 is specifically: Based on a time series division method, the data set is divided into a training set, a validation set and a test set in a ratio of 8:1:1; the adaptive error prediction model is trained through the training set and the loss function; in the training process, the adaptive error prediction model is continuously optimized in terms of at least hyperparameters such as learning rate, batch size, network depth and network width through a Bayesian optimization method until the loss value of the loss function is less than a preset loss threshold; the prediction accuracy is calculated through the validation set to verify the trained adaptive error prediction model; and the confidence is calculated through the test set to test the adaptive error prediction model that passes the verification.
6. A self-adapting error correction method for dynamic energy metering as claimed in claim 1, characterized in that: The step S4 is specifically: In combination with the quantification technology and the dynamic pruning technology, the adaptive error prediction model that passes the test is compressed, the root mean square error, the mean absolute error, the mean absolute percentage error, the Pearson correlation coefficient, the determination coefficient and the F1 score of the compressed adaptive error prediction model are calculated to verify the performance, and after the performance verification passes, the adaptive error prediction model is deployed to the electric energy metering device through the containerization technology, and the actual operation data is collected to perform drift compensation training on the adaptive error prediction model deployed to the electric energy metering device.
7. A self-adapting error correction method for dynamic energy metering as claimed in claim 1, wherein: The step S5 is specifically: The electric energy metering device collects real-time operation data including metering data, environmental working condition data, error correlation feature data, equipment state data and equipment identity data, and inputs the preprocessed real-time operation data into the deployed adaptive error prediction model through the streaming engine calling Kalman filtering algorithm, the adaptive error prediction model performs inference based on the hardware acceleration technology, dynamically and real-timely outputs error prediction results, compensates the metering data in the real-time operation data based on the error prediction results, and performs adaptive error correction to obtain corrected metering values.
8. A self-adapting error correction method for dynamic energy metering as claimed in claim 1, characterized by: The step S6 is specifically: The electric energy metering device splices the real-time error prediction results and the corrected metering values into first spliced data, digitally signs the first spliced data through a preset private key to obtain a signature value, acquires a current timestamp, splices the first spliced data and the timestamp into second spliced data, calculates the hash value of the second spliced data through the SHA-256 algorithm, uploads the hash value to the block chain for notarization, acquires a quantum key issued by a server based on quantum communication through a secondary communication channel, encrypts the first spliced data, the signature value and the timestamp into a metering data packet through the quantum key, and transmits the metering data packet to the server through a primary communication channel.
9. A self-adapting error correction method for dynamic energy metering as claimed in claim 8, characterized in that: The private key is generated based on the DCDSA algorithm, and a public key matched with the private key is preset in the server; the quantum key is generated based on a quantum key distribution device; the primary communication channel and the secondary communication channel are two independent channels, and both the primary communication channel and the secondary communication channel adopt encrypted communication.
10. A self-adapting error correction method for dynamic energy metering as claimed in claim 1, wherein: The step S7 is specifically: The server real-timely receives the metering data packet, decrypts the metering data packet through the generated quantum key to obtain the first spliced data, the signature value and the timestamp, splices the first spliced data and the timestamp into the second spliced data, performs integrity verification on the second spliced data through the hash value notarized by the block chain, performs time validity verification through the timestamp, performs signature verification on the signature value through the preset public key, and then analyzes the first spliced data to obtain the error prediction results and the corrected metering values; The corrected metering values are encrypted and stored through the SM9 algorithm, the error mean of the error prediction results of each electric energy metering device is calculated, and when the error mean is greater than a preset error preset, a retraining instruction is issued to each electric energy metering device; Each power metering device constructs an incremental data set based on the received retraining instruction, the real-time operation data and the obtained error feedback, and iteratively optimizes the deployed adaptive error prediction model through a federated learning mechanism by calling the incremental data set.
Citation Information
Cited By
Intelligent electric meter range calibration and error compensation method for nonlinear load
CN121559424A