An electric energy metering box metering error online self-calibration method and system

CN122901758APending Publication Date: 2026-10-13HUA TAI DIAN QI KE JI (HE NAN) YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610878292.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-17
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0004]本申请提供了一种电能计量箱计量误差在线自校准方法及系统,解决了现有电能计量箱在线校准中对外部溯源标准器存在强依赖、以及双通道差值数据有效性无法可靠验证的问题,在不停电、不引入外部标准器的前提下实现了两通道绝对误差的自解算与在线补偿

Benefits of technology

[0009]本申请提供的技术方案中,通过在电能计量箱内构建计量通道与校验通道的双通道结构,并向两通道同时注入同一标准源信号,使得两通道在相同激励条件下独立产生响应值,从而得到第一通道差值;在此基础上,通过互换计量通道与校验通道各自承担的计量职责与校验职责,再次注入标准源信号得到第二通道差值,由于两次注入采用相同标准源且角色对调,第一通道差值与第二通道差值之间形成符号严格相反的代数关系,标准源信号的绝对精度在差值作差过程中被代数消去,使得标准源信号无需具备经外部溯源认证的绝对精度,仅需在单次校准周期内保持幅值稳定即可满足使用要求,从根本上解除了现有在线校准方案对外部溯源标准器的强依赖,使电能计量箱在不停电、不拆除设备的运行状态下即可启动校准流程,克服了传统离线检定必须停电作业的工程限制。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122901758A_ABST
    Figure CN122901758A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of electric energy metering, and discloses an electric energy metering box metering error online self-calibration method and system. The method comprises the following steps: injecting a standard source signal into a metering channel and a verification channel to obtain a first channel difference value; after the metering responsibility and the verification responsibility of the two channels are interchanged, the standard source signal is injected again to obtain a second channel difference value; the two difference values are substituted into a symbolic opposite equation set to self-solve absolute errors of the channels; and the absolute errors of the channels are written into a metering chip calibration register in opposite signs to complete online error compensation. The application solves the problems that the existing electric energy metering box online calibration has a strong dependence on external traceability standard devices and the validity of double-channel difference value data cannot be reliably verified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electricity metering technology, and in particular to an online self-calibration method and system for the metering error of an electricity metering box. Background Technology

[0002] As the core metering device for electricity consumption trade settlement in the power system, the electricity metering box typically consists of a current transformer, a voltage transformer, an analog-to-digital converter, and a metering chip connected in series to form a complete metering circuit. Currently, the error verification method for electricity metering boxes is mainly offline calibration. This involves a professional metrologist bringing a standard electricity meter or standard transformer traceable by a national metrology institution to the site during a power outage. The standard meter and the metering device under test are connected in parallel to the same test circuit. By comparing the output difference of the two meters under the same electrical input, it is determined whether the error of the device under test exceeds the allowable range, and the metering chip register parameters are manually adjusted accordingly to complete error compensation. This offline verification method has been used in the power industry for many years, forming a relatively complete system of on-site verification procedures.

[0003] However, the aforementioned existing technologies have the following shortcomings: First, offline verification must be carried out under system power outage conditions, which interrupts the normal power supply to users. Moreover, the verification cycle is usually in the form of years, which cannot detect the error drift of the metering device caused by temperature changes, load fluctuations, or component aging between two verification cycles, resulting in the continuous accumulation of long-term operating errors that cannot be detected in time. Second, although existing online monitoring methods have proposed schemes to operate the standard transformer and the transformer under test in parallel, or to compare the output of the standard by injecting a reference signal with known parameters, the above schemes all require the reference signal or parallel standard to have absolute accuracy with traceability certification. In the actual operating environment of the power metering box without power outage, due to factors such as limited box space, strong electromagnetic interference, and complex temperature field, it is difficult to integrate an external standard that meets the traceability requirements in the box, so the absolute accuracy of online calibration cannot be guaranteed. Third, in the existing dual-channel comparison scheme, the roles of the two channels are fixed. When the reference channel itself drifts, the calibration result becomes invalid, and the existing technology lacks an effective self-traceability means for the error of the reference channel itself. Summary of the Invention

[0004] This application provides an online self-calibration method and system for metering errors of electricity metering boxes, which solves the problems of strong dependence on external traceability standards and unreliable verification of the validity of dual-channel difference data in existing online calibration of electricity metering boxes. It achieves self-calculation and online compensation of absolute errors of two channels without power outages or the introduction of external standards.

[0005] Firstly, this application provides an online self-calibration method for the metering error of an electricity metering box, the online self-calibration method for the metering error of the electricity metering box comprising: Step S1: Inject standard source signals into the metering channel and calibration channel in the power metering box to obtain the difference of the first channel; Step S2: Swap the measurement and verification responsibilities of the metering channel and the verification channel, and re-inject the standard source signal into the swapped metering channel and the verification channel to obtain the second channel difference; wherein, the first channel difference is obtained by subtracting the response value of the metering channel from the response value of the verification channel, and the second channel difference is obtained by subtracting the response value of the swapped verification channel from the response value of the swapped metering channel, and the first channel difference and the second channel difference are opposites of each other; Step S3: Substitute the difference between the first channel and the difference between the second channel into a set of equations with opposite signs formed by two role swaps, and calculate the absolute error of the measurement channel and the absolute error of the verification channel without introducing an external traceability standard. Step S4: Write the absolute error of the metering channel and the absolute error of the verification channel into the metering chip calibration register of the metering channel and the verification channel respectively with opposite signs to complete the online error compensation.

[0006] Secondly, this application provides an online self-calibration system for the metering error of an electricity metering box, the online self-calibration system for the metering error of the electricity metering box comprising: The injection module is used to inject standard source signals into the metering channel and the calibration channel in the power metering box to obtain the first channel difference. The interchange module is used to interchange the metering and verification responsibilities of the metering channel and the verification channel, and to re-inject the standard source signal into the interchanged metering channel and the verification channel to obtain a second channel difference; wherein, the first channel difference is obtained by subtracting the response value of the metering channel from the response value of the verification channel, and the second channel difference is obtained by subtracting the response value of the interchanged verification channel from the response value of the interchanged metering channel, and the first channel difference and the second channel difference are opposites of each other; The calculation module is used to substitute the difference between the first channel and the difference between the second channel into a set of equations with opposite signs formed by two role swaps, and to automatically calculate the absolute error of the measurement channel and the absolute error of the verification channel without introducing an external traceability standard. The compensation module is used to write the absolute error of the metering channel and the absolute error of the verification channel into the calibration register of the metering chip of the metering channel and the verification channel respectively with opposite signs, so as to complete the online error compensation.

[0007] Thirdly, an online self-calibration device for metering error of an electricity metering box is provided, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the online self-calibration device for metering error of the electricity metering box to execute the above-described online self-calibration method for metering error of the electricity metering box.

[0008] Fourthly, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, which, when executed on a computer, cause the computer to perform the above-described online self-calibration method for metering error of an energy metering box.

[0009] The technical solution provided in this application constructs a dual-channel structure of metering and calibration channels within the energy metering box, and simultaneously injects the same standard source signal into both channels, enabling the two channels to independently generate response values ​​under the same excitation conditions, thereby obtaining the first channel difference. Based on this, by swapping the metering and calibration responsibilities undertaken by the metering and calibration channels, the standard source signal is injected again to obtain the second channel difference. Since the two injections use the same standard source and the roles are reversed, a strictly opposite algebraic relationship is formed between the first and second channel differences. The absolute accuracy of the standard source signal is algebraically eliminated during the difference calculation process, so that the standard source signal does not need to have the absolute accuracy certified by external traceability. It only needs to maintain amplitude stability within a single calibration cycle to meet the usage requirements. This fundamentally eliminates the strong dependence of existing online calibration schemes on external traceability standards, allowing the energy metering box to start the calibration process without power interruption or equipment removal, overcoming the engineering limitation that traditional offline verification must be carried out by power outage.

[0010] This application substitutes the difference between the first and second channels as two known quantities into a system of two linear equations consisting of two role swaps. Through addition and subtraction elimination operations, the absolute errors of the metering channel and the verification channel are solved simultaneously. The solutions are independent of each other and their validity can be verified by the algebraic self-consistency condition that their sum approaches zero. This ensures that the absolute errors of each channel are uniquely determined without an external reference benchmark, solving the problem that the drift of the reference channel itself cannot be independently traced in existing dual-channel schemes. The calculated absolute errors are written to the calibration register of each channel metering chip with opposite signs. The compensation operation directly acts on the gain correction register of the metering chip. The entire process is automatically completed under the control of the microcontroller inside the box. The metering pulse output terminal is continuously held during switching through the pulse latch circuit, and the metering data on the user side is not interrupted. This realizes uninterrupted, external standard-free, fully automatic online closed-loop compensation of the metering error of the power metering box. Attached Figure Description

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

[0012] Figure 1 This is a schematic diagram of an embodiment of the online self-calibration method for metering error of the power metering box in this application. Figure 2 This is a schematic diagram illustrating the verification process where the difference between the first channel and the difference between the second channel are opposites in an embodiment of this application. Figure 3 This is a schematic diagram illustrating the verification of the solution accuracy of the system of equations with opposite signs in an embodiment of this application. Detailed Implementation

[0013] This application provides an online self-calibration method and system for metering errors in an electricity metering box. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0014] For ease of understanding, the specific process of the embodiments of this application is described below. Please refer to [link / reference]. Figure 1 One embodiment of the online self-calibration method for metering error of the power metering box in this application includes: Step S1: Inject standard source signals into the metering channel and calibration channel in the power metering box to obtain the difference of the first channel; Specifically, both the metering channel and the calibration channel are composed of current transformers, voltage transformers, analog-to-digital converters, and metering chips connected in series. They have identical structural specifications and reside in the same enclosure. This is to ensure that the temperature and electromagnetic environments experienced by both channels are consistent, eliminating the impact of environmental differences on subsequent difference calculations. The standard source signal refers to the test voltage and test current signals with known frequencies and known in-phase relationships generated by the in-enclosure direct digital frequency synthesizer. Their amplitudes are much smaller than the rated values, and their superposition and injection do not affect normal metering. The first channel difference refers to the difference between the power response value of the metering channel to the standard source signal and the power response value of the calibration channel to the standard source signal. This difference reflects the relative deviation between the two channels under the same excitation and does not depend on the absolute accuracy of the standard source signal.

[0015] Step S2: Swap the measurement and calibration responsibilities of the metering channel and the calibration channel, and inject standard source signals into the swapped metering channel and calibration channel again to obtain the second channel difference; wherein, the first channel difference is obtained by subtracting the response value of the metering channel from the response value of the calibration channel, and the second channel difference is obtained by subtracting the response value of the swapped calibration channel from the response value of the swapped metering channel, and the first channel difference and the second channel difference are opposites of each other; Specifically, the role swap is achieved through the on / off operation of relays in the role switching matrix within the enclosure. The metering channel, originally responsible for external power grid connection, is switched to bypass sampling mode, while the verification channel, originally responsible for bypass sampling, is switched to external power grid connection mode. The two channels complete the role swap at the physical hardware level. After the swap, the same standard source signal as in step S1 is injected again to obtain the second channel difference. Since the interval between the two injections is only the time required for relay switching, the hardware drift of the two channels during this period is extremely small and negligible. Therefore, the signs of the first channel difference and the second channel difference are strictly opposite, meaning that their sum approaches zero. This is the only solvable physical premise for the subsequent equations.

[0016] Step S3: Substitute the difference between the first channel and the difference between the second channel into the system of equations with opposite signs formed by the two role swaps, and calculate the absolute error of the measurement channel and the absolute error of the verification channel without introducing an external traceability standard. Specifically, the system of equations with opposite signs consists of two sets of interchanging differences: the first difference equals the absolute error of the measurement channel minus the absolute error of the calibration channel; the second difference equals the absolute error of the calibration channel minus the absolute error of the measurement channel; and the difference between the two equations results in the absolute error of the measurement channel equals the first channel difference minus the second channel difference divided by two, and the absolute error of the calibration channel equals the second channel difference minus the first channel difference divided by two. This solution process does not rely on any external traceability standard; the true value of the standard source signal is algebraically eliminated during the subtraction of the two equations, and the absolute error is entirely determined by the relative relationship between the two differences.

[0017] Step S4: Write the absolute error of the metering channel and the absolute error of the calibration channel into the calibration register of the metering chip of the metering channel and the calibration channel respectively with opposite signs to complete the online error compensation.

[0018] Specifically, the metering chip calibration register refers to the register inside the metering chip used to store the gain correction coefficient. Its value directly participates in the chip's internal multiplication operations, thereby correcting the output electrical energy. Writing the absolute error of the metering channel and the absolute error of the verification channel into their respective metering chip calibration registers with opposite signs means negating the error value and converting it to an integer multiple of the least significant bit of the register before writing it. This allows subsequent metering outputs from the chip to automatically cancel out the error at the hardware level. The entire process is completed without interrupting power to the electricity metering box, without disconnecting the meter, and without removing the equipment. The metering pulse output terminal is continuously held during switching via a pulse latch circuit, ensuring uninterrupted electricity metering data on the user side.

[0019] In one specific embodiment, step S1 includes: A metering channel and a verification channel with the same structural specifications are constructed in the power metering box. The primary side of the metering channel is connected to the external power grid voltage and current signals, and the primary side of the verification channel is connected to the bypass tap of the secondary side of the current transformer of the metering channel, thus obtaining a dual-channel sampling structure. Based on a dual-channel sampling structure, a temperature-compensated crystal oscillator drives a direct digital frequency synthesizer to generate a standard test voltage signal and a standard test current signal with a frequency of 50 Hz and an amplitude stability better than 0.005%. The standard test voltage signal and the standard test current signal are used as standard source signals. The standard source signal is simultaneously superimposed and injected into the secondary sampling points of the current transformers in both the metering channel and the verification channel via an isolation coupling transformer. The injection duration is ten power frequency cycles, and the response values ​​of the metering channel and the verification channel are collected respectively. Based on the response values ​​of the metering channel and the verification channel, the difference between the response values ​​of each metering channel and the response values ​​of each verification channel is calculated to obtain the first channel difference value.

[0020] Specifically, the dual-channel sampling structure refers to a system where, within the same energy metering box, the primary side of the metering channel is directly connected in series with the external power grid main circuit, undertaking the formal energy metering responsibility. The primary side of the verification channel is not connected to the main circuit; instead, a bypass tap is drawn from the secondary side of the current transformer in the metering channel, parallel to the formal secondary circuit. This bypass tap is located between the output terminal of the current transformer secondary winding and the input terminal of the formal metering chip. The verification channel collects the same secondary side electrical quantities as the metering channel through this tap, allowing both channels to independently complete sampling and metering under the same signal input conditions. This is a structural prerequisite for the validity of subsequent difference calculations. The sampling point on the secondary side of the current transformer refers to the specific location where the standard source signal is superimposed and injected. It is selected at the signal line node between the output terminal of the current transformer secondary winding and the input terminal of each channel's analog-to-digital conversion unit, ensuring that the injected signal and the normal power grid signal are simultaneously responded to by the metering chip in the same sampling path.

[0021] The amplitude stability of the standard test voltage and current signals is set to be better than 0.005%, based on the fact that the least significant bit resolution of the metering chip is approximately 0.000047%. A stability of 0.005% corresponds to approximately 106 least significant bits. Within this stability range, the amplitude fluctuations of the standard source signal itself introduce errors into the difference calculation that are far less than one least significant bit, ensuring the validity of the difference. The injection duration is set to ten power frequency cycles, or 200 milliseconds, based on the fact that the settling time of the metering chip's internal integral filter is no less than five power frequency cycles. Using ten power frequency cycles ensures that the metering chip's output value is completely stable before acquiring the response value, eliminating the influence of transient response on the acquisition results. The temperature-compensated crystal oscillator is used to suppress the influence of ambient temperature changes on the output frequency of the direct digital frequency synthesizer, ensuring that the frequency consistency of the standard source signal between two injections satisfies the stability prerequisite of the subsequent equations with opposite signs.

[0022] In one specific embodiment, the metrological and verification responsibilities of the metering channel and the verification channel are interchanged, including: Send control commands to each relay in the role switching matrix to disconnect the connection between the primary side of the metering channel and the external power grid voltage and current signals, and switch the primary side of the verification channel to connect to the external power grid voltage and current signals, thus obtaining the metering channel and the verification channel after the role switching are reversed. Based on the metering channel and the verification channel after the responsibilities are swapped, the metering pulse output terminal of the metering channel after the responsibilities are swapped is kept connected through a pulse latching circuit to obtain an uninterrupted metering state. Under uninterrupted metering conditions, the primary side of the verification channel after the responsibilities are swapped is connected to the bypass tap of the secondary side of the current transformer in the metering channel to obtain the swapped dual-channel sampling structure. The validity of the switching completion status of each relay in the role switching matrix is ​​verified, and the swapped dual-channel sampling structure that passes the verification is used as the basis for subsequent injection operations.

[0023] Specifically, the role switching matrix consists of four sets of double-pole double-throw relays. The on / off state of each relay is controlled by the microcontroller inside the enclosure via the high and low levels of general-purpose input / output pins. Initially, the primary side of the metering channel connects to the external power grid voltage and current signals through the closed contacts of two sets of relays, while the primary side of the verification channel is isolated from the main circuit through the open contacts of the other two sets of relays. When the roles are swapped, the microcontroller operates the relays sequentially in a disconnect-then-connection order: first, it disconnects the two sets of relay contacts between the primary side of the metering channel and the external power grid, and then it closes the two sets of relay contacts between the primary side of the verification channel and the external power grid. The entire switching process takes no more than 500 milliseconds. The metering channel after the role swap refers to the channel that, after the contacts are opened, switches to sampling via the bypass tap of the current transformer secondary side. The verification channel after the role swap refers to the channel that, after the contacts are closed, switches to the channel responsible for metering the external power grid connection. The swapped dual-channel sampling structure refers to the overall connection state of the dual channels after the above role swap is completed.

[0024] The pulse latch circuit, composed of D flip-flops, latches the state of the last valid metering pulse before the relay switching and continuously outputs it to the metering pulse output terminal during relay switching, maintaining this state for at least one second. This duration is set based on twice the upper limit of 500 milliseconds for relay switching time, ensuring that the metering pulse output terminal always has a signal before the switching is complete. This prevents the external power consumption information acquisition system from losing pulse records due to the switching gap, thus obtaining uninterrupted metering status. The validity verification criteria are as follows: the microcontroller reads the status register of each relay feedback contact, confirming that the primary side contact of the verification channel after the responsibility swap is in a closed state, the primary side contact of the metering channel after the responsibility swap is in an open state, and the connection contact between the primary side of the verification channel after the responsibility swap and the bypass tap of the secondary side of the current transformer is in a closed state. If all three conditions are met simultaneously, the verification is deemed successful, and the current connection state is confirmed as the swapped dual-channel sampling structure; otherwise, the switching operation is triggered to be re-executed.

[0025] In one specific embodiment, a standard source signal is injected again into the interchanged metering channel and calibration channel to obtain a second channel difference, including: The standard source signal is simultaneously superimposed and injected into the secondary sampling points of the current transformers in each channel of the interchanged dual-channel sampling structure via an isolation coupling transformer. The injection duration is ten power frequency cycles. The response values ​​of the metering channel and the verification channel after the responsibilities are interchanged are collected respectively. The second channel difference is obtained by subtracting the response values ​​of the verification channel after the swap of responsibilities from the response values ​​of the metering channel after the swap of responsibilities. The difference between the first channel and the difference between the second channel are summed to obtain the difference consistency verification result. Based on the difference consistency verification result, the absolute value of the difference consistency verification result is compared with the preset consistency threshold, and the first channel difference and the second channel difference whose absolute value does not exceed the preset consistency threshold are selected as valid channel difference pairs.

[0026] Specifically, the response value of the metering channel after the role swap refers to the power metering output value of the original metering channel when it switches to bypass sampling state after the role swap is completed, and the response value of the verification channel after the role swap refers to the power metering output value of the original verification channel when it switches to external power grid access metering responsibility after the role swap is completed, and the response value of the verification channel when it switches to external power grid access metering responsibility. The acquisition method of both is exactly the same as that of the metering channel response value and verification channel response value in step S1. Both are obtained by continuously injecting ten power frequency cycles and then reading the power register output value of each channel metering chip. The injection duration setting is consistent with step S1. The second channel difference is obtained by subtracting the metering channel response value after the role swap from the verification channel response value after the role swap. The order of subtraction is the reverse of the first channel difference in step S1. This reversal of order is the basis for generating the opposite sign relationship.

[0027] The difference consistency check result is obtained by directly adding the difference between the first channel and the second channel. Its physical meaning is the degree to which the sum of the two differences deviates from zero. If the hardware state of the two channels remains stable during the two injections, the difference between the first and second channels are strictly opposites, and their sum is theoretically zero. If abnormal disturbances or hardware drift acceleration occur during the switching period, causing inconsistencies in the two measurement conditions, the sum will deviate from zero. The preset consistency threshold is set to twice the least significant bit resolution of the metering chip. This setting is based on the following: the upper limit of quantization error for a single acquisition is one least significant bit, and the upper limit of cumulative quantization error for two acquisitions is two least significant bits. Using this as a threshold can identify inconsistencies introduced by hardware anomalies, excluding normal quantization errors. The first and second channel differences whose absolute values ​​do not exceed the preset consistency threshold are selected as valid channel difference pairs. These difference pairs are identified as opposite-sign difference data generated by the two role swaps and are passed to subsequent steps as input to the opposite-sign equation system. Difference pairs exceeding the threshold are judged as invalid and trigger a re-execution of the complete injection process.

[0028] In one specific embodiment, the first channel difference and the second channel difference are opposites of each other, including: Based on the effective channel difference pairs, the difference between the first channel difference and the second channel difference is subtracted to obtain the negative number verification deviation value; The absolute value of the negative number verification deviation value is compared with the judgment threshold formed by twice the lowest effective bit resolution of the metering chip. Valid channel difference pairs whose absolute value exceeds the judgment threshold are marked as abnormal difference pairs, and valid channel difference pairs whose absolute value does not exceed the judgment threshold are marked as qualified difference pairs. For abnormal difference pairs, trigger a re-execution of the complete injection process; for qualified difference pairs, retain and output them. The first channel difference and the second channel difference in the qualified difference pair are used as inputs to the system of equations with opposite signs.

[0029] Specifically, the first channel difference in the effective channel difference pair is multiplied by negative one and inverted, then subtracted from the second channel difference to obtain the algebraic deviation between the two. This calculation differs from the difference consistency verification result in step S2 in that the difference consistency verification result is the direct addition of the two differences to determine if the sum approaches zero; the opposite number verification deviation value is obtained by inverting the first channel difference and subtracting it from the second channel difference, directly verifying whether the inverted first channel difference and the second channel difference are numerically equal, i.e., whether they constitute a strict opposite number relationship.

[0030] If the two values ​​are strictly opposites, then the difference of the first channel, after being inverted, will be exactly the same as the difference of the second channel, and the deviation value for the opposite number verification will be zero. If a deviation exists, the absolute value of the deviation value for the opposite number verification will reflect the magnitude of the deviation. The judgment threshold is set to twice the resolution of the least significant bit of the metering chip, which is the same as the preset consistency threshold value and is based on the same criteria. That is, the upper limit of the cumulative quantization error of the two acquisitions is two least significant bits. Deviations within this range are considered normal quantization errors and do not affect the validity of the equation system solution.

[0031] Valid channel difference pairs whose absolute values ​​exceed the judgment threshold are marked as abnormal difference pairs, indicating that there is an inconsistency between the two channels that exceeds the normal quantization error range during the two injections. This difference pair does not meet the precondition for the establishment of the sign-opposite equation set, and the complete injection process must be re-executed, that is, starting from the standard source signal injection operation in step S1, and re-acquiring the difference between the first channel and the second channel until a qualified difference pair is obtained. Valid channel difference pairs whose absolute values ​​do not exceed the judgment threshold are marked as qualified difference pairs. The difference between the first channel and the second channel in this difference pair has passed two judgments: difference consistency verification and inverse number verification, confirming that it satisfies the sign-opposite relationship. The difference between the first channel and the second channel is directly used as two known quantities of the sign-opposite equation set and passed to step S3 for algebraic solution of the absolute error of the measurement channel and the absolute error of the verification channel.

[0032] Figure 2This is a schematic diagram illustrating the verification process in which the difference between the first channel and the difference between the second channel are opposites in an embodiment of this application. Figure 2 The upper half of the line graph shows the trend of the difference between the first channel and the second channel over ten consecutive calibration cycles. The two curves are symmetrically distributed around the zero value. The difference between the first channel is positive and decreases cycle by cycle, while the difference between the second channel is negative and decreases synchronously in absolute value cycle by cycle. The two maintain a strict sign-opposite relationship in numerical terms. The lower half of the bar graph shows the absolute value of the difference consistency verification result in each calibration cycle, that is, the absolute value of the sum of the difference between the first channel and the second channel. The absolute value of the difference consistency verification result in each cycle is much lower than the judgment threshold composed of twice the least effective bit resolution of the metering chip, indicating that the difference data collected by the two role swaps meet the preconditions for the establishment of the sign-opposite equation set and can be used as a valid channel difference pair to be passed into the subsequent solution steps.

[0033] In one specific embodiment, step S3 includes: Substitute the first channel difference and the second channel difference in the qualified difference pair into the set of equations with opposite signs. The set of equations with opposite signs consists of the first equation and the second equation. The first equation states that the first channel difference is equal to the difference between the absolute error of the measurement channel and the absolute error of the verification channel. The second equation states that the second channel difference is equal to the difference between the absolute error of the verification channel and the absolute error of the measurement channel. This yields the set of equations to be solved. Based on the system of equations to be solved, the first equation is subtracted from the second equation, and the difference between the first channel difference and the second channel difference is divided by two to obtain the absolute error of the measurement channel. Based on the absolute error of the metering channel, the difference between the difference of the second channel and the difference of the first channel is divided by two to obtain the absolute error of the verification channel. Substitute the absolute error of the metering channel and the absolute error of the verification channel into the missing verification condition of the external traceability standard, verify that the absolute value of the sum of the absolute error of the metering channel and the absolute error of the verification channel does not exceed the lowest effective bit resolution of the metering chip, and select the absolute error of the metering channel and the absolute error of the verification channel that meet the missing verification condition of the external traceability standard as the valid absolute error pair.

[0034] Specifically, the system of equations with opposite signs is established based on the difference definition relationship after two role swaps. The logic for establishing the first equation is as follows: In step S1, the metering channel is primary and the calibration channel is secondary. The difference between the two channels is obtained by subtracting the calibration channel response value from the metering channel response value. The metering channel response value equals the true value of the standard source signal plus the absolute error of the metering channel, and the calibration channel response value equals the true value of the standard source signal plus the absolute error of the calibration channel. After subtracting the two, the true value of the standard source signal is algebraically eliminated. Therefore, the difference between the two channels equals the absolute error of the metering channel minus the absolute error of the calibration channel. The logic for establishing the second equation is as follows: After the role swap in step S2, the calibration channel is primary and the metering channel is secondary. The difference between the two channels is obtained by subtracting the metering channel response value from the calibration channel response value after the role swap. Similarly, the true value of the standard source signal is algebraically eliminated. Therefore, the difference between the two channels equals the absolute error of the calibration channel minus the absolute error of the metering channel. Thus, the second equation is exactly the negative of the first equation, and the two equations have strictly opposite signs, forming a system of equations with opposite signs. Subtracting the second equation from the first equation, the left side represents the difference between the first and second channels, and the right side represents the absolute error of the measurement channel minus twice the absolute error of the verification channel. Dividing both sides by two yields the absolute error of the measurement channel. Substituting the absolute error of the measurement channel into the first equation, we obtain the absolute error of the verification channel, which is equal to the difference between the difference of the second and first channels divided by two. Throughout the entire solution process, the true value of the standard source signal has been eliminated during the equation establishment stage, and the solution result does not depend on the absolute accuracy of the standard source signal.

[0035] The external traceability standard missing verification condition refers to the judgment condition for verifying the self-consistency of the calculated absolute errors of the measurement channel and the calibration channel without using any external traceability standard. The verification content is as follows: Adding the absolute errors of the measurement channel and the calibration channel, according to the algebraic structure of the system of equations with opposite signs, the sum of the absolute errors of the measurement channel and the calibration channel is theoretically equal to zero, i.e., they are opposites of each other. If there are no numerical calculation errors in the solution process, the absolute value of the sum should be zero. The actual allowable verification threshold is set to the least significant bit resolution of the measurement chip. This setting is based on the fact that the rounding error introduced by the division by two operation in integer register operations during the solution process is limited to one least significant bit. Measurement channel absolute errors and calibration channel absolute errors that meet this condition are selected as valid absolute error pairs, confirming the algebraic self-consistency of their solution results, and are passed to step S4 for writing to the measurement chip calibration register. Solution results that do not meet this condition are judged as calculation abnormalities, triggering the re-execution of the substitution and solution operation in step S3.

[0036] Figure 3 This is a schematic diagram illustrating the verification of the solution accuracy of the system of equations with opposite signs in an embodiment of this application. Figure 3The left and right figures respectively show the verification results of the solution accuracy of the measurement channel and the calibration channel under simulation conditions. The horizontal axis is the true absolute error of each channel, and the vertical axis is the absolute error obtained by solving the system of opposite signs equations. The scattered points in the figure are simulation data points, and the dashed line is the ideal solution line when the true value and the solution value are completely consistent. All scattered points are closely distributed on both sides of the ideal solution line. The root mean square error of the measurement channel solution and the root mean square error of the calibration channel solution are both at extremely low levels. This verifies that without introducing an external traceability standard, the absolute error of each of the two channels can be self-solved with extremely high accuracy using only the difference between the first channel and the difference between the second channel generated by two role swaps.

[0037] In one specific embodiment, step S4 includes: Based on the effective absolute error pair, the absolute error of the metering channel and the absolute error of the verification channel are divided by the least effective bit resolution of the calibration register of each metering chip to obtain the compensation amount of the metering channel register and the compensation amount of the verification channel register. Write the compensation amount of the metering channel register to the current value of the metering chip calibration register of the metering channel with the opposite sign, and write the compensation amount of the verification channel register to the current value of the metering chip calibration register of the verification channel with the opposite sign to obtain the compensation writing results of each channel register. Based on the compensation write results of each channel register, the standard source signal is injected again into the metering channel and the verification channel. The response values ​​of the compensated metering channel and the compensated verification channel are collected respectively. The residual error of each channel is obtained by subtracting the response values ​​of each compensated metering channel and each compensated verification channel from the true value of the standard source signal. The absolute value of the residual error of each channel is compared sequentially with the first judgment threshold, the second judgment threshold, and the upper limit of the compensation capability of the calibration register of each metering chip. The residual error of each channel whose absolute value does not exceed the first judgment threshold is marked as a successful compensation state. The residual error of each channel whose absolute value exceeds the first judgment threshold but does not exceed the second judgment threshold is marked as a warning state. The residual error of each channel whose absolute value exceeds the second judgment threshold or exceeds the upper limit of the compensation capability of the calibration register of the metering chip is marked as a failure state, thus obtaining the online error compensation result.

[0038] Specifically, the absolute error of the metering channel is divided by the least significant bit resolution of the metering chip calibration register to obtain an integer compensation amount represented by the number of least significant bits in the register; the conversion process for the compensation amount of the verification channel register is the same. The meaning of writing with the opposite sign is as follows: if the absolute error of the metering channel is positive, indicating a positive deviation, the converted compensation amount is negatively added to the current stored value of the metering chip calibration register, reducing the stored value and thus correcting the subsequent output value of the metering chip in the negative direction; conversely, if the absolute error of the metering channel is negative, the opposite applies. The write operation reads the current value of the metering chip calibration register through the serial peripheral interface bus via the microcontroller, performs the addition and subtraction operations, and writes the result back to the register. The compensation write result for each channel register is the final stored value of the metering chip calibration register after the write-back is completed. The true value of the standard source signal refers to the power product of the standard test voltage signal and the standard test current signal output by the direct digital frequency synthesizer under the condition of being in phase. This value is determined when the standard source signal is generated in step S1. Its value is guaranteed by the temperature-compensated crystal oscillator to ensure frequency stability and remains unchanged throughout the calibration process. The residual error of each channel is obtained by subtracting the true value from the response value of each channel after compensation, reflecting the residual deviation after compensation writing.

[0039] The first judgment threshold is set at 20% of the allowable error limit. This is based on the premise that the residual error after successful compensation should be much smaller than the allowable error limit, and using 20% ​​as the success judgment boundary provides sufficient safety margin. The second judgment threshold is set at 80% of the allowable error limit. This is based on the premise that even if the value exceeds 80%, it is close to the boundary and an early warning is required so that maintenance personnel can arrange for verification. The upper limit of the compensation capability of the metering chip calibration register is the maximum correction range corresponding to the register bit width. Exceeding this range indicates that the register can no longer eliminate the current error through software compensation and must be judged as a failure state. When the absolute value of the residual error of each channel does not exceed the first judgment threshold, it is marked as a successful compensation state, and the online self-calibration process ends. When marked as an early warning state, an early warning event is reported to the main station through the communication interface, and maintenance personnel decide whether to arrange on-site verification. When marked as a failure state, the metering pulse output terminal is switched to the backup counting module through the relay and the electromagnetic lock of the box door is locked, triggering forced on-site maintenance. The above three states together constitute the online error compensation result.

[0040] The online self-calibration method for metering error of the electricity metering box in the embodiments of this application has been described above. The online self-calibration system for metering error of the electricity metering box in the embodiments of this application is described below. One embodiment of the online self-calibration system for metering error of the electricity metering box in the embodiments of this application includes: The injection module is used to inject standard source signals into the metering channel and the calibration channel in the power metering box to obtain the first channel difference. The interchange module is used to interchange the metering and verification responsibilities of the metering channel and the verification channel, and to re-inject the standard source signal into the interchanged metering channel and the verification channel to obtain a second channel difference; wherein, the first channel difference is obtained by subtracting the response value of the metering channel from the response value of the verification channel, and the second channel difference is obtained by subtracting the response value of the interchanged verification channel from the response value of the interchanged metering channel, and the first channel difference and the second channel difference are opposites of each other; The calculation module is used to substitute the difference between the first channel and the difference between the second channel into a set of equations with opposite signs formed by two role swaps, and to automatically calculate the absolute error of the measurement channel and the absolute error of the verification channel without introducing an external traceability standard. The compensation module is used to write the absolute error of the metering channel and the absolute error of the verification channel into the calibration register of the metering chip of the metering channel and the verification channel respectively with opposite signs, so as to complete the online error compensation.

[0041] This invention also provides an online self-calibration device for electricity metering box measurement errors, which can be a server. The device includes a processor, memory, display screen, input device, network interface, and database connected via a system bus. The processor, designed as a computer, provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores the data corresponding to this embodiment. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the above-described method.

[0042] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the online self-calibration method for the metering error of the power metering box.

[0043] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0044] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an online self-calibration device for metering errors in an energy metering box (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0045] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for online self-calibration of metering error in an electricity metering box, characterized in that, The method includes: Step S1: Inject standard source signals into the metering channel and calibration channel in the power metering box to obtain the difference of the first channel; Step S2: Swap the measurement and verification responsibilities of the metering channel and the verification channel, and re-inject the standard source signal into the swapped metering channel and the verification channel to obtain the second channel difference; wherein, the first channel difference is obtained by subtracting the response value of the metering channel from the response value of the verification channel, and the second channel difference is obtained by subtracting the response value of the swapped verification channel from the response value of the swapped metering channel, and the first channel difference and the second channel difference are opposites of each other; Step S3: Substitute the difference between the first channel and the difference between the second channel into a set of equations with opposite signs formed by two role swaps, and calculate the absolute error of the measurement channel and the absolute error of the verification channel without introducing an external traceability standard. Step S4: Write the absolute error of the metering channel and the absolute error of the verification channel into the metering chip calibration register of the metering channel and the verification channel respectively with opposite signs to complete the online error compensation.

2. The online self-calibration method for metering error of an energy metering box according to claim 1, characterized in that, Step S1 includes: A metering channel and a verification channel with the same structural specifications are constructed in the power metering box. The primary side of the metering channel is connected to the external power grid voltage signal and current signal, and the primary side of the verification channel is connected to the bypass tap of the transformer secondary side of the metering channel to obtain a dual-channel sampling structure. Based on the dual-channel sampling structure, a temperature-compensated crystal oscillator drives a direct digital frequency synthesizer to generate a standard test voltage signal and a standard test current signal with a frequency of 50 Hz and an amplitude stability better than 0.005%. The standard test voltage signal and the standard test current signal are used as the standard source signal. The standard source signal is simultaneously superimposed and injected into the secondary sampling points of the current transformers of the metering channel and the verification channel via an isolation coupling transformer. The injection duration is ten power frequency cycles, and the response values ​​of the metering channel and the verification channel are collected respectively. Based on the response values ​​of the metering channels and the response values ​​of the verification channels, the difference between each response value of the metering channels and each response value of the verification channels is calculated to obtain the first channel difference value.

3. The online self-calibration method for metering error of an energy metering box according to claim 1, characterized in that, The interchange of the metering channel and the verification channel, which respectively assumes the metering and verification responsibilities, includes: Send control commands to each relay in the role switching matrix to disconnect the connection between the primary side of the metering channel and the external power grid voltage and current signals, and switch the primary side of the verification channel to access the external power grid voltage and current signals, thus obtaining the metering channel and the verification channel after the role switching are reversed. Based on the metering channel and the verification channel after the responsibilities have been swapped, the metering pulse output terminal of the metering channel after the responsibilities have been swapped is kept connected through a pulse latching circuit to obtain an uninterrupted metering state. In the uninterrupted metering state, the primary side of the verification channel after the responsibilities are swapped is connected to the bypass tap of the transformer secondary side of the metering channel to obtain the swapped dual-channel sampling structure. The validity of the switching completion status of each relay in the role switching matrix is ​​verified, and the swapped dual-channel sampling structure that passes the verification is used as the basis for subsequent injection operations.

4. The online self-calibration method for metering error of an energy metering box according to claim 3, characterized in that, The step of re-injecting the standard source signal into the interchanged metering channel and the calibration channel to obtain the second channel difference includes: The standard source signal is simultaneously superimposed and injected into the secondary sampling points of the current transformers in each channel of the interchanged dual-channel sampling structure via an isolation coupling transformer. The injection duration is ten power frequency cycles. The response values ​​of the metering channel and the verification channel after the responsibilities are interchanged are collected respectively. The second channel difference is obtained by subtracting the response value of the verification channel after the responsibilities are swapped from the response value of the metering channel after the responsibilities are swapped. The difference between the first channel and the difference between the second channel are summed to obtain the difference consistency verification result; Based on the difference consistency verification result, the absolute value of the difference consistency verification result is compared with a preset consistency threshold, and the first channel difference and the second channel difference whose absolute value does not exceed the preset consistency threshold are selected as valid channel difference pairs.

5. The online self-calibration method for metering error of an energy metering box according to claim 4, characterized in that, The first channel difference and the second channel difference are opposites, including: Based on the effective channel difference pair, the first channel difference is inverted and then subtracted from the second channel difference to obtain the negative number verification deviation value; The absolute value of the negative number verification deviation value is compared with a judgment threshold consisting of twice the lowest effective bit resolution of the metering chip. The effective channel difference pairs whose absolute values ​​exceed the judgment threshold are marked as abnormal difference pairs, and the effective channel difference pairs whose absolute values ​​do not exceed the judgment threshold are marked as qualified difference pairs. For the abnormal difference pairs, the complete injection process is re-executed; for the qualified difference pairs, they are retained and output. The first channel difference and the second channel difference in the qualified difference pair are used as the input values ​​of the set of opposite equations.

6. The online self-calibration method for metering error of an electricity metering box according to claim 5, characterized in that, Step S3 includes: Substitute the first channel difference and the second channel difference in the qualified difference pair into the set of opposite equations, wherein the set of opposite equations consists of a first equation and a second equation. The first equation states that the first channel difference is equal to the difference between the absolute error of the measurement channel and the absolute error of the verification channel, and the second equation states that the second channel difference is equal to the difference between the absolute error of the verification channel and the absolute error of the measurement channel, thus obtaining the set of equations to be solved. Based on the set of equations to be solved, subtract the first equation from the second equation, and divide the difference between the first channel difference and the second channel difference by two to obtain the absolute error of the measurement channel. Based on the absolute error of the metering channel, the difference between the second channel difference and the first channel difference is divided by two to obtain the absolute error of the verification channel. Substitute the absolute error of the metering channel and the absolute error of the verification channel into the missing verification condition of the external traceability standard, verify that the absolute value of the sum of the absolute error of the metering channel and the absolute error of the verification channel does not exceed the lowest effective bit resolution of the metering chip, and select the absolute error of the metering channel and the absolute error of the verification channel that meet the missing verification condition of the external traceability standard as valid absolute error pairs.

7. The online self-calibration method for metering error of an electricity metering box according to claim 6, characterized in that, Step S4 includes: Based on the effective absolute error pair, the absolute error of the metering channel and the absolute error of the verification channel are divided by the least effective bit resolution of the calibration register of each metering chip to obtain the compensation amount of the metering channel register and the compensation amount of the verification channel register. Write the compensation amount of the metering channel register to the current value of the metering chip calibration register of the metering channel with the opposite sign, and write the compensation amount of the verification channel register to the current value of the metering chip calibration register of the verification channel with the opposite sign to obtain the compensation writing results of each channel register. Based on the compensation write results of each channel register, the standard source signal is injected again into the metering channel and the verification channel. The compensationd response values ​​of the metering channel and the verification channel are collected respectively. The difference between the compensationd response values ​​of each metering channel and the compensationd response values ​​of each verification channel and the true value of the standard source signal is calculated to obtain the residual error of each channel. The absolute value of the residual error of each channel is compared sequentially with the first judgment threshold, the second judgment threshold, and the upper limit of the compensation capability of the calibration register of each metering chip. The residual error of each channel whose absolute value does not exceed the first judgment threshold is marked as a successful compensation state. The residual error of each channel whose absolute value exceeds the first judgment threshold but does not exceed the second judgment threshold is marked as a warning state. The residual error of each channel whose absolute value exceeds the second judgment threshold or exceeds the upper limit of the compensation capability of the calibration register of the metering chip is marked as a failure state, thus obtaining the online error compensation result.

8. An online self-calibration system for metering error of an electricity metering box, characterized in that, For implementing the online self-calibration method for metering error of an energy metering box as described in any one of claims 1-7, the online self-calibration system for metering error of the energy metering box comprises: The injection module is used to inject standard source signals into the metering channel and the calibration channel in the power metering box to obtain the first channel difference. The interchange module is used to interchange the metering and verification responsibilities of the metering channel and the verification channel, and to re-inject the standard source signal into the interchanged metering channel and the verification channel to obtain a second channel difference; wherein, the first channel difference is obtained by subtracting the response value of the metering channel from the response value of the verification channel, and the second channel difference is obtained by subtracting the response value of the interchanged verification channel from the response value of the interchanged metering channel, and the first channel difference and the second channel difference are opposites of each other; The calculation module is used to substitute the difference between the first channel and the difference between the second channel into a set of equations with opposite signs formed by two role swaps, and to automatically calculate the absolute error of the measurement channel and the absolute error of the verification channel without introducing an external traceability standard. The compensation module is used to write the absolute error of the metering channel and the absolute error of the verification channel into the calibration register of the metering chip of the metering channel and the verification channel respectively with opposite signs, so as to complete the online error compensation.

9. An online self-calibration device for metering error of an electricity metering box, characterized in that, It includes a memory and a processor, the memory storing a computer program that can run on the processor, and the processor executing the computer program to implement the online self-calibration method for metering error of the power metering box as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run by the processor, it causes the processor to execute the online self-calibration method for metering error of the power metering box as described in any one of claims 1 to 7.