A static current detection method and system suitable for an electric energy meter

CN122632175BActive Publication Date: 2026-11-03CSG SMART SCI&TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611114151.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-11-03
Estimated Expiration
2046-07-27

AI Technical Summary

Technical Problem

Existing electricity meters have low accuracy in static current detection under extreme environments, are susceptible to temperature drift and magnetic field interference, and have large detection errors due to device aging, making it impossible to maintain high accuracy throughout their lifespan.

Method used

A lightweight environmental awareness neural network model is adopted, which combines one-dimensional convolutional branching and attention mechanism to quantify environmental disturbances in real time. Through nonlinear feature fusion and implicit compensation, an anti-interference static current detection method is generated, and the model bias parameters are corrected online through life cycle baseline tracking logic.

Benefits of technology

It improves the static current detection accuracy of electricity meters in extreme environments, reduces hardware costs, avoids the failure of traditional formulas in extreme environments, and achieves high-precision detection throughout the entire life cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122632175B_ABST
    Figure CN122632175B_ABST
Patent Text Reader

Abstract

The application discloses a static current detection method and system suitable for an electric energy meter, and relates to the technical field of electric energy metering; the application synchronously collects electrical weak signals and environment state data and constructs a multi-dimensional time sequence characteristic sequence; the multi-dimensional time sequence characteristic sequence is input into a lightweight environment perception neural network model which is quantified by KL divergence; a one-dimensional convolution branch is used to extract waveform characteristics, and an attention mechanism branch is used to quantize environment interference in real time to dynamically allocate feature fusion weights, realize extreme value normalization, nonlinear feature fusion and implicit compensation; a fully connected layer integer multiply-add instruction is used to directly map and output a static current true value, replacing traditional floating point formula calculation; meanwhile, online bias correction is realized based on a life cycle baseline tracking; the application eliminates the constraints of complex compensation formulas, releases microcontroller computing power, and greatly improves the metering accuracy of the electric energy meter in extreme environments and the whole life cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electrical energy metering technology, and specifically relates to a static current detection method and system suitable for electricity meters. Background Technology

[0002] In smart grids and modern electricity metering systems, smart meters are the core terminals for achieving precise energy management and trade settlement. High-precision detection of static current (the minute current measured by the meter under extremely low load or near-no-load conditions) is directly related to preventing leakage and electricity theft, accurately measuring the standby power consumption of household appliances, and maintaining the economic benefits of power grid companies. It is a key indicator for evaluating the metering performance of smart meters.

[0003] In existing applications, electricity meters typically rely on hardware sampling circuits (such as manganese copper shunts combined with operational amplifiers) and microcontrollers (MCUs) for static current detection. Because hardware devices are extremely sensitive to the environment, developers must pre-program highly complex mathematical compensation formulas into the MCU to compensate for temperature drift, nonlinear errors, and external alternating magnetic field interference. For example, when the ambient temperature changes, the MCU needs to call high-order polynomial fitting formulas (such as temperature coefficient formulas containing square and cubic terms) for calculation; when facing magnetic field interference, it needs to substitute piecewise linear interpolation formulas for compensation. After each sampling, the MCU must extract data from the temperature and magnetic field sensors and substitute them into these cumbersome floating-point algebraic equations to solve for the compensated current value.

[0004] This reveals the following problems with existing technologies: 1. Over-reliance on complex mathematical formulas leads to huge consumption of floating-point computing power in MCUs; 2. Fixed formulas have strict fitting boundaries, and once they encounter extreme and sudden environmental changes (such as drastic cooling or complex magnetic fields), the formulas are prone to failure, resulting in an exponential amplification of detection errors; 3. Traditional formulas are difficult to resist the irreversible aging of hardware over time, resulting in serious blind spots and inaccuracies in static current detection in the later stages of the energy meter's life cycle. Summary of the Invention

[0005] (a) Technical problems to be solved In view of the problems in the related technologies, the present invention provides a static current detection method and system suitable for electricity meters, so as to overcome the above-mentioned technical problems existing in the existing related technologies.

[0006] (II) Technical Solution To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: On one hand, the present invention provides a static current detection method suitable for electricity meters, comprising the following steps: S1. Synchronously acquire the original weak electrical signals and environmental status data inside the electricity meter in real time, perform extreme value normalization preprocessing on the original weak electrical signals and environmental status data, extract multi-dimensional sensing feature vectors, and generate a multi-dimensional time series feature sequence to be analyzed that includes the time dimension. S2. Input the multi-dimensional time-series feature sequence to be analyzed into a lightweight environmental perception neural network model; use a one-dimensional convolution branch to extract waveform features that reflect the real static current, and use an attention mechanism branch to quantify the temperature change interference, spatial magnetic field distortion interference, and device background noise interference in real time. S3. Based on the temperature change interference, spatial magnetic field distortion interference, and device background noise interference, feature fusion weights are dynamically allocated within the lightweight environmental perception neural network model. The environmental interference features and the original electrical waveform features are fused nonlinearly and implicitly compensated to generate an anti-interference implicit feature representation. S4. Based on the anti-interference implicit feature representation, the current static current true value is output through the fully connected output layer of the lightweight environmental perception neural network model using integer matrix multiplication and addition instructions. S5. Utilize the lifecycle baseline tracking logic to perform low-frequency trend analysis on the true value of the long-term output static current and calculate the device aging offset rate; when the device aging offset rate reaches the lifecycle update threshold, trigger the online secondary correction procedure for the model bias parameters. Preferably, step S1 includes the following steps: S11. A weak voltage drop signal is obtained by using the manganese copper shunt integrated in the sampling circuit of the electricity meter. After being amplified by a programmable gain amplifier, the original weak electrical signal is obtained. S12. Simultaneously, the thermistor arranged on the main board of the electricity meter is used to obtain the real-time internal temperature signal, and the Hall sensor is used to obtain the triaxial spatial magnetic field strength signal as environmental status data. S13. Set a fixed time sliding window; align the original weak electrical signal, real-time internal temperature signal and triaxial spatial magnetic field strength signal with timestamps according to time sequence to obtain the aligned signal values. S14. Find the physical maximum and minimum values ​​of each signal at the factory calibration, linearly map the aligned signal values ​​to a unified value range of zero to one, construct a multi-dimensional sensing feature vector, and splice them in the time sliding window to form a multi-dimensional time series feature sequence to be analyzed. Preferably, the construction and training of the lightweight environmental perception neural network model in S2 includes the following steps: S21. Place the standard energy meter in the high and low temperature alternating damp heat test chamber and the electromagnetic interference generation chamber, and input the known high-precision standard static current as the reference label; traverse different temperature gradients and magnetic field strength combinations, record the corresponding multi-dimensional time series feature sequences, and construct a historical multi-dimensional environmental perception dataset. S22. Construct an initial lightweight environmental perception neural network model; divide the historical multidimensional environmental perception dataset according to a preset training data ratio to obtain a training dataset and a test dataset. S23. Set the target error threshold; input the training dataset into the initial lightweight environmental awareness neural network model; update the model weights through the backpropagation algorithm with the goal of reducing the average absolute error between the model output value and the benchmark label; S24. When the training error is less than the target error threshold, stop training and use the test dataset for verification; if the test error meets the target, output the trained floating-point neural network model. Preferably, the integer quantization process performed on the lightweight environmental perception neural network model in step S2 includes the following steps: S241. Statistically analyze the numerical distribution range of weight parameters and activation values ​​in each layer of the trained floating-point neural network model. S242. Based on the numerical distribution range, calculate the scaling factor and zero offset required to map the floating-point number to the eight-bit integer field; S243. Using the scaling factor and zero offset, convert all floating-point weights and bias terms in the model into eight-bit integer parameters to generate an integer quantization model suitable for execution by the energy meter microcontroller. Preferably, the real-time quantization of temperature change interference, spatial magnetic field distortion interference, and device background noise interference in S2 includes the following steps: S251. Input the multi-dimensional temporal feature sequence to be analyzed into the attention mechanism branch; use global average pooling operation to compress the time dimension to obtain an environmental feature vector containing global environmental information; S252. The environmental feature vector is passed sequentially through a dimension reduction fully connected layer and a dimension increase fully connected layer to capture the nonlinear dependence of temperature, magnetic field and voltage signals across channels, and obtain the dimension increase features. S253. Calculate the probability distribution of the upgraded features using the normalized exponential function, and output the temperature change interference, spatial magnetic field distortion interference, and device background noise interference with values ​​between zero and one. Preferably, the dynamic allocation of feature fusion weights, nonlinear feature fusion, and implicit compensation in S3 includes the following steps: S31. Divide the waveform features extracted by the one-dimensional convolution branch into voltage feature layer, temperature feature layer and magnetic field feature layer according to the channel; S32. The temperature change interference, spatial magnetic field distortion interference, and device background noise interference are used as multiplication weights and multiplied element-wise with the corresponding voltage feature layer, temperature feature layer, and magnetic field feature layer to obtain the weighted feature layers. When the temperature change disturbance approaches one, the network automatically amplifies the activation value of the temperature feature layer in subsequent network layers, forcing the model to rely on the temperature compensation path for inference. S33. The weighted feature layers are spliced ​​along the channel dimension, and the features are transformed by a non-linear activation function to generate an anti-interference implicit feature representation. Preferably, step S4 includes the following steps: S41. Flatten the anti-interference implicit feature representation into a one-dimensional feature vector; S42. Input the one-dimensional feature vector into a fully connected output layer composed of integer parameters; S43. Call the multiply-accumulate operation instruction inside the energy meter microcontroller to perform matrix multiplication and accumulation operations on the one-dimensional feature vector and the integer weights of the fully connected output layer to obtain the accumulation result; S44. Subtract the preset integer bias from the accumulated result, and perform inverse quantization shift operation according to the quantization scaling factor to directly output the true value of the quiescent current at the ampere level. Preferably, the lifecycle baseline tracking logic in S5 includes the following steps: S511. Set the baseline update cycle; within each baseline update cycle, select all detection data of the energy meter under zero load condition, and calculate the long-term average drift of the true value of the output static current under the zero load condition. S512. Compare the long-term average drift with the zero-point absolute reference value calibrated at the factory, and calculate the device aging offset rate. S513. Set a lifecycle update threshold; when the device aging offset rate is greater than the lifecycle update threshold for three consecutive baseline update cycles, it is determined that the hardware device has undergone irreversible aging. Preferably, the online secondary correction procedure for triggering the model bias parameters in S5 includes the following steps: S521. Extract the feature components of the long-term average drift and generate an aging compensation vector; S522. The aging compensation vector is back-mapped to the bias term of the fully connected output layer of the lightweight environmental perception neural network model. S523. The addition instruction is used to superimpose and correct the integer bias term of the fully connected output layer to complete the online adaptive evolution of the model and eliminate the static current measurement blind zone caused by device aging.

[0007] On the other hand, the present invention also provides a static current detection system suitable for electricity meters, implementing the aforementioned static current detection method for electricity meters, the system comprising: The multi-dimensional environment synchronous sensing module is used to collect the original weak electrical signals, internal temperature signals and spatial magnetic field signals of the energy meter in real time, and perform extreme value normalization and timestamp alignment to output the multi-dimensional time series feature sequence to be analyzed. The edge intelligent inference engine module has a built-in lightweight environmental perception neural network model that has been quantized by integers. It receives the multi-dimensional temporal feature sequence to be analyzed and uses one-dimensional convolution and attention mechanisms to quantify environmental interference and decouple features. The mapping output module, based on the anti-interference implicit feature representation extracted by the edge intelligent inference engine module, directly maps and outputs the true value of static current through integer matrix multiplication and addition operations; The full lifecycle adaptive module is used to track the device aging offset rate under zero load conditions and correct the bias parameters of the neural network model online when the offset exceeds the limit, so as to achieve closed-loop precision control.

[0008] (III) Beneficial Effects The present invention has the following beneficial effects: This invention introduces a data-driven end-to-end lightweight neural network, abandoning the traditional high-order polynomial temperature fitting and nonlinear compensation formulas. Through the dual-branch collaboration of feature extraction and attention mechanism, the system can implicitly sense sudden temperature changes and magnetic field distortions, and directly output the real static current using nonlinear mapping. This solves the technical bottleneck of traditional fixed formulas failing when exceeding the fitting boundary, and improves the accuracy and robustness of the energy meter in detecting small currents under extreme alternating environments.

[0009] This invention converts floating-point neural networks into eight-bit integer parameters through quantization methods such as KL divergence calibration. During inference, the system only needs to call a single-cycle integer matrix multiplication and addition instruction (MAC instruction) to complete the error compensation task that originally required massive floating-point operations. This enables the environmental perception AI model to run smoothly on low-cost energy meter chips with weak computing power and no floating-point operation unit, achieving both algorithmic dimensionality reduction and avoiding increased hardware costs.

[0010] This invention addresses the problem of factory calibration failure caused by irreversible aging of hardware components. By tracking zero-load baseline drift at extremely low frequencies, the system can correct the bias terms of the neural network output layer online using integer addition instructions after confirming component aging. This allows the energy meter to maintain measurement accuracy throughout its lifespan without recalibration or issuing new formulas, eliminating measurement blind spots caused by aging.

[0011] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of the invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For those skilled in the art, the drawings can be obtained from these drawings without creative effort.

[0013] Figure 1 This is a schematic flowchart of a static current detection method for electricity meters according to the present invention. Figure 2 This is a schematic diagram of a static current detection system for electricity meters according to the present invention. Detailed Implementation

[0014] The technical solutions of the embodiments of the invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the invention, and not all embodiments. Based on the embodiments of the invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the invention.

[0015] Please see Figure 1 This invention discloses a static current detection method suitable for electricity meters, comprising the following steps: S1. Synchronously acquire the original weak electrical signals and environmental status data inside the electricity meter in real time, perform extreme value normalization preprocessing on the original weak electrical signals and environmental status data, extract multi-dimensional sensing feature vectors, and generate a multi-dimensional time series feature sequence to be analyzed that includes the time dimension. S2. Input the multi-dimensional time-series feature sequence to be analyzed into a pre-trained and integer-quantized lightweight environmental perception neural network model; use the one-dimensional convolution branch inside the model to extract waveform features that reflect the real static current, and use the attention mechanism branch to quantize the temperature change interference, spatial magnetic field distortion interference, and device background noise interference in real time. S3. Based on the temperature change interference, spatial magnetic field distortion interference, and device background noise interference, feature fusion weights are dynamically allocated within the lightweight environmental perception neural network model. The environmental interference features and the original electrical waveform features are fused nonlinearly and implicitly compensated to generate an anti-interference implicit feature representation. S4. Based on the anti-interference implicit feature representation, the current static current true value is directly mapped and output through the fully connected output layer of the lightweight environmental perception neural network model using integer matrix multiplication and addition instructions. S5. Utilize the lifecycle baseline tracking logic to perform extremely low frequency trend analysis on the true value of the long-term output static current and calculate the device aging offset rate; when the device aging offset rate reaches the preset lifecycle update threshold, trigger the online secondary correction procedure of the model bias parameters. This invention, through the synchronous acquisition and extreme value normalization of multi-dimensional environmental features, abandons the traditional approach of relying excessively on complex high-order polynomials for error compensation in electricity meters. It introduces a lightweight environmental perception neural network and attention mechanism to achieve nonlinear feature fusion and implicit compensation for environmental disturbances such as sudden temperature changes and magnetic field distortions. Combined with edge integer quantization technology, this end-to-end model can run smoothly on ordinary microcontrollers with limited computing power, freeing up hardware resources. Through lifecycle baseline tracking and online bias correction logic, it quantifies and offsets baseline drift caused by irreversible aging of components. This achieves high-precision, adaptive detection of minute static currents in extreme alternating environments and throughout the entire lifecycle of the electricity meter. S1 includes the following steps: S11. A weak voltage drop signal is obtained by using the manganese copper shunt integrated in the sampling circuit of the electricity meter. After being amplified by a programmable gain amplifier, the original weak electrical signal is obtained. Specifically, S11 is as follows: In the current sampling circuit of the smart energy meter, when it is under extremely low load or at the edge of no load (such as only the standby current of household appliances), the static current flowing through the manganese copper shunt is usually at the milliampere or even microampere level; at this time, the voltage drop generated across the shunt is extremely weak and easily drowned out by the background noise; the system amplifies the weak voltage drop signal through the built-in low-noise programmable gain amplifier (PGA) and converts it into a digital raw electrical weak signal through a high-precision analog-to-digital converter (ADC) at a sampling rate of 4000 times per second; The coarse current RMS value is provided independently by the metering chip inside the energy meter. The metering chip has a built-in hardware RMS detection path, which continuously monitors the load current with low power consumption. Its output refresh rate is usually several times per second, which is completely physically isolated from the 4000 times / second sampling of the high-precision ADC. Therefore, the system can obtain the macro current estimate in real time without starting the high-precision ADC, thus avoiding the circular dependency that requires sampling to determine whether to sample. Furthermore, to avoid the flooding and interference of large load current during normal power consumption on the extraction of weak static signals, the system includes a hardware or software-level state gating pre-processing logic before acquiring the original weak electrical signals: real-time monitoring of the current apparent power or coarse current effective value of the energy meter, and only when the coarse current effective value is lower than a preset extremely low load threshold (such as lower than 5% of the nominal starting current) will the high-precision ADC be triggered to intercept the weak voltage drop signal at a sampling rate of 4000 times / second and transmit it to the downstream network; if it is in a normal large load power consumption state, the static current detection network is frozen, thereby achieving condition isolation between load current and static current at the physical signal acquisition source; S12. Simultaneously, the thermistor arranged on the main board of the electricity meter is used to obtain the real-time internal temperature signal, and the Hall sensor is used to obtain the triaxial spatial magnetic field strength signal as environmental status data. Specifically, S12 involves the following steps: Due to the inherent temperature drift characteristics of the manganese-copper shunt and operational amplifier circuit, and the fact that the electricity meter is susceptible to external malicious strong magnetic interference leading to inaccurate metering, the system mounts an NTC thermistor on a surface in the key sampling area of ​​the motherboard to collect the micro-environment temperature of the motherboard at a frequency of 10 times per second. At the same time, a three-axis Hall sensor is arranged inside the meter casing to collect the spatial magnetic field strength in the X, Y, and Z dimensions. These data together constitute the environmental status data characterizing the current working environment of the electricity meter. S13. Set a fixed time sliding window; align the original weak electrical signal, real-time internal temperature signal and triaxial spatial magnetic field strength signal with timestamps according to time sequence to obtain the aligned signal values. Specifically, S13 involves the system allocating a circular buffer memory (FIFO) within the microcontroller (MCU) and setting the length of the time sliding window to 80 sampling cycles (corresponding to a complete AC power frequency cycle of 20 milliseconds, based on a sampling rate of 4000 times / second). Due to the high sampling rate of the voltage signal and the low sampling rate of the temperature and magnetic field signals, the system uses zero-order hold interpolation to fill the low-frequency temperature and magnetic field data onto the high-frequency voltage time axis, ensuring that at any given time stamp, there is corresponding data in the five dimensions of voltage, temperature, magnetic field X, magnetic field Y, and magnetic field Z. Since ambient temperature and spatial magnetic field are low-frequency slowly varying physical quantities, their physical state can be regarded as quasi-static within a tiny time sliding window of only 20 milliseconds. Therefore, using zero-order hold interpolation to fill the high-frequency voltage time axis with the most recently sampled low-frequency environmental data will not only avoid introducing significant phase shifts or high-frequency spurious noise errors, but also meet the mandatory requirement of neural networks for the alignment of multidimensional input tensor sizes with low computational overhead. Furthermore, to eliminate numerical conflicts regarding the sampling rate in the preceding and following texts, the time sliding window length set by the circular buffer memory allocated by the system can adaptively match the ADC sampling rate; when the ADC sampling rate changes due to different configurations, the system can automatically adjust the window length to maintain alignment of the entire cycle. For example, when the sampling rate drops to 2000 times / second, the window length is adjusted to 40 sampling cycles. S14. Find the physical maximum and minimum values ​​of each signal at the factory calibration, linearly map the aligned signal values ​​to a unified value range of zero to one, construct a multi-dimensional sensing feature vector, and splice them in the time sliding window to form a multi-dimensional time series feature sequence to be analyzed. S14 specifically involves: To eliminate the interference of different sensor physical dimensions (such as millivolts, degrees Celsius, and Gaussians) on the neural network weight update, the system does not perform any complex filtering formula calculations, but only performs basic extreme value normalization; for the current (voltage drop) signal, the maximum and minimum physical limits set at the factory calibration are specifically defined as the maximum and minimum electrical range boundary values ​​that the system's programmable gain amplifier (PGA) can measure without distortion in conjunction with the analog-to-digital converter (ADC) at the current highest gain setting; for example, if the operating temperature limit of the energy meter is set to -40 degrees to +85 degrees, when the current temperature is 22.5 degrees, it is converted to a dimensionless value of 0.5 through proportional mapping; within a time window of 50 sampling points, a two-dimensional matrix with a size of 50 rows (time steps) multiplied by 5 columns (feature dimension) is formed, which is the multidimensional time-series feature sequence to be analyzed; this sequence retains the complete time-domain features of the electrical waveform and the transient features of environmental changes, serving as the input to the subsequent neural network; Through the synchronous acquisition of multidimensional electrical and environmental state data, zero-order hold interpolation alignment, and extreme value normalization processing, this system eliminates the differences in sampling frequency and dimensions of different physical sensors at the data input source; it constructs a multidimensional temporal feature sequence that is highly aligned in time and space, providing a data foundation for the subsequent accurate environmental perception and implicit compensation of the neural network, and improving the reliability of the data. The construction and training of the lightweight environment-aware neural network model in S2 includes the following steps: S21. Place the standard energy meter in the high and low temperature alternating damp heat test chamber and the electromagnetic interference generation chamber, and input the known high-precision standard static current as the reference label; traverse different temperature gradients and magnetic field strength combinations, record the corresponding multi-dimensional time series feature sequences, and construct a historical multi-dimensional environmental perception dataset. Specifically, S21 involves: before the model leaves the factory, using a high-precision source meter (such as a Fluke calibrator) to input precise static current values ​​ranging from 0.001A to 0.05A (as a reference label) into the energy meter; controlling the temperature chamber to rise from -40 degrees to 85 degrees at a rate of 5 degrees per minute, while simultaneously applying an alternating magnetic field ranging from 0 to 500 millitalas using an electromagnetic coil; during this process, the energy meter continuously collects the time series defined in S1; after several weeks of automated testing, input series-real current data pairs containing extreme environmental interference are collected to construct a complete training dataset; S22. Construct an initial lightweight environmental perception neural network model; divide the historical multidimensional environmental perception dataset according to a preset training data ratio to obtain a training dataset and a test dataset. S22 specifically involves: dividing the data according to a preset training data ratio (e.g., 80% training set and 20% test set); the network model architecture adopts a dual-branch structure: the main branch is a feature extraction network containing 3 layers of one-dimensional convolutional layers (1D-CNN), used to capture the periodic features and distortions of the voltage waveform within 50 time steps; the auxiliary branch is a channel attention mechanism network, used to evaluate environmental interference; Specifically, the input layer of the initial lightweight environmental perception neural network model receives a 50×5 multidimensional temporal feature sequence to be analyzed, which is simultaneously input to the main branch and the auxiliary branch in parallel. The main branch has three cascaded one-dimensional convolutional layers. The first layer has a kernel size of 3 and outputs 16 channels. The second and third layers increase the number of channels to 32 and 64 respectively. Each layer is followed by a batch normalization layer and a ReLU activation function, and finally outputs a deep feature map with a size of 50×64. This feature map is divided into voltage feature layers (channels 1-21), temperature feature layers (channels 22-42), and magnetic field feature layers (channels 43-64) according to the channel index. The auxiliary branch outputs three independent attention weights through pooling and fully connected layers. The two branches merge at the feature fusion layer. The three weights output by the auxiliary branch are multiplied by the temperature feature layer, magnetic field feature layer, and voltage feature layer output by the main branch through channel-wise tensor multiplication. Furthermore, the channel attention mechanism network of the auxiliary branch specifically includes: a global average pooling layer to compress the time dimension; followed by a dimension-reducing fully connected layer (16 neurons, ReLU activation function) to reduce the number of parameters; and then a dimension-upgrading fully connected layer (3 neurons, corresponding to three perturbations, Sigmoid activation function); the overall number of parameters of the model is controlled at approximately 15,000, and the memory usage of activation values ​​is less than 4KB, which meets the SRAM limit of the microcontroller; Furthermore, all model weights are in INT8 format, with approximately 15,000 parameters and a storage footprint of ≈15KB. The peak activation value appears at the output of the third convolutional layer, with a size of 50×64=3200 INT8 values ​​(3.2KB). Including the small amount of intermediate cache required for the batch normalization layer, the total activation memory is <4KB. The total memory footprint for weights and activation values ​​is approximately 19KB. Even with the overhead of network inference code and circular buffers, the total memory consumption can be controlled within 30KB, meeting the 32KB SRAM limit of a typical Cortex-M0 core MCU. The two branches are executed in parallel. The interference weights of the auxiliary branch are only included in the weighted fusion after the main branch outputs the deep feature map. Specifically, during forward propagation, the input sequence flows into the two branches at the same time. The main branch completes the convolution operation to obtain the feature map, and the auxiliary branch calculates three interferences at the same time. Then, in the feature fusion layer, the calculated interference weights are applied to the generated feature map. The whole process is passed sequentially in one go, without iteration or feedback loops. The attention mechanism does not require explicit separation of physical sources. It automatically learns implicit feature patterns corresponding to temperature, magnetic field and noise independently by using a large number of training samples containing different environmental combinations (such as individual temperature change, individual magnetization, noise level change, etc.) with the current truth label as the supervision signal. The environmental feature vector after global pooling already contains these distinguishable statistical features. The up-dimensional fully connected layer and the Sigmoid output further map them into independent interference scores. S23. Set the target error threshold; input the training dataset into the initial lightweight environmental awareness neural network model; update the model weights through the backpropagation algorithm with the goal of reducing the average absolute error between the model output value and the benchmark label; Specifically, S23 involves training on a cloud-based GPU server. The network automatically discovers the physical law that when the temperature drops from 20 degrees to -10 degrees, the voltage of the manganese-copper shunt decreases, but the actual input current remains unchanged. This nonlinear temperature compensation relationship is internalized as a weight parameter in the convolution kernel. The entire process does not require manual derivation of any temperature coefficient (TCR) compensation formula, thus achieving data-driven implicit compensation. Furthermore, the average absolute error is specifically calculated using the mean absolute error (MAE) as the loss function; the target error threshold is calculated based on the legal accuracy class of the electricity meter. For example, for a 0.2S class high-precision electricity meter, the root mean square error of its static microcurrent must be less than 0.2% of the nominal value. Based on this physical limit, the system derives the target error threshold as 2 microamps. During training, when the MAE of the test set is lower than this objective threshold for 10 consecutive epochs and no longer decreases, the model is determined to have converged and an early stopping mechanism is triggered, outputting the final model. S24. When the training error is less than the target error threshold, stop training and use the test dataset for verification; if the test error meets the target, output the trained floating-point neural network model. By constructing a historical multidimensional environmental perception dataset containing extreme temperature and magnetic field interference, and using a dual-branch lightweight neural network architecture for backpropagation training, this model can automatically mine and internalize the nonlinear physical laws between environmental factors and current errors. By replacing the tedious steps of manually deriving temperature coefficients or magnetic field cancellation formulas, the model has a powerful data-driven implicit compensation capability, solving the technical bottleneck that traditional fixed formulas are prone to failure when they exceed the fitting boundary. Since the main control MCU of an electricity meter (such as an ARM Cortex-M0 core chip) usually does not have a hardware floating-point unit (FPU), directly running a floating-point AI model would lead to a collapse in computing power; therefore, this invention performs post-training quantization (PTQ); the integer quantization processing of the lightweight environmental perception neural network model in S2 includes the following steps: S241. Statistically analyze the numerical distribution range of weight parameters and activation values ​​in each layer of the trained floating-point neural network model. S242. Based on the numerical distribution range, calculate the scaling factor and zero offset required to map the floating-point number to the eight-bit integer field; S243. Using the scaling factor and zero offset, convert all floating-point weights and bias terms in the model into eight-bit integer parameters to generate an integer quantization model suitable for execution by the energy meter microcontroller. Specifically, S241-S243 involves the system employing the Kullback-Leibler (KL) divergence calibration algorithm. Specifically, the KL divergence calibration algorithm uses 1000 representative multidimensional temporal feature sequences randomly selected from the test set as the calibration dataset. During the calibration forward propagation, the histogram distribution of activation values ​​for each network layer is statistically analyzed (e.g., divided into 2048 histogram bins). By continuously moving the truncation threshold, the KL divergence (relative entropy) between the pre-quantization floating-point distribution and the post-quantization INT8 distribution is calculated. The threshold that minimizes the KL divergence is selected as the optimal truncation point, thereby deriving the scaling factor and zero-point offset. The histogram distribution of activation values ​​of each network layer is collected during inference on the test dataset. Based on this distribution, the cutoff threshold that minimizes information loss before and after quantization is found, thereby obtaining the scaling factor and zero offset of the floating-point number mapping to the INT8 integer domain of -128 to 127. Through this KL divergence calibration process, all floating-point parameters are hard converted to eight-bit integer parameters, ensuring that the model size is compressed to one-quarter of the original size and can run on the MCU of the energy meter without floating-point operations. By introducing post-training quantization technology based on KL divergence calibration, this invention hard-converts the massive floating-point parameters into eight-bit integer parameters; compresses the model storage volume and eliminates the microcontroller's dependence on hardware floating-point arithmetic units when performing inference. Furthermore, the KL divergence calibration is specifically used for activation value quantization. The optimal truncation threshold and scaling factor are determined by minimizing the information loss of the activation value distribution before and after quantization. For the weight parameters of convolutional and fully connected layers, a symmetric quantization strategy based on the maximum absolute value per channel is adopted, which does not require KL divergence calibration and directly maps the floating-point weights linearly to the INT8 range. By combining the two methods, both quantization accuracy and engineering implementation efficiency are taken into account. The real-time quantification of temperature change interference, spatial magnetic field distortion interference, and device background noise interference in S2 includes the following steps: S251. Input the multi-dimensional temporal feature sequence to be analyzed into the attention mechanism branch; use global average pooling operation to compress the time dimension to obtain an environmental feature vector containing global environmental information; S252. The environmental feature vector is passed sequentially through a dimension reduction fully connected layer and a dimension increase fully connected layer to capture the nonlinear dependence of temperature, magnetic field and voltage signals across channels, and obtain the dimension increase features. S253. Calculate the probability distribution of the upgraded features using the normalized exponential function, and output the temperature change interference, spatial magnetic field distortion interference, and device background noise interference with values ​​between zero and one. Specifically, S251-S253 refers to the process of real-time quantification of interference during the actual operation of the electricity meter, as follows: The real-time multidimensional time-series feature sequence to be analyzed is input into the attention mechanism branch. This branch first uses global average pooling to compress the data of 50 time steps into a 1×5 feature vector containing global environmental information. The correlation between temperature, magnetic field and voltage is captured through two fully connected layers (with a nonlinear activation function in between). The Sigmoid activation function is used to perform independent nonlinear mapping on the upgraded features, and outputs three independent disturbances with values ​​in the range (0,1): temperature change disturbance, spatial magnetic field distortion disturbance, and device background noise disturbance. For example, when an electricity meter is approached by a strong magnet used by an electricity thief, the data in the Hall sensor channel fluctuates violently; the attention mechanism branch will keenly capture this change, and the spatial magnetic field distortion interference is as high as 0.95, while the temperature change interference is only 0.1. By using an attention mechanism branch to perform global pooling and probability distribution calculation on temporal features, the system can quantify the degree of temperature change or magnetic field distortion in the current environment in real time and dynamically, just like human intuition. This interference quantification based on a soft gating mechanism avoids the false triggering problem caused by traditional hard logic threshold judgment and provides an adaptive weight basis for subsequent accurate feature decoupling. It should be noted that the three interference levels, including temperature change interference level, mentioned in this invention are not based on traditional fixed physical thresholds (such as change rate > 1℃ / s) for hard judgment, but rather on confidence probabilities learned by the neural network based on the distribution of historical training data. When the transient change pattern of environmental features is highly similar to the strong interference samples in the training set, the corresponding interference probability value output by the Softmax function approaches 1. This soft gating mechanism reflects the model's quantitative assessment of the current environmental interference components. The dynamic allocation of feature fusion weights, nonlinear feature fusion, and implicit compensation in S3 include the following steps: S31. Divide the waveform features extracted by the one-dimensional convolution branch into voltage feature layer, temperature feature layer and magnetic field feature layer according to the channel; S31 specifically involves the microcontroller acquiring the 50×64 deep feature map output by the main branch in memory and strictly dividing it according to the preset channel index; specifically, channels 1 to 21 are divided into voltage feature layers, channels 22 to 42 into temperature feature layers, and channels 43 to 64 into magnetic field feature layers, ensuring the independent representation and isolation of multidimensional physical features within the network. S32. The temperature change interference, spatial magnetic field distortion interference, and device background noise interference are used as multiplication weights and multiplied element-wise with the corresponding voltage feature layer, temperature feature layer, and magnetic field feature layer to obtain the weighted feature layers. When the temperature change disturbance approaches one, the network automatically amplifies the activation value of the temperature feature layer in subsequent network layers, forcing the model to rely on the temperature compensation path for inference. Specifically, S32 is as follows: When the microcontroller receives the interference weight output by the auxiliary branch, it calls the internal single-cycle multiplication instruction to broadcast the weight scalar and multiply it element by element into the corresponding feature layer matrix; for example, when the objectively calculated spatial magnetic field distortion interference is 0.9, the overall value of the magnetic field feature layer (channels 43-64) is amplified by 0.9 times, thereby dynamically activating the specific neuron path that resists magnetic field interference inside the network and realizing feature recalibration; Furthermore, although superficially each feature layer is multiplied by the same scalar, since subsequent fully connected layers have independent weight coefficients for different channels, the overall scaling is equivalent to raising or suppressing the contribution intensity of the feature layer to the final output according to the magnitude of the disturbance, thereby realizing the dynamic bias of the network inference path. This mechanism is consistent with the Squeeze-and-Excitation operation concept in channel attention and is an effective feature recalibration method that can significantly improve the robustness of the model to specific environmental disturbances without significantly increasing computing power. S33. The weighted feature layers are spliced ​​along the channel dimension, and the features are transformed by a non-linear activation function to generate an anti-interference implicit feature representation. Specifically, S33 involves the microcontroller reassembling the three weighted feature layers along the channel dimension into a 50×64 reconstruction matrix and passing it through the ReLU nonlinear activation function. Under the action of this activation function, invalid noise features below zero are forcibly truncated and set to zero, thereby achieving implicit compensation for environmental interference through nonlinear spatial mapping, enabling subsequent fully connected layers to regress current values ​​unaffected by interference based on these robust features. Furthermore, the nonlinear feature fusion and implicit compensation of the environmental interference features and the original electrical waveform features is essentially a dynamic error compensation and feature remapping mechanism based on attention weights. The network does not filter out or subtract environmental signals at the physical level, but rather amplifies the feature weights of the interfered channels, forcing the subsequent fully connected layers to automatically perform nonlinear baseline shifting and compensation based on these activated environmental features, thereby offsetting the measurement deviation caused by environmental changes at the output. By dynamically allocating feature fusion weights and nonlinear activation truncation, deep decoupling of environmental interference features and original electrical waveform features is achieved. This mechanism enables the network to adaptively adjust the activation intensity of the anti-interference path according to real-time environmental changes, effectively stripping away false background noise caused by sudden changes in the external environment, generating implicit feature representations, and enhancing the anti-interference robustness of the system. S4 includes the following steps: S41. Flatten the anti-interference implicit feature representation into a one-dimensional feature vector; Specifically, S41 is as follows: the microcontroller uses global max pooling to compress the time dimension (50) of the anti-interference implicit feature representation with a size of 50×64 (corresponding to the 64 channels of the final output of the aforementioned cascaded one-dimensional convolutional layer), extracts the extreme values ​​of each channel, and flattens it into a one-dimensional feature vector with a length corresponding to the number of channels (i.e., 64). S42. Input the one-dimensional feature vector into a fully connected output layer composed of integer parameters; Specifically, S42 involves inputting the 64-dimensional feature vector into the fully connected output layer. The fully connected output layer is represented in memory as a 64×1 integer weight matrix. All its parameters are solidified into INT8 format through KL divergence calibration in the S2 stage and do not contain any floating-point data. S43. Call the multiply-accumulate operation instruction inside the energy meter microcontroller to perform matrix multiplication and accumulation operations on the one-dimensional feature vector and the integer weights of the fully connected output layer to obtain the accumulation result; Specifically, S43 involves the microcontroller calling the built-in MAC hardware instruction to complete the multiplication and accumulation operation of a feature value and its corresponding integer weight within one clock cycle; after 64 loops, the dot product result is accumulated losslessly into a 32-bit integer register to prevent data overflow. S44. Subtract the preset integer bias from the accumulated result, and perform inverse quantization shift operation according to the quantization scaling factor to directly output the true value of the quiescent current at the ampere level. Specifically, S44 involves subtracting the integer bias stored in the quantization stage from the accumulated result in the 32-bit register, and applying a scaling factor by replacing the time-consuming division operation with the arithmetic right shift instruction of the microcontroller; finally, the true value of the ampere-level static current accurate to 0.001A is directly mapped at the output port. Through integer matrix multiplication and addition operations in the fully connected layer, a direct mapping from high-dimensional implicit features to one-dimensional physical current values ​​is achieved; the inference process avoids complex floating-point operations and polynomial substitution, making full use of the single-cycle MAC instructions and shift operations of the low-end microcontroller; the current detection calculation delay is shortened, and high-precision calculation is achieved in the energy meter terminal with limited computing power. Furthermore, considering that the output of the neural network model is essentially a nonlinear estimate based on the input features, for the sake of rigor, the direct mapping output of the current true static current value described in this invention is specifically a direct mapping output of the current high-precision estimated detection value of the static current. The lifecycle baseline tracking logic in S5 includes the following steps: S511. Set the baseline update cycle; within each baseline update cycle, select all detection data of the energy meter under zero load condition, and calculate the long-term average drift of the true value of the output static current under the zero load condition. Specifically, S511 involves the system opening a low-frequency static data area in the non-volatile memory, with the baseline update cycle strictly defined by the internal RTC clock as 720 hours (30 days). Within this cycle, the system automatically extracts the moment when the voltage and current phase angle fluctuation is less than 0.5 degrees and the amplitude is less than 1% of the nominal starting current as the zero-load state, and calculates the arithmetic mean of thousands of static current true values ​​output in this state to obtain the long-term average drift. Furthermore, considering that a strictly zero-load state is rare in actual power grid operation, the system can be configured to a nighttime off-peak forced capture mode; during the off-peak period of the electrode in the early morning every day, when the load current is detected to be lower than 5% of the nominal starting current for 10 consecutive minutes, it is considered to be an approximate zero-load state and data screening is performed; if the sample size in a period is less than 100, a weighted moving average is performed using historical effective drift data to meet the statistical sample size requirements. S512. Compare the long-term average drift with the zero-point absolute reference value calibrated at the factory, and calculate the device aging offset rate. Specifically, S512 involves the system reading the zero-point absolute reference value burned into the EEPROM at the factory, subtracting the absolute reference value from the long-term average drift, and dividing by the nominal static starting current of the energy meter to calculate the dimensionless device aging offset percentage. S513. Set a lifecycle update threshold; when the device aging offset rate is greater than the lifecycle update threshold for three consecutive baseline update cycles, it is determined that the hardware device has undergone irreversible aging. Specifically, S513 is as follows: The life cycle update threshold is obtained by reading the maximum drift variance fitted by the system in the standard accelerated aging test (1000 hours of dual 85 test) before the batch of devices leaves the factory, and taking 3 times the standard deviation of the variance (3σ principle) as the threshold; when the aging offset rate is greater than the 3σ threshold for three consecutive cycles (90 days), the system statistically confirms that it is irreversible hardware aging rather than occasional environmental fluctuations. Furthermore, in order to improve the real-time performance of aging correction, the judgment condition for three consecutive baseline update cycles can be adaptively shortened; for example, if a sliding baseline update cycle is used as 7 days, when the drift rate of three consecutive short cycles (21 days) is greater than the set 3σ threshold, the online secondary correction program is triggered, thereby accelerating the model's response speed to hardware aging. By employing rigorous zero-load state screening and setting an objective aging threshold based on the 3σ principle, this logic achieves extremely low-frequency baseline tracking of the underlying hardware state of the energy meter. This mechanism can accurately distinguish between short-term environmental disturbances and long-term irreversible aging, avoiding misjudgments and miscompensations, and providing data support for subsequent online adaptive correction. The online secondary correction procedure for the model bias parameters in S5 includes the following steps: S521. Extract the feature components of the long-term average drift and generate an aging compensation vector; Specifically, S521 involves: when correction is triggered, the system extracts the sign bit and effective value of the long-term average drift; based on the quantization scaling factor stored in stage S2, the effective drift value is divided in reverse by the scaling factor and rounded down to generate an integer aging compensation vector, ensuring that the compensation dimensions are consistent with the network layer. S522. The aging compensation vector is back-mapped to the bias term of the fully connected output layer of the lightweight environmental perception neural network model. Specifically, S522 involves the system addressing the physical address of the bias term of the fully connected output layer of the lightweight environmental awareness neural network model stored in Flash or EEPROM according to the memory mapping table, and using the aging compensation vector as the incremental parameter to be updated. S523. The addition instruction is used to superimpose and correct the integer bias term of the fully connected output layer to complete the online adaptive evolution of the model and eliminate the static current measurement blind zone caused by device aging. Specifically, S523 involves using the microcontroller's integer addition instruction to directly superimpose the negative of the aging compensation vector into the bias term of the aforementioned physical address. This operation only requires a single addition to shift the network output reference, eliminating the need to re-execute high-computing-power backpropagation training and removing the microampere-level measurement blind zone caused by aging. By using lightweight bias inverse mapping and a single integer addition instruction, online adaptive evolution of the neural network model is achieved. This mechanism, which can dynamically offset component aging errors without retraining, solves the problem of metering inaccuracies in the later stages of the electricity meter's lifespan. In this way, the output reference of the network model is pulled back to absolute zero. This online bias correction not only requires minimal computation (only one addition) but also solves the problems of under-counting and over-counting of static current in the later stages of the electricity meter's lifespan.

[0016] For further details, please refer to Figure 2 A static current detection system suitable for electricity meters, implementing the static current detection method for electricity meters, the system comprising: The multi-dimensional environment synchronous sensing module is used to collect the original weak electrical signals, internal temperature signals and spatial magnetic field signals of the energy meter in real time, and perform extreme value normalization and timestamp alignment to output the multi-dimensional time series feature sequence to be analyzed. The edge intelligent inference engine module has a built-in lightweight environmental perception neural network model that has been quantized by integers. It receives the multi-dimensional temporal feature sequence to be analyzed and uses one-dimensional convolution and attention mechanisms to quantify environmental interference and decouple features. The mapping output module, based on the anti-interference implicit feature representation extracted by the edge intelligent inference engine module, directly maps and outputs the true value of static current through integer matrix multiplication and addition operations; The full lifecycle adaptive module is used to track the device aging offset rate under zero load conditions and correct the bias parameters of the neural network model online when the offset exceeds the limit, so as to achieve closed-loop precision control. This invention utilizes data-driven edge intelligent nonlinear mapping to replace the traditional, complex, and rigid mathematical compensation formulas with a dimensionality-reducing approach. In the field of smart meters, the long-standing mindset for solving errors has been to derive higher-order and more complex compensation equations. This invention lightweights and quantizes powerful nonlinear fitting tools from the cloud, bringing them down to the microcontroller of the energy meter, which is limited by computing power. Through the dual-branch collaboration of one-dimensional convolution and attention mechanisms, the system implicitly senses and decouples sudden temperature changes and magnetic field distortions, and uses integer matrix multiplication and addition instructions to instantly complete the stripping of multidimensional interference and current mapping. It eliminates the burden of high-order polynomials, calculus, and other floating-point operations on low-cost hardware, and more importantly, it endows the energy meter with the ability to continuously optimize. By tracking the aging variance of the time baseline and realizing online bias correction, the device can maintain static microcurrent detection accuracy in extreme alternating environments and device aging conditions throughout its life cycle.

[0017] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0018] The preferred embodiments of the invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention.

Claims

1. A static current detection method suitable for electricity meters, characterized in that, Includes the following steps: S1. Synchronously acquire the original weak electrical signals and environmental status data inside the electricity meter in real time, perform extreme value normalization preprocessing on the original weak electrical signals and environmental status data, extract multi-dimensional sensing feature vectors, and generate a multi-dimensional time series feature sequence to be analyzed that includes the time dimension. S2. Input the multi-dimensional time-series feature sequence to be analyzed into a lightweight environmental perception neural network model; use a one-dimensional convolution branch to extract waveform features that reflect the real static current, and use an attention mechanism branch to quantify the temperature change interference, spatial magnetic field distortion interference, and device background noise interference in real time. S3. Based on the temperature change interference, spatial magnetic field distortion interference, and device background noise interference, feature fusion weights are dynamically allocated within the lightweight environmental perception neural network model. The environmental interference features and the original electrical waveform features are fused nonlinearly and implicitly compensated to generate an anti-interference implicit feature representation. S4. Based on the anti-interference implicit feature representation, the current static current true value is output through the fully connected output layer of the lightweight environmental perception neural network model using integer matrix multiplication and addition instructions. S5. Utilize the lifecycle baseline tracking logic to perform low-frequency trend analysis on the true value of the long-term output static current and calculate the device aging offset rate; when the device aging offset rate reaches the lifecycle update threshold, trigger the online secondary correction procedure for the model bias parameters. The lifecycle baseline tracking logic includes the following steps: S511. Set the baseline update cycle; within each baseline update cycle, select all detection data of the energy meter under zero load condition, and calculate the long-term average drift of the true value of the output static current under the zero load condition. S512. Compare the long-term average drift with the zero-point absolute reference value calibrated at the factory, and calculate the device aging offset rate. S513. Set a lifecycle update threshold; when the device aging offset rate is greater than the lifecycle update threshold for three consecutive baseline update cycles, it is determined that the hardware device has undergone irreversible aging.

2. The static current detection method for electricity meters according to claim 1, characterized in that, S1 includes the following steps: S11. A weak voltage drop signal is obtained by using the manganese-copper shunt integrated in the sampling circuit of the electricity meter. After being amplified by a programmable gain amplifier, the original weak electrical signal is obtained. S12. Simultaneously, the thermistor arranged on the main board of the electricity meter is used to obtain the real-time internal temperature signal, and the Hall sensor is used to obtain the triaxial spatial magnetic field strength signal as environmental status data. S13. Set a time sliding window; align the original weak electrical signal, real-time internal temperature signal and triaxial spatial magnetic field strength signal with timestamps according to time sequence to obtain the aligned signal values. S14. Find the physical maximum and minimum values ​​of each signal at the factory calibration, linearly map the aligned signal values ​​to a unified value range of zero to one, construct a multi-dimensional sensing feature vector, and splice them together within the time sliding window to form a multi-dimensional time series feature sequence to be analyzed.

3. The static current detection method for electricity meters according to claim 2, characterized in that, The construction and training of the lightweight environment-aware neural network model in S2 includes the following steps: S21. Place the standard energy meter in the high and low temperature alternating damp heat test chamber and the electromagnetic interference generation chamber, and input the known high-precision standard static current as the reference label; traverse different temperature gradients and magnetic field strength combinations, record the corresponding multi-dimensional time series feature sequences, and construct a historical multi-dimensional environmental perception dataset. S22. Construct an initial lightweight environmental perception neural network model; divide the historical multidimensional environmental perception dataset according to a preset training data ratio to obtain a training dataset and a test dataset. S23. Set the target error threshold; input the training dataset into the initial lightweight environmental awareness neural network model; update the model weights through the backpropagation algorithm with the goal of reducing the average absolute error between the model output value and the benchmark label; S24. When the training error is less than the target error threshold, stop training and use the test dataset for verification; if the test error meets the target, output the trained floating-point neural network model.

4. The static current detection method for electricity meters according to claim 3, characterized in that, The lightweight environmental perception neural network model in S2 undergoes integer quantization processing, which includes the following steps: S241. Statistically analyze the numerical distribution range of weight parameters and activation values ​​in each layer of the trained floating-point neural network model. S242. Based on the numerical distribution range, calculate the scaling factor and zero offset required to map the floating-point number to the eight-bit integer field; S243. Using the scaling factor and zero offset, convert all floating-point weights and bias terms in the model into eight-bit integer parameters to generate an integer quantization model suitable for execution by the energy meter microcontroller.

5. The static current detection method for electricity meters according to claim 1, characterized in that, The real-time quantification of temperature change interference, spatial magnetic field distortion interference, and device background noise interference in S2 includes the following steps: S251. Input the multi-dimensional temporal feature sequence to be analyzed into the attention mechanism branch; use global average pooling operation to compress the time dimension to obtain an environmental feature vector containing global environmental information; S252. Pass the environmental feature vector through a dimension reduction fully connected layer and a dimension increase fully connected layer in sequence to obtain the dimension increase features; S253. Calculate the probability distribution of the upgraded features using the normalized exponential function, and output the temperature change interference, spatial magnetic field distortion interference, and device background noise interference values ​​between zero and one.

6. The static current detection method for electricity meters according to claim 5, characterized in that, The dynamic allocation of feature fusion weights, nonlinear feature fusion, and implicit compensation in S3 include the following steps: S31. Divide the waveform features extracted by the one-dimensional convolution branch into voltage feature layer, temperature feature layer and magnetic field feature layer according to the channel; S32. The temperature change interference, spatial magnetic field distortion interference, and device background noise interference are used as multiplication weights and multiplied element-wise with the corresponding voltage feature layer, temperature feature layer, and magnetic field feature layer to obtain the weighted feature layers. When the temperature change disturbance approaches one, the network automatically amplifies the activation value of the temperature feature layer in subsequent network layers, forcing the model to rely on the temperature compensation path for inference. S33. The weighted feature layers are spliced ​​along the channel dimension, and the features are transformed by a non-linear activation function to generate an anti-interference implicit feature representation.

7. The static current detection method for electricity meters according to claim 1, characterized in that, S4 includes the following steps: S41. Flatten the anti-interference implicit feature representation into a one-dimensional feature vector; S42. Input the one-dimensional feature vector into a fully connected output layer composed of integer parameters; S43. Call the multiply-accumulate operation instruction inside the energy meter microcontroller to perform matrix multiplication and accumulation operations on the one-dimensional feature vector and the integer weights of the fully connected output layer to obtain the accumulation result; S44. Subtract the preset integer bias from the accumulated result, and perform dequantization shift operation according to the quantization scaling factor to output the true value of the static current.

8. The static current detection method for electricity meters according to claim 1, characterized in that, The online secondary correction procedure for the model bias parameters in S5 includes the following steps: S521. Extract the feature components of the long-term average drift and generate an aging compensation vector; S522. The aging compensation vector is back-mapped to the bias term of the fully connected output layer of the lightweight environmental perception neural network model. S523. Use addition instructions to superimpose and correct the integer bias terms of the fully connected output layer.

9. A static current detection system for electricity meters, used to implement the static current detection method for electricity meters as described in any one of claims 1-8, characterized in that, The system includes: The multi-dimensional environment synchronous sensing module is used to collect the original weak electrical signals, internal temperature signals and spatial magnetic field signals of the energy meter in real time, and perform extreme value normalization and timestamp alignment to output the multi-dimensional time series feature sequence to be analyzed. The edge intelligent inference engine module has a built-in lightweight environmental perception neural network model that has been quantized by integers. It receives the multi-dimensional temporal feature sequence to be analyzed and uses one-dimensional convolution and attention mechanisms to quantify environmental interference and decouple features. The mapping output module, based on the anti-interference implicit feature representation extracted by the edge intelligent inference engine module, directly maps and outputs the true value of static current through integer matrix multiplication and addition operations; The full lifecycle adaptive module is used to track the device aging offset rate under zero load conditions and correct the bias parameters of the neural network model online when the offset exceeds the limit, so as to achieve closed-loop precision control and lifecycle baseline tracking logic. The tracking is implemented through lifecycle baseline tracking logic, specifically including the following steps: S511. Set the baseline update cycle; within each baseline update cycle, select all detection data of the energy meter under zero load condition, and calculate the long-term average drift of the true value of the output static current under the zero load condition. S512. Compare the long-term average drift with the zero-point absolute reference value calibrated at the factory, and calculate the device aging offset rate. S513. Set a lifecycle update threshold; when the device aging offset rate is greater than the lifecycle update threshold for three consecutive baseline update cycles, it is determined that the hardware device has undergone irreversible aging.

Citation Information

Patent Citations

  • Electric energy information acquisition and management method based on artificial intelligence algorithm

    CN119598250A

  • Electric energy meter fault test system and method

    CN120352828A