Electric energy meter metering error compensation method based on non-uniform temperature field quick response
By constructing a resistance correction model to correct for current rise and fall, the metering error problem of electricity meters under non-uniform temperature fields is solved, and accurate metering compensation of electricity meters is achieved over a wide temperature range, improving metering accuracy and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU XILI INTELLIGENT TECH CO LTD
- Filing Date
- 2026-04-07
- Publication Date
- 2026-05-12
AI Technical Summary
Existing electricity meters struggle to achieve accurate temperature compensation under non-uniform temperature conditions, causing metering errors to drift with temperature and affecting metering accuracy and reliability.
By acquiring the internal ambient temperature of the electricity meter, the load current value of the shunt, and the current change trend, a resistance correction model is constructed. Corrections are made for both rising and falling current conditions. Two-dimensional polynomial fitting and least squares method are used to calculate the correction coefficients, and rising and falling resistance correction models are constructed to achieve accurate correction of the shunt resistance value.
Under wide temperature range and non-uniform temperature field conditions, rapid and accurate compensation for electricity meter measurement errors was achieved, improving measurement accuracy and reliability.
Smart Images

Figure CN122017309A_ABST
Abstract
Description
Technical Field
[0001] This invention generally relates to the field of power systems, and more specifically, to a method for compensating for metering errors in electricity meters based on a fast response to a non-uniform temperature field. Background Technology
[0002] The accuracy and reliability of electricity meter readings are crucial for power grid metering and settlement, line loss analysis, and operational control. Electronic electricity meters are inevitably affected by both ambient temperature changes and internal self-heating during operation, causing metering errors to drift with temperature. This drift is often not a simple linear relationship but is coupled with factors such as current load levels, material temperature characteristics, and the electrical parameter drift of key components. For example, the reference voltage of the metering chip drifts with temperature changes, causing changes in the analog-to-digital conversion reference value, thus affecting the quantization accuracy of the sampled data. Voltage divider resistors used for voltage sampling and sampling resistors used for current sampling (such as those made of manganese copper) both have temperature coefficients that may change non-linearly, altering the equivalent parameters of the voltage / current sampling link with temperature, thereby affecting the accuracy of the metering results.
[0003] Current mainstream solutions typically integrate temperature sensors within the metering chip, along with temperature compensation algorithms, to correct sampled values or metering results. However, the heat dissipation, thermal paths, and temperature rise dynamics of different components within an energy meter vary, easily creating a spatially non-uniform internal temperature field and temperature gradient. In this case, a single-point temperature (e.g., the temperature inside the chip or the external ambient temperature) cannot accurately characterize the true operating temperature of key components in the voltage / current sampling link, causing the temperature input of the compensation model to deviate from reality. This introduces compensation residuals, making it difficult to simultaneously achieve both compensation accuracy and response speed over a wide temperature range and under rapid temperature change conditions. Summary of the Invention
[0004] According to the present invention, a metering error compensation scheme for electricity meters based on rapid response to non-uniform temperature fields is provided. This scheme can improve the metering accuracy and reliability of metering data under temperature variation conditions.
[0005] In a first aspect of the present invention, a method for compensating for metering errors in an energy meter based on a fast response to a non-uniform temperature field is provided. The method includes: Obtain the internal ambient temperature, shunt load current value, and shunt resistance value of the energy meter to be compensated; based on the shunt load current value, obtain the current change trend; Based on the internal ambient temperature, shunt load current value and current change trend, a resistance correction model is constructed; the shunt resistance value is corrected using the resistance correction model to obtain the target shunt resistance value. The metering error of the energy meter is compensated based on the target shunt resistor value.
[0006] Furthermore, the construction of the resistance correction model based on the internal ambient temperature, shunt load current value, and current variation trend includes: When the current change trend is increasing or constant, a preset temperature step size is used to obtain the rising data set based on the internal ambient temperature, shunt load current value, and temperature step size; a rising resistance correction model is constructed based on the rising data set, and the rising resistance correction model is used as the final resistance correction model. When the current change trend is decreasing, a decreasing data set is obtained by setting a preset time sampling point based on the internal ambient temperature, shunt load current value and time sampling point; a decreasing resistance correction model is constructed based on the decreasing data set, and the decreasing resistance correction model is used as the final resistance correction model.
[0007] Furthermore, the step of obtaining the rising dataset based on the internal ambient temperature, shunt load current value, and temperature step size includes: The internal ambient temperature is taken as the minimum temperature, and the temperature rise sampling points are set according to the minimum temperature and the temperature step size. Set the rising current sampling point according to the shunt load current value; Adjust the internal temperature of the energy meter to be compensated until it reaches each rising temperature sampling point. Then, collect the shunt resistance value according to the rising current sampling point to obtain the set of rising shunt resistance values for each rising temperature sampling point. Based on the temperature value of each rising temperature sampling point, the set of rising shunt resistance values for each rising temperature sampling point, and the rising current sampling point, a rising sampling data set for each rising temperature sampling point is constructed. Each data entry in the rising sampling data set includes: rising shunt resistance value, rising temperature value, and rising current value. The rising temperature value is the value of the rising temperature sampling point when the rising shunt resistance value is collected, and the rising current value is the value of the rising current sampling point when the rising shunt resistance value is collected. The rising sample dataset of all temperature rise points is taken as the rising dataset.
[0008] Further, the step of acquiring the shunt resistance value based on the rising current sampling point includes: After loading the shunt load current to reach each rising current sampling point, the shunt resistance value is collected to obtain the shunt resistance value at each rising current sampling point. The set of shunt resistance values at all rising current sampling points is used as the set of rising shunt resistance values at the corresponding temperature points.
[0009] Furthermore, a rising resistance correction model is constructed based on the rising dataset, including: A two-dimensional polynomial is used to fit the data in the rising dataset to obtain the current rising model; The correction coefficients for the current rise model were calculated using the least squares method. A corrected model for rising resistance is constructed based on the correction coefficients of the current rise model.
[0010] Furthermore, the step of obtaining the descent dataset based on the internal ambient temperature, shunt load current value, and time sampling points includes: The internal ambient temperature is taken as the minimum temperature, and the temperature sampling points for the decrease are set according to the minimum temperature and the temperature step size. Set the falling current sampling point according to the shunt load current value; Adjust the internal temperature of the energy meter to be compensated until it reaches each temperature drop sampling point. Then, collect the shunt resistance value based on the current drop sampling point and time sampling point to obtain the shunt resistance value at each temperature drop sampling point. Based on the temperature value of each temperature drop sampling point, the set of shunt resistance values for each temperature drop sampling point, the set of current drop sampling points, and the time sampling points, a set of temperature drop sampling data for each temperature drop sampling point is constructed. Each data point in the set of temperature drop sampling data contains: shunt resistance value, temperature drop value, current drop value, and time value. The temperature drop value is the value of the temperature drop sampling point when the shunt resistance value is collected, the current drop value is the value of the current drop sampling point when the shunt resistance value is collected, and the time value is the value of the time sampling point when the shunt resistance value is collected. The set of all decreasing temperature sampling data points is used as the decreasing dataset.
[0011] Further, the step of acquiring the shunt resistance value based on the falling current sampling point and the time sampling point includes: Preset the maximum shunt current value, and adjust the shunt current to reach the maximum shunt current value; After successively reducing the current value of the shunt to each decreasing current sampling point, the shunt resistance value is collected according to the time sampling point to obtain the shunt resistance value at each decreasing current sampling point; The set of shunt resistance values at all current-dropping sampling points is taken as the current-dropping shunt resistance value at the corresponding temperature point.
[0012] Furthermore, the step of acquiring the shunt resistance value based on time sampling points includes: The current value of the shunt is kept at the corresponding falling current sampling point for a certain period of time. When the time sampling point is reached, the shunt resistance value of each time sampling point is collected. Use the shunt resistance values of all time sampling points as the shunt resistance values of the corresponding falling current sampling points.
[0013] Furthermore, the step of constructing a descent resistance correction model based on the descent dataset includes: A two-dimensional polynomial is used to fit the data in the descent dataset to obtain a current descent baseline model; the correction coefficients of the current descent baseline model are calculated using the least squares method; and a target current descent baseline model is constructed based on the correction coefficients of the current descent baseline model. Using the modified current-declining baseline model, the baseline prediction value for each data point in the declining dataset is calculated; the data residuals are then calculated based on the data in the declining dataset and the corresponding baseline prediction values. A time-corrected model is constructed based on the descent dataset; the correction coefficients of the time-corrected model are calculated using the least squares method based on the data residuals; and a target time-corrected model is constructed based on the correction coefficients of the time-corrected model. Based on the target current decrease baseline model and the target time correction model, a decrease resistance correction model is constructed.
[0014] In a second aspect of the invention, an electronic device is provided. The electronic device includes at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect of the invention.
[0015] Compared with the prior art, the present invention has the following beneficial technical effects: This invention, based on the internal ambient temperature of the electricity meter, the shunt load current, and the current variation trend, specifically distinguishes between current rise and fall scenarios, and adapts corresponding modeling logic accordingly. It comprehensively covers various temperature-changing scenarios and perfectly adapts to complex operating conditions with wide temperature ranges and non-uniform temperature fields, breaking through the limitations of traditional solutions. Furthermore, by constructing different resistance correction models for both current rise and fall scenarios, it achieves accurate and rapid correction of the shunt resistance value under non-uniform temperature fields, thereby enabling rapid compensation for metering errors in the electricity meter.
[0016] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0017] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein: Figure 1A flowchart of a method for compensating for metering errors in an energy meter based on a fast response to a non-uniform temperature field, according to an embodiment of the present invention, is shown. Figure 2 A flowchart illustrating the construction of an ascending dataset according to an embodiment of the present invention is shown; Figure 3 A flowchart illustrating the acquisition of a set of rising shunt resistor values according to an embodiment of the present invention is shown; Figure 4 A flowchart illustrating the construction of a rising resistance correction model according to an embodiment of the present invention is shown; Figure 5 A flowchart illustrating the construction of a descent dataset according to an embodiment of the present invention is shown; Figure 6 A flowchart illustrating the acquisition of the resistance value of the dropout shunt according to an embodiment of the present invention is shown; Figure 7 A flowchart illustrating the acquisition of the shunt resistance value at the falling current sampling point according to an embodiment of the present invention is shown; Figure 8 A flowchart illustrating the construction of a falling resistance correction model according to an embodiment of the present invention is shown; Figure 9 A block diagram of an exemplary electronic device capable of implementing embodiments of the present invention is shown; Among them, 900 is an electronic device, 901 is a computing unit, 902 is a ROM, 903 is a RAM, 904 is a bus, 905 is an I / O interface, 906 is an input unit, 907 is an output unit, 908 is a storage unit, and 909 is a communication unit. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0020] In this invention, a resistance correction model is constructed based on the changing trends of the load current of different shunts. This model is then used to correct the resistance of the shunt, and the metering error of the energy meter is compensated based on the corrected resistance. This approach comprehensively covers various temperature-changing scenarios, perfectly adapting to complex operating conditions with wide temperature ranges and non-uniform temperature fields, breaking through the limitations of traditional solutions. Furthermore, by constructing different resistance correction models for both rising and falling current conditions, accurate and rapid correction of the shunt resistance under non-uniform temperature fields is achieved, thereby enabling rapid compensation for the metering error of the energy meter.
[0021] Figure 1 A flowchart of a method for compensating for metering errors in an energy meter based on a rapid response to a non-uniform temperature field, according to an embodiment of the present invention, is shown.
[0022] The method includes S101~S103: S101. Obtain the internal ambient temperature, shunt load current value, and shunt resistance value of the energy meter to be compensated; obtain the current change trend based on the shunt load current value. The internal ambient temperature is obtained through temperature sensors located near the shunt and inside the meter; the shunt load current is the initial measured current value obtained by the metering chip based on the shunt's nominal resistance value or the corrected resistance value from the previous moment.
[0023] S102. Based on the internal ambient temperature, shunt load current value and current change trend, construct a resistance correction model; use the resistance correction model to correct the shunt resistance value to obtain the target shunt resistance value.
[0024] In this embodiment, the step of constructing a resistance correction model based on the internal ambient temperature, shunt load current value, and current variation trend includes: (1) When the current change trend is rising or unchanged, a temperature step size is preset, and the rising data set is obtained according to the internal ambient temperature, the shunt load current value and the temperature step size; a rising resistance correction model is constructed based on the rising data set, and the rising resistance correction model is used as the final resistance correction model.
[0025] In this embodiment, as Figure 2 As shown, the step of obtaining the rising dataset based on the internal ambient temperature, shunt load current value, and temperature step size includes S201~S205: S201. Using the internal ambient temperature as the minimum temperature, set the temperature rise sampling points based on the minimum temperature and the temperature step size. Assume the minimum temperature is... Temperature step size is The upper limit of temperature sampling points is Then the temperature sampling point is: , , , .
[0026] S202. Set the rising current sampling points according to the shunt load current value. The rising current sampling points are I0, I1, I2, ..., I... M Where I0 is the current corresponding to the minimum power measured by the meter, I M I1 is the current corresponding to the maximum power measured by the electricity meter, I2 is the current corresponding to the second minimum power measured by the electricity meter, and I3 is the current corresponding to the third minimum power measured by the electricity meter.
[0027] S203. Adjust the internal temperature of the energy meter to be compensated so that it reaches each rising temperature sampling point. Then, collect the shunt resistance value according to the rising current sampling point to obtain the set of rising shunt resistance values for each rising temperature sampling point.
[0028] In this embodiment, as Figure 3 As shown, the step of acquiring the shunt resistor value based on the rising current sampling point includes S301~S302: S301. Load the shunt current until it reaches each rising current sampling point, then collect the shunt resistance value to obtain the shunt resistance value at each rising current sampling point.
[0029] Specifically, the shunt is loaded with current. Under each current level, after the shunt reaches a preset stable state, the actual resistance value of the shunt under this operating condition is measured in a laboratory setting. The set of resistance values at the first temperature rise sampling point is denoted as R. U00 R U01 R U02 R U0M The set of resistance values at the second temperature rise sampling point is denoted as R. U10 R U11 R U12 R U1M This process continues until the set of shunt resistance values for all temperature rise sampling points has been collected.
[0030] In this embodiment, the preset stable state is the state in which the thermal state of the shunt tends to be stable, which can be determined by any of the following methods or combinations: (1) the output change rate of the temperature sensor near the shunt is lower than the preset threshold of 0.1℃ / min; (2) the current stabilization time reaches the set value of 10 min.
[0031] S302. The set of shunt resistance values at all rising current sampling points is used as the set of rising shunt resistance values at the corresponding temperature points. The set of rising shunt resistance values takes the following form: R U00 RU01 R U02 R U0M R U10 R U11 R U12 R U1M ...... R UN0 R UN1 R UN2 R UNM By setting relatively dense sampling points during the current rise and collecting shunt resistance values after the current reaches each sampling point, the impact of transient fluctuations and electromagnetic transients on the acquisition results during current rise can be effectively reduced. This ensures that the resistance values corresponding to each sampling point can accurately reflect the shunt characteristics under steady-state current conditions, thereby improving the reliability of the raw data. This sampling method can effectively cover the change process of shunt resistance under rising current conditions, providing a high-quality data foundation for establishing an accurate and continuous current-resistance mapping relationship using methods such as binomial fitting. This, in turn, improves the accuracy of resistance correction and error compensation under wide temperature ranges and non-uniform temperature fields.
[0032] S204. Based on the temperature value of each rising temperature sampling point, the set of rising shunt resistance values for each rising temperature sampling point, and the rising current sampling point, construct a rising sampling data set for each rising temperature sampling point. Each data entry in the rising sampling data set includes: a rising shunt resistance value, a rising temperature value, and a rising current value. The rising temperature value is the value from the falling temperature sampling point when the rising shunt resistance value is collected, and the rising current value is the value from the rising current sampling point when the rising shunt resistance value is collected.
[0033] Specifically, each time the rising shunt resistance value is collected, the rising shunt resistance value, rising temperature value (rising temperature sampling point value), and rising current value (rising current sampling point value) are taken as a data element to form a single data entry in the rising sampling data set.
[0034] S205. Collect the rising temperature sampling data from all the rising temperature sampling points as the rising dataset. In this embodiment, the measured internal ambient temperature is used as the lowest temperature. Combined with a fixed temperature step size, the rising temperature sampling points are set to achieve gradient-ordered sampling in both temperature and current dimensions. This avoids the drawbacks of random and scattered sampling, ensuring that the parameters of each sampling point are controllable and the intervals are uniform. This avoids the problems of data dispersion and excessive deviation from the source. The obtained resistance data closely matches the actual temperature rise characteristics of the shunt under non-uniform temperature fields, greatly improving the accuracy and reliability of the data. By associating the rising shunt resistance value, the corresponding rising temperature value, and the rising current value one by one, a standardized rising sampling dataset is constructed. Compared with single-dimensional compensation data, this dataset can accurately reflect the actual change law of the shunt resistance under non-uniform temperature fields, allowing the subsequently constructed rising resistance correction model to fit the actual operating conditions and greatly improving the accuracy of error compensation.
[0035] In this embodiment, as Figure 4 As shown, a rising resistance correction model is constructed based on the rising dataset, including S401~S403: S401. A two-dimensional polynomial is used to fit the data in the rising dataset to obtain the current rising model. Specifically, the data set at each temperature point in the rising dataset is fitted separately to obtain the current rising model for each temperature point.
[0036] In this embodiment, the current rise model is as follows: in, This is a current rise model; These are the coefficients of the first current rise model; These are the coefficients of the second current rise model; These are the coefficients of the third current rise model; These are the coefficients of the fourth current rise model; These are the coefficients of the fifth current rise model; These are the coefficients of the sixth current rise model; This represents the current temperature rise. This represents the rising current value.
[0037] S402. Calculate the correction coefficients of the current rise model using the least squares method.
[0038] Specifically, the target current rise model is determined using the least squares method, and then the coefficients of the target current rise model are used as correction coefficients for the current rise model. The formula for determining the target current rise model is as follows: in, Indexing for ascending datasets; This is the resistance value of the rising shunt; This is the current rise model corresponding to the kth rising dataset.
[0039] S403. Construct a rising resistance correction model based on the correction coefficients of the current rise model. The rising resistance correction model is as follows: in, A correction model for rising resistance; This is the current rise model after correction based on the correction coefficients of the current rise model.
[0040] By employing a two-dimensional polynomial to fit and model the rising current dataset at different temperature points, the variation of shunt resistance under the combined effects of temperature and current can be more accurately characterized, taking into account the coupled influence of temperature and current factors on the resistance value. Fitting generates a continuous and smooth current-resistance curve, making the model results more closely match the actual variation characteristics of the shunt resistance. This improves the accuracy of error compensation over a wide temperature range, solving the problem of poor compensation performance caused by discontinuous fitting and insufficient fit in traditional single models under wide temperature conditions. The least squares method is used to solve the model correction coefficients, eliminating minor interference and noise during data acquisition, ensuring the accuracy and reliability of the current rising model coefficients, thereby improving the model's robustness and stability and avoiding compensation distortion caused by data fluctuations.
[0041] (2) When the current change trend is decreasing, a time sampling point is preset, and a decreasing data set is obtained based on the internal ambient temperature, the shunt load current value and the time sampling point; a decreasing resistance correction model is constructed based on the decreasing data set, and the decreasing resistance correction model is used as the final resistance correction model.
[0042] In this embodiment, as Figure 5 As shown, the step of obtaining the descent dataset based on the internal ambient temperature, shunt load current value, and time sampling points includes S501~S505: S501. Using the internal ambient temperature as the minimum temperature, set the decreasing temperature sampling points based on the minimum temperature and the temperature step size. Assume the minimum temperature is... Temperature step size is The upper limit of temperature sampling points is The temperature sampling point for the decrease is: , , , , .
[0043] S502. Set the falling current sampling point according to the shunt load current value.
[0044] S503. Adjust the internal temperature of the energy meter to be compensated so that it reaches each temperature drop sampling point. Then, collect the shunt resistance value based on the current drop sampling point and time sampling point to obtain the shunt resistance value at each temperature drop sampling point.
[0045] In this embodiment, as Figure 6 As shown, the step of acquiring the shunt resistor value based on the falling current sampling point and the time sampling point includes S601~S603: S601. Preset the maximum value of the shunt current, and adjust the current of the shunt to reach the maximum value of the shunt current.
[0046] S602. After successively reducing the current value of the shunt to each decreasing current sampling point, the shunt resistance value is collected according to the time sampling point to obtain the shunt resistance value at each decreasing current sampling point.
[0047] Specifically, under laboratory conditions, the internal ambient temperature of the electricity meter is set to T. a0 And first make the shunt operate at the maximum current I. M (The meter measures the current corresponding to the maximum power) until the shunt reaches a preset stable state; then the shunt load current is changed from I... M Reduce to target currents I0, I1, I2, ..., I M Any current level in the range.
[0048] In this embodiment, as Figure 7 As shown, the step of collecting the shunt resistor value based on time sampling points includes S701~S702: S701. Maintain the shunt current value for the corresponding time at the falling current sampling point. When the time sampling point is reached, collect the shunt resistance value at each time sampling point. The falling current sampling points are: t1, t2, t3, ..., t... P Where t1 is the first preset sampling time after current reduction, preferably 1 second; t2 is the second preset sampling time after current reduction; t3 is the third preset sampling time after current reduction; t P This refers to the sampling time when the shunt temperature and the internal ambient temperature of the meter reach thermal equilibrium or near thermal equilibrium.
[0049] As some optional implementations of this embodiment, assuming the current drop sampling point is 5A, and the current drop sampling points are 1s, 4s, 6s, and 9s; then, the first shunt resistor value is collected after the shunt current value is maintained at 5A for 1s, the second shunt resistor value is collected after the shunt current value is maintained at 5A for 4s, the third shunt resistor value is collected after the shunt current value is maintained at 5A for 6s, and the fourth shunt resistor value is collected after the shunt current value is maintained at 5A for 9s. The set of the four collected shunt resistor resistance values is taken as the shunt resistor resistance value at the current current drop sampling point.
[0050] S702. Use the shunt resistance values of all time sampling points as the shunt resistance values of the corresponding falling current sampling points.
[0051] Specifically, when the ambient temperature is T a0 The target current is I M At each sampling point, the actual shunt resistance measured is recorded as: R D0M1 R D0M2 R D0M3 R D0MP When the ambient temperature is T a0 The target current is I M-1 The actual resistance measured at each sampling point is denoted as: R D0(M-1)1 R D0(M-1)2 R D0(M-1)3 R D0(M-1)P When the ambient temperature is T a0 The target current is I M-2 The actual resistance measured at each sampling point is denoted as: R D0(M-2)1 R D0(M-2)2 R D0(M-2)3 R D0(M-2)P ..., when the ambient temperature is T a0 When the target current is I0, the actual resistance measured at each time sampling point is recorded as: R D001 R D002 R D003 R D00P This process continues until the shunt resistance values at all temperature drop sampling points have been collected.
[0052] At each temperature point, resistance values are collected sequentially at multiple time sampling points, from the transient moment (e.g., 1 second) after current reduction to the steady-state moment when the shunt and the internal environment of the meter reach thermal equilibrium. This comprehensively covers the transient, relaxation, and steady-state stages after current reduction, ensuring the collected data fully reflects the attenuation trend of resistance over time after current decrease. Resistance is then collected at the corresponding current-dropping sampling point after the shunt current has decreased and stabilized. This avoids sampling errors caused by transient fluctuations during current switching, electromagnetic interference, and temperature jumps, ensuring accurate and reliable resistance data at individual sampling points. Invalid interference data is eliminated, guaranteeing dataset quality from the source and solidifying the foundation for error compensation accuracy. By correlating time sampling values, current drop values, ambient temperature values, and shunt resistance values, a four-dimensional correlation of temperature, current, time, and resistance is formed. This data accurately reflects the complex operating conditions of the electricity meter, including uneven temperature fields, rapid temperature changes, and sudden current drops, ensuring data consistency across a wide temperature range.
[0053] S603. The collection of shunt resistance values at all current-dropping sampling points is taken as the current-dropping shunt resistance value at the corresponding temperature point. Specifically, the current-dropping shunt resistance value at each temperature point is as follows: When the ambient temperature is T a0 hour: R D001 R D002 R D003 R D00P R D011 R D012 R D013 R D01P R D021 R D022 R D023 R D02P ...... R D0M1 R D0M2 R D0M3 R D0MP When the ambient temperature is T a1 hour: R D101 R D102 R D103 R D10P R D111 R D112 R D113 R D11P R D121R D122 R D123 R D12P ...... R D1M1 R D1M2 R D1M3 R D1MP ...... When the ambient temperature is T aN hour: R DN01 R DN02 R DN03 R DN0P R DN11 R DN12 R DN13 R DN1P R DN21 R DN22 R DN23 R DN2P ...... R DNM1 R DNM2 R DNM3 R DNMP At each ambient temperature point, the shunt is first loaded to its maximum current and stabilized. Then, the current is gradually reduced from the maximum current to each decreasing current sampling point, and the corresponding shunt resistance value is collected at each decreasing current sampling point. This method allows for the acquisition of resistance response data during the transition from maximum load to low load at each temperature point, making the collected results more consistent with the actual load reduction conditions of the shunt. Furthermore, by combining resistance acquisition with multiple time sampling points during the gradual current reduction process, resistance data of the shunt changing over time at different decreasing current levels can be obtained. This allows for the construction of a correlated dataset covering temperature, current, and time dimensions, providing support for the subsequent establishment of a high-precision correction model.
[0054] S504. Based on the temperature value of each temperature drop sampling point, the set of shunt resistance values for each temperature drop sampling point, the set of current drop sampling points, and the time sampling points, construct a temperature drop sampling data set for each temperature drop sampling point. Each data entry in the temperature drop sampling data set includes: a shunt resistance value, a temperature drop value, a current drop value, and a time value. The temperature drop value is the value at the temperature drop sampling point when the shunt resistance value is collected; the current drop value is the value at the current drop sampling point when the shunt resistance value is collected; and the time value is the value at the time sampling point when the shunt resistance value is collected.
[0055] Specifically, each time the resistance value of the shunt is collected, the current shunt resistance value, the temperature value (temperature sampling point value), and the current value (current sampling point value) are used as a data element to form a single data item in the shunt sampling data set.
[0056] S505. Collect all the decreasing temperature sampling data from all the decreasing temperature sampling points into a decreasing dataset.
[0057] This embodiment introduces the time dimension into the sampling of the descent operating condition and correlates the descent shunt resistance value, descent temperature value, descent current value, and time value to construct a standardized descent sampling dataset. This dataset comprehensively covers the transient, relaxation, and steady-state phases of the shunt during the descent process, clearly characterizing the dynamic law of the shunt resistance changing with temperature, current, and time. Compared to traditional methods that only sample based on a single temperature point or a single steady-state condition, this descent sampling dataset provides more complete data support for subsequent fitting and modeling, thereby improving the ability of the corrected model to represent complex operating conditions.
[0058] In this embodiment, as Figure 8 As shown, the step of constructing the descent resistance correction model based on the descent dataset includes steps S801 to S804: S801. Fit the data in the falling dataset using a two-dimensional polynomial to obtain the current falling baseline model; calculate the correction coefficients of the current falling baseline model using the least squares method; construct the target current falling baseline model based on the correction coefficients of the current falling baseline model.
[0059] Specifically, the data set at each temperature point in the decreasing dataset is fitted separately to obtain the current decrease baseline model for each temperature point; wherein, the current decrease baseline model is: in, For the current drop baseline model; These are the coefficients of the baseline model for the first current drop; The coefficients of the second current-decreasing baseline model; The coefficients are the baseline model coefficients for the third current drop. The coefficients are the baseline model coefficients for the fourth current drop. The coefficients of the fifth current-decreasing baseline model; The coefficients of the sixth current-decreasing baseline model; This represents the current temperature drop value. To reduce the current value.
[0060] Specifically, the modified current drop baseline model is determined using the least squares method, and the coefficients of the modified current drop baseline model are then used as the correction coefficients of the target current drop baseline model. The formula for determining the modified current drop baseline model is as follows: in, Index for the descent dataset; To reduce the shunt resistance value; For the first The current rise model corresponds to the data in the decreasing dataset.
[0061] S802. Using the modified current-decreasing baseline model, calculate the baseline prediction value for each data point in the decreasing dataset; calculate the data residuals based on the data in the decreasing dataset and the corresponding baseline prediction values.
[0062] Specifically, the formula for calculating the data residuals is: in, For data residuals; Baseline predicted value; For the descent dataset, the first Data.
[0063] S803. Construct a time correction model based on the descent dataset; calculate the correction coefficients of the time correction model using the least squares method based on the data residuals; construct a target time correction model based on the correction coefficients of the time correction model.
[0064] In this embodiment, the formula for constructing the time correction model is: in, For time correction models; To correct the model coefficients as soon as possible; To correct the model coefficients in the second time step; The model coefficients are corrected for the third time step; The model coefficients are corrected for the fourth time step; The model coefficients are corrected for the fifth time step; The model coefficients are corrected for the sixth time step; This represents the current temperature drop value. To reduce the current value.
[0065] Specifically, the modified time correction model is determined using the least squares method, and then the coefficients of the modified time correction model are used as the correction coefficients of the time correction model. The formula for determining the modified time correction model is as follows: in, Index for the descent dataset; For data residuals; This is a time-corrected model.
[0066] S804. Based on the target current decrease baseline model and the target time correction model, a decrease resistance correction model is constructed. Specifically, the formula for constructing the decrease resistance correction model is: in, For the reduced resistance correction model; Baseline model for target current decrease; The model is modified for the target time.
[0067] To address the unique thermal hysteresis and resistance relaxation characteristics of current reduction conditions, a two-layer modeling approach combining a baseline model and a time-correction model is employed. First, a baseline model for current reduction is constructed using a two-dimensional polynomial to fit the fundamental influences of temperature and current on the shunt resistance. Then, a time-correction model is separately constructed based on the data residuals to compensate for the dynamic hysteresis deviation of the resistance over time after current reduction. This approach accurately reflects the resistance change pattern under the coupled effects of multiple factors such as temperature, current, and time, completely eliminating compensation deviations under dynamic operating conditions and ensuring the accuracy of metering error compensation over a wide temperature range. The least squares method is used to iteratively solve the correction coefficients of the baseline and time-correction models, minimizing the sum of squared errors between the measured resistance value and the model prediction value. This effectively filters out random noise and interference data during the acquisition process, ensuring the accuracy and reliability of the model coefficients and improving the model's stability and anti-interference capability. By calculating the data residuals between the baseline prediction and measured values, a targeted time-correction model is constructed to fit the residual components, achieving closed-loop error correction. This comprehensively covers the transient, relaxation, and steady-state changes of the shunt after current reduction, further improving the consistency and reliability of metering compensation under all operating conditions.
[0068] When the current increases, the shunt generates self-heating under the load current, and its temperature rise forms a temperature gradient with the ambient temperature inside the electricity meter. In this embodiment, a calibration dataset (rising dataset) is constructed within a preset temperature range to establish a temperature and current correction model for the shunt resistance. When the current decreases, the shunt temperature does not decrease synchronously with the current decrease. This is because the shunt temperature decreases gradually through heat exchange with the surrounding medium, and it takes a certain amount of time to reach a new thermal equilibrium state. Therefore, during the process of shunt current decrease, the actual working resistance of the shunt cannot be accurately determined based solely on the ambient temperature and the current; a time parameter needs to be further introduced. Based on the above principle, this embodiment constructs a current-decreasing transient calibration dataset (falling dataset) containing a time parameter within a preset temperature range to establish a temperature, current, and time correction model for the shunt resistance.
[0069] S103. Compensate for the metering error of the energy meter to be compensated based on the target shunt resistor value. Specifically, the compensation principle is as follows: An energy meter that uses a shunt for current sampling has its metering link based on the shunt resistor R. The load current I flowing through the shunt generates a voltage drop, denoted as U across the shunt. sh Metering chip measures U sh The load current is then calculated by combining the shunt resistor R. This calculated current is denoted as I. m It satisfies I m equal to U sh Divide by R. The electricity meter synchronously measures the line voltage, which is denoted as U. line And according to U line with I m Calculate the instantaneous power, denoted as P, which satisfies P equal to U. line Multiply by I m The electricity meter accumulates the power P over time to obtain the electricity consumption value, denoted as E. In the above metering chain, the accuracy and temperature stability of the shunt resistor R directly determine the accuracy of the current calculation, thus affecting the final metering results of power P and electricity E. If there is a deviation between the actual resistance R of the shunt and the nominal resistance, the calculated current I will be affected. m This introduces proportional errors, which are further transmitted to power P and energy E, causing systematic metering deviations. Simultaneously, under temperature changes and self-heating, if the equivalent resistance of the shunt drifts with temperature Tr, the metering results will drift with changing operating conditions, reducing the consistency and reliability of the electricity meter under different seasons and load conditions. Therefore, establishing a shunt resistance correction and fast response compensation mechanism for nonlinear resistance drift that may still occur in manganese-copper shunts under wide temperature ranges and dynamic loads is a key technical approach to improve the metering accuracy and reliability of electricity meter data.
[0070] According to embodiments of the present invention, the present invention has the following advantages compared with the prior art: (1) To address the pain point that existing electricity meter temperature compensation technology is difficult to simultaneously balance compensation accuracy and response speed under wide temperature range and rapid temperature change conditions, by distinguishing between two working conditions of current rise / constancy and current fall, a differentiated sampling mechanism and resistance correction model are constructed respectively, thereby realizing accurate and rapid correction of shunt resistance under non-uniform temperature field.
[0071] (2) Intelligent switching of modeling strategy according to the current change trend: When the current rises, a two-dimensional steady-state model of temperature and current is adopted; when the current falls, a time dimension is introduced, and a three-dimensional steady-state model of temperature, current and time is adopted. In this way, the shortcomings of the traditional single compensation model cannot take into account the two dynamic processes of heating and cooling at the same time, so that the present invention can still maintain a stable and reliable compensation effect under complex working conditions of sudden current change and rapid temperature change.
[0072] (3) By correcting the actual resistance value of the shunt in real time, the system error caused by temperature drift, self-heating and thermal hysteresis is eliminated from the current sampling link, which significantly improves the metering accuracy and long-term stability of the energy meter in complex environments such as high and low temperatures, sudden load changes and uneven temperature fields, and ensures accurate and reliable metering results throughout the entire working condition and life cycle.
[0073] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0074] According to embodiments of the present invention, an electronic device is also provided.
[0075] Figure 9 A schematic block diagram of an electronic device 900 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0076] Electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or a computer program loaded into random access memory (RAM) 903 from storage unit 908. The RAM 903 may also store various programs and data required for the operation of electronic device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. An input / output (I / O) interface 905 is also connected to bus 904.
[0077] Multiple components in electronic device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of displays, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows electronic device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0078] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as methods S101-S103. For example, in some embodiments, methods S101-S103 may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of methods S101-S103 described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to execute methods S101-S103 by any other suitable means (e.g., by means of firmware).
[0079] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0080] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0081] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0082] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0083] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0084] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0085] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0086] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for compensating metering errors in an energy meter based on a fast response to a non-uniform temperature field, characterized in that, include: Obtain the internal ambient temperature, shunt load current value, and shunt resistance value of the energy meter to be compensated; The current variation trend is obtained based on the shunt load current value; A resistance correction model is constructed based on the internal ambient temperature, shunt load current value, and current variation trend; The shunt resistance value is corrected using the aforementioned resistance correction model to obtain the target shunt resistance value; The metering error of the energy meter to be compensated is compensated based on the target shunt resistor value.
2. The method according to claim 1, characterized in that, The resistance correction model is constructed based on the internal ambient temperature, shunt load current value, and current variation trend, including: When the current change trend is increasing or constant, a preset temperature step size is used to obtain the rising data set based on the internal ambient temperature, shunt load current value, and temperature step size; a rising resistance correction model is constructed based on the rising data set, and the rising resistance correction model is used as the final resistance correction model. When the current change trend is decreasing, a decreasing data set is obtained by setting a preset time sampling point based on the internal ambient temperature, shunt load current value and time sampling point; a decreasing resistance correction model is constructed based on the decreasing data set, and the decreasing resistance correction model is used as the final resistance correction model.
3. The method according to claim 2, characterized in that, The data set obtained based on the internal ambient temperature, shunt load current value, and temperature step size includes: The internal ambient temperature is taken as the minimum temperature, and the temperature rise sampling points are set according to the minimum temperature and the temperature step size. Set the rising current sampling point according to the shunt load current value; Adjust the internal temperature of the energy meter to be compensated until it reaches each rising temperature sampling point. Then, collect the shunt resistance value according to the rising current sampling point to obtain the set of rising shunt resistance values for each rising temperature sampling point. Based on the temperature value of each rising temperature sampling point, the set of rising shunt resistance values for each rising temperature sampling point, and the rising current sampling point, a rising sampling data set for each rising temperature sampling point is constructed. Each data entry in the rising sampling data set includes: rising shunt resistance value, rising temperature value, and rising current value. The rising temperature value is the value of the rising temperature sampling point when the rising shunt resistance value is collected, and the rising current value is the value of the rising current sampling point when the rising shunt resistance value is collected. The rising sample dataset of all temperature rise points is taken as the rising dataset.
4. The method according to claim 3, characterized in that, The step of acquiring the shunt resistor value based on the rising current sampling point includes: After loading the shunt load current to reach each rising current sampling point, the shunt resistance value is collected to obtain the shunt resistance value at each rising current sampling point. The set of shunt resistance values at all rising current sampling points is used as the set of rising shunt resistance values at the corresponding temperature points.
5. The method according to claim 3, characterized in that, Based on the aforementioned rising data set, a rising resistance correction model is constructed, including: A two-dimensional polynomial is used to fit the data in the rising dataset to obtain the current rising model; The correction coefficients for the current rise model were calculated using the least squares method. A corrected model for rising resistance is constructed based on the correction coefficients of the current rise model.
6. The method according to claim 2, characterized in that, The descent dataset obtained based on the internal ambient temperature, shunt load current value, and time sampling points includes: The internal ambient temperature is taken as the minimum temperature, and the temperature sampling points for decreasing temperature are set according to the minimum temperature and the temperature step size. Set the falling current sampling point according to the shunt load current value; Adjust the internal temperature of the energy meter to be compensated until it reaches each temperature drop sampling point. Then, collect the shunt resistance value based on the current drop sampling point and time sampling point to obtain the shunt resistance value at each temperature drop sampling point. Based on the temperature value of each temperature drop sampling point, the set of shunt resistance values for each temperature drop sampling point, the set of current drop sampling points, and the time sampling points, a set of temperature drop sampling data for each temperature drop sampling point is constructed. Each data point in the set of temperature drop sampling data contains: shunt resistance value, temperature drop value, current drop value, and time value. The temperature drop value is the value of the temperature drop sampling point when the shunt resistance value is collected, the current drop value is the value of the current drop sampling point when the shunt resistance value is collected, and the time value is the value of the time sampling point when the shunt resistance value is collected. The set of all decreasing temperature sampling data points is used as the decreasing dataset.
7. The method according to claim 6, characterized in that, The step of acquiring the shunt resistor value based on the falling current sampling point and the time sampling point includes: Preset the maximum shunt current value, and adjust the shunt current to reach the maximum shunt current value; After successively reducing the current value of the shunt to each decreasing current sampling point, the shunt resistance value is collected according to the time sampling point to obtain the shunt resistance value at each decreasing current sampling point; The set of shunt resistance values at all current-dropping sampling points is taken as the current-dropping shunt resistance value at the corresponding temperature point.
8. The method according to claim 7, characterized in that, The step of collecting the shunt resistor value based on time sampling points includes: The current value of the shunt is kept at the corresponding falling current sampling point for a certain period of time. When the time sampling point is reached, the shunt resistance value of each time sampling point is collected. Use the shunt resistance values of all time sampling points as the shunt resistance values of the corresponding falling current sampling points.
9. The method according to claim 6, characterized in that, The construction of the descent resistance correction model based on the descent dataset includes: A two-dimensional polynomial is used to fit the data in the descent dataset to obtain a current descent baseline model; the correction coefficients of the current descent baseline model are calculated using the least squares method; and a target current descent baseline model is constructed based on the correction coefficients of the current descent baseline model. Using the modified current-declining baseline model, the baseline prediction value for each data point in the declining dataset is calculated; the data residuals are then calculated based on the data in the declining dataset and the corresponding baseline prediction values. A time-corrected model is constructed based on the descent dataset; the correction coefficients of the time-corrected model are calculated using the least squares method based on the data residuals; and a target time-corrected model is constructed based on the correction coefficients of the time-corrected model. Based on the target current decrease baseline model and the target time correction model, a decrease resistance correction model is constructed.
10. An electronic device, comprising at least one processor; and a memory communicatively connected to said at least one processor; characterized in that, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.