Error compensation method and system for improving the measurement accuracy of an electric energy meter in a high-temperature environment

CN122525193BActive Publication Date: 2026-10-09CSG SMART SCI&TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611026494.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-10
Publication Date
2026-10-09
Estimated Expiration
2046-07-10

AI Technical Summary

Technical Problem

然而,在实际复杂运行环境中,电能表内部的计量芯片、电流互感器及分压电阻网络等关键元器件的发热特性与空间分布各异,存在明显的温度梯度,单点测温根本无法真实反映各核心部件的实际工作结温

Benefits of technology

本发明实现了高精度的多源温度场感知与解耦补偿;通过在关键发热区域布设多个传感器,并结合客观实验推导的热传导权重模型,精确还原了核心元器件的实际工作结温,解决了传统单点测温失真的问题;利用分层递进架构中的基础温漂补偿层,以极低的算力消耗优先消除了主要的温度线性和低阶非线性漂移,为后续高阶动态补偿奠定了精准的数据基础。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122525193B_ABST
    Figure CN122525193B_ABST
Patent Text Reader

Abstract

The application discloses an error compensation method and system for improving the metering precision of an electric energy meter in a high-temperature environment, and relates to the technical field of electric power metering and intelligent sensors; a plurality of temperature sensors are arranged in the electric energy meter, the actual working temperature of key components is calculated based on a heat conduction weight model, operating state parameters are collected and a multi-dimensional feature vector is constructed, a layered progressive model of a basic temperature drift compensation layer, a multi-factor coupling compensation layer and an adaptive residual compensation layer is used to calculate compensation quantities layer by layer, the total compensation quantity is fused and written into a metering chip register to realize real-time correction at the hardware level, model parameters are updated through an incremental learning strategy based on a built-in self-checking mechanism and a threshold set based on an accuracy limit, and the problems of single-point temperature measurement distortion, difficulty in eliminating multi-factor coupling errors and model failure caused by component aging are solved, and high-precision adaptive metering of the electric energy meter in an extreme high-temperature environment and the whole life cycle is realized without increasing the computing power burden of an MCU.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power metering and intelligent sensor technology, and specifically relates to an error compensation method and system for improving the metering accuracy of electricity meters under high temperature conditions. Background Technology

[0002] As the core terminal equipment for electricity metering and trade settlement in smart grids, the accuracy of electricity meters directly affects the economic interests of both electricity suppliers and consumers, as well as the accuracy of grid dispatching. In recent years, with the intensification of global warming and the urban heat island effect, centralized meter boxes installed outdoors face severe high-temperature challenges in extreme summer weather. The temperature inside the boxes often rises to 70°C or even higher, far exceeding the upper limit of the standard operating temperature of electricity meters, leading to increasingly prominent metering inaccuracies and an urgent need for effective error compensation methods.

[0003] Currently, conventional methods for handling high-temperature errors in electricity meters mainly rely on static temperature compensation before shipment. Existing technologies typically employ single-point temperature measurement schemes, utilizing a single thermistor inside the metering chip or on the PCB board to obtain the temperature, and correcting the metering error based on a fixed piecewise linear interpolation or a single polynomial model. However, in actual complex operating environments, the heating characteristics and spatial distribution of key components such as the metering chip, current transformer, and voltage divider resistor network inside the electricity meter vary, exhibiting significant temperature gradients. Single-point temperature measurement simply cannot accurately reflect the actual junction temperature of each core component. Furthermore, the metering error caused by high temperature is not a simple single-variable function of temperature, but rather a nonlinear result deeply coupled with multiple factors such as load current, power factor, and voltage fluctuations. Traditional static fixed models not only fail to decouple these complex variables but also cannot cope with the temperature drift characteristics shift caused by component aging (such as resistance drift and magnetic degradation) after long-term operation, resulting in a significant decrease in compensation effectiveness in the later stages of equipment service.

[0004] This shows that existing technologies suffer from problems such as internal temperature field sensing distortion, difficulty in eliminating multi-factor coupling errors, and a lack of long-term adaptive evolution capability in static models. As a result, the metering errors of existing electricity meters are prone to exceed limits under extreme high-temperature conditions and in the later stages of their entire life cycle, making it difficult to meet the stringent requirements of modern smart grids for high-precision and high-reliability metering. Summary of the Invention

[0005] (a) Technical problems to be solved To address the problems in related technologies, this invention provides an error compensation method and system for improving the metering accuracy of electricity meters under high-temperature environments, thereby overcoming the aforementioned technical problems existing in the prior art.

[0006] (II) Technical Solution To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: S1. Multiple temperature sensors are installed inside the electricity meter to collect temperature data from each area simultaneously. The actual operating temperature of each key component is calculated based on the heat conduction weighting model to establish the temperature field distribution inside the electricity meter. S2. Real-time acquisition of the current operating status parameters of the electricity meter, combined with the temperature values ​​of each area obtained in S1 to construct a multi-dimensional feature vector, and normalization preprocessing of the multi-dimensional feature vector to generate standardized features; S3. Based on the standardized features generated in S2, the compensation amount is calculated layer by layer through a hierarchical progressive error compensation model. The hierarchical progressive error compensation model includes a basic temperature drift compensation layer, a multi-factor coupling compensation layer, and an adaptive residual compensation layer. The three layers are processed in sequence and their respective compensation amounts are output. S4. The three-layer compensation amounts in S3 are weighted and fused to obtain the total compensation amount; it is determined whether the total compensation amount exceeds the compensation limit. If it does not exceed the limit, the total compensation amount is converted into the metering chip correction register value and written into the metering chip to complete the real-time error correction of the power metering value; otherwise, an alarm is triggered and the compensation parameters are locked. S5. Trigger the built-in self-verification mechanism of the energy meter at a preset time interval to obtain the deviation between the current actual error value and the total compensation amount. When the deviation exceeds the update threshold, use the incremental learning strategy to update the model parameters of the multi-factor coupled compensation layer and the adaptive residual compensation layer in S3 online. Preferably, step S1 includes the following steps: S11. Temperature sensors are installed in the metering chip area, current transformer area and voltage divider resistor network area on the PCB board of the electricity meter, respectively, and the temperature values ​​of the three areas are collected synchronously at a preset sampling period. S12. The heat conduction weighting coefficient is obtained by the constant temperature chamber step temperature response experiment. The experiment is carried out at at least four temperature points. The transfer relationship between each temperature measurement point and the junction temperature of the metering chip is recorded. The least squares identification method is used to determine each weighting coefficient. S13. Based on the current operating current and supply voltage of the metering chip, and combined with the chip junction-to-environment thermal resistance parameters, calculate the dynamic self-heating temperature rise increment of the chip caused by load fluctuations. Preferably, step S13 includes the following steps: S131. Read the current operating current and supply voltage of the metering chip, and calculate the dynamic power dissipation increment of the chip actually converted into heat energy, in combination with the chip's effective heat dissipation coefficient. S132. Multiply the dynamic power dissipation increment obtained in S131 by the thermal resistance from the chip junction to the environment to obtain the dynamic self-heating temperature rise increment. S14. Based on the temperature value obtained in S11, the heat conduction weighting coefficient obtained in S12, and the self-heating temperature rise obtained in S13, the actual operating temperature of each key component is calculated by weighted summation. Preferably, step S2 includes the following steps: S21. Read the current load current RMS value, power factor, voltage RMS value and grid frequency from the metering chip register; S22. Read the cumulative running time of the energy meter from the RTC clock module; S23. Combine the three regional temperature values ​​obtained in S1 with the current effective value of load current, power factor, effective value of voltage, and grid frequency obtained in S21, as well as the cumulative running time of the energy meter obtained in S22, to construct an eight-dimensional feature vector; S24. Normalize the eight-dimensional feature vector constructed in S23, map the data of each dimension to the [0,1] interval, and generate standardized features; Preferably, step S24 includes the following steps: S241. Set upper and lower bounds for the normalization range of each dimension of the eight-dimensional feature vector, wherein the upper and lower bounds are determined according to the design specifications of the electricity meter. S242. Map each dimension using the min-max normalization formula to obtain standardized features; Preferably, step S3 includes the following steps: S31. Input the temperature component in the normalized feature generated in S2 into the basic temperature drift compensation layer, and use a third-order polynomial model to calculate the basic temperature drift compensation amount of the voltage channel, current channel and phase channel respectively. S32. The standardized feature multi-factor coupling compensation layer generated in S2 is used to calculate the coupling compensation amount between temperature and load current and power factor using a support vector regression model based on radial basis function kernel. S33. The difference between the sum of the basic temperature drift compensation amount obtained in S31 and the coupling compensation amount obtained in S32 and the actual measurement error is used as the residual signal and input into the adaptive residual compensation layer. S34, the adaptive residual compensation layer adopts a recursive least squares algorithm with a forgetting factor, taking the residual signal of S33 as the target, and identifies the residual compensation amount online; Preferably, step S32 includes the following steps: S321. Calculate the Euclidean distance between the input feature vector and each support vector; S322. Substitute the Euclidean distance into the radial basis kernel function to calculate the kernel function value; S323. Multiply each kernel function value by the corresponding support vector weight, sum the results, and add the bias term to obtain the coupling compensation amount. Preferably, step S4 includes the following steps: S41. Add the basic temperature drift compensation, coupling compensation, and online identification residual compensation directly to obtain the total compensation. S42. Determine whether the absolute value of the total compensation amount exceeds the upper limit of the compensation amount. If it does, lock the current compensation amount and stop updating it, and send an alarm message to the main station. Otherwise, execute S43. S43. Convert the total compensation amount obtained in S41 into the gain correction register value and phase correction register value of the metering chip, and write them into the metering chip to complete real-time compensation. S44. The metering chip corrects the subsequent energy accumulation calculation based on the written correction register value, resulting in a compensated energy metering value. Preferably, the register value conversion in S43 includes the following steps: S431. Calculate the total compensation amount using the bit width of the metering chip's gain correction register and the gain factor corresponding to the full scale. e total The corresponding quantized value, after being rounded down, becomes the value written to the gain correction register; S432. Based on the angular difference component in the phase channel compensation, quantize it according to the step accuracy of the phase correction register of the metering chip to obtain the value written to the phase correction register. Preferably, step S5 includes the following steps: S51. Trigger self-calibration at a preset time interval, control the internal precision reference source to output a known power signal, measure the signal through the metering chip and compare it with the theoretical value to obtain the current actual error; S52. Calculate the deviation between the current actual error obtained in S51 and the total compensation amount predicted by the model in S3; S53. Determine whether the deviation obtained in S52 exceeds the update threshold. If it does, add the feature vector and actual error under the current working condition as new samples to the training set, trigger the support vector regression model of the multi-factor coupling compensation layer to perform incremental updates, and reset the covariance matrix of the recursive least squares algorithm of the adaptive residual compensation layer. S54. A sliding window mechanism is used to manage the training sample set. When the total number of samples exceeds the window capacity, the oldest sample is removed to ensure that the model reflects the current state of the device. Preferably, an error compensation system for improving the metering accuracy of electricity meters under high temperature conditions is provided, which implements the error compensation method for improving the metering accuracy of electricity meters under high temperature conditions. The system includes a temperature field sensing module, a feature construction module, a hierarchical compensation module, a compensation application module, and an online learning module. The temperature field sensing module is used to deploy multiple temperature sensors and collect temperature data from each area, and to calculate the actual operating temperature of each key component based on the heat conduction weighting model. The feature construction module is used to collect the operating status parameters of the electricity meter, combine them with the temperature value output by the temperature field sensing module to construct a multi-dimensional feature vector and perform normalization preprocessing. The hierarchical compensation module is used to receive the standardized features output by the feature construction module, and calculate each compensation amount layer by layer through the basic temperature drift compensation layer, the multi-factor coupling compensation layer and the adaptive residual compensation layer. The compensation application module is used to fuse the three-layer compensation quantities output by the hierarchical compensation module, convert them into the calibration register value of the metering chip and write them, and at the same time perform over-limit detection and alarm. The online learning module is used to periodically trigger self-verification to obtain the actual error, compare it with the model prediction value, and then decide whether to update the model parameters in the hierarchical compensation module.

[0007] (III) Beneficial Effects The present invention has the following beneficial effects: This invention achieves high-precision multi-source temperature field sensing and decoupling compensation; by deploying multiple sensors in key heat-generating areas and combining them with a heat conduction weight model derived from objective experiments, the actual operating junction temperature of core components is accurately restored, solving the problem of distortion in traditional single-point temperature measurement; by utilizing the basic temperature drift compensation layer in the hierarchical progressive architecture, the main linear and low-order nonlinear temperature drifts are eliminated with extremely low computing power consumption, laying a precise data foundation for subsequent high-order dynamic compensation.

[0008] This invention overcomes the problem of eliminating multi-factor coupling errors. By constructing a multi-dimensional feature vector containing temperature, current, power factor, and running time, and introducing normalization processing and support vector regression model, the complex nonlinear coupling effect between temperature and grid load state is accurately quantified and compensated. This multi-dimensional feature mapping mechanism breaks the limitations of traditional single-variable compensation and ensures the metering consistency of the electricity meter under full load range and extreme operating conditions.

[0009] This invention endows the electricity meter with adaptive evolution capabilities throughout its entire lifecycle. Relying on the built-in self-verification mechanism to obtain actual errors, and combined with the recursive least squares algorithm with a variable forgetting factor and incremental learning strategy, the system can autonomously trigger online updates of model parameters based on objective thresholds calculated according to the accuracy level. This effectively overcomes the problem of static model failure caused by device aging, ensuring that the equipment maintains high-precision metering throughout its service life. At the same time, the over-limit locking alarm mechanism ensures the absolute security of power grid data.

[0010] 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

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

[0012] Figure 1 This is a flowchart illustrating an error compensation method for improving the metering accuracy of an electricity meter under high-temperature conditions, according to the present invention. Figure 2 This is a schematic diagram of a module of an error compensation system for improving the metering accuracy of electricity meters under high-temperature conditions, according to the present invention. Detailed Implementation

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

[0014] Please see Figure 1 This invention discloses an error compensation method for improving the metering accuracy of electricity meters under high-temperature environments, comprising the following steps: S1. Multiple temperature sensors are installed inside the electricity meter to collect temperature data from each area simultaneously. The actual operating temperature of each key component is calculated based on the heat conduction weighting model to establish the temperature field distribution inside the electricity meter. S2. Real-time acquisition of the current operating status parameters of the electricity meter, combined with the temperature values ​​of each area obtained in S1 to construct a multi-dimensional feature vector, and normalization preprocessing of the multi-dimensional feature vector to generate standardized features; S3. Based on the standardized features generated in S2, the compensation amount is calculated layer by layer through a hierarchical progressive error compensation model. The hierarchical progressive error compensation model includes a basic temperature drift compensation layer, a multi-factor coupling compensation layer, and an adaptive residual compensation layer. The three layers are processed in sequence and their respective compensation amounts are output. S4. The three-layer compensation amounts in S3 are weighted and fused to obtain the total compensation amount; it is determined whether the total compensation amount exceeds the compensation limit. If it does not exceed the limit, the total compensation amount is converted into the metering chip correction register value and written into the metering chip to complete the real-time error correction of the power metering value; otherwise, an alarm is triggered and the compensation parameters are locked. S5. Trigger the built-in self-verification mechanism of the energy meter at a preset time interval to obtain the deviation between the current actual error value and the total compensation amount. When the deviation exceeds the update threshold, use the incremental learning strategy to update the model parameters of the multi-factor coupled compensation layer and the adaptive residual compensation layer in S3 online. This invention organically combines multi-source temperature field sensing, multi-dimensional feature construction, hierarchical progressive compensation, direct writing to hardware registers, and an online self-learning mechanism to form a complete closed-loop error correction system. It overcomes the limitations of traditional single-point temperature measurement and static single compensation models by using a derived heat conduction weight model to restore the true internal temperature field, achieving precise decoupling and layer-by-layer elimination of basic temperature drift errors, multi-factor coupling errors, and residual errors from device aging under complex high-temperature environments. Relying on built-in self-verification and incremental learning strategies, and dynamically triggering model updates based on thresholds calculated according to national metrological standards, it endows the energy meter with adaptive evolution capabilities throughout its entire lifecycle. This dynamic compensation architecture effectively ensures metrological fairness and data reliability under extreme high-temperature conditions and long-term operation without significantly increasing the MCU's computing power burden. S1 includes the following steps: S11. Temperature sensors are installed in the metering chip area, current transformer area, and voltage divider resistor network area on the PCB board of the electricity meter, respectively, to synchronously collect the temperature values ​​of the three areas at a preset sampling period. T 1. T 2. T 3; In specific implementation, S11 is as follows: This embodiment uses a DS18B20 digital temperature sensor with a temperature resolution of 0.0625℃ and a temperature range of -55℃ to +125℃; the first temperature sensor is positioned directly above the metering chip package, no more than 3mm from the chip surface, and is fixed by thermal grease; the second temperature sensor is attached to the middle of the outer surface of the current transformer core and fixed with high-temperature epoxy resin; the third temperature sensor is located at the center of the voltage divider resistor network and soldered to the reserved pad on the PCB board; the three sensors are connected to the GPIO port of the MCU through a single bus interface. The MCU sends temperature conversion commands to the three sensors simultaneously with a sampling period of 5 seconds, and reads the temperature data of each sensor sequentially after the conversion is completed in 750ms; the reason for using a 5-second sampling period is that the internal thermal time constant of the energy meter is usually between 30 seconds and 120 seconds, and a 5-second sampling period can fully capture the temperature change trend without causing excessive communication burden on the MCU; By deploying temperature sensors in three key heat source areas inside the electricity meter, the temperature gradient distribution inside the electricity meter can be sensed, avoiding the problem of inaccurate temperature measurement caused by the temperature measurement point being far away from the actual heat source in the traditional single-point temperature measurement scheme. S12. Obtain the heat conduction weighting coefficient through a constant temperature chamber step temperature response experiment. α 1. α 2. α 3. The experiment was conducted at at least four temperature points, and the transfer relationship between each temperature measurement point and the junction temperature of the metering chip was recorded. The least squares identification method was used to determine each weight coefficient. In specific implementation, S12 involves: placing the energy meter in a programmable constant temperature chamber, setting four temperature steps of 25℃, 45℃, 65℃, and 85℃; maintaining a constant temperature at each temperature step for at least 3 hours to ensure that the energy meter reaches a thermal equilibrium state; and simultaneously recording the readings of three external temperature sensors while in thermal equilibrium. T 1. T 2. T 3. And the readings of the internal temperature register of the metering chip. T die (As a reference value for the chip junction temperature); four sets of data were obtained at four temperature points, and the following system of linear equations was established: ;in i =1,2,3,4;Δ T self The temperature rise is due to the chip's self-heating. Since the number of equations (4) is greater than the number of unknowns (3), the least squares method is used to solve the overdetermined system of equations to obtain the heat conduction weighting coefficient. Because the constant temperature chamber is calibrated under the reference operating conditions (rated voltage, reference current) I base The process is performed under these conditions, during which the chip exhibits a constant reference self-heating temperature rise Δ. T self base When establishing a system of linear equations, the readings from the internal temperature register of the metering chip are first obtained. T die Subtract Δ T self base This yields the equivalent ambient temperature, which has been freed from the influence of the reference self-heating, and is then compared with the temperature at each measurement point. T 1. T 2. T 3. Establishing relationships: T die,i -Δ T self base =( α 1 T 1,i + α 2 T 2,i + α 3 T 3,i ),in( i =1..4); The overdetermined equations are solved using the least squares method to obtain the heat conduction weighting coefficients. α 1 、α 2 、α 3; the identified weighted sum α 1 T 1+ α 2 T 2+ α 3T 3, in a physical sense, represents the equivalent ambient temperature that does not include the contribution of the reference self-heating; Furthermore, the aforementioned constant temperature chamber calibration is performed after the energy meter has reached thermal equilibrium under reference operating conditions (such as rated voltage, no-load, or small current flow). Therefore, the identified weighting coefficients... α 1. α 2. α The weighted sum constructed in section 3 physically represents the chip's local equivalent ambient temperature, which includes the contribution of self-heating from the baseline state, rather than the purely external ambient temperature; the constraint condition is... α 1+ α 2+ α 3=1 and all coefficients are greater than 0; typical experimental results are α 1 = 0.72 α 2 = 0.15 α 3=0.13, indicating that the sensor in the metering chip area contributes the most to the chip junction temperature; the linear weighted model has covered the rated operating temperature range of the energy meter, and the residual nonlinear thermal conduction characteristic deviation will be treated as part of the coupling error by the subsequent S32 multi-factor coupling compensation layer. S13. Based on the current operating current and supply voltage of the metering chip, and combined with the chip junction-to-environment thermal resistance parameters, calculate the dynamic self-heating temperature rise increment Δ caused by load fluctuations. T self ; S13 includes the following steps: S131. Read the current operating current of the metering chip. I chip and power supply voltage V chip By combining the chip's effective heat dissipation coefficient, the dynamic power dissipation increment that the chip actually converts into heat energy is calculated. S132, Multiply the dynamic power dissipation increment obtained in S131 by the junction-to-ambient thermal resistance. R thja The dynamic self-heating temperature rise increment Δ is obtained. T self ; In specific implementation, S13 specifically involves: to avoid physical duplication of calculations with the reference heating factor included in the weighting model of S12, this step introduces the concept of dynamic temperature rise; the power supply voltage of the metering chip... V chip Power is supplied by the power management circuit at a fixed value of 3.3V; operating current... I chip The voltage across the sampling resistor is measured by the MCU's ADC channel and then divided by the resistance value by connecting a 10Ω precision sampling resistor in series in the chip's power supply circuit. Since the total power consumption of the chip includes DC static power consumption and dynamic switching power consumption that fluctuates with the sampling frequency, this embodiment introduces an effective heat dissipation coefficient. β (Typical value is 0.95, determined according to the chip datasheet), and the current operating current. I chip Reference current during S12 constant temperature chamber calibration I base Take the difference; therefore, the dynamic power dissipation increment is equal to ( I chip - I base The product of 3.3V and β; multiplied by the chip junction-to-ambient thermal resistance. R thja (45℃ / W), the dynamic self-heating temperature rise increment Δ is obtained. T self This calculation method unifies the dimensions and reference standards, ensuring the self-consistency of the physical model. S14, Temperature value obtained based on S11 T 1. T 2. T 3. Heat conduction weighting coefficient obtained from S12 α 1. α 2. α 3 and the self-heating temperature rise Δ obtained by S13 T self The actual operating temperature of each key component is calculated by weighted summation; In specific implementation, S14 specifically involves: the actual junction temperature of the metering chip is calculated according to formula... T chip =( α 1 T 1+ α 2 T 2+ α 3 T 3)+Δ T self Calculate; where Δ T self The dynamic self-heating temperature rise increment relative to the reference current Ibase, calculated by S13, is implicitly included in the weighting terms under the reference state, avoiding redundant calculation of physical quantities. For the current transformer core temperature TCT and the voltage divider resistor network temperature TR, this embodiment directly takes... T 2. TThe reading of 3 is used instead of weighted calculation because the transformer core and voltage divider resistor have a large heat capacity (large thermal inertia), and the second and third temperature sensors achieve physical-level close contact with the measured object through thermally conductive adhesive / welding, with their contact thermal resistance approaching zero and local thermal convection disturbances being minimal; while the metering chip has a plastic-encapsulated structure, the first sensor can only approach but cannot contact the internal wafer ( D ie Since there is air gap thermal resistance, multi-source weighted calculation must be used; the MCU updates the above three temperature values ​​every 5 seconds and stores them in the temperature data buffer for use in subsequent steps; When the ambient temperature changes rapidly, the transient temperature deviation between the metering chip and the current transformer caused by the difference in thermal capacity is usually no more than 0.5℃. This tiny dynamic residual will be covered by the real-time inference output of the S34 adaptive residual compensation layer. This invention integrates multi-point temperature measurement data into the actual operating temperature of each component through a heat conduction weighting model. Compared with directly using the readings of a single sensor, this invention can eliminate temperature measurement errors caused by sensor installation position deviations and local thermal convection disturbances, thereby improving the accuracy of temperature estimation. S2 includes the following steps: S21. Read the current effective value of the load current from the metering chip register. I L Power factor cosφ RMS voltage U and grid frequency f ; S22. Read the cumulative running time of the energy meter from the RTC clock module. t run ; S23, Obtain the temperature values ​​of the three regions obtained in S1. T 1. T 2. T 3 and S21 obtained I L Power factor cosφ RMS voltage U and grid frequency f and the cumulative operating time of the S22 electricity meter t run Combine to construct an eight-dimensional feature vector X=[ T 1, T 2, T 3, I L , cosφ , U , f , t run ]; S24. Perform normalization preprocessing on the eight-dimensional feature vector X constructed in S23, mapping the data of each dimension to the [0,1] interval to generate standardized features. X norm ; S24 includes the following steps: S241. Set upper and lower bounds for the normalization range of each dimension of the eight-dimensional feature vector X. The upper and lower bounds are determined according to the design specifications of the electricity meter. S242. Apply the min-max normalization formula to each dimension to obtain standardized features. X norm ; In specific implementation, S24 is as follows: the normalized upper and lower bounds of each dimension are set according to the design specifications of the electricity meter as follows: T 1. T 2. T The lower limit of 3 is -30℃, and the upper limit is 90℃; I L The lower bound is 0A, and the upper bound is I max (In this embodiment, it is 6A); cos f The lower bound is -1.0, and the upper bound is 1.0; U The lower limit is 0V, and the upper limit is 264V (1.2 times the rated voltage of 220V). f The lower bound is 45Hz, and the upper bound is 55Hz; t run The lower bound is 0 hours, and the upper bound is 175,200 hours (corresponding to a 20-year design life); if the calculation result is less than 0, it is taken as 0, and if it is greater than 1, it is taken as 1, to prevent abnormal data from causing the normalization result to exceed the bounds; The MCU has an 8×float32 feature data buffer in its internal RAM, and the latest data is stored in the buffer every sampling period (5 seconds). X norm Write to this buffer, overwriting the data from the previous period; at the same time, maintain a historical feature queue of length 12 (store the feature data of the most recent 60 seconds), which is used to construct the regression vector of the adaptive residual compensation layer in S3; This invention eliminates the influence of differences in the dimensions and orders of magnitude of each dimension on subsequent model calculations through normalization preprocessing, making the distance calculation of the radial basis kernel function in the support vector regression model physically meaningful and avoiding the problem of a certain dimension dominating the distance calculation due to excessively large values. S3 includes the following steps: S31. Standardize the features generated in S2. X normThe temperature component is input into the base temperature drift compensation layer, and a third-order polynomial model is used to calculate the base temperature drift compensation for the voltage channel, current channel, and phase channel respectively. e base ; In specific implementation, S31 specifically involves: the basic temperature drift compensation layer maintaining a set of third-order polynomial coefficients for each of the three channels; taking the voltage channel as an example, the compensation amount is calculated as follows: ,in T chip 23 represents the actual junction temperature of the metering chip calculated by S14, and 23 represents the reference temperature (in °C). a 1. a 2. a 3 represents the coefficients of the first, second, and third terms of the third-order temperature drift compensation polynomial; the polynomial coefficients are determined by factory calibration: seven temperature points are set in the constant temperature chamber: -25℃, 0℃, 23℃, 40℃, 55℃, 70℃, and 85℃. After each temperature point stabilizes for 2 hours, the rated load is output using a 0.05-class standard power source. I b =1.5A, cos f =1.0, U =220V), record the error value of the electricity meter at each temperature point, where, I b This indicates the rated reference current of the electricity meter; with the error at 23℃ as the zero reference, the error values ​​at the other 6 temperature points are compared with the temperature deviation ( T -23) Establish the correspondence and fit the coefficients of the third-order polynomial using the least squares method; the current channel is based on... T CT For input variables, phase channels and T chip For the input variables, similar calibration and fitting were performed respectively, and the total basic compensation amount was obtained by adding the basic compensation amounts of the three channels. The core temperature (TCT) of a current transformer directly determines its permeability temperature drift, which is the dominant physical variable for the current path ratio difference and angle difference temperature drift. This feature selection is common knowledge in this field. At the same time, the SVR model of the S32 layer takes all temperature features as input, which can further capture the cross effects that any single variable cannot cover. S32, Standardize the features generated in S2 X norm The input multi-factor coupling compensation layer uses a support vector regression model based on radial basis function kernels to calculate the coupling compensation amount between temperature, load current, and power factor. e couple ; S32 includes the following steps: S321. Calculate the input feature vector. Xnorm With each support vector X i The Euclidean distance between them; S322, Substitute the Euclidean distance into the radial basis kernel function. Calculate the kernel function value; where, c Represents the kernel width coefficient of the radial basis function; S323. Multiply each kernel function value by its corresponding support vector weight, sum the results, and add the bias term to obtain the coupling compensation amount. e couple ; In specific implementation, S32 is as follows: To avoid the S31 polynomial fitting and SVR training sharing the same data, which could lead to an overestimation of generalization ability, 90 sets of working condition data are randomly divided into a training set (80%) and a validation set (20%) during factory calibration; the S31 polynomial coefficients are fitted only using the training set, and the residuals of the training set samples are calculated based on the fitting results as the target value of SVR; the hyperparameters of the SVR model are selected through 5-fold cross-validation on the training set; finally, the overall compensation accuracy is evaluated using the validation set to ensure that the training of the support vector regression model is completed during the factory calibration stage; the network architecture of the SVR model is set as follows: the input layer is an 8-dimensional feature vector, the hidden layer uses the radial basis function (RBF) to map the features to a high-dimensional space, and the output layer is a single coupling error compensation amount; the training process uses an ε-insensitive loss function and employs the sequential minimum optimization (SMO) algorithm to solve the quadratic programming problem (…). QP The problem is that the convergence criterion for training is set as follows: the tolerance of all samples satisfying the Karush-Kuhn-Tucker (KKT) condition is less than 10. -3 Or reach the maximum number of iterations of 1000; If the model still does not meet the KKT conditional tolerance after 1000 iterations, the current optimal solution (the parameter with the smallest loss function in each iteration) is retained, and the training is marked as not fully converged and written to the log. The model can still be used for inference, and the model will be retrained first during the next self-verification update. The calibration operating condition combination is as follows: temperatures are set at -25℃, 23℃, 55℃, 70℃, and 85℃, for a total of 5 points; and the load current is set to 0.05. I b 0.1 I b 0.2 I b 0.5 I b 1.0 I b , I maxA total of 6 points were used, with 3 points having power factors of 1.0, 0.8L, and 0.5L, a rated voltage of 220V, and a frequency of 50Hz, forming 5×6×3=90 calibration conditions. The energy meter error was recorded under each condition. After deducting the compensation amount from the S31 basic temperature drift compensation layer, the remaining error was used as the training target value for the SVR model. The SVR model parameters were set as follows: kernel function parameters... c =0.5 (selected from {0.01, 0.1, 0.5, 1.0, 5.0} through 5-fold cross-validation), penalty coefficient C =50 (selected from {1,10,50,100,500}). e - Insensitive band = 0.0002 (corresponding to 0.02% error, approximately 1 / 25 of the allowable error of 0.5S level); After training, approximately 25 to 35 support vectors are obtained, and the support vector coordinates, weights, and bias terms are stored in the energy meter's Flash memory; During operation, the MCU calculates according to steps S321 to S323. e couple The computational complexity is O ( M × d ),in M This is the number of support vectors (approximately 30). d With 8-dimensional features, a single calculation takes approximately 2ms, meeting the real-time requirement of a 5-second sampling period; To address the limitation of fixed Flash memory space, the system sets an upper limit of 50 support vectors. When incremental updates cause the number of support vectors to exceed this limit, instead of removing individual support vectors, a full SVR retraining based on all samples within the current sliding window is triggered. Regularization and parameter optimization are used to naturally compress the number of support vectors to within the limit in order to maintain the global optimality of the model and the integrity of the kernel space. S33, the basic temperature drift compensation amount obtained in S31 e base The coupling compensation amount obtained from S32 e couple After summing, the difference between the summation and the actual measurement error is used as the residual signal and input into the adaptive residual compensation layer. In specific implementation, S33 is as follows: within the normal 5-second sampling period, since the actual external measurement error cannot be obtained, the logic of this step is to extract the output of the first two layers of compensation model as the known feedforward quantity, construct a regression vector and input it to the adaptive residual compensation layer for forward inference calculation; S34, the adaptive residual compensation layer, employs a recursive least squares algorithm with a forgetting factor, using the residual signal from S33 as the target, to identify the residual compensation amount online. e residual ; In specific implementation, S34 specifically involves: within a standard 5-second sampling period, utilizing the pre-defined parameter vector... i ( n -1) Perform residual compensation e residual The inference output; however, only when the self-verification is triggered in step S5 does it target the actual acquired residual signal and adjust the parameter vector. i ( n Iterative updates will be performed. Regression vector of recursive least squares algorithm f ( n Set as a 4-dimensional vector f (n)=[1, T 1norm , IL norm , T 1norm × IL norm ], corresponding to the constant term, normalized temperature term, normalized current term, and temperature-current cross term, respectively; parameter vector i ( n The parameter vector is 4×1 dimension; during algorithm initialization, the parameter vector... i (0) Let it be a vector of all zeros, and the covariance matrix be... P (0) is set to 1000× I 4 ( I 4 represents the 4th order identity matrix, and 1000 represents the initial uncertainty (a larger value is chosen to ensure rapid convergence in the early stages of the algorithm); forgetting factor. l A variable strategy is adopted: the MCU calculates the absolute value of the temperature change between two adjacent sampling periods, |Δ T 1|, if |Δ T 1| / Δ t If the temperature change is greater than 0.5℃ / min (i.e., the temperature change exceeds 0.042℃ within 5 seconds), then the temperature is determined to be in a rapid change phase, and the forgetting factor is set to [value missing]. l =0.92; if |Δ T 1| / Δ t If the flow rate is ≤0.1℃ / min, the temperature is considered stable, and the forgetting factor is set to... l =0.99; when the value is between these two values, 0.92 and 0.99 are used as the upper and lower limits, respectively, and the forgetting factor is calculated by linear interpolation; for each sampling period, the algorithm calculates the forgetting factor based on the current regression vector. f ( n and parameter vector i ( n -1) Calculate the predicted residuals, and then update them using the recursive formula. i ( n )and P(0), the output residual compensation amount; Specifically: the current regression vector is multiplied by the parameter vector of the previous period to obtain the prediction residual compensation amount at the current moment. Then, the prediction value is subtracted from the target residual value to obtain the prediction error. The gain vector is calculated using the covariance matrix and the regression vector. The magnitude of the gain determines the contribution of the current prediction error to the parameter correction. The smaller the forgetting factor, the faster the historical data decays, and the greater the weight of the new data. The prediction error is multiplied by the gain vector as a correction term to update the parameter vector of the previous period to the current parameter vector. The covariance matrix is ​​updated according to the recursive formula to prepare for the calculation of the next period. It should be noted that the above update process is only executed once when the S5 self-verification obtains the true target residual value; during the daily 5-second sampling period, only the current regression vector and the current parameter vector are used to perform an inner product operation once to output the residual compensation amount for S4 fusion, and no update step is executed. Furthermore, addressing the issue of insufficient data for frequent updates during daily operation, the collaborative mechanism of this application is as follows: the high-frequency operating condition fluctuations of the electricity meter (such as sudden temperature changes and load changes) are responded to and digested in real time by the two models S31 (polynomial) and S32 (SVR) based on the current state input; while S34 (RLS algorithm) targets the extremely slow physical process of component aging (in months / years); therefore, the RLS algorithm only performs static inference within a 5-second cycle, and the self-verification update frequency once a day fully meets the tracking requirements of Shannon sampling theorem for slow aging drift in control theory, ensuring the physical effectiveness of the algorithm under data shortage conditions; S35, Output three-layer compensation amount e base , e couple and e residual Provided for S4 to integrate; In specific implementation, S35 specifically refers to: the MCU calculating the value obtained in S31. e base S32 calculated e couple Calculated with S34 e residual The three compensation values ​​are stored in the compensation register respectively. They are all stored in floating-point form, and the unit is a dimensionless ratio (for example, 0.001 represents 0.1% error). The three compensation values ​​are updated synchronously once in each sampling period (5 seconds). The layered progressive error compensation model described in S3 is based on a systematic orthogonal decoupling of the physical mechanism of electricity meter error generation. The basic temperature drift compensation layer (polynomial) handles the main linear and low-order nonlinear temperature drifts with minimal computation, and is used to eliminate the dominant low-frequency macroscopic static temperature drift caused by the material temperature coefficient. The multi-factor coupling compensation layer (SVR) handles the high-order coupling effect between temperature and load, and uses an offline-trained SVR model to achieve high-precision compensation, and is used to eliminate the mid-frequency nonlinear state error caused by the interaction of load current, power factor and temperature (i.e., fitting the residual of the first layer). The adaptive residual compensation layer (RLS) captures the residual errors that the first two layers cannot cover and the drift caused by device aging through an online adaptive algorithm, and is used to track the high-frequency random residuals caused by the irreversible drift of long-term device aging (i.e., tracking the residual of the second layer). The three-layer model constitutes a collaborative mechanism of reference surface, surface correction and dynamic fine-tuning in a physical sense. S4 includes the following steps: S41, Adjust the basic temperature drift compensation amount e base Coupling compensation amount e couple Online identification of residual compensation amount e residual Add them directly to get the total compensation amount. e total ; In specific implementation, S41 is as follows: the MCU reads the three floating-point values ​​in the compensation register and directly performs addition to obtain the result. e total Since the overall metering error of the electricity meter is a small disturbance (usually within ±2%), according to the Taylor expansion theory of multivariate functions, the higher-order nonlinear coupling term can be approximated as the linear superposition of each reduced-dimensional subspace within this small interval. At the same time, this application adopts a residual cascade mechanism (the residual of the SVR fitting polynomial and the residual of the RLS fitting SVR) during model training, which forces the orthogonality of the three compensation quantities in physical space from the algorithm structure, thereby avoiding oscillations or repeated compensation caused by direct addition. S42. Determine the absolute value of the total compensation amount. e total Does it exceed the maximum compensation amount? e max Alternatively, determine whether the residual error of the prediction after compensation exceeds the allowable error limit; if it does, lock the current compensation amount and stop updating it, and send an alarm message to the main station; otherwise, execute S43. In specific implementation, S42 is as follows: To avoid the arbitrariness of alarm logic from contradicting actual security logic, this embodiment sets up dual limit judgment logic; the first physical defense line: judgment | etotal | Does it exceed the maximum physical adjustment range of the metering chip's hardware gain register (e.g., the maximum adjustment of a certain chip is ±5%), to prevent register overflow; Second line of defense: Predict the residual error after compensation (i.e., the actual error minus the total compensation) through an internal model, and determine whether the residual error exceeds the allowable error limit of the energy meter's accuracy class (0.5% for 0.5S class); If the over-limit condition is met: The MCU performs the following operations: Set the current e total The value is locked and written to a protected area of ​​the Flash memory. Subsequent sampling cycles will not update the compensation amount but will continue to use this locked value. An alarm flag is set. In the next communication window, an alarm message is sent to the data acquisition terminal via the RS485 interface or carrier communication module. The message content includes the energy meter address, alarm type code (0x3A indicates compensation exceeding the limit), and current status. e total Value and trigger time timestamp; after the alarm is triggered, the maintenance personnel need to check on-site to confirm that there is no abnormality in the hardware before issuing an unlock command through the main station to restore normal compensation updates; Furthermore, considering the reliability requirements of unattended operation of electricity meters, an automatic recovery mechanism is added: after exceeding the limit and locking, if the residual error after compensation in three consecutive self-checks (each with an interval of 24 hours) falls back to within 80% of the allowable error limit, the MCU automatically releases the compensation lock, resumes the normal compensation update process, and reports a recovery event (alarm type code 0x3B) to the main station; this mechanism can avoid long-term locking caused by occasional extreme operating conditions and ensure metering fairness; S43. The total compensation amount obtained in S41 e total The values ​​are converted into the gain correction register value and phase correction register value of the metering chip and written into the metering chip to complete real-time compensation. The register value conversion in S43 includes the following steps: S431. Calculate the total compensation amount using the bit width of the metering chip's gain correction register and the gain factor corresponding to the full scale. e total The corresponding quantized value, after being rounded, yields the value written to the gain correction register. REG gain ; S432. Based on the angular difference component in the phase channel compensation, quantize it according to the step precision of the phase correction register of the metering chip to obtain the write value of the phase correction register. REG phase ; In specific implementation, S432 is as follows: Taking a certain type of metering chip as an example, its gain correction register is a 24-bit signed integer with a bit width of... W=23 (the highest bit is the sign bit), the full scale corresponds to a gain adjustment range of ±50%; the formula for calculating the value written to the gain correction register is: Where 1.0 represents the amount to be compensated. e total The physical unit is 1 (i.e., 100% of the reference ratio); 0.5 represents the full-scale adjustment range of the metering chip's gain correction register (±50%, i.e., 0.5 times); 2 23 The digital range of the gain correction register is indicated; e total For example, =0.01014, REG gain =170121, converted to hexadecimal, is written to the gain correction register address of the metering chip; The phase correction register is a 16-bit signed integer with a step precision of 0.02° / LSB; the phase channel angular difference compensation amount... e Extracted separately from the phase channel fundamental compensation polynomial of S31 (in degrees); the MCU transmits via SPI interface in each sampling period REG gain and REG phase The writing operation to the metering chip takes approximately 50μs and has no impact on the system's real-time performance. S44. The metering chip corrects the subsequent energy accumulation calculation based on the written correction register value, resulting in a compensated energy metering value. In specific implementation, S44 is as follows: The internal hardware of the metering chip automatically superimposes the gain correction register value onto the digital gain of the voltage and current sampling channels, so that the subsequent power calculation and energy accumulation automatically include the error compensation effect; the MCU does not need to perform additional processing on the energy pulse output, and the compensation process is completely transparent to the external system; the accuracy of the compensated energy pulse is the accuracy of the compensated metering; after each new correction register value is written, the MCU reads back the register content for verification. If the read value is inconsistent with the written value, it is rewritten, and retried up to 3 times. If it is still inconsistent, the SPI communication fault log is recorded. This invention applies compensation by directly converting the compensation amount into the hardware correction register value of the metering chip, and uses the internal hardware multiplier of the metering chip to realize the compensation calculation. It does not occupy the computing resources of the MCU, and the compensation accuracy is determined by the bit width of the metering chip register (24 bits correspond to about 0.006% compensation resolution), which is superior to the software post-processing method. S5 includes the following steps: S51. Trigger self-calibration at a preset time interval, control the internal precision reference source to output a known power signal, measure the signal through the metering chip and compare it with the theoretical value to obtain the current actual error. e actual; In specific implementation, S51 is as follows: the self-calibration trigger interval is set to 24 hours, and the trigger time is selected during the off-peak load period between 2:00 AM and 4:00 AM to reduce the impact of the self-calibration process on normal metering; in addition, when the MCU detects that the temperature changes by more than 15°C within 10 minutes (for example, the meter box temperature rises sharply due to direct sunlight in the summer afternoon), an additional self-calibration is also triggered; the self-calibration process is as follows: the MCU controls the analog switch via GPIO to switch the voltage input channel of the metering chip to the internal precision voltage reference source (using LM4040-4.1 precision reference, initial accuracy ± 0.1%, temperature coefficient 15ppm / ℃), while switching the current input channel to the internal precision current source (converting the reference voltage to a known current through a precision resistor); after switching, wait 500ms for the signal to stabilize, then read the power measurement register value of the metering chip, continuously collect data for 60 seconds and take the average value as the measured power; the theoretical power value is known; it is calculated based on the reference voltage value, precision resistor value and circuit topology (calibrated at the factory and stored in Flash); the current actual error is calculated based on the measured power and the theoretical power value; after self-verification, the MCU switches the analog switch back to the normal metering channel; To ensure metrological integrity, any measurement gaps during the self-calibration period will be compensated according to the following scheme: The self-calibration is scheduled during the early morning off-peak period, when the line load current is usually below 0.01Ib, resulting in minimal metering loss. Before the switching operation, the MCU latches the current total accumulated energy value. E before The MCU then starts a timer; during the verification period, the MCU records the average load current at a rate of once per second through an independent auxiliary current sampling channel (without passing through an analog switch). I avg After the verification is completed and the system switches back to the normal channel, the MCU performs the operation according to the formula. E compensate = U nominal × I avg × T cal × cos φest Calculate the amount of electricity to be replenished during the verification period. E compensate ,in U nominal This is the rated voltage of the electricity meter. I avg To assist in the sampling channel recording the average load current during the calibration period, T cal To self-verify the actual duration, cos φestFor the power factor estimate, the average power factor of the most recent 5 minutes of historical operating data is preferred. If historical data is insufficient, a conservative estimate of 1.0 is used. E compensate The energy is accumulated into the total energy register. Through the above method, the impact of self-calibration on user metering is reduced to less than 1 / 10 of the allowable error of the energy meter accuracy class, thus meeting the business continuity requirements. S52. Calculate the current actual error obtained in S51. e actual The total compensation amount predicted by the model in S3 e total The deviation Δ between e ; In specific implementation, S52 specifically involves: the MCU transmitting the self-verification time... e actual Calculated at the same time S4 e total A comparison is needed; it should be noted that the metering chip has already applied [something] during self-calibration. e total Compensation, therefore e actual This reflects the residual error after compensation; the actual deviation is calculated as | e actual |, which is the absolute value of the error that still exists after compensation; S53. Determine the deviation Δ obtained in S52. e Has the update threshold been exceeded? d If the value exceeds the limit, the feature vector and actual error under the current working condition will be added to the training set as new samples, triggering the support vector regression model of the multi-factor coupling compensation layer to perform incremental updates, and at the same time resetting the covariance matrix of the recursive least squares algorithm of the adaptive residual compensation layer. In specific implementation, S53 specifically involves: updating the threshold. d According to national metrological standards, the allowable error limit for the accuracy class of the electricity meter is set at 1 / 5; when Δ e > d At that time, the MCU performs the following update operations: (1) SVR model incremental update: The simplified SMO single-step update here means mathematically that: the Lagrange multipliers of other support vectors in the model are fixed, and only the newly added violation sample and the sample with the largest prediction error (KKT violation degree) in the existing support vector set are selected to form a pair of variables for analytical solution and update, so as to quickly approach the optimal solution without calling the full QP solver, and adapt to the MCU computing power to standardize the feature vector at the current self-verification time. X norm and the corresponding error correction value ( e actual In addition to the current e total The new sample (as the new target error value) is added to the training sample set stored in Flash. A simplified incremental SVR update strategy is adopted: the kernel function value of the new sample and each existing support vector is calculated, and if the new sample is located in the existing support vector... e - Outside the insensitive band (i.e., the existing model's prediction error for this sample exceeds...) e If the value is 0.0002, then the sample is included in the support vector set, the weights of the SVR model are updated, and the weight update strategy adopts a simplified SMO single-step update. After the update, the new support vector set and weights are written back to the Flash memory. (2) RLS algorithm reset: The covariance matrix of the adaptive residual compensation layer is reset. P Reset to 500× I 4 (Choosing a moderate uncertainty value allows the algorithm to adapt to new states quickly without completely losing historical information), parameter vector i Keep it unchanged (preserve the historical learning outcomes as a new starting point); S54. A sliding window mechanism is used to manage the training sample set. When the total number of samples exceeds the window capacity... N w At that time, the oldest sample is removed to ensure that the model reflects the current state of the device; In specific implementation, S54 specifically refers to: sliding window capacity. N w The sample size is set at 150. Considering that self-calibration is triggered every 24 hours (plus additional self-calibration triggered by temperature changes, averaging about 1.2 times per day), 150 samples cover the operational data of the most recent 125 days (about 4 months). A window that is too small (e.g., 30 samples) will result in insufficient training samples for the model and poor generalization ability; a window that is too large (e.g., 500 samples) will contain too much historical data and will not be able to reflect the aging trend of the device in a timely manner. 150 samples strike a balance between model stability and aging tracking ability. When the total number of samples exceeds 150, the MCU deletes the sample with the earliest timestamp according to the first-in-first-out principle, and then performs full retraining on the SVR model. Due to the limited number of samples (150) and the low feature dimension (8 dimensions), the full retraining takes about 3 to 5 seconds. It is scheduled to be executed after the self-calibration is completed in the early morning and will not affect normal measurement. This invention achieves continuous evolution of the compensation model through an online self-learning mechanism, which can adaptively track the temperature drift characteristics of the electricity meter caused by component aging (such as resistance drift, transformer magnetic performance degradation, crystal frequency shift, etc.) during long-term operation. Compared with the traditional one-time factory calibration scheme, the adaptive compensation method of this invention can maintain high metering accuracy throughout the entire life cycle of the electricity meter (usually 10 to 15 years). For example, taking the operation scenario of a 0.5S-class three-phase smart energy meter in an extreme high-temperature environment in summer as an example, the complete working process of the method of the present invention is demonstrated: The electricity meter is installed in an outdoor centralized meter box in a southern city. Its rated parameters are 3×220V / 380V and 1.5(6)A. On a summer day at 14:00, the outdoor temperature reached 42℃. Due to direct sunlight and the combined heat dissipation of multiple electricity meters, the ambient temperature inside the meter box rose to 78℃. At this time, the electricity meter was measuring the air conditioning load of a commercial user, with a load current of 3.2A (approximately 0.53A). I max The power factor is 0.85L. The readings of the three temperature sensors are as follows: T 1 = 81.5℃ (metering chip area, slightly higher than ambient temperature due to chip self-heating). T 2 = 76.8℃ (current transformer area) T 3 = 77.2℃ (voltage divider resistor region); MCU calculates the self-heating temperature rise Δ of the chip. T self =2.23℃, calculated as the actual junction temperature of the metering chip T chip =82.47℃; MCU reads from metering chip IL =3.2A、cos f =0.85、 U =221V、 f =50.02Hz, read from RTC t run =25680 hours (running for approximately 3 years); constructing feature vectors X =[81.5,76.8,77.2,3.2,0.85,221,50.02,26280], after normalization X norm =[0.929,0.890,0.893,0.533,0.925,0.837,0.502,0.150]; The first layer of basic temperature drift compensation calculation, based on T chip Substituting 82.47℃ into the voltage channel polynomial, the temperature deviation is 82.47 - 23 = 59.47℃, which yields the calculated result. e baseU =0.00753; Similarly, calculate the current path and phase path to obtain the total. e base =0.01182; the second-layer SVR model with X norm Using the input as input, calculate the kernel function values ​​with respect to the 30 support vectors and sum them using weighted methods to obtain the result. e couple =-0.00215 (the negative value indicates that the coupling effect partially offsets the basic temperature drift); Output of the third-layer RLS algorithm e residual =0.00047; Total compensation e total =0.01182 + (-0.00215) + 0.00047 = 0.01014 (i.e., 1.014%); | e total |=1.014%> e max =1.0%, triggering an over-limit alarm; the MCU locks the compensation amount at 0.01014 and sends an alarm message to the master station; after receiving the alarm, the maintenance personnel arrange on-site inspection and confirm that the electricity meter hardware is normal (the compensation amount is close to the upper limit only due to extreme high temperature), and issue an unlock command through the master station and e max The temporary adjustment is 1.5% (for batch adjustments of electricity meters in this extreme high-temperature area). After unlocking, the electricity meters will resume normal compensation updates. Under this operating condition, without any compensation, the metering error of the energy meter is -1.85% (a negative error indicates under-metering of energy); after applying the compensation method of this invention, the residual error is -1.85% + 1.014% × correction coefficient ≈ -0.12%, which meets the allowable error requirement of ±0.5% for 0.5S class; the self-calibration results show that the compensation error at each load point is within ±0.25% under 70℃ environment, proving that the online self-learning mechanism effectively tracks the characteristic changes caused by device aging.

[0015] Please see Figure 2 An error compensation system for improving the metering accuracy of electricity meters under high temperature conditions is disclosed. The system includes a temperature field sensing module, a feature construction module, a hierarchical compensation module, a compensation application module, and an online learning module. The temperature field sensing module is used to deploy multiple temperature sensors and collect temperature data from each area, and to calculate the actual operating temperature of each key component based on the heat conduction weighting model. The feature construction module is used to collect the operating status parameters of the electricity meter, combine them with the temperature value output by the temperature field sensing module to construct a multi-dimensional feature vector and perform normalization preprocessing. The hierarchical compensation module is used to receive the standardized features output by the feature construction module, and calculate each compensation amount layer by layer through the basic temperature drift compensation layer, the multi-factor coupling compensation layer and the adaptive residual compensation layer. The compensation application module is used to fuse the three-layer compensation quantities output by the hierarchical compensation module, convert them into the calibration register value of the metering chip and write them, and at the same time perform over-limit detection and alarm. The online learning module is used to periodically trigger self-verification to obtain the actual error, compare it with the model prediction value, and then decide whether to update the model parameters in the hierarchical compensation module. This invention abandons the traditional passive and fixed compensation approach of single-point temperature measurement combined with a static single model, and proposes a collaborative adaptive compensation architecture that combines multi-source sensing, hierarchical decoupling, and dynamic evolution. Through spatial multi-point temperature measurement and thermodynamic weight calculation, the fuzzy meter box temperature is visualized as the actual junction temperature of the core components. The complex nonlinear error is reduced in dimensionality and broken down into three independent levels: basic temperature drift, multi-factor coupling, and dynamic residuals. This achieves high-precision fitting while adapting to the limited computing power of the edge MCU. The objective built-in self-calibration acts as a supervisor, driving the model to perform incremental learning and optimization throughout the entire life cycle of the electricity meter. This not only eliminates short-term metering deviations caused by extreme high temperatures and complex load coupling, but also overcomes the accuracy degradation problem caused by long-term component aging. With extremely low hardware cost and computing power, it endows ordinary smart meters with high-precision maintenance-free self-calibration capabilities, improving the fairness of electricity trade settlement and the management efficiency of power grid assets.

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

[0017] 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. An error compensation method for improving the metering accuracy of electricity meters under high-temperature environments, characterized in that, Includes the following steps: S1. Multiple temperature sensors are installed inside the electricity meter to collect temperature data from each area simultaneously. The actual operating temperature of each key component is calculated based on the heat conduction weighting model to establish the temperature field distribution inside the electricity meter. S2. Real-time acquisition of the current operating status parameters of the electricity meter, combined with the temperature values ​​of each area obtained in S1 to construct a multi-dimensional feature vector, and normalization preprocessing of the multi-dimensional feature vector to generate standardized features; S3. Based on the standardized features generated in S2, the compensation amount is calculated layer by layer through a hierarchical progressive error compensation model. The hierarchical progressive error compensation model includes a basic temperature drift compensation layer, a multi-factor coupling compensation layer, and an adaptive residual compensation layer. The three layers are processed in sequence and their respective compensation amounts are output. S4. The three-layer compensation amounts in S3 are weighted and fused to obtain the total compensation amount; it is determined whether the total compensation amount exceeds the compensation limit. If it does not exceed the limit, the total compensation amount is converted into the metering chip correction register value and written into the metering chip to complete the real-time error correction of the power metering value. Otherwise, trigger an alarm and lock the compensation parameters; S5. Trigger the built-in self-verification mechanism of the energy meter at a preset time interval to obtain the deviation between the current actual error value and the total compensation amount. When the deviation exceeds the update threshold, use the incremental learning strategy to update the model parameters of the multi-factor coupled compensation layer and the adaptive residual compensation layer in S3 online.

2. The error compensation method for improving the metering accuracy of electricity meters under high-temperature environments according to claim 1, characterized in that, S1 includes the following steps: S11. Temperature sensors are installed in the metering chip area, current transformer area and voltage divider resistor network area on the PCB board of the electricity meter, respectively, and the temperature values ​​of the three areas are collected synchronously at a preset sampling period. S12. Obtain the heat conduction weighting coefficients through a constant temperature chamber step temperature response experiment. The experiment is conducted at at least four temperature points, and the transfer relationship between each temperature measurement point and the junction temperature of the metering chip is recorded. The least squares identification method is used to determine each weighting coefficient. S13. Based on the current operating current and supply voltage of the metering chip, and combined with the chip junction-to-environment thermal resistance parameters, calculate the dynamic self-heating temperature rise increment of the chip caused by load fluctuations. S14. Based on the temperature value obtained in S11, the heat conduction weighting coefficient obtained in S12, and the self-heating temperature rise obtained in S13, the actual operating temperature of each key component is calculated by weighted summation.

3. The error compensation method for improving the metering accuracy of electricity meters under high-temperature environments according to claim 2, characterized in that, S13 includes the following steps: S131. Read the current operating current and supply voltage of the metering chip, and calculate the dynamic power dissipation increment of the chip actually converted into heat energy, in combination with the chip's effective heat dissipation coefficient. S132. Multiply the dynamic power dissipation increment obtained in S131 by the thermal resistance from the chip junction to the environment to obtain the dynamic self-heating temperature rise increment.

4. The error compensation method for improving the metering accuracy of electricity meters under high-temperature environments according to claim 2, characterized in that, S2 includes the following steps: S21. Read the current load current RMS value, power factor, voltage RMS value and grid frequency from the metering chip register; S22. Read the cumulative running time of the energy meter from the RTC clock module; S23. Combine the three regional temperature values ​​obtained in S1 with the current effective value of load current, power factor, effective value of voltage, and grid frequency obtained in S21, as well as the cumulative running time of the energy meter obtained in S22, to construct an eight-dimensional feature vector; S24. Normalize the eight-dimensional feature vector constructed in S23, mapping the data of each dimension to the [0,1] interval to generate standardized features.

5. The error compensation method for improving the metering accuracy of electricity meters under high-temperature environments according to claim 4, characterized in that, S24 includes the following steps: S241. Set upper and lower bounds for the normalization range of each dimension of the eight-dimensional feature vector, wherein the upper and lower bounds are determined according to the design specifications of the electricity meter. S242. Map each dimension using the min-max normalization formula to obtain standardized features.

6. The error compensation method for improving the metering accuracy of electricity meters under high-temperature environments according to claim 4, characterized in that, S3 includes the following steps: S31. Input the temperature component in the normalized feature generated in S2 into the basic temperature drift compensation layer, and use a third-order polynomial model to calculate the basic temperature drift compensation amount of the voltage channel, current channel and phase channel respectively. S32. The standardized input multi-factor coupling compensation layer generated in S2 is used to calculate the coupling compensation amount between temperature and load current and power factor using a support vector regression model based on radial basis function kernel. S33. The difference between the sum of the basic temperature drift compensation amount obtained in S31 and the coupling compensation amount obtained in S32 and the actual measurement error is used as the residual signal and input into the adaptive residual compensation layer. S34, the adaptive residual compensation layer, adopts a recursive least squares algorithm with a forgetting factor, and uses the residual signal of S33 as the target to identify the residual compensation amount online.

7. The error compensation method for improving the metering accuracy of electricity meters under high-temperature environments according to claim 6, characterized in that, S4 includes the following steps: S41. Add the basic temperature drift compensation, coupling compensation, and online identification residual compensation directly to obtain the total compensation. S42. Determine whether the absolute value of the total compensation amount exceeds the upper limit of the compensation amount. If it does, lock the current compensation amount and stop updating it, and send an alarm message to the main station. Otherwise, execute S43. S43. Convert the total compensation amount obtained in S41 into the gain correction register value and phase correction register value of the metering chip, and write them into the metering chip to complete real-time compensation.

8. The error compensation method for improving the metering accuracy of electricity meters under high-temperature environments according to claim 7, characterized in that, The register value conversion in S43 includes the following steps: S431. Calculate the quantization value corresponding to the total compensation amount by using the bit width of the gain correction register of the metering chip and the gain multiple corresponding to the full scale, and obtain the value written to the gain correction register after rounding. S432. Based on the angular difference component in the phase channel compensation, quantize it according to the step accuracy of the phase correction register of the metering chip to obtain the value written to the phase correction register.

9. The error compensation method for improving the metering accuracy of electricity meters under high-temperature environments according to claim 7, characterized in that, S5 includes the following steps: S51. Trigger self-calibration at a preset time interval, control the internal precision reference source to output a known power signal, measure the signal through the metering chip and compare it with the theoretical value to obtain the current actual error; S52. Calculate the deviation between the current actual error obtained in S51 and the total compensation amount; S53. Determine whether the deviation obtained in S52 exceeds the update threshold. If it does, add the feature vector and actual error under the current working condition as new samples to the training set, trigger the support vector regression model of the multi-factor coupling compensation layer to perform incremental updates, and reset the covariance matrix of the recursive least squares algorithm of the adaptive residual compensation layer. S54. A sliding window mechanism is used to manage the training sample set. When the total number of samples exceeds the window capacity, the oldest sample is removed to ensure that the model reflects the current state of the device.

10. An error compensation system for improving the metering accuracy of electricity meters under high-temperature environments, characterized in that, The system for implementing the error compensation method for improving the metering accuracy of electricity meters under high temperature environments as described in any one of claims 1-9 includes a temperature field sensing module, a feature construction module, a hierarchical compensation module, a compensation application module, and an online learning module. The temperature field sensing module is used to deploy multiple temperature sensors and collect temperature data from each area, and to calculate the actual operating temperature of each key component based on the heat conduction weighting model. The feature construction module is used to collect the operating status parameters of the electricity meter, combine them with the temperature value output by the temperature field sensing module to construct a multi-dimensional feature vector and perform normalization preprocessing. The hierarchical compensation module is used to receive the standardized features output by the feature construction module, and calculate each compensation amount layer by layer through the basic temperature drift compensation layer, the multi-factor coupling compensation layer and the adaptive residual compensation layer. The compensation application module is used to fuse the three-layer compensation quantities output by the hierarchical compensation module, convert them into the calibration register value of the metering chip and write them, and at the same time perform over-limit detection and alarm. The online learning module is used to periodically trigger self-verification to obtain the actual error, compare it with the model prediction value, and then decide whether to update the model parameters in the hierarchical compensation module.

Citation Information

Patent Citations

  • Ammeter adaptive error compensation method, system and device based on multi-physical coupling and hidden variable modeling, and storage medium

    CN120871015A

  • Multifunctional intelligent electric meter temperature drift compensation method and system

    CN120928019A