A load self-aware wide-range error calibration method and system for an internet of things electric energy meter

CN122652449BActive Publication Date: 2026-10-27HANGZHOU HUALONG ELECTRONIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611162201.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-10-27
Estimated Expiration
2046-08-03

AI Technical Summary

Technical Problem

[0006]为解决现有物联网电能表在宽量程运行过程中难以识别量程切换后短时过渡样本、容易将带有前一量程历史影响的周波样本误用于校准系数更新的问题,本发明提供一种用于物联网电能表的负载自感知宽量程误差校准方法及系统

Benefits of technology

[0022]综上所述,本申请所采用的技术方案中电能表在运行过程中以周波为基本处理单位,获取电压、电流采样数据和当前量程状态;当负载突变引起电流量程切换时,不仅判断当前量程是否改变,还进一步提取电流阶跃斜率、功率因数突变量和谐波包络衰减特征,用以识别量程切换后由采样前端和数字滤波链路恢复过程引起的量程边界残影窗。在该残影窗内,对应周波样本仍用于电能累计和事件记录,但不用于校准系数更新;在残影窗结束后,系统根据残影消退模板逐周波释放校准更新权重,直至满足稳定性条件后恢复正常更新。该方案将样本状态识别、校准参数保护和权重释放控制结合到宽量程电能表的在线校准过程中。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122652449B_ABST
    Figure CN122652449B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of load self-awareness wide range error calibration method and system for internet of things electric energy meter.The method obtains the cycle level voltage, current sampling data and current range state of electric energy meter, extracts current step slope, power factor mutation quantity and harmonic envelope attenuation characteristics, judges whether range boundary event occurs, and determines the range boundary residual window caused by sampling front end gain switching, holding capacitor release and digital filter history state residue.In the residual window, the update of current gain, active power gain, phase compensation and other calibration coefficients is frozen, while normal electric energy metering is maintained;After the end of the residual window, generate or call residual fading template based on stable samples before and after the boundary, and gradually release calibration update weight according to cycle.The present application can reduce the risk of wide range calibration parameter pollution by transition sample in load mutation scene, and improve the stability of internet of things electric energy meter online calibration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent management technology for electricity metering equipment and Internet of Things (IoT) terminals, and in particular to a load self-sensing wide-range error calibration method and system for IoT electricity meters. Background Technology

[0002] Electricity meters are fundamental equipment in electricity metering systems. Their measurement results are directly used for user electricity consumption statistics, transformer area line loss analysis, load management, and power system operation data collection. With the development of smart grids, electricity information collection systems, and the Internet of Things (IoT) for power, electricity meters are gradually transforming from simple energy accumulation devices into IoT terminals with capabilities for data acquisition, status monitoring, remote communication, parameter management, and recording of operational anomalies. IoT electricity meters face more complex power environments during field operation. Different user-side loads exhibit significant differences in power levels, connection times, waveform patterns, and start-stop patterns, thus placing higher demands on the wide-range metering capabilities and dynamic operational stability of electricity meters.

[0003] In scenarios involving residential electricity consumption, small and micro-sized industrial and commercial electricity consumption, distributed energy access, electric vehicle charging, inverter equipment operation, and large-scale switching power supply access, the same electricity meter may switch between light load, rated load, heavy load, low power factor load, non-sinusoidal load, and sudden load for extended periods. For example, when a user only keeps a few standby devices on at night, the electricity meter is in a light load or low load state; when electric heating equipment, air conditioning compressors, charging equipment, or motor loads start, the current may jump from the light load range to the heavy load range in a very short time; when these devices are disconnected, the current may quickly drop back to the light load range. These changes not only require the electricity meter to cover a wide current measurement range, but also cause its sampling link and metering parameters to undergo state switching in a short period of time.

[0004] Existing technologies have at least the following shortcomings when facing the above situations: First, they mainly focus on the selection of metering parameters corresponding to the current level, without fully identifying whether several cycle samples are still affected by the previous range state after range switching; second, remote operation error calibration and factory calibration are difficult to cover the cycle-level transition process when the load changes rapidly in the field; third, although harmonic compensation and load identification use waveform characteristics, they usually do not combine current step, power factor change and harmonic envelope attenuation to identify the range boundary ghosting window; fourth, the simple fixed delay method cannot adaptively determine the freeze time according to the switching direction and ghosting risk level, nor can it gradually release the calibration update weight after the ghosting window ends; fifth, existing solutions often do not distinguish between the metering purpose and calibration purpose of the samples, which may lead to transition samples that can be used for continuous energy metering being incorrectly used for calibration coefficient updates.

[0005] Based on the above, it is necessary to provide a load self-sensing wide-range error calibration method and system for IoT energy meters, so that when the energy meter detects a current range switch, it can reduce the impact of the range switch transition sample on the wide-range calibration parameters while maintaining the continuity of normal energy metering. Summary of the Invention

[0006] To address the challenges of existing IoT energy meters in identifying short-term transitional samples after range switching during wide-range operation, and the potential for misusing cycle samples with historical influences from the previous range for calibration coefficient updates, this invention provides a load-sensing wide-range error calibration method and system for IoT energy meters. This method acquires cycle-level sampling data and the current current range status at the energy meter end. It then uses the current step slope, power factor abrupt changes, and harmonic envelope attenuation characteristics to determine whether load abrupt changes cause a range boundary ghosting window. Within this ghosting window, the corresponding cycle sample updates the calibration coefficients are frozen. After the ghosting window ends, the calibration update weights are released cycle-by-cycle based on the ghosting fading template, allowing the calibration parameter updates to transition from the frozen state to the normal state. This processing method ensures the energy meter maintains normal energy accumulation while reducing the risk of transitional samples contaminating wide-range calibration parameters.

[0007] One aspect of the present invention provides a load self-sensing wide-range error calibration method for Internet of Things (IoT) energy meters. The method includes acquiring cycle-level sampling data and the current current range status of the energy meter. The cycle-level sampling data may include cycle-level voltage sampling data and cycle-level current sampling data, or cycle-level electrical parameters calculated by a metering chip based on voltage and current sampling signals. The current current range status may include at least one of the following: current current range, sampling gain level, and calibration parameter table index. The current current range indicates the current range to which the current cycle current effective value belongs; the sampling gain level indicates the gain configuration currently used by the sampling front-end or metering chip; and the calibration parameter table index indicates the calibration parameter group called in the current metering process.

[0008] After obtaining the cycle-level sampling data, the current step slope, power factor abrupt change, and harmonic envelope attenuation characteristics are extracted from the cycle-level sampling data. Specifically, the current step slope can be determined based on the change between the current RMS value of the current cycle and the previous cycle's current RMS value, or the normalized current change ratio can be determined based on the ratio of the change to the previous cycle's current RMS value or minimum reference current. The current step slope or normalized current change ratio can be used to determine whether the load experiences a significant abrupt change between adjacent cycles. The power factor abrupt change can be determined based on the difference between the current cycle's power factor and the previous cycle's power factor, or the difference between the moving averages of the power factors of multiple consecutive cycles. The power factor abrupt change reflects whether the load phase relationship, load configuration, or sampling link phase state has changed. The harmonic envelope attenuation characteristics can be determined based on the changing trend of waveform distortion characterization quantities in the continuous cycle after range switching. The waveform distortion characterization quantities can be one or more of the following: second harmonic amplitude, third harmonic amplitude, fifth harmonic amplitude, total harmonic distortion rate, peak-to-average power ratio of current waveform, half-cycle asymmetry, or cycle differential energy.

[0009] When a current range switch is detected and at least one of the aforementioned features meets the ghosting triggering condition, a range boundary ghosting window is determined. The current range switch can be an uplink switch from a low current range to a high current range, or a downlink switch from a high current range to a low current range; it can be a switch between adjacent current ranges, or a cross-range switch spanning at least one intermediate range. The ghosting triggering condition may include a current step slope greater than a preset threshold, a normalized current change ratio greater than a preset ratio, a power factor mutation greater than a power factor mutation threshold, and a waveform distortion characteristic showing a continuous decreasing trend or a cumulative decrease ratio greater than a preset decrease ratio threshold after the range switch. By combining the range switch with at least one load mutation feature, it is possible to avoid mistaking ordinary range boundary fluctuations for range boundary ghosting events, and to avoid ignoring the sampling link recovery process based solely on the current value switching parameters.

[0010] The range boundary ghosting window refers to the time window after a current range switch where the cycle sample is unsuitable for participating in calibration coefficient updates due to sampling front-end gain switching, holding capacitor release, analog filter link recovery, or residual historical state of the digital filter. This time window does not mean that the energy meter cannot use the corresponding cycle sample for energy accumulation, but rather that the corresponding cycle sample is not suitable for updating the current gain coefficient, active power gain coefficient, phase compensation coefficient, zero-point offset coefficient, or other calibration coefficients. By distinguishing between the metering purpose and calibration purpose of the sample, this invention can constrain the calibration parameter update process while maintaining continuous metering of the energy meter.

[0011] When determining the range boundary ghosting window, the switching direction can be determined based on the current range before and after the switch, and the ghosting risk level can be determined based on at least two of the following: current step slope, power factor abrupt change, harmonic envelope attenuation characteristics, and sampling gain level change. Ghosting risk levels can include mild ghosting risk, moderate ghosting risk, and high ghosting risk. For slight switching between adjacent current ranges, a shorter basic ghosting window length can be determined; for switching from a low current range to a high current range, or for a rapid drop from a high current range back to a low current range, a longer basic ghosting window length can be determined. Since the low current signal is more susceptible to the relative influence of the previous high current state after a downlink switch, preferably, under the same ghosting risk level, the basic ghosting window length corresponding to a downlink cross-range switch can be greater than the basic ghosting window length corresponding to an uplink cross-range switch.

[0012] Furthermore, after determining the basic afterimage window length, fluctuations in the effective current value, power factor, and waveform distortion characteristics of consecutive cycles can be detected. If, just before the basic afterimage window ends, at least one of these fluctuations fails to meet a stability threshold, the range boundary afterimage window is extended within the maximum afterimage window length. If a predetermined number of consecutive cycles within the basic afterimage window meet the stability threshold, the range boundary afterimage window can be terminated early. In this way, the afterimage window length is no longer a fixed delay but can be adjusted according to the intensity of load changes, switching direction, and afterimage attenuation status.

[0013] Within the range boundary ghosting window, the corresponding cycle sample is marked as a ghosting frozen sample, and the update of the calibration coefficient by the ghosting frozen sample is frozen. The freezing can be achieved in several ways. Specifically, the ghosting frozen sample can be prevented from entering the calibration sample queue, the calibration update weight of the ghosting frozen sample in the calibration sample queue can be set to zero, or the calibration parameter table of the corresponding current range can be locked within the range boundary ghosting window, keeping it in its original version without being written to or fixed based on the ghosting frozen sample. The calibration coefficients can include at least one of the following: current gain coefficient, active power gain coefficient, phase compensation coefficient, and zero-point offset coefficient. For cases where only the current channel experiences range switching, it is preferable to freeze the updates of the current gain coefficient, active power gain coefficient, and phase compensation coefficient; for cases where the voltage channel also experiences abnormal recovery, the updates of the voltage gain coefficient or other related parameters can also be frozen simultaneously.

[0014] While the calibration coefficients are being updated, the frozen image samples can still be used for energy accumulation, electrical parameter display, load surge event recording, and image fading template generation. In other words, this invention does not address the image retention problem by directly discarding all cycle data after range switching; instead, it manages the sample status according to the data's intended use. For energy accumulation and event recording, the frozen image samples remain usable; for calibration coefficient updates, their use is restricted. This approach avoids affecting the continuity of energy meter readings by simply discarding data, and also prevents contamination of calibration parameters by indiscriminately using data.

[0015] After the range boundary ghosting window ends, the weights are updated by cycle-based release calibration based on the ghosting fading template. The ghosting fading template can be generated based on stable samples before and after the boundary, or a preset template can be retrieved from the meter's local memory. The stable samples before the boundary are cycle samples where the fluctuations in current RMS value, power factor, and waveform distortion are all less than the corresponding stability threshold for multiple consecutive cycles before the range switch. The stable samples after the boundary are cycle samples where the fluctuations in current RMS value, power factor, and waveform distortion are all less than the corresponding stability threshold for multiple consecutive cycles after the range boundary ghosting window ends. By comparing the stable samples before the boundary, the samples within the ghosting window, and the stable samples after the boundary, the process by which the ghosting effect gradually weakens from a strong state to a stable state can be determined.

[0016] The ghosting fading template includes at least a default ghosting window length, a maximum ghosting window length, a calibration update weight sequence, and stability judgment rules. Optionally, the ghosting fading template may also include a template number, current range before switching, current range after switching, switching direction, ghosting risk level, load form label, sampling gain level change type, template version, template confidence level, and verification information. The calibration update weight sequence may include a zero-weight segment within the ghosting window and a non-zero-weight release segment after the ghosting window. For example, in one optional configuration, the calibration update weight for several cycles within the ghosting window is zero, and the calibration update weight for several cycles after the ghosting window is 0.25, 0.50, 0.75, and 1.00, respectively; in another optional configuration, for downlink cross-level switching, the weights after the ghosting window can be set to 0.20, 0.40, 0.70, and 1.00, respectively. The above values ​​only represent one configurable release method; actual products can be set according to the sampling link establishment time, digital filter order, and range switching direction.

[0017] When a preset ghosting fading template exists in the local memory that matches the current range before switching, the current range after switching, the switching direction, and the ghosting risk level, the preset ghosting fading template can be directly invoked. When no matching preset ghosting fading template is found, a temporary ghosting fading template can be generated based on the stable samples before the boundary, the ghosting frozen samples within the range boundary ghosting window, and the stable samples after the boundary. The temporary ghosting fading template can be used only for the current range boundary event, or it can be converted into a reusable running template after multiple occurrences of the same range boundary event and the consistency condition is met, through a restricted update mechanism.

[0018] The ghosting fading template can be updated under certain conditions. Specifically, when the cumulative occurrence of the same type of range boundary event reaches a preset number, and the ghosting window length, switching direction, ghosting risk level, and stable recovery cycle number of multiple range boundary events meet the consistency condition, at least one of the following parameters of the ghosting fading template can be updated: default ghosting window length, maximum ghosting window length, calibration update weight sequence, stability judgment rule, and template confidence level. To avoid excessive changes in template parameters due to occasional abnormal events, the adjustment range of each update is preferably no more than a preset limit. Furthermore, the previous version of the template is saved before the template update, and if the proportion of abnormal events increases or the number of stability judgment failures increases after the update, the current template is reverted to the previous version.

[0019] Another aspect of the present invention provides a load self-sensing wide-range error calibration system for Internet of Things (IoT) energy meters. The system includes a sampling data acquisition module, a range status monitoring module, a feature extraction module, a ghosting window recognition module, a calibration update freezing module, a template management module, a weight release module, and a calibration parameter management module. The sampling data acquisition module acquires cycle-level sampling data; the range status monitoring module acquires the current current range status; and the feature extraction module extracts current step slope, power factor abrupt changes, and harmonic envelope attenuation features. The ghosting window recognition module determines a range boundary ghosting window when a current range switch is detected and at least one of the features satisfies a ghosting trigger condition. The calibration update freezing module freezes the update of calibration coefficients for the corresponding cycle samples within the range boundary ghosting window. The template management module generates or calls ghosting fading templates; the weight release module releases calibration update weights by cycle; and the calibration parameter management module restores the calibration coefficient update for the corresponding current range after stability conditions are met.

[0020] The system can be deployed in the main control unit of an IoT energy meter, or it can be implemented collaboratively by a metering chip, a main control unit, a memory, and a communication unit. The sampling data acquisition module can read the RMS current value, power factor, and waveform distortion characteristics from the metering chip, or obtain the raw sampled values ​​from the analog-to-digital converter and calculate cycle-level electrical parameters in the main control unit. The range status monitoring module can determine the current range based on the RMS current value and a preset range threshold, or it can directly read the gain level status of the metering chip or sampling front end. The template management module can save preset templates, running templates, and rollback templates in local non-volatile memory. The communication unit can upload range boundary event records, ghosting window length, weight release sequence, template version, and calibration parameter table version to the main station or cloud platform, and can also receive ghosting trigger thresholds, ghosting fading templates, or calibration parameter configurations from the main station or cloud platform.

[0021] Optionally, the IoT energy meter can be a single-phase energy meter or a three-phase energy meter. For a three-phase energy meter, range boundary ghosting window identification, calibration update freezing, and weight release can be performed separately for each phase. If the three phases simultaneously switch ranges in the same direction within a preset cycle range, the event can be identified as a three-phase linked range boundary event, and a ghosting fading template corresponding to a higher ghosting risk level can be used in the total active power gain calibration update. For low-cost energy meters that do not have a specified harmonic register, the total harmonic distortion rate, current waveform peak-to-average power ratio, half-cycle asymmetry, or cycle differential energy can be used to replace the specified harmonic amplitude to construct harmonic envelope attenuation characteristics. Through the above optional methods, the present invention can be adapted to different hardware platforms and different IoT energy meter product forms.

[0022] In summary, the technical solution adopted in this application uses cycles as the basic processing unit to acquire voltage and current sampling data and the current range status during the operation of the energy meter. When a sudden load change causes a current range switch, it not only determines whether the current range has changed, but also further extracts the current step slope, power factor change amount, and harmonic envelope attenuation characteristics to identify the range boundary ghosting window caused by the recovery process of the sampling front-end and digital filtering link after the range switch. Within this ghosting window, the corresponding cycle sample is still used for energy accumulation and event recording, but not for calibration coefficient updates. After the ghosting window ends, the system releases the calibration update weights cycle by cycle according to the ghosting fading template until the stability condition is met and normal updates resume. This solution integrates sample status identification, calibration parameter protection, and weight release control into the online calibration process of a wide-range energy meter.

[0023] Compared with existing technologies, the present invention can achieve at least the following technical effects: identify the afterimage window after range switching, reducing the situation where transitional samples are misused for calibration updates; freeze the calibration coefficient update within the afterimage window, reducing the risk of wide-range calibration parameters being affected by residual states; through afterimage fading templates and cycle-by-cycle weight release, the calibration update can be smoothly restored from the frozen state to the normal state; by retaining the metrological purpose of the afterimage frozen samples, the continuity of power accumulation is maintained; and through end-side template storage and IoT communication collaboration, it can adapt to the wide-range error calibration requirements under different hardware versions, different load forms, and different operating scenarios. Attached Figure Description

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

[0025] Figure 1 A schematic diagram of the load self-sensing wide-range error calibration system for IoT energy meters provided in an embodiment of the present invention.

[0026] Figure 2 A flowchart of a load self-sensing wide-range error calibration method provided for an embodiment of the present invention.

[0027] Figure 3 A flowchart for range boundary ghost window recognition provided for embodiments of the present invention.

[0028] Figure 4 The image retention template creation, invocation, and weight release control diagram provided for embodiments of the present invention.

[0029] Figure 5 A schematic diagram of an IoT power meter field application scenario provided for an embodiment of the present invention.

[0030] Figure 6 A schematic diagram showing the comparison of the afterimage treatment effect during range switching provided in the embodiments of the present invention. Detailed Implementation

[0031] 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. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0032] It should be understood that in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0033] The specific embodiments of the present invention are described below with reference to the accompanying drawings. The described embodiments are intended to enable those skilled in the art to understand and implement the present invention, and are not intended to limit the scope of protection of the present invention. Unless otherwise stated, the energy meter in the following embodiments can be a single-phase IoT energy meter or a three-phase IoT energy meter; the current range, threshold, number of cycles, weight sequence, and sampling frequency described below are engineering configuration examples for ease of explanation, and actual products can be adjusted according to the energy meter specifications, metering chip capabilities, sampling front-end structure, and grid frequency.

[0034] The IoT energy meter referred to in this invention is an energy metering device that includes a voltage sampling unit, a current sampling unit, a metering chip, a main control unit, a memory, and a communication unit. This IoT energy meter can collect voltage and current signals, calculate electrical parameters such as energy, effective current value, and power factor, and can interact with a master station or cloud platform via a local communication interface or a remote communication network. The IoT energy meter can use a shunt, current transformer, Hall sensor, Rogowski coil, or other current sampling devices as the current sampling unit. The sampling front end of the IoT energy meter may include a programmable gain amplifier, multi-range sampling channels, anti-aliasing filter circuit, holding capacitor, analog-to-digital converter unit, and internal digital filter of the metering chip.

[0035] The cycle-level sampling data referred to in this invention refers to sampling data or electrical parameter data formed using one power grid cycle as the basic processing unit. In a 50Hz AC power grid, the duration of one cycle is 20ms; in a 60Hz AC power grid, the duration of one cycle is approximately 16.67ms. In one embodiment, the sampling frequency of the electricity meter is 6.4kHz, and each cycle in a 50Hz power grid corresponds to 128 sampling points. The main control unit can directly read the original voltage and current sampling sequence within one cycle, or it can read the effective current value, power factor, harmonic components, total harmonic distortion rate, or other waveform distortion characteristics already calculated by the metering chip.

[0036] The current current range status referred to in this invention refers to information that characterizes the current current measurement range and metering parameter status of the energy meter. This status may include at least one of the following: current current range, sampling gain level, calibration parameter table index, metering chip register configuration status, or multi-range sampling channel number. In one configuration, the energy meter divides the current range into low-load, light-load, medium-load, and high-load ranges according to the effective current value. Different ranges may correspond to different sampling gain levels or different calibration parameter tables. The calibration parameter table may include one or more of the following: current gain coefficient, active power gain coefficient, phase compensation coefficient, zero-point offset coefficient, and voltage gain coefficient.

[0037] The range boundary ghosting window referred to in this invention refers to a time window after a current range switch in an energy meter, where several consecutive cycle samples are unsuitable for participating in calibration coefficient updates due to sampling front-end gain switching, holding capacitor release, analog filter link recovery, or residual historical states of the digital filter. Cycle samples within this time window can continue to be used for normal energy accumulation, electrical parameter display, and event recording, but not for updating calibration coefficients. This invention refers to these samples as ghosting frozen samples. After the ghosting window ends, some samples, although out of the frozen window, may still be on the edge of the recovery process. Therefore, this invention can mark these samples as weight release samples and assign them a calibration update weight of less than 1 according to the ghosting fading template. When multiple consecutive cycles meet the stability condition, the samples can be marked as stable calibration samples, and full-weight calibration updates can resume.

[0038] The ghosting fading template referred to in this invention is a control template used to describe the gradual fading of ghosting effects at range boundaries with frequency under different range switching directions, different ghosting risk levels, and different load conditions. This template may include a default ghosting window length, a maximum ghosting window length, a calibration update weight sequence, and stability judgment rules. The ghosting fading template can be pre-set in the energy meter's memory at the factory, or a temporary template can be generated during operation from stable samples before the boundary, frozen ghosting samples, and stable samples after the boundary. It can also be updated under limited conditions after consistency requirements are met.

[0039] Example 1

[0040] This embodiment combines Figure 1 and Figure 2This paper describes a method for calibrating a wide-range self-sensing error in an IoT energy meter. This embodiment uses a single-phase 220V, 5(60)A IoT energy meter as an example. The energy meter includes a voltage sampling unit 101, a current sampling unit 102, a sampling gain switching unit 103, an analog-to-digital conversion unit 104, a metering chip 105, a main control unit 106, a memory 107, and a communication unit 108. The main control unit 106 executes the processing logic of the sampling data acquisition module 201, the range status monitoring module 202, the feature extraction module 203, the afterimage window recognition module 204, the calibration update freeze module 205, the template management module 206, the weight release module 207, and the calibration parameter management module 208.

[0041] In this embodiment, the electricity meter can employ four current ranges. The first range, R0, is the low-load range, with a current range of 0.02A to 0.25A; the second range, R1, is the light-load range, with a current range of 0.25A to 1A; the third range, R2, is the medium-load range, with a current range of 1A to 10A; and the fourth range, R3, is the high-load range, with a current range of 10A to 60A. To avoid frequent switching due to current fluctuations near the range boundaries, hysteresis thresholds are set between adjacent ranges. For example, the upward threshold for switching from R1 to R2 is set to 1.05A, and the downward threshold for R2 to R1 is set to 0.95A; the upward threshold for switching from R2 to R3 is set to 10.5A, and the downward threshold for R3 to R2 is set to 9.5A. The above values ​​are for illustrative purposes only; actual products can be set according to the basic current, reference current, or maximum current ratio.

[0042] like Figure 2 As shown, the method in this embodiment includes steps S101 to S110.

[0043] In step S101, cycle-level sampling data and the current current range status are acquired. Voltage sampling unit 101 acquires the voltage signal of the circuit under test, and current sampling unit 102 acquires the current signal flowing through the user-side load 110. The sampled signals are input to metering chip 105 via sampling gain switching unit 103 and analog-to-digital conversion unit 104. Metering chip 105 can output the effective current value, power factor, total harmonic distortion rate, and current metering register status corresponding to one cycle to main control unit 106, or it can output the original sampling sequence to main control unit 106, which calculates the cycle-level electrical parameters. At the end of each cycle, main control unit 106 generates a cycle record, which includes the cycle number, current effective current value, current power factor, waveform distortion characterization, current current range, sampling gain level, calibration parameter table index, and sample status identifier.

[0044] In step S102, cycle-level electrical parameters are calculated. If the metering chip 105 has already output the effective value of the current and the power factor, the main control unit 106 directly reads the corresponding register values. If the main control unit 106 needs to calculate based on the original sampled values, it can remove the DC bias from the voltage sampling sequence and current sampling sequence within one cycle and calculate the effective value of the voltage, the effective value of the current, the active power, and the power factor. In this embodiment, the current cycle number is denoted as k, the current effective value of the current is denoted as I_rms(k), and the current power factor is denoted as PF(k). The waveform distortion characterization quantity can be denoted as EH(k), which can be the harmonic envelope value obtained by weighting the second, third, and fifth harmonics, or it can be the total harmonic distortion rate, the peak-to-average power ratio of the current waveform, the half-cycle asymmetry, or the cycle differential energy.

[0045] In one implementation, when the metering chip 105 provides the second harmonic amplitude H2(k), the third harmonic amplitude H3(k), and the fifth harmonic amplitude H5(k), the main control unit 106 determines EH(k) as 0.3×H2(k) + 0.4×H3(k) + 0.3×H5(k). In another implementation, when the metering chip 105 only provides the total harmonic distortion rate THD_I(k), EH(k) is determined as THD_I(k). In yet another implementation, when the energy meter cannot provide harmonic components, the cycle differential energy can be determined based on the waveform difference between adjacent cycles of the current, and this cycle differential energy can be used as a substitute waveform distortion characterization quantity.

[0046] In step S103, the current step slope, power factor abrupt change, and harmonic envelope attenuation characteristics are extracted. The current step slope is used to represent the rate of current change between adjacent cycles. The main control unit 106 can first calculate the change between the current effective value of the current in the current cycle and the current effective value of the previous cycle, denoted as ΔI(k), where ΔI(k) = |I_rms(k) - I_rms(k-1)|, I_rms(k) is the current effective value of the k-th cycle, and k is the cycle number. Further, the ratio of ΔI(k) to the duration of one cycle T_cycle can be used as the current step slope SI(k), i.e., SI(k) = ΔI(k) / T_cycle. To adapt to different electricity meter specifications, the normalized current change ratio RI(k) can also be calculated, where RI(k) = ΔI(k) / max(I_rms(k-1), I_min), and I_min is the minimum reference current, used to avoid abnormal amplification of the ratio due to the previous cycle current being too small. In this embodiment, I_min can be taken as 0.05A, and T_cycle is the duration of one grid cycle, which is 20ms at 50Hz and approximately 16.67ms at 60Hz.

[0047] Power factor abrupt changes are used to characterize changes in load phase relationship or load configuration. The main control unit 106 can calculate the difference between the current cycle power factor and the previous cycle power factor, denoted as ΔPF(k), where ΔPF(k) = |PF(k) - PF(k-1)|. In cases of high grid noise or short-term jitter in the power factor register, the main control unit 106 can also use the difference between the moving averages of the power factor over multiple consecutive cycles as the power factor abrupt change. For example, the average power factor of the current two cycles can be compared with the average power factor of the previous two cycles to reduce the impact of occasional single-cycle disturbances on the judgment result.

[0048] Harmonic envelope attenuation characteristics are used to characterize whether waveform distortion exhibits a gradual decreasing trend after range switching. In this embodiment, after detecting a current range switch, the main control unit 106 observes the changes in EH(k), EH(k+1), EH(k+2), and subsequent cycles. If EH(k) shows a decreasing trend over multiple consecutive cycles, or if its cumulative decrease ratio is greater than a preset decrease ratio threshold, then a harmonic envelope attenuation characteristic is determined to exist. The preset decrease ratio threshold can be 15%, or it can be configured to other values ​​based on the sampling link, metering chip, and on-site noise level.

[0049] In step S104, it is determined whether a current range switch has occurred. The range status monitoring module 202 determines the current range based on the current effective value I_rms(k) of the current cycle and the preset range threshold. If the current current range is different from the current range corresponding to the previous stable cycle, a candidate event for a current range switch is determined. The main control unit 106 simultaneously records the current range Range_Pre before the switch, the current range Range_Cur after the switch, the switching direction Switch_Direction, the switching cycle Switch_Cycle, and whether the sampling gain level has changed.

[0050] In this embodiment, if the current rises from 0.42A to 12.60A within one cycle, the current range switches from R1 to R3, which is an upward cross-range switch from a low current range to a high current range. If the current falls back from 18.00A to 0.55A within one cycle, the current range switches from R3 to R1, which is a downward cross-range switch from a high current range to a low current range. If the current only rises from 0.92A to 1.18A, the current range switches from R1 to R2, which is an adjacent current range switch.

[0051] In step S105, it is determined whether the afterimage triggering condition is met. The afterimage triggering condition is used to determine whether current range switching may be accompanied by residual effects from the sampling link. In this embodiment, when a current range switching is detected, and at least one of the current step slope, power factor abrupt change, and harmonic envelope attenuation characteristics meets the corresponding threshold condition, a range boundary event can be determined to have occurred. To improve the reliability of the determination, it is also possible to require that the current range switching and at least two characteristics meet the conditions together, or to determine the afterimage risk level based on the number of conditions met.

[0052] In one configuration, when ΔI(k) is greater than 0.5A and RI(k) is greater than 0.30, the current step slope is deemed to meet the afterimage triggering condition. When ΔPF(k) is greater than 0.08, the power factor abrupt change is deemed to meet the afterimage triggering condition. When EH(k) shows a decreasing trend over several consecutive cycles after range switching, or when the cumulative decrease in EH(k) is greater than 15%, the harmonic envelope attenuation characteristic is deemed to meet the afterimage triggering condition. For different specifications of energy meters, the above thresholds can be configured according to the maximum current, basic current, sampling noise level, and product accuracy class.

[0053] In this embodiment, if the energy meter switches from R1 to R3, and the current increases from 0.42A to 12.60A, then ΔI(k) = 12.18A, and RI(k) is approximately 29.0, which significantly exceeds the normalized ratio threshold. If simultaneously the power factor changes from 0.980 to 0.910, and the harmonic envelope decreases from 0.180 to 0.145, 0.118, and 0.096 in subsequent cycles, then the main control unit 106 determines that the event meets the ghosting triggering condition and further identifies it as a range boundary event with a higher ghosting risk level.

[0054] In step S106, the range boundary ghosting window is determined. The ghosting window identification module 204 determines the basic ghosting window length based on the switching direction and ghosting risk level of the range boundary event. The ghosting risk level can be determined based on the number of features that meet the ghosting triggering conditions, the switching direction, whether the switching occurs across ranges, and the change in sampling gain level. For events where only slight switching occurs between adjacent ranges and the current step, power factor abrupt change, and harmonic envelope attenuation are all weak, a shorter ghosting window can be determined or observation can be performed. For events where the switching occurs across ranges and multiple features meet the ghosting triggering conditions, a longer ghosting window can be determined.

[0055] In one configuration, a mild ghosting risk event corresponds to a base ghosting window of 1 to 2 cycles, a moderate ghosting risk event corresponds to a base ghosting window of 2 to 4 cycles, and a high ghosting risk event corresponds to a base ghosting window of 4 to 8 cycles. For downlink cross-rate switching, since the low current range is more susceptible to the relative impact of the residual effect of the previous high current state, a longer base ghosting window can be used than for uplink cross-rate switching. For example, a high ghosting risk event switching from R1 to R3 can use a default ghosting window of 4 cycles, and a high ghosting risk event switching from R3 to R1 can use a default ghosting window of 6 cycles.

[0056] After determining the basic afterimage window length, the main control unit 106 can further determine whether to extend or terminate the afterimage window early. If, before the basic afterimage window ends, the fluctuations in the effective current value, power factor, and waveform distortion characteristics of consecutive cycles still do not meet the stability threshold, the range boundary afterimage window is extended within the maximum afterimage window length. If a preset number of consecutive cycles within the basic afterimage window meet the stability threshold, the afterimage window can be terminated early. The stability threshold can be configured as follows: effective current value fluctuation less than 2%, power factor fluctuation less than 0.03, and waveform distortion characteristic fluctuation less than 5%. The above values ​​are engineering configuration examples and do not limit the invention.

[0057] In step S107, the update of calibration coefficients for samples within the afterimage window is frozen. After determining the range boundary afterimage window, the calibration update freeze module 205 marks the corresponding cycle sample within the afterimage window as the afterimage frozen sample and sets the update weight of this sample for the calibration coefficients to zero. The calibration coefficients may include at least one of the following: current gain coefficient Ki, active power gain coefficient Kp, phase compensation coefficient Kφ, and zero-point offset coefficient K0. In the case where only the current channel experiences range switching, the updates of Ki, Kp, and Kφ can be frozen first. If the voltage channel also has an abnormal recovery state, the update of the voltage gain coefficient Ku can be frozen simultaneously.

[0058] Freezing does not mean stopping energy metering. The frozen image samples can still be used for energy accumulation, electrical parameter display, load surge event recording, and image fading template generation. In this embodiment, the calibration parameter management module 208 only restricts frozen image samples from entering the calibration sample queue, or sets the update weight of frozen image samples in the calibration sample queue to 0. The calibration parameter table 301 for the corresponding range remains the original version within the image window and is not written to or fixed based on the frozen image samples. Through this process, the energy meter maintains metering continuity after range switching, while avoiding transitional samples directly affecting calibration parameters.

[0059] In step S108, a ghosting fading template is generated or invoked. The template management module 206 searches for a matching template in the ghosting fading template library 302 in the memory 107 based on the current range before switching, the current range after switching, the switching direction, the ghosting risk level, and the load shape label. If a matching preset template exists, it is invoked. If no matching preset template exists, the template management module 206 can generate a temporary ghosting fading template based on the pre-boundary stable sample, the ghosting frozen sample, and the post-boundary stable sample.

[0060] Before the boundary, the stable sample is a cycle sample in which the fluctuations in the effective current value, power factor, and waveform distortion are all less than the corresponding stability threshold for several consecutive cycles before the range switching. After the boundary, the stable sample is a cycle sample in which the fluctuations in the effective current value, power factor, and waveform distortion are all less than the corresponding stability threshold for several consecutive cycles after the range boundary afterimage window ends. The template management module 206 can determine the length of the frozen section and the length of the weight release section based on the degree of deviation of the afterimage frozen sample from the stable sample after the boundary.

[0061] In this embodiment, the ghosting fading template includes at least a default ghosting window length, a maximum ghosting window length, a calibration update weight sequence, and a stability determination rule. For events switching from R1 to R3 with a high ghosting risk level, the template can be configured such that the weights for the first four cycles within the ghosting window are 0, and the weights for the next four cycles are 0.25, 0.50, 0.75, and 1.00, respectively. For events switching from R3 to R1 with a high ghosting risk level, the template can be configured such that the weights for the first six cycles within the ghosting window are 0, and the weights for the next four cycles are 0.20, 0.40, 0.70, and 1.00, respectively. These configurations reflect the processing differences for different switching directions.

[0062] In step S109, the calibration update weights are released cycle by cycle. The weight release module 207 assigns calibration update weights to subsequent cycle samples one cycle at a time, based on the calibration update weight sequence output by the afterimage fading template, after the afterimage window ends. If the current cycle is an afterimage frozen sample, its update weight is 0. If the current cycle is a weight release sample, its update weight is a value greater than 0 and less than 1. If the current cycle has already met the stability condition, its update weight can be restored to 1.

[0063] In one calibration parameter update method, a conventional calibration algorithm obtains a candidate correction amount ΔK for a certain calibration coefficient. After introducing the weight release mechanism of this invention, the actual correction amount participating in the update is ΔK_actual = Update_Weight × ΔK. Here, ΔK is the candidate calibration correction amount generated by the existing calibration algorithm, Update_Weight is the calibration update weight corresponding to the current cycle sample, and ΔK_actual is the actual correction amount participating in this round of parameter update. When Update_Weight is 0, the calibration coefficient is not updated for that cycle; when Update_Weight is 0.25, that cycle participates in the update with only one-quarter of the candidate correction amount; when Update_Weight is 1.00, that cycle participates in the update with full weight according to the conventional calibration algorithm. Through this method, samples after the ghosting window ends do not immediately participate in the calibration update with full weight, but are gradually restored according to the ghosting fading template.

[0064] During the weight release phase, the main control unit 106 continues to monitor the effective current value, power factor, and waveform distortion characteristics. If another current range switch occurs during the weight release phase, the current weight release process is terminated, and the ghost window recognition is re-executed starting from the new range switch event. If no new range switch occurs during the weight release phase, but the fluctuations in the effective current value, power factor, or waveform distortion characteristics do not meet the stability threshold, the weight increase can be paused, maintaining the current weight for one or more cycles, or the ghost window extension judgment can be re-entered. This processing can address situations where the load repeatedly starts and stops or the transition process is prolonged.

[0065] In step S110, the calibration coefficient update for the corresponding current range is resumed after the stability conditions are met. The stability conditions may include current RMS value fluctuations being less than a first stability threshold, power factor fluctuations being less than a second stability threshold, and waveform distortion fluctuations being less than a third stability threshold over a consecutive preset number of cycles, while the current range and sampling gain level remain unchanged. In this embodiment, five consecutive cycles can be used as the stability judgment window, with current RMS value fluctuations less than 2%, power factor fluctuations less than 0.03, and waveform distortion fluctuations less than 5% as stability conditions. After the stability conditions are met, the calibration parameter management module 208 marks the corresponding cycle sample as a stable calibration sample and allows the calibration coefficients for the corresponding current range to be updated according to the conventional calibration algorithm.

[0066] To protect memory lifespan, the calibration parameter management module 208 can first maintain temporary calibration parameters in the volatile storage area. When the cumulative number of stable calibration samples reaches a preset number, the change in calibration parameters exceeds the minimum write threshold, and the current period is not in the ghosting window or weight release phase, the calibration parameters are then written to the non-volatile memory. If the energy meter experiences a power outage, reset, communication parameter conflict, or grid frequency anomaly during the ghosting window or weight release phase, the current event can be marked as an abnormal event. Samples in this abnormal event are not used for template updates or calibration parameter fixation.

[0067] The following describes this embodiment using a specific operational process. Initially, the electricity meter is in the light load range R1, with an effective current value of approximately 0.42A, a power factor of approximately 0.980, and a waveform distortion characteristic of approximately 0.034. After the user connects a high-power load, the current rises to 12.60A within one cycle, the current range switches from R1 to R3, and the sampling gain level switches from a higher gain level to a lower gain level. The main control unit 106 detects ΔI(k) = 12.18A, RI(k) is greater than 30%, the power factor changes from 0.980 to 0.910, and the waveform distortion characteristic decreases from 0.180 to 0.145, 0.118, and 0.096 in subsequent cycles. Based on this, the main control unit 106 determines that this event is a high-risk upward cross-range boundary event with high ghosting risk and determines a range boundary ghosting window for four cycles.

[0068] During these four cycles, the samples are still used for energy accumulation and electrical parameter display, but they do not enter the calibration sample queue, or their calibration update weight is set to 0. After the ghosting window ends, the template management module 206 calls the ghosting fading template corresponding to the uplink cross-range event from R1 to R3, and the weight release module 207 sets the calibration update weights for subsequent cycles to 0.25, 0.50, 0.75, and 1.00 respectively. If no new range switching is detected during the weight release phase, and the current RMS value, power factor, and waveform distortion characterization all meet the stability conditions, the calibration parameter management module 208 resumes the normal update of the R3 range calibration coefficients.

[0069] Therefore, in this embodiment, during the rapid transition from a light load to a heavy load, the calibration parameters for the new range are not immediately updated based solely on the change in current range. Instead, the calibration update is further identified within the range boundary ghosting window, frozen within the ghosting window, and released cycle by cycle after the ghosting window ends. This process reduces the impact of short-term transitional samples after range switching on the current current range calibration parameters, while ensuring that the normal metering process of the electricity meter is not interrupted.

[0070] Example 2

[0071] This embodiment combines Figure 3The method for identifying the range boundary ghosting window is further explained. This embodiment can be executed in the IoT energy meter described in Embodiment 1, or in other wide-range energy meters with the ability to acquire cycle-level electrical parameters. Figure 3 The range boundary ghost window recognition process shown is used not only to determine whether a current range switch has occurred, but also to determine whether the cycle sample after the current range switch is in a transitional state that is not suitable for participating in the calibration coefficient update.

[0072] In this embodiment, the identification of the range boundary ghosting window does not solely rely on whether the current effective value of the current cycle crosses the range threshold. Instead, it comprehensively considers range state changes, current step slope, power factor abrupt changes, harmonic envelope attenuation characteristics, and sampling gain level changes for judgment. This approach is necessary because the load current may experience short-term fluctuations near the range boundary. If a long freeze window is initiated simply because the current crosses the threshold, it could reduce the number of effective calibration samples. Conversely, if calibration updates are allowed only based on whether the current range has switched, the recovery process of the sampling front-end and digital filtering link might be overlooked. Therefore, this embodiment uses multiple cycle-level features to confirm ghosting risk, ensuring that the start and end positions and duration of the range boundary ghosting window match the actual load abrupt change state.

[0073] Specifically, at the end of each cycle, the main control unit acquires the current RMS current value I_rms(k), power factor PF(k), waveform distortion characterization EH(k), current current range Range(k), current sampling gain level Gain(k), and current calibration parameter table index Param(k). Here, k represents the current cycle number. If Range(k) differs from the range Range(k-1) corresponding to the previous stable cycle, or if Gain(k) differs from Gain(k-1), the main control unit first marks the current cycle as a candidate cycle for range switching. This candidate marking only indicates a change in the energy meter's range state and does not necessarily indicate that a ghosting window has occurred.

[0074] When judging the current step characteristics, the main control unit calculates the change in the effective value of the current between adjacent cycles, ΔI(k), where ΔI(k) = |I_rms(k) - I_rms(k-1)|. In a 50Hz power grid, the duration of one cycle, T_cycle, is 20ms. The main control unit can use SI(k) = ΔI(k) / T_cycle as the current step slope. To be compatible with different specifications of energy meters, the main control unit can also calculate the normalized current change ratio RI(k), where RI(k) = ΔI(k) / max(I_rms(k-1), I_min), and I_min is the minimum reference current. In a 5(60)A energy meter, I_min can be configured as 0.05A or as a smaller ratio related to the maximum current Imax. If ΔI(k) is greater than the first current threshold and RI(k) is greater than the first ratio threshold, then the current step judgment node 401 outputs the current step candidate result. The first current threshold can be 0.5A, or it can be set to a value between 0.008Imax and 0.02Imax based on the maximum current Imax; the first proportional threshold can be 30%, or it can be configured according to the product's range division and noise level.

[0075] When determining power factor mutation characteristics, the main control unit calculates the difference ΔPF(k) between the current cycle power factor and the previous cycle power factor, where ΔPF(k) = |PF(k) - PF(k-1)|. If the power factor register experiences short-term jitter, the moving average power factor of multiple consecutive cycles can be used for judgment. For example, the average power factor of the current cycle and the previous cycle can be compared with the average power factor of the two cycles prior, and the difference between the two can be used as the power factor mutation amount. If the power factor mutation amount is greater than the power factor mutation threshold, the power factor mutation judgment node 402 outputs the power factor mutation candidate result. The power factor mutation threshold can be set to a configurable value between 0.05 and 0.15, and 0.08 can be used in a more balanced configuration. The role of the power factor mutation amount is to identify whether the load phase relationship or load configuration has changed, thereby assisting in judging whether there may be residual effects of phase compensation or digital filtering history in the sampling link.

[0076] When determining the harmonic envelope attenuation characteristics, the main control unit selects different waveform distortion characterization quantities based on the data capabilities provided by the energy meter. If the metering chip can output the second harmonic amplitude H2(k), the third harmonic amplitude H3(k), and the fifth harmonic amplitude H5(k), then EH(k) = 0.3 × H2(k) + 0.4 × H3(k) + 0.3 × H5(k) can be used as the harmonic envelope value, where H2(k), H3(k), and H5(k) are harmonic amplitudes under the same dimension, preferably normalized amplitudes relative to the fundamental amplitude or the effective value of the current current in the current cycle. If the metering chip only outputs the total harmonic distortion rate THD_I(k), then EH(k) = THD_I(k). If the metering chip does not provide a harmonic register, but the main control unit can read the sampling waveforms of adjacent current cycles, then it can be calculated according to DE(k)=Σ_{n=1}^{N}|i_k(n)-i_{k-1}(n)| 2 The differential energy of the current cycle is calculated, and DE(k) is used as a substitute harmonic envelope value, where n represents the sampling point number within the current cycle, N is the number of sampling points within one cycle, and i_k(n) is the current sample value of the nth current in the kth cycle after gain conversion and phase alignment. If only the peak current and the effective current value can be obtained, the peak-to-average power ratio of the current waveform can be used as a substitute indicator. The different implementation methods described above are all used to describe whether waveform distortion or waveform differences gradually diminish with the cycle after range switching.

[0077] The harmonic envelope attenuation judgment node 403 observes the EH changes of multiple consecutive cycles after the candidate cycle of range switching. If EH(k), EH(k+1), and EH(k+2) show a decreasing trend, or the cumulative decrease ratio from EH(k) to EH(k+2) is greater than a preset decrease ratio threshold, then it is determined that harmonic envelope attenuation characteristics exist. The preset decrease ratio threshold can be 15%, or it can be set to a configurable value between 10% and 25%. If the load itself is a switching power supply type load with high harmonic content but stable, its EH may remain at a high level but not show obvious attenuation; in this case, the main control unit can not identify it as residual attenuation, but treat it as a stable non-sinusoidal load. It can be seen that this embodiment focuses not on the absolute value of the harmonics themselves, but on whether the waveform distortion characterization quantity in the consecutive cycles after range switching shows a recovery process from strong to weak.

[0078] The sampling gain level change judgment node 404 is used to confirm whether a hardware state change that may introduce residual effects has occurred at the sampling front end. In a power meter using a programmable gain amplifier, the main control unit can read the gain level Gain(k) and determine whether it has switched from a high gain level to a low gain level, or vice versa. In a power meter using a multi-range sampling channel, the main control unit can read the currently enabled sampling channel number. If a change in current range is accompanied by a change in sampling gain level or a change in sampling channel, the ghosting risk level can be increased. If only the calibration parameter table index changes and the hardware sampling level remains unchanged, the ghosting risk level can be relatively reduced.

[0079] The afterimage risk level judgment node 405 determines the afterimage risk level based on the above judgment results. Specifically, when only current range switching is detected, and the current step, power factor abrupt change, harmonic envelope attenuation, and sampling gain change are all weak, the event can be determined as a normal range switching or a mild afterimage risk event. When current range switching and current step characteristics coexist, but the power factor abrupt change and harmonic envelope attenuation are weak, it can be determined as a mild afterimage risk event. When current range switching, current step characteristics, and at least one of power factor abrupt change or harmonic envelope attenuation coexist, it can be determined as a moderate afterimage risk event. When the current range switching is a cross-range switching, and multiple of the current step, power factor abrupt change, harmonic envelope attenuation, and sampling gain range change coexist, it can be determined as a high afterimage risk event.

[0080] After determining the ghosting risk level, the basic ghosting window length determination node 406 determines the basic ghosting window length based on the switching direction and the ghosting risk level. If the event is a minor ghosting risk event between adjacent ranges, the basic ghosting window length can be 1 to 2 cycles. If the event is a moderate ghosting risk event, the basic ghosting window length can be 2 to 4 cycles. If the event is a high ghosting risk event, the basic ghosting window length can be 4 to 8 cycles. For events with the same high ghosting risk, downlink cross-range switching can use a basic ghosting window length no shorter than uplink cross-range switching. For example, when switching from R1 to R3, a basic ghosting window of 4 cycles can be used, while when switching from R3 to R1, a basic ghosting window of 6 cycles can be used. The reason for this setting is that when a large current range falls back to a small current range, the amplitude of the small current signal is lower, and the relative influence of the residual state of the previous large current range on the current small signal is more easily manifested.

[0081] The ghosting window extension judgment node 407 is used to avoid the basic ghosting window being too short. When the basic ghosting window is about to end, the main control unit continues to judge whether the current RMS value fluctuation, power factor fluctuation, and waveform distortion characterization fluctuation of the continuous cycle all meet the stability threshold. The current RMS value fluctuation can be expressed as the ratio of the difference between the maximum and minimum current RMS values ​​in the current stable observation window to the average value. The power factor fluctuation can be expressed as the difference between the maximum and minimum power factor values ​​in the current stable observation window. The waveform distortion characterization fluctuation can be expressed as the ratio of the difference between the maximum and minimum EH values ​​in the current stable observation window to the average value. In one configuration, the current RMS value fluctuation threshold is 2%, the power factor fluctuation threshold is 0.03, and the waveform distortion characterization fluctuation threshold is 5%. If at least one of these thresholds is not met, and the current ghosting window length has not yet reached the maximum ghosting window length, the main control unit extends the ghosting window by one or more cycles. The maximum ghosting window length can be 8 cycles, 10 cycles, or 12 cycles, and the specific value can be determined according to the digital filter order and the sampling front-end setup time.

[0082] The early termination judgment node 408 for the image retention window is used to avoid an excessively long basic image retention window. When a preset number of consecutive cycles within the basic image retention window have met the stability threshold, the main control unit can terminate the image retention window early. For example, if, after the first two cycles of the basic image retention window, the RMS current fluctuation is less than 2%, the power factor fluctuation is less than 0.03, and the EH fluctuation is less than 5%, and the current range and sampling gain level remain unchanged, the image retention window can be terminated early. Early termination does not necessarily mean immediate resumption of full-weight calibration updates; the main control unit can still enter the weight release phase, allowing one or more subsequent cycles to participate in the calibration update with a weight less than 1.

[0083] To further illustrate the recognition effect of this embodiment, the following description uses a scenario of a sudden change from light load to heavy load. Assume that the effective current values ​​of the electricity meter in the five cycles prior to the switch are 0.41A, 0.42A, 0.42A, 0.41A, and 0.42A, respectively; the power factor is between 0.980 and 0.982; and the energy efficiency (EH) is between 0.034 and 0.035. The main control unit determines this as a pre-boundary stable state. In the current cycle k, the effective current value rises to 12.60A, the range switches from R1 to R3, and the sampling gain level switches from G2 to G0. The main control unit calculates ΔI(k) = 12.18A, RI(k) is much greater than 30%; the power factor changes from 0.980 to 0.910; and the EH decreases from 0.180 to 0.145, 0.118, and 0.096 in subsequent cycles. At this time, the current step judgment node 401, the power factor change judgment node 402, the harmonic envelope attenuation judgment node 403, and the sampling gain level change judgment node 404 all output results that meet the conditions. The ghosting risk level judgment node 405 determines it as a high ghosting risk event, and the basic ghosting window length determination node 406 determines the default ghosting window length to 4 cycles.

[0084] Let's describe the scenario of a load drop-off from a heavy load to a light load. Assume the effective current value before the switch is approximately 18A, the range is R3, and the sampling gain is G0. At the current cycle m, the high-power load disconnects, the effective current value drops to 0.55A, the range switches to R1, and the sampling gain switches to G2. The main control unit calculates a significant current step and detects the power factor changing from 0.959 to 0.892, and the EH gradually decreasing from 0.155 to 0.128, 0.109, 0.094, 0.086, and 0.080. Since this event involves a downlink cross-range switch, and low-current range signals are more susceptible to residual effects, the main control unit classifies this event as a high-risk ghosting event and invokes the default ghosting window configuration of 6 cycles or at least 6 cycles.

[0085] If the event is a minor switch between adjacent ranges, such as a current increase from 0.92A to 1.18A, or a switch from range R1 to R2, but the power factor change is less than 0.01, the EH does not show a significant attenuation trend, and the sampling gain level does not change significantly, then the main control unit can classify the event as a normal range switch or a minor ghosting risk event. For such events, a freeze observation of only one cycle can be set, or the long-term freeze window can be avoided if the stability conditions are met. Therefore, this embodiment avoids applying the same freeze duration to all range switches.

[0086] In this embodiment, the identification of the range boundary ghosting window is no longer a simple delay process, but is determined jointly by the range state, load mutation characteristics, and continuous cycle stability. This identification result can be directly provided to the calibration update freeze module 205 and the weight release module 207, enabling the subsequent calibration parameter update process to distinguish between ghosting freeze samples, weight release samples, and stable calibration samples.

[0087] Example 3

[0088] This embodiment combines Figure 4 This embodiment describes the establishment, invocation, updating, and cycle-based release calibration update of the afterimage fading template. This embodiment can be implemented in conjunction with Embodiment 1 and Embodiment 2, or it can be used as a specific implementation of the template management module 206 and the weight release module 207 in an IoT energy meter.

[0089] In this embodiment, the afterimage fading template is used to describe the control rules for the gradual fading of afterimage effects with frequency after range switching. This template does not directly replace the meter's measurement results, nor does it directly invalidate the energy data within the afterimage window. Instead, it is used to determine the weights of different frequency samples in calibration parameter updates. Using this template, the energy meter can classify samples after range switching into afterimage-frozen samples, weight-released samples, and stable calibration samples. The calibration update weight for afterimage-frozen samples is 0, the calibration update weight for weight-released samples is greater than 0 and less than 1, and the calibration update weight for stable calibration samples is 1.

[0090] like Figure 4 As shown, the template management module 206 can obtain the afterimage fading template from the preset template calling process 501, the temporary template generation process 502, and the template restricted update process 503. The preset template calling process 501 is suitable for situations where the electricity meter has already been configured with templates for common range switching directions at the factory. The temporary template generation process 502 is suitable for situations where no suitable preset template is matched for the current range boundary event. The template restricted update process 503 is suitable for situations where similar range boundary events occur multiple times and the statistical results are consistent. The version rollback process 504 is used to restore the previous version template when an anomaly occurs after a template update.

[0091] In one implementation, the ghosting fading templates are stored in the ghosting fading template library 302 of the memory 107. Each template may include a template number, current range before switching, current range after switching, switching direction, ghosting risk level, sampling gain level change type, load form label, default ghosting window length, maximum ghosting window length, calibration update weight sequence, stability judgment rule, template version, template confidence level, and verification information. For low-cost energy meters, the template fields can be simplified, retaining only the current range before switching, current range after switching, ghosting risk level, default ghosting window length, maximum ghosting window length, calibration update weight sequence, and stability judgment rule. Each template can be stored using a compact data structure to reduce the occupation of non-volatile memory.

[0092] When the ghosting window recognition module 204 determines that a range boundary event has occurred, the template management module 206 first searches for a preset template based on the current range before switching, the current range after switching, and the ghosting risk level. If a perfectly matching template exists, it is directly called. If no perfectly matching template exists, but a general template with the same switching direction and the same ghosting risk level exists, the general template is called, and the default ghosting window length is adjusted according to the actual range span. If only templates with the same switching direction but similar ghosting risk levels exist, the similar template can be called with conservative adjustments, such as increasing the basic ghosting window length by one cycle or reducing the initial release weight. If no available template exists, the temporary template generation process 502 is initiated.

[0093] Pre-set templates can be established during the electricity meter manufacturing process. For electricity meters with the same hardware version, the same sampling front-end design, and the same metering chip model, templates can be established through typical load switching tests. For example, for the upstream cross-range switching from R1 to R3, the RMS current, power factor, and EH changes can be tested under light load conditions when suddenly increasing the power resistive load, switching power supply type load, and motor starting simulated load. If the test results show that most of the high residual risk events from R1 to R3 complete the main attenuation within 4 cycles and gradually stabilize within the following 4 cycles, then template T_R1_R3_L3 can be set, with a default residual window length of 4 cycles, a maximum residual window length of 8 cycles, and calibration update weight sequences of 0, 0, 0, 0, 0.25, 0.50, 0.75, and 1.00. For the downlink cross-range switching from R3 to R1, if the test results show that the recovery process of the low current range is relatively long, the template T_R3_R1_L3 can be set with a default ghosting window length of 6 cycles and a maximum ghosting window length of 10 cycles. The calibration update weight sequence is 0, 0, 0, 0, 0, 0, 0.20, 0.40, 0.70 and 1.00.

[0094] The temporary template generation process 502 is executed based on the pre-boundary stable sample set 305, the afterimage frozen sample set 306, and the post-boundary stable sample set 307. The pre-boundary stable sample set 305 consists of multiple consecutive cycle samples that meet the stability threshold before the range switch, characterizing the stable state of the range before the switch. The afterimage frozen sample set 306 consists of cycle samples within the afterimage window at the range boundary, characterizing the transition recovery process after the range switch. The post-boundary stable sample set 307 consists of multiple consecutive cycle samples that meet the stability threshold after the afterimage window ends, characterizing the stable state of the range after the switch. The template management module 206 can compare each cycle in the afterimage frozen sample set 306 with the mean or median of the post-boundary stable sample set 307 to determine the degree of deviation of each afterimage cycle from the stable state.

[0095] In one feasible deviation calculation method, the template management module 206 calculates the deviation ratio of the current RMS value, the deviation of the power factor, and the deviation ratio of the waveform distortion characterization quantity. The deviation ratio of the current RMS value can be the absolute value of the difference between the current RMS value of the current afterimage cycle and the average RMS value of the current in the stable sample set after the boundary, divided by the average RMS value of the current. The deviation of the power factor can be the absolute value of the difference between the current power factor of the afterimage cycle and the average power factor of the stable sample set after the boundary. The deviation ratio of the waveform distortion characterization quantity can be the absolute value of the difference between the current EH of the afterimage cycle and the average EH of the stable sample set after the boundary, divided by the average EH. If at least two of the above three items exceed the corresponding deviation threshold, the cycle can be identified as a high-deviation cycle, and its calibration update weight is set to 0. If only one item exceeds the corresponding deviation threshold, or multiple items are slightly higher than the stability threshold, the cycle can be identified as a medium-deviation cycle, and its calibration update weight can be set to a value between 0.20 and 0.70. If the sample set stabilizes after all three terms are close to the boundary, then the cycle can be identified as a low deviation cycle, and its calibration update weight can be set to 0.75 or 1.00.

[0096] Once a temporary template is generated, it can be used only for current range boundary events. If similar events occur multiple times subsequently, and the temporary template generation results are consistent in terms of default afterimage window length, number of cycles to recover stable operation, and release weight sequence, then the template management module 206 can use the temporary template as a candidate running template. To avoid occasional load anomalies or power grid anomalies causing the template to be incorrectly fixed, the candidate running template needs to be confirmed through the template restricted update process 503.

[0097] Template-restricted update process 503 is executed after the cumulative occurrence of the same type of range boundary event reaches a preset number. The same type can be determined by the current range before switching, the current range after switching, the switching direction, the ghosting risk level, and the sampling gain level change type. The preset number can be 5, 10, or other values. In one configuration, the template management module 206 only allows updating the corresponding template when the cumulative occurrence of the same type of range boundary event is no less than 10 times, and at least 8 of these events have a recovery stable cycle number falling within the same cycle interval. The update content can include the default ghosting window length, the maximum ghosting window length, the calibration update weight sequence, and the stability judgment rules. The adjustment range of each update is limited; for example, the default ghosting window length can be adjusted by a maximum of 1 cycle per update, the maximum ghosting window length by a maximum of 2 cycles per update, and the initial release weight by a maximum of 0.1 per update. This limiting process can prevent the template from undergoing significant changes due to a small number of abnormal events.

[0098] Version rollback process 504 is used to ensure the reliability of the updated template. Before updating the template, the template management module 206 saves the previous version template to the template rollback area 304 and writes the version number and verification information to the new template. The updated template continues to be monitored within a preset observation period. If, after using the new template, the number of stability judgment failures after the ghost window ends increases, or the proportion of ghost windows being retried during the weight release phase increases, or the candidate offset of the calibration parameters exceeds the preset range, the template management module 206 can roll back the current template to the previous version template. If the energy meter interacts with the main station or cloud platform 109 through the communication unit 108, the terminal can only upload template update suggestions, and the main station or cloud platform 109 will uniformly issue the official template after statistically analyzing the data of the same type of energy meter.

[0099] The weight release module 207 assigns weights cycle-by-cycle to the cycle samples after the range boundary afterimage window based on the calibration update weight sequence 308 output by the template management module 206. For example... Figure 4 As shown, the weight release process can include a zero-weight freeze segment 505, a non-zero-weight release segment 506, and a full-weight recovery segment 507. The zero-weight freeze segment 505 corresponds to cycle samples within the range boundary ghost window, where all their calibration update weights are 0. The non-zero-weight release segment 506 corresponds to cycle samples that are not yet fully stable after the ghost window ends but are allowed to partially participate in calibration updates; their calibration update weights can increase cycle by cycle. The full-weight recovery segment 507 corresponds to cycle samples that have met the stability condition, where their calibration update weight is 1.

[0100] In a specific example, an uplink range switching event from R1 to R3 calls the template T_R1_R3_L3, whose weight sequence is 0, 0, 0, 0, 0.25, 0.50, 0.75, and 1.00. If the range switching occurs at cycle k, then cycles k to k+3 are a zero-weight frozen segment, and their samples do not participate in the calibration coefficient update; cycles k+4 to k+6 are a non-zero-weight release segment, with update weights of 0.25, 0.50, and 0.75 respectively; cycles k+7 and thereafter enter the full-weight recovery segment when the stability condition is met, with an update weight of 1.00. If the conventional calibration algorithm calculates the candidate correction amount ΔKi for the current gain coefficient at cycle k+4, then the actual correction amount participating in the update is 0.25 × ΔKi; if the candidate correction amount ΔKp for the active power gain coefficient is calculated at cycle k+5, then the actual correction amount participating in the update is 0.50 × ΔKp. Therefore, the weight release module 207 does not change the calculation logic of the conventional calibration algorithm, but applies sample state-related weight control to the candidate correction amount before it enters the calibration parameter table.

[0101] In another specific example, a downlink range switching event from R3 to R1 invokes the template T_R3_R1_L3, whose weight sequence is 0, 0, 0, 0, 0, 0, 0.20, 0.40, 0.70, and 1.00. If the range switching occurs at cycle m, then cycles m to m+5 are a zero-weight freeze segment; cycles m+6 to m+8 are a non-zero-weight release segment; and cycles m+9 and thereafter resume full-weight updates when stability conditions are met. Compared to uplink range switching events, this template sets a longer zero-weight freeze segment and a lower initial release weight, making it suitable for scenarios where the previous high-current state has a relatively large impact on the light-load sampling results when the load falls back to a light load.

[0102] During the weight release process, the weight release module 207 does not mechanically proceed sequentially, but continuously receives feedback from the range status monitoring module 202 and the feature extraction module 203. If a current range switch is detected again within the non-zero weight release segment 506, the weight release module 207 terminates the current release process and notifies the afterimage window recognition module 204 to re-determine the afterimage window with the new range switch event. If no new range switch occurs, but the current RMS value fluctuation, power factor fluctuation, or EH fluctuation does not meet the stability threshold, the weight release module 207 can pause the weight increment and maintain the current weight for one or more cycles. If the fluctuation persists and reaches the afterimage trigger condition, the afterimage window judgment process can be re-entered. If multiple consecutive cycles meet the stability condition, the full weight recovery segment 507 is entered.

[0103] This embodiment also allows for verification management of template storage. The ghosting template library 302 in memory 107 can be configured with verification information, such as cyclic redundancy check values. The main control unit 106 reads and verifies the template before power-on or before template invocation. If verification fails, the template is not invoked; instead, the previous version template in the template rollback area 304 is invoked, or a safe default template is invoked. The safe default template can employ a relatively conservative configuration, for example, using a freeze segment of at least four cycles for events with a high ghosting risk, and a release sequence of 0.25, 0.50, 0.75, and 1.00; and using a freeze segment of at least six cycles for downlink cross-rate events, and a release sequence of 0.20, 0.40, 0.70, and 1.00. In this way, even if the template data is corrupted or a suitable template is not matched, the energy meter can still use a conservative strategy to protect calibration parameters.

[0104] This embodiment can also be implemented in conjunction with the main station or cloud platform 109. The communication unit 108 can upload an event summary after the afterimage event ends. The event summary includes the electricity meter identifier, hardware version, software version, template version, current range before switching, current range after switching, afterimage risk level, actual afterimage window length, weight release sequence, number of cycles to restore stability, and anomaly marker. The main station or cloud platform 109 can statistically analyze the event summaries of multiple electricity meters according to the electricity meter model, hardware version, and event type, generate template parameter optimization suggestions, and distribute afterimage trigger thresholds or afterimage fading templates through the communication network. After receiving the template, the terminal side first performs legality and version verification, and only activates the new template if it is not currently in the afterimage window or weight release phase.

[0105] In this embodiment, the afterimage fading template transforms sample processing after range switching from a fixed delay into a configurable, callable, and updatable weight control process. This process can utilize templates pre-set at the factory or generate temporary templates from stable field samples, maintaining reliability through restricted updates and version rollbacks. Since the template outputs calibration update weights rather than directly replacing metering results, this embodiment protects the online calibration parameter updates of wide-range energy meters without altering the energy accumulation logic.

[0106] Example 4

[0107] This embodiment combines Figure 1This document describes a load self-sensing wide-range error calibration system for IoT energy meters. The system can be deployed inside the IoT energy meter 100 and is implemented collaboratively by a metering chip 105, a main control unit 106, a memory 107, and a communication unit 108. Alternatively, the main control unit 106 can execute the main processing logic and call the metering register data provided by the metering chip 105. The system described in this embodiment corresponds to the steps in the aforementioned method embodiments. Each functional module in the system can be implemented through hardware circuits, embedded software, firmware programs, or a combination of hardware and software.

[0108] like Figure 1 As shown, the IoT energy meter 100 includes a voltage sampling unit 101, a current sampling unit 102, a sampling gain switching unit 103, an analog-to-digital converter 104, a metering chip 105, a main control unit 106, a memory 107, and a communication unit 108. The voltage sampling unit 101 is used to acquire the voltage signal of the tested line, and the current sampling unit 102 is used to acquire the current signal flowing through the user-side load 110. The sampling gain switching unit 103 is used to adjust the gain level or sampling channel of the sampling front end according to the current range status. The analog-to-digital converter 104 is used to convert the analog sampling signal into a digital sampling signal. The metering chip 105 is used to generate the effective value of the current, power factor, active power, cumulative energy value, and waveform distortion characterization quantities based on the voltage and current sampling signals. The main control unit 106 is used to perform range boundary ghosting window recognition, calibration update freezing, ghosting fading template management, and calibration update weight release. The memory 107 is used to store the calibration parameter table 301, the afterimage fading template library 302, the event log 303, and the template rollback area 304. The communication unit 108 is used to interact with the main station or cloud platform 109 via a communication network.

[0109] The system includes a sampling data acquisition module 201, a range status monitoring module 202, a feature extraction module 203, a ghost window recognition module 204, a calibration update freeze module 205, a template management module 206, a weight release module 207, and a calibration parameter management module 208. Further, the system may also include an event logging module 209 and a communication management module 210. These modules can be integrated into the software tasks of the main control unit 106, or partially supported by the metering chip 105. For example, the metering chip 105 can calculate the effective voltage value, effective current value, power factor, and harmonic register, while the main control unit 106 can perform range boundary ghost window recognition and calibration update control.

[0110] The sampling data acquisition module 201 is used to acquire cycle-level sampling data. This module can directly read the cycle-level electrical parameters output by the metering chip 105, or it can read the original voltage and current sampling sequences from the analog-to-digital conversion unit 104 and form a cycle-level sampling record. In a specific implementation, the sampling data acquisition module 201 reads data with one power grid cycle as the period. In a 50Hz power grid, cycle-level data is read once every 20ms; in a 60Hz power grid, cycle-level data is read once every approximately 16.67ms. If the sampling frequency is 6.4kHz, then each cycle in a 50Hz power grid corresponds to 128 sampling points. The cycle-level sampling record formed by the sampling data acquisition module 201 can include the cycle number, current RMS value, power factor, waveform distortion characterization, current current range, sampling gain level, calibration parameter table index, sample status, and calibration update weight.

[0111] The range status monitoring module 202 is used to acquire the current range status and determine whether a current range switch has occurred. This module can determine the current range based on the relationship between the effective current value and a preset range threshold, or it can directly read the range status of the sampling gain switching unit 103 or the metering chip 105. To avoid repeated switching due to current fluctuations near the range boundaries, the range status monitoring module 202 can set an uplink threshold and a downlink threshold. For example, between the light load range R1 and the medium load range R2, the uplink switching threshold can be set to 1.05A, and the downlink fallback threshold can be set to 0.95A. When the module detects that the current current range is inconsistent with the current range of the previous stable cycle, it records the current range before the switch, the current range after the switch, the switching direction, the switching cycle, and whether the sampling gain range has changed.

[0112] The feature extraction module 203 is used to extract the current step slope, power factor abrupt change, and harmonic envelope attenuation features. Specifically, the feature extraction module 203 calculates the current change based on the difference between the effective values ​​of currents in adjacent cycles, and determines the current step slope based on the ratio of this current change to the duration of one cycle. This module can also determine the normalized current change ratio based on the ratio of the current change to the larger of the previous cycle's effective current value and the minimum reference current. The power factor abrupt change can be determined by the difference between the current cycle's power factor and the previous cycle's power factor, or by the difference between the moving averages of the power factors of multiple consecutive cycles. The harmonic envelope attenuation features can be determined by the weighted value of the second, third, and fifth harmonic amplitudes, or by the total harmonic distortion rate, the peak-to-average power ratio of the current waveform, half-cycle asymmetry, or cycle differential energy. The feature results output by the feature extraction module 203 are provided to the afterimage window recognition module 204 to determine whether there is a risk of afterimages after range switching.

[0113] The afterimage window identification module 204 is used to determine the range boundary afterimage window when a current range switch is detected and at least one feature meets the afterimage triggering condition. This module determines the range boundary event and its afterimage risk level based on the switching direction output by the range status monitoring module 202 and the current step slope, power factor abrupt change, and harmonic envelope attenuation characteristics output by the feature extraction module 203. If the range switch is only a slight change between adjacent ranges, and the current step, power factor abrupt change, and waveform distortion characteristic attenuation are not significant, the afterimage window identification module 204 can identify it as a normal range switch or a mild afterimage risk event. If the range switch is a cross-range switch, and multiple features meet the afterimage triggering condition, the afterimage window identification module 204 can identify it as a high afterimage risk event. This module further determines the basic afterimage window length based on the afterimage risk level and switching direction, and determines whether to extend or terminate the afterimage window early based on the stability of subsequent continuous cycles.

[0114] The calibration update freeze module 205 is used to freeze the update of calibration coefficients for corresponding cycle samples within the range boundary afterimage window. This module receives the start and end cycles of the afterimage window output by the afterimage window identification module 204 and marks the cycle samples within the afterimage window as afterimage frozen samples. The calibration update freeze module 205 can achieve freezing by preventing afterimage frozen samples from entering the calibration sample queue, by setting the calibration update weight of the afterimage frozen samples to 0, or by locking the calibration parameter table corresponding to the current current range within the afterimage window. The frozen objects can include the current gain coefficient, active power gain coefficient, phase compensation coefficient, and zero-point offset coefficient. When the current channel undergoes a range switch, it is preferable to freeze the updates of the current gain coefficient, active power gain coefficient, and phase compensation coefficient. The calibration update freeze module 205 does not stop energy accumulation; the afterimage frozen samples can still be used for energy accumulation, electrical parameter display, load change event recording, and afterimage fading template generation.

[0115] The template management module 206 is used to generate, call, and update afterimage fading templates. This module can search for a matching template in the afterimage fading template library 302 based on the current range before and after the switch, the switching direction, the afterimage risk level, and the load shape label. If a matching template exists, it is directly called. If no matching template exists, the template management module 206 can generate a temporary template based on the pre-boundary stable sample set 305, the afterimage frozen sample set 306, and the post-boundary stable sample set 307. The pre-boundary stable sample set 305 characterizes the stable state of the range before the switch, the post-boundary stable sample set 307 characterizes the stable state of the range after the switch, and the afterimage frozen sample set 306 characterizes the recovery process after the range switch. The template management module 206 determines the zero-weight frozen section and the non-zero-weight release section by comparing the deviation of the afterimage frozen samples from the post-boundary stable samples. This module can also perform limited updates to the template when similar range boundary events occur multiple times and meet consistency conditions, and restore the previous version template through the template rollback area 304 in case of update anomalies.

[0116] Furthermore, when no matching preset ghosting fading template is found, the main control unit can first call a safe default template to freeze and release weights for the current range boundary event. This safe default template includes at least a conservative ghosting window length and a cycle-by-cycle increasing calibration update weight sequence. After the current event ends and a stable sample is obtained after the boundary, the template management module generates a temporary ghosting fading template based on the stable sample before the boundary, the frozen ghosting sample, and the stable sample after the boundary. This temporary ghosting fading template is preferentially used for subsequent events of the same type and is only written into the running template area after multiple instances of the same type of event satisfying the consistency condition.

[0117] The weight release module 207 determines the calibration update weight sequence based on the afterimage fading template and releases the calibration update weights by cycle. This module sets the weight within the range boundary afterimage window to 0, sets one or more cycles after the afterimage window to release weights greater than 0 and less than 1, and restores the weights to 1 after the stability condition is met. Specifically, if the weight sequence output by the template is 0, 0, 0, 0, 0.25, 0.50, 0.75, and 1.00, the first four cycles after the range switch do not participate in the calibration parameter update, and the subsequent three cycles participate in the update with weights of 0.25, 0.50, and 0.75 respectively. Afterwards, full weight update is restored after the stability condition is met. During the release process, the weight release module 207 continuously monitors the range status and load mutation characteristics. If another range switch occurs, the current weight release process is terminated, and the afterimage window recognition module 204 is triggered to re-identify the new range boundary afterimage window.

[0118] The calibration parameter management module 208 manages the calibration parameter tables 301 corresponding to different current ranges and controls the updating of calibration coefficients according to the sample status and calibration update weights. The calibration parameter table 301 can store the current gain coefficient, power gain coefficient, phase compensation coefficient, zero-point offset coefficient, version number, and verification information separately for each current range. When the sample status is a frozen sample with ghosting, the calibration parameter management module 208 does not update the calibration parameters based on that sample. When the sample status is a weighted release sample, the calibration parameter management module 208 multiplies the candidate correction amount obtained from the conventional calibration algorithm by the corresponding calibration update weight before participating in the temporary parameter update. When the sample status is a stable calibration sample, the calibration parameter management module 208 updates according to the normal calibration algorithm. To reduce the number of writes to the non-volatile memory, the calibration parameter management module 208 can first maintain temporary calibration parameters in the volatile storage area. Once the number of stable calibration samples reaches a preset number, the parameter change exceeds the minimum write threshold, and the current state is not in the ghosting window or weighted release phase, the parameters are then permanently saved to the non-volatile memory.

[0119] The event logging module 209 is used to record range boundary events, ghosting window identification results, and calibration update control processes. The event log can include the event occurrence time, current range before switching, current range after switching, switching direction, ghosting risk level, ghosting window length, weight release sequence, template number, template version, calibration parameter table version, and anomaly flag. The event logging module 209 can store several recent events in the memory 107. If the energy meter experiences a power outage, reset, voltage anomaly, frequency anomaly, or communication parameter conflict, the event logging module 209 can mark the current event as an anomalous event. Data marked as anomalous events is not used for template-restricted updates or for calibration parameter fixation.

[0120] The communication management module 210 controls the data interaction between the communication unit 108 and the master station or cloud platform 109. The communication management module 210 can upload range boundary event records, ghosting window length, weight release sequence, template version, and calibration parameter table version. It can also receive ghosting trigger thresholds, ghosting fading templates, and calibration parameter configurations from the master station or cloud platform 109. To avoid remote parameter updates interfering with local ghosting event processing, the communication management module 210, upon receiving a new template or threshold, can first perform legality verification, version verification, and verification value verification. The new configuration will only take effect when the current state is not within the range boundary ghosting window, not in the weight release phase, and not in the calibration parameter solidification process.

[0121] In this embodiment, the system modules can be implemented within the same main control unit 106, or their functions can be divided according to the capabilities of the hardware platform. For example, in an energy meter with a powerful metering chip 105, the calculation of cycle-level electrical parameters and the extraction of some harmonic indicators can be completed by the metering chip 105, while the main control unit 106 mainly performs state judgment, template management, and weight release. In a low-cost energy meter, the metering chip 105 may only provide the effective value of the current, power factor, and active power, and the main control unit 106 can use the peak-to-average power ratio, cycle differential energy, or power factor recovery trend as waveform distortion characteristics. The different implementation methods described above do not affect the functional correspondence between the modules in this embodiment.

[0122] Through this embodiment, the system can link the sampling link, range status, load change characteristics, calibration parameter table, and template management mechanism. This enables the energy meter to not only execute the call to the parameters corresponding to the current range when a wide range switch occurs, but also determine whether the sample after the range switch is suitable for participating in the calibration parameter update. Corresponding to the steps in the method embodiment, this system can collaboratively achieve range boundary ghosting window recognition, calibration update freezing within the ghosting window, and weight release after the ghosting window through end-side module collaboration.

[0123] Example 5

[0124] This embodiment combines Figure 5 and Figure 6 This paper describes the specific application scenarios of the present invention in field IoT energy meters. This embodiment uses a single-phase 220V, 5(60)A IoT energy meter as an example to illustrate its processing flow and optimized processing effect in a mixed load environment of residential and small-scale industrial and commercial enterprises. This application scenario is only used to illustrate the implementation of the present invention; the actual product can be adjusted according to the energy meter type, user load characteristics, and communication method.

[0125] like Figure 5 As shown, the IoT power meter 100 is installed in the user-side power supply line. The user-side load 110 may include a light-load standby load 601, a high-power load 602, a switching power supply type load 603, a motor type load 604, and a charging device load 605. The light-load standby load 601 can be a router, standby power supply, low-power lighting equipment, or other long-term low-power devices; the high-power load 602 can be an electric water heater, electromagnetic heating equipment, or air conditioner electric auxiliary heating equipment; the switching power supply type load 603 can be multiple adapters, LED driver power supplies, or office equipment power supplies; the motor load 604 can be an air conditioner compressor, water pump, or fan; and the charging device load 605 can be an electric bicycle charger, a home charging device, or other charging loads with start-stop control processes. The connection and disconnection of the above loads may cause the current to switch rapidly between light-load, medium-load, and high-load levels.

[0126] The technical requirements of this embodiment include: the energy meter should maintain continuous energy accumulation during rapid load start-up and shutdown; after range switching, the energy meter should avoid using samples that are clearly in the process of sampling link recovery for calibration coefficient updates; the energy meter should be able to complete ghosting window recognition and weight release at the end side without relying on the real-time participation of the master station; the energy meter should be able to record range boundary events and upload event summaries to the master station or cloud platform 109 when communication conditions permit; the energy meter should support adjusting the ghosting trigger threshold and ghosting fading template through remote parameter distribution.

[0127] In terms of hardware selection, the voltage sampling unit 101 in this embodiment uses a resistor divider network and an anti-aliasing filter circuit, while the current sampling unit 102 uses a shunt or a current transformer. The sampling gain switching unit 103 uses a programmable gain amplifier that supports multiple gain levels, or a configurable gain channel within the metering chip. The analog-to-digital conversion unit 104 uses a high-resolution analog-to-digital converter built into the metering chip 105, which can output the effective value of the current, active power, power factor, and total harmonic distortion. The main control unit 106 can use a low-power microcontroller to perform ghosting window recognition and calibration update control. The memory 107 includes a non-volatile storage area for storing the calibration parameter table 301, a template area for storing the ghosting fading template library 302, a log area for storing the event log 303, and a template rollback area 304 for storing the previous version template. The communication unit 108 can be one of HPLC, RS485, NB-IoT, LoRa or 4G Cat.1, and the specific communication method does not affect the end-side processing logic of the present invention.

[0128] In terms of parameter settings, this embodiment divides the current range into four ranges: R0, R1, R2, and R3. R0 is the low-load range, ranging from 0.02A to 0.25A; R1 is the light-load range, ranging from 0.25A to 1A; R2 is the medium-load range, ranging from 1A to 10A; and R3 is the high-load range, ranging from 10A to 60A. The sampling frequency is set to 6.4kHz, corresponding to 128 sampling points per cycle in a 50Hz power grid. In the current step judgment, the current change threshold is set to 0.5A, and the normalized current change ratio threshold is set to 30%. The power factor change threshold is set to 0.08. In the harmonic envelope attenuation judgment, if the metering chip 105 outputs the total harmonic distortion rate, then the total harmonic distortion rate is used as the waveform distortion characterization quantity; if the metering chip 105 outputs the amplitudes of the second, third, and fifth harmonics, then 0.3×H2 + 0.4×H3 + 0.3×H5 is used as the harmonic envelope value. The cumulative decrease ratio threshold of the harmonic envelope is set to 15%. In the stability judgment, the current effective value fluctuation threshold is set to 2%, the power factor fluctuation threshold is set to 0.03, and the waveform distortion characterization quantity fluctuation threshold is set to 5%.

[0129] In this embodiment, the memory 107 pre-configures several ghosting fading templates. For uplink high ghosting risk events when switching from R1 to R3, the default ghosting window length is set to 4 cycles, the maximum ghosting window length is set to 8 cycles, and the weight sequence is set to 0, 0, 0, 0, 0.25, 0.50, 0.75, and 1.00. For downlink high ghosting risk events when switching from R3 to R1, the default ghosting window length is set to 6 cycles, the maximum ghosting window length is set to 10 cycles, and the weight sequence is set to 0, 0, 0, 0, 0, 0.20, 0.40, 0.70, and 1.00. For mild ghosting risk events in adjacent ranges, the default ghosting window length is set to 1 to 2 cycles, and the weight release sequence can be set to 0, 0.50, and 1.00. The above template parameters can be preset at the factory based on the sampling link test results of the same model of energy meter, or they can be adjusted by the main station or cloud platform 109 based on the event statistics results after on-site operation.

[0130] The control optimization process of this embodiment is described below. For example... Figure 5 As shown, when the electricity meter 100 is running in a light-load standby state, the user-side load 110 is mainly a light-load standby load 601, with an effective current value of approximately 0.42A and a current range of R1. At this time, the sampling gain switching unit 103 is in a higher gain setting, and the calibration parameter management module 208 calls the calibration parameter table corresponding to the R1 range. The main control unit 106 detects that the effective current value fluctuation is less than 2%, the power factor fluctuation is less than 0.03, and the waveform distortion characteristic quantity fluctuation is less than 5% in multiple consecutive cycles. Therefore, these cycle samples are marked as stable calibration samples and allowed to participate normally in the R1 range calibration coefficient update.

[0131] When a user connects a high-power load 602, the effective current value increases from 0.42A to 12.60A within one cycle, the current range switches from R1 to R3, and the sampling gain level switches from a higher gain level to a lower gain level. After detecting the range switch, the main control unit 106 calculates the current change, the normalized current change ratio, the power factor abrupt change, and the harmonic envelope change trend. If the detected current change is 12.18A, the normalized current change ratio is greater than 30%, the power factor changes from 0.980 to 0.910, and the waveform distortion characteristics decrease from 0.180 to 0.145, 0.118, and 0.096 in subsequent cycles, then the main control unit 106 determines this event as a high-risk event for uplink ghosting across R1 to R3. The ghost window identification module 204 determines the range boundary ghost windows of 4 cycles, and the calibration update freeze module 205 marks the 4 cycles as ghost freeze samples and prohibits them from participating in the R3 range calibration parameter update.

[0132] Within the afterimage window, the energy meter 100 continues to accumulate energy normally using the currently valid calibration parameters for the R3 range and displays the current voltage, current, and power information to the user. Afterimage-frozen samples do not enter the R3 range calibration sample queue, or their calibration update weight is set to 0. After the afterimage window ends, the template management module 206 calls the R1 to R3 uplink span template, and the weight release module 207 assigns update weights of 0.25, 0.50, 0.75, and 1.00 to subsequent cycles sequentially. During the weight release phase, if the conventional online calibration algorithm calculates a candidate correction value for the R3 current gain for a certain cycle, the calibration parameter management module 208 multiplies this candidate correction value by the update weight of the current cycle before entering the temporary parameter update process. If multiple consecutive cycles meet the stability condition, the R3 range calibration parameters resume normal updating.

[0133] When the high-power load 602 is disconnected, the effective current value drops rapidly from approximately 18A to 0.55A, and the current range switches from R3 to R1. Since this process involves a fallback from a high load to a light load, the previous high current state has a relatively large impact on the light load sampling results. After detecting a current step, power factor change, and waveform distortion attenuation, the main control unit 106 identifies this as a high-risk event for residual images during the downlink span from R3 to R1. The residual image window identification module 204 calls the downlink span template to determine the range boundary residual image window for 6 cycles, and after the residual image window ends, it uses a weighted release sequence of 0.20, 0.40, 0.70, and 1.00. Through this processing, the calibration parameters for the R1 light load range are not immediately updated during the sampling link recovery phase immediately after the high load is disconnected.

[0134] If a motor-type load 604 repeatedly starts and stops on-site, such as an air conditioner compressor failing to start and causing the current to fluctuate briefly between R1 and R3, the weight release module 207 will receive a switching notification from the range status monitoring module 202 again before completing the current release process. At this point, the system terminates the current release process and reprocesses the new range switch as a new range boundary event. Before continuous stabilization, the calibration parameter management module 208 will not use any affected cycles for calibration parameter fixing. The event logging module 209 marks this event as a reciprocating switching event and saves the number of switches, duration, and anomaly flag. This process avoids multiple overlapping transition phases alternatingly affecting the calibration parameter tables for different ranges.

[0135] If the electricity meter 100 used on-site does not have a designated harmonic register, the main control unit 106 can use alternative waveform distortion characteristics to complete the afterimage recognition. For example, when the metering chip 105 can provide the peak current and the effective current value, the peak-to-average power ratio (PAPR) of the current waveform can be calculated, and the afterimage attenuation can be judged based on the decreasing trend of the PAPR after range switching. When the main control unit 106 can read the current sampling sequence of adjacent cycles, the cycle differential energy can be calculated, and whether the waveform has recovered to stability can be judged based on whether the differential energy gradually decreases. In this way, low-cost IoT electricity meters can also implement the afterimage window recognition and calibration update control of this invention.

[0136] Figure 6 This is used to illustrate the effect comparison of this embodiment. Figure 6 In (a), the current RMS value change curve 701 represents the current change when the load rapidly changes from a light load state to a heavy load state. The sloping filled area after the range switching point 702 represents the range boundary ghost window 703. This ghost window does not indicate an interruption in power metering, but rather that the frequency sample in this segment does not participate in the calibration coefficient update. Figure 6 The harmonic envelope attenuation curve 704 in (b) indicates that the waveform distortion characterization quantity gradually decreases from a higher state to a stable state after the range switching, which is used to illustrate that the afterimage effect has the process characteristic of fading with the cycle. Figure 6 (c) Compare the three calibration update weight control methods. In the comparison scheme 705, the full weight is updated immediately after the range switching. In the fixed freeze scheme 706, the full weight is restored immediately after the fixed freeze period. In the present application scheme 707, the zero weight is maintained within the afterimage window and the weight is increased to full weight cycle by cycle according to the afterimage fading template after the afterimage window ends. Figure 6 (d) shows the candidate offset curve 708, which represents the schematic trend of candidate calibration parameter offset under different weight control methods. The peak value and recovery oscillation amplitude of the curve corresponding to the scheme of this application are smaller than those of the processing methods of immediate full weight update and sudden recovery after fixed freeze. Figure 6 The curves shown are used to represent the technical interaction relationship and do not limit the specific current value, harmonic envelope value or calibration parameter offset.

[0137] In a set of engineering configuration examples, for an uplink range transition event from R1 to R3, if updates are made immediately without freezing, the first few cycles after the range switch may all enter the R3 range calibration sample queue, resulting in a large offset of calibration parameter candidates. When using a fixed freeze of 4 cycles, the first 4 cycles do not participate in calibration updates, but the 5th cycle immediately participates in the update with full weight. If this cycle is still in a recovery edge state, it may still cause some parameter offset. Using the processing method of this embodiment, the first 4 cycles do not participate in calibration updates, the 5th to 7th cycles gradually participate in updates with weights of 0.25, 0.50, and 0.75 respectively, and the 8th cycle and thereafter are updated with full weight after the stability condition is met. Therefore, the impact of transitional samples on calibration parameters is limited in stages.

[0138] In another engineering configuration example, for the downlink crossover event when R3 switches to R1, without freezing, the light load calibration parameters are more susceptible to the residual effects of the previous high current state. When using the downlink crossover template in this embodiment, the system first freezes for 6 cycles, then uses a weighted release sequence of 0.20, 0.40, 0.70, and 1.00 to gradually restore and update the light load calibration parameters after the sampling link stabilizes. Because the light load signal amplitude is relatively small, this more conservative release method is better suited to scenarios where heavy loads fall back to light loads.

[0139] This embodiment can also coordinate with the main station or cloud platform 109 via the communication unit 108. After completing a range boundary event processing, the electricity meter 100 can upload an event summary. The event summary includes the electricity meter identifier, hardware version, software version, event occurrence time, current range before and after the switch, afterimage risk level, actual afterimage window length, template version used, weight release sequence, number of recovery stable cycles, and anomaly marker. The main station or cloud platform 109 can perform statistics on events from multiple electricity meters of the same model or hardware version. If it is found that a batch of electricity meters generally requires a longer recovery time in the R3 to R1 down-range cross-range event, a new down-range cross-range afterimage fading template can be issued. After receiving the new template, the electricity meter 100 verifies it and makes the new template effective when it is not currently in the afterimage window, not in the weight release stage, and has not had its calibration parameters fixed.

[0140] This embodiment enables range boundary ghosting window recognition, calibration update freezing, ghosting fading template invocation, and weight release control in mixed load environments. This process utilizes the existing sampling link, metering chip, main control unit, memory, and communication unit of the energy meter, requiring no additional external standard source or interruption of the energy accumulation channel. For IoT energy meter operating scenarios with frequent load changes and significant wide range switching, this implementation can maintain normal metering while managing the status of calibration parameter update samples.

[0141] Compared with the prior art, the present invention can identify whether short-term transition samples are suitable for participating in calibration coefficient updates after current range switching. By identifying the range boundary afterimage window, the transition samples are distinguished from the stable calibration samples, so that the calibration update process no longer depends solely on the current current range number or the current effective value, thereby reducing the possibility that the current range calibration parameters are biased by the residual state of the previous range.

[0142] Secondly, in the technical solution adopted in this invention, the image-frozen samples are not discarded entirely, but continue to be used for energy accumulation, electrical parameter display, load mutation event recording, and template generation, only limiting their participation in calibration coefficient updates. This processing method avoids the impact of simply discarding data on continuous metering and also prevents transitional samples from entering the calibration sample queue and causing parameter contamination. For IoT energy meters, this method is easy to implement through software logic on the existing metering framework without requiring changes to the basic metering link.

[0143] Finally, this invention can distinguish between slight switching between adjacent ranges, upward cross-range switching from low current to high current, downward cross-range switching from high current to low current, and repeated start-stop scenarios. For events with low ghosting risk, the freeze time can be shortened; for events with high ghosting risk, the ghosting window can be extended or the initial release weight can be reduced. By gradually releasing rather than immediately restoring all weights, the possibility of secondary parameter contamination caused by samples at the edge of the ghosting window can be reduced.

[0144] This invention also facilitates edge deployment and batch maintenance in IoT energy meters. The method is primarily based on cycle-level electrical parameters, threshold judgment, template invocation, and weight control, without relying on complex neural networks or requiring external standard sources or additional high-cost sensors. The ghosting fading template can be stored locally on the energy meter or statistically optimized and remotely distributed via a main station or cloud platform. Through the collaborative management of event logs, template versions, and calibration parameter table versions, similar hardware platforms can gradually optimize ghosting window recognition and weight release strategies over long-term operation.

[0145] Furthermore, in the aforementioned embodiments, a single-phase 220V, 5(60)A IoT energy meter is mainly used as an example to illustrate the load self-sensing wide-range error calibration method and system. It should be understood that the aforementioned voltage specifications, current specifications, range division, sampling frequency, number of cycles, threshold conditions, and weight sequences are all feasible configurations for ease of explanation and are not intended to limit the scope of this invention. This invention can be adjusted according to different energy meter product forms, sampling link structures, metering chip capabilities, and field load characteristics.

[0146] In one optional implementation, the present invention can be applied to three-phase IoT energy meters. For three-phase four-wire or three-phase three-wire energy meters, cycle-level sampling data acquisition, current current range status judgment, load change feature extraction, range boundary ghosting window identification, calibration update freezing, and weight release can be performed on phases A, B, and C respectively. Each phase can have an independent current range, sampling gain level, calibration parameter table, and ghosting fading template. When only one phase experiences range switching and meets the ghosting triggering condition, only the calibration coefficient update of the corresponding current range can be frozen, while other phases that have not experienced range boundary ghosting events can still maintain calibration parameters according to normal logic. When the three phases simultaneously experience range switching in the same direction within a preset cycle range, this event can be identified as a three-phase linked range boundary event, and the higher ghosting risk level among the three phases can be used as the control basis for the total active power gain calibration update. In this method, the current gain coefficient of each phase can be released independently for calibration update weights, while the calibration coefficients involving total active power or three-phase combined power can be restored and updated after all three phases meet the stability conditions.

[0147] In another alternative embodiment, the present invention can be adapted to different current sampling devices. The current sampling unit can employ a shunt, current transformer, Hall sensor, Rogowski coil, or other sampling devices capable of outputting current characterization signals. When using a shunt, the sampling link may focus more on thermal drift and front-end amplifier recovery during high current switching; when using a current transformer, core transients, low-current linearity, and phase compensation changes can be further considered; when using a Hall sensor, bias drift and sensor response time can be considered; when using a Rogowski coil, integration and high-frequency transient responses can be considered. Regardless of the current sampling device used, as long as the energy meter can obtain the cycle-level current RMS value, power factor, and at least one waveform distortion characterization quantity, the range boundary ghosting window can be identified according to the method described in the present invention, and the calibration coefficient update can be frozen and weighted out.

[0148] In another alternative embodiment, the present invention can be adapted to different range division methods. In the aforementioned embodiment, the current range is divided into four ranges: R0, R1, R2, and R3. In other products, three, five, or more ranges can be set according to the base current, reference current, maximum current, accuracy class, and dynamic range of the sampling front end. Each range can be divided according to a fixed current range or according to a proportion of the maximum current. For example, the micro-load range can be set to a current range below 0.02Imax, the light load range can be set to 0.02Imax to 0.1Imax, the medium load range can be set to 0.1Imax to 0.5Imax, and the heavy load range can be set to 0.5Imax to Imax. Hysteresis intervals can be set between different ranges to reduce boundary jitter. For energy meters with a large number of ranges, the image fading template can be categorized according to adjacent range switching, cross-range switching, and cross-range switching, without needing to set a separate template for each pair of range combinations.

[0149] In one alternative implementation, the present invention can be adapted to low-cost energy meters that do not have harmonic registers. If the metering chip cannot directly output the second, third, fifth, or total harmonic distortion rate, alternative waveform distortion metrics can be used. These alternative waveform distortion metrics can be the peak-to-average power ratio (PAPR) of the current waveform, half-cycle asymmetry, cycle differential energy, the number of current spikes near zero crossings, or the power factor recovery slope. The PAPR can be determined based on the ratio of the peak current value to the effective current value of the current in the current cycle, and is suitable for identifying switching power supply loads and peak current changes. The half-cycle asymmetry can be determined based on the difference between the positive and negative half-cycle current areas, and is suitable for identifying half-wave rectified or biased loads. The cycle differential energy can be determined based on the difference in the current sampling sequences of two adjacent cycles, and is suitable for identifying whether the waveform is still in the recovery process. The power factor recovery slope can be determined based on the speed at which the power factor approaches a stable value in consecutive cycles after range switching, and is suitable for energy meters with weak hardware data capabilities. The above alternative methods enable the present invention to be implemented in products with different hardware costs and different metering chip capabilities.

[0150] In another alternative implementation, the present invention can be applied to 50Hz and 60Hz power grids. For a 50Hz power grid, the duration of one power grid cycle is 20ms; for a 60Hz power grid, the duration of one power grid cycle is approximately 16.67ms. The system can determine the cycle boundary through zero-crossing detection, phase-locked loop, or the frequency register of the metering chip, and determine the number of sampling points corresponding to each cycle based on the actual frequency. If the sampling frequency is fixed but the power grid frequency deviates, the main control unit can uniformly calculate the current step slope, power factor abrupt change, and waveform distortion characterization based on the actual cycle length. When the power grid frequency deviates significantly from the rated range, the system can pause template updates and calibration parameter fixation, retaining only normal metering and event records to avoid frequency anomalies affecting the afterimage window recognition results.

[0151] In one optional implementation, the ghosting trigger condition can be implemented using a rule-based threshold method or with the assistance of a lightweight model. The rule-based threshold method can directly determine the trigger based on the current step slope, normalized current change ratio, power factor abrupt change, harmonic envelope cumulative decrease ratio, and sampling gain level change. It is characterized by its simplicity, strong interpretability, and suitability for low-cost end-side deployment. The lightweight model can be a decision tree, logistic regression, or a small rule table model. Its input features can include the current range before switching, the current range after switching, the switching direction, the current step slope, the power factor abrupt change, the harmonic envelope attenuation ratio, the sampling gain level change, and the number of recovery cycles for similar historical events. Its output can be the ghosting risk level, the default ghosting window length, or the weight release sequence number. This lightweight model can be generated based on prototype test data during the factory delivery stage, or it can be generated and distributed by the main station or cloud platform based on event statistics of the same model of energy meter. Even when using a lightweight model, this invention still retains rules such as threshold limiting, maximum ghosting window length, template backoff, and stability determination to avoid model output causing calibration update out of control.

[0152] In another optional implementation, the afterimage fading template may include multi-level storage and a multi-level activation mechanism. A fixed template can be stored in non-volatile memory at the time of meter manufacture. This fixed template ensures that afterimage window management can still be performed when the meter is running for the first time, during communication outages, or when the operating template is damaged. During meter operation, a restricted updated template can be stored in the operating template area. This operating template takes precedence over the fixed template. For range boundary events that do not match a fixed template or operating template, a temporary template can be generated in the volatile storage area. This temporary template is only used for the current event and is not immediately fixed. Before updating the template, the previous version template can be saved to the template rollback area, and a version number and verification information can be set for the new template. If, after the template update, the number of stability judgment failures increases after the afterimage window ends, the afterimage window is frequently retried during the weight release phase, or the candidate offset of calibration parameters increases abnormally, the current template can be rolled back to the previous version template.

[0153] In one optional implementation, the present invention can collaboratively manage range boundary ghosting events with a master station or cloud platform. Real-time ghosting window identification, freezing, and weight release are completed at the meter end, without relying on real-time master station participation. After the event ends, the meter can upload an event summary via the communication unit. The event summary may include meter identifier, hardware version, software version, template version, current range before switching, current range after switching, switching direction, ghosting risk level, actual ghosting window length, weight release sequence, number of cycles to restore stability, calibration parameter table version, and anomaly flag. The master station or cloud platform can statistically analyze range boundary events of the same model, hardware version, or batch of meters and generate template parameter optimization results. After receiving the template from the master station or cloud platform, the meter can perform legality verification, version verification, and verification value verification, and activate the new template when it is not currently in a ghosting window, not in the weight release phase, and not in the calibration parameter solidification process.

[0154] In another alternative implementation, the present invention can be used in conjunction with a remote operational error calibration mechanism. When the master station or cloud platform performs remote operational error analysis, the energy meter can mark samples within the range boundary ghosting window as unsuitable for calibration coefficient updates, and can also mark samples in the weight release phase as low-weight samples. When constructing the error estimation sample set, the master station or cloud platform can exclude ghosting frozen samples, or weight the samples according to the calibration update weights uploaded by the energy meter. Through this cooperative approach, remote operational error calibration does not need to identify the short-term recovery process within the sampling link, but directly utilizes the sample status identifier generated at the energy meter end, thereby avoiding the use of short-term transition data after range switching for long-term error estimation.

[0155] In one alternative embodiment, the present invention can be used for dynamic testing during the production calibration or type testing phase. Traditional calibration processes typically involve calibrating gain, phase, and offset parameters under stable standard source conditions. If it is necessary to test the dynamic calibration protection capability of the energy meter during wide range switching, test sequences such as light load to heavy load, heavy load to light load, adjacent range switching, cross-range switching, and repeated start-stop can be constructed on the standard source or test bench. During the test, the energy meter records range boundary events, ghosting window length, and weight release sequence. The test equipment can compare whether samples within the ghosting window are prohibited from participating in calibration parameter updates. This method can be used for generating factory-preset templates or for verifying the recovery time differences of sampling links in different hardware versions.

[0156] In another alternative implementation, the present invention can provide protection against abnormal states. When a voltage drop, overvoltage, frequency anomaly, metering chip reset, communication parameter update, main control unit restart, or power failure occurs during a range boundary event, the system can mark the current event as an abnormal event. The afterimage frozen samples in the abnormal event can still be retained in the event log, but will not be used for template restricted updates or calibration parameter solidification. If the anomaly occurs within the afterimage window, the system will not continue to use the afterimage window state before the interruption to update calibration parameters after resuming operation; instead, it will reacquire continuous and stable samples before resuming calibration updates. If the anomaly occurs during template writing, the system can restore the previous version of the template through the template rollback area or call the safe default template.

[0157] In one optional implementation, the present invention can specifically handle loads that are repeatedly started and stopped. When the energy meter is in the range boundary ghosting window or weight release phase, if a new current range switch is detected again, and the new switch meets the ghosting trigger condition, the system terminates the current ghosting window or the current weight release process, and redefines the range boundary ghosting window starting from the new range switch event. If multiple back-and-forth switches occur within a preset time, the event can be marked as a back-and-forth switch event, and the solidification of calibration parameters during the back-and-forth switch is prohibited. After the current range remains stable over several consecutive cycles, and the current RMS value, power factor, and waveform distortion characteristics all meet the stability threshold, the system resumes weight release according to the corresponding ghosting fading template. This method can be applied to scenarios such as motor start failure, compressor repeated start-stop, charging equipment handshake failure, or intermittent access of switching power supply groups.

[0158] In one optional implementation, the calibration parameter management module can employ a tiered writing mechanism. During cycle-level processing, the energy meter does not need to write calibration parameters to non-volatile memory for every cycle. Instead, it first maintains candidate calibration parameters in the volatile memory area. When the cumulative number of stable calibration samples reaches a preset number, the change in candidate calibration parameters exceeds the minimum effective change threshold, the current state is not in the ghosting window or weight release phase, and the voltage, frequency, and communication status are all normal, the candidate calibration parameters are then fixed to the non-volatile memory. If the current sample is a ghosting frozen sample, the candidate correction amount is not included in the candidate calibration parameters. If the current sample is a weight release sample, the candidate correction amount is multiplied by the current calibration update weight and then included in the candidate parameter update. If the current sample is a stable calibration sample, the candidate correction amount is included in the candidate parameter update with full weight. This method reduces the number of writes to the non-volatile memory and avoids parameter fixing during ghosting events.

[0159] In another alternative implementation, the present invention can employ different freezing strategies for different calibration coefficients. For the current gain coefficient and active power gain coefficient, the range switching ghosting usually has a more direct impact, so it can be completely frozen within the ghosting window. For the phase compensation coefficient, whether to freeze it can be determined based on the power factor abrupt change and harmonic envelope attenuation characteristics; if the power factor change is small and there is no obvious phase disturbance, the update weight of the phase compensation coefficient can be reduced without complete freezing. For the voltage gain coefficient, if only the current sampling channel experiences range switching and the voltage channel is stable, the voltage gain coefficient can be left unfrozen; if the voltage channel also experiences range switching or there is a recovery process in the voltage sampling link, the voltage gain coefficient can be frozen simultaneously. For the zero-point offset coefficient, a more conservative freezing strategy can be adopted under low current range to avoid the residual state affecting the low current zero-point estimation when the load falls back to a light load.

[0160] In one alternative implementation, the afterimage risk level can be further differentiated by combining load form labels. Load form labels do not necessarily identify specific appliance types, but rather describe the impact characteristics of current load abrupt changes on the recovery of the sampling link. If the power factor is close to 1 and the waveform distortion characteristic is low, the load form can be labeled as an approximately resistive load; if the power factor changes significantly, it can be labeled as a phase disturbance type load; if the waveform distortion characteristic is high and shows significant attenuation after range switching, it can be labeled as a harmonic attenuation type load; if the current step amplitude is large and there are repeated starts and stops in a short period of time, it can be labeled as an impulse start-stop type load. The afterimage fading template can select different default afterimage window lengths and weighted release sequences based on the load form labels. This processing can improve the targeting of afterimage window mitigation without complex load identification.

[0161] The above-mentioned optional implementation methods can be implemented individually or in combination. As long as the electricity meter determines the range boundary after switching current range based on the load self-sensing characteristics, restricts the corresponding cycle sample from participating in the calibration coefficient update within the afterimage window, and releases the calibration update weight according to the afterimage fading template after the afterimage window ends, it belongs to the implementable variation of the technical solution of the present invention.

[0162] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for calibrating a wide-range self-sensing error in an IoT energy meter, characterized in that, include: Acquire cycle-level sampling data and current current range status of the energy meter; extract current step slope, power factor abrupt change, and harmonic envelope attenuation characteristics based on the cycle-level sampling data; when a current range switch is detected and at least one of the aforementioned characteristics satisfies the afterimage triggering condition, determine the range boundary afterimage window; the afterimage triggering condition is at least one of the following conditions: current step slope is greater than a preset threshold, power factor abrupt change is greater than a power factor abrupt change threshold, waveform distortion characterization shows a continuous decreasing trend after the range switch, or the cumulative decrease ratio of the waveform distortion characterization is greater than a preset decrease ratio threshold; the range boundary afterimage window refers to the time window after the current range switch where the cycle sample is unsuitable for participating in the calibration coefficient update due to sampling front-end gain switching, holding capacitor release, analog filter link recovery, or residual historical state of digital filter; freeze the update of the calibration coefficient by the corresponding cycle sample within the range boundary afterimage window; the afterimage window is defined as the time window within the range boundary afterimage window. After the shadow window ends, according to the calibration update weight sequence output by the shadow fading template, calibration update weights are assigned to subsequent cycle samples one cycle at a time. The calibration update weight of the weight release sample is greater than 0 and less than 1. The candidate correction amount of the calibration coefficient obtained by the conventional calibration algorithm is multiplied by the calibration update weight corresponding to the current cycle sample as the actual correction amount participating in the update. After the stability condition is met, the calibration update weight is restored to 1, and the full weight update of the calibration coefficient of the corresponding current range is restored. The shadow fading template is a control template used to describe the gradual fading of the shadow effect at the range boundary with the cycle. It includes at least the default shadow window length, the maximum shadow window length, the calibration update weight sequence, and the stability judgment rule. The stability condition is that the fluctuation of the effective value of the current is less than the first stability threshold, the fluctuation of the power factor is less than the second stability threshold, and the fluctuation of the waveform distortion characterization is less than the third stability threshold in a consecutive preset number of cycles, and the current current range and sampling gain level remain unchanged.

2. The load self-sensing wide-range error calibration method for IoT energy meters according to claim 1, characterized in that, The cycle-level sampling data includes cycle-level voltage sampling data and cycle-level current sampling data. The current current range status includes at least one of the current current range, sampling gain level, and calibration parameter table index. The method calculates the current RMS value, power factor, and waveform distortion characterization of the current cycle based on the cycle-level voltage sampling data and the cycle-level current sampling data, and uses the current RMS value to determine the current range to which the current cycle belongs.

3. The load self-sensing wide-range error calibration method for IoT energy meters according to claim 2, characterized in that, The current step slope is determined based on the change between the current effective value of the current cycle and the current effective value of the previous cycle. The method uses the ratio of the change to the duration of one cycle as the current step slope and the ratio of the change to the larger of the current effective value of the previous cycle and the minimum reference current as the normalized current change ratio. When the change is greater than a first current threshold and the normalized current change ratio is greater than a first ratio threshold, a current step candidate feature is determined to exist.

4. The load self-sensing wide-range error calibration method for IoT energy meters according to claim 2, characterized in that, The power factor mutation amount is determined based on the difference between the current cycle power factor and the previous cycle power factor, or based on the difference between the moving average power factor of multiple consecutive cycles. When the power factor mutation amount is greater than the power factor mutation threshold, it is determined that there is a phase relationship disturbance or a load mode mutation, and the power factor mutation amount and the current step slope are used together to distinguish between ordinary current amplitude changes and cross-range load mutations with residual risk.

5. The load self-sensing wide-range error calibration method for IoT energy meters according to claim 2, characterized in that, The harmonic envelope attenuation characteristic is determined based on the changing trend of waveform distortion characterization quantities in consecutive cycles after range switching; the waveform distortion characterization quantities include at least one of the second harmonic amplitude, third harmonic amplitude, fifth harmonic amplitude, total harmonic distortion rate, peak-to-average power ratio of current waveform, half-cycle asymmetry, and cycle differential energy; when the waveform distortion characterization quantity shows a decreasing trend in consecutive cycles after range switching, or the cumulative decrease ratio is greater than a preset decrease ratio threshold, it is determined that a harmonic envelope attenuation characteristic exists.

6. The load self-sensing wide-range error calibration method for IoT energy meters according to claim 1, characterized in that, Determining the range boundary ghosting window includes: determining the switching direction based on the current range before and after the switching, wherein the switching direction includes an upward switching from a low current range to a high current range, a downward switching from a high current range to a low current range, an adjacent current range switching, and a cross-range current range switching; determining the ghosting risk level based on at least two of the following: current step slope, power factor abrupt change, harmonic envelope attenuation characteristics, and sampling gain level change; and determining the basic ghosting window length based on the switching direction and the ghosting risk level.

7. The load self-sensing wide-range error calibration method for IoT energy meters according to claim 6, characterized in that, After determining the basic afterimage window length, continue to detect the fluctuations in the effective current value, power factor, and waveform distortion characteristics of the continuous cycle; when at least one of the fluctuations in the effective current value, power factor, and waveform distortion characteristics fails to meet the stability threshold, extend the range boundary afterimage window within the maximum afterimage window length range; When a preset number of cycles all meet the stability threshold, the range boundary ghosting window is terminated early.

8. The load self-sensing wide-range error calibration method for IoT energy meters according to claim 1, characterized in that, Freezing the update of the calibration coefficients for the corresponding cycle sample within the range boundary afterimage window includes: allowing the corresponding cycle sample to continue participating in energy accumulation, electrical parameter display, load change event recording, and afterimage fading template generation, and prohibiting the corresponding cycle sample from entering the calibration sample queue, or setting the calibration update weight of the corresponding cycle sample in the calibration sample queue to zero; the calibration coefficients include at least one of current gain coefficient, active power gain coefficient, phase compensation coefficient, and zero-point offset coefficient.

9. The load self-sensing wide-range error calibration method for IoT energy meters according to claim 1, characterized in that, The afterimage fading template is generated or called based on the pre-boundary stable sample and the post-boundary stable sample. The pre-boundary stable sample is a cycle sample in which the fluctuation of the effective value of current, the fluctuation of the power factor, and the fluctuation of the waveform distortion characterization quantity are all less than the corresponding stable threshold within a continuous number of cycles before the range switching. The post-boundary stable sample is a cycle sample in which the fluctuation of the effective value of current, the fluctuation of the power factor, and the fluctuation of the waveform distortion characterization quantity are all less than the corresponding stable threshold within a continuous number of cycles after the range boundary afterimage window ends.

10. A load self-sensing wide-range error calibration system for IoT energy meters, characterized in that, The system includes a sampling data acquisition module, a range status monitoring module, a feature extraction module, a ghosting window recognition module, a calibration update and freeze module, a template management module, a weight release module, and a calibration parameter management module. The sampling data acquisition module acquires cycle-level sampling data. The range status monitoring module acquires the current current range status. The feature extraction module extracts current step slope, power factor abrupt change, and harmonic envelope attenuation features. The ghosting window recognition module determines the range boundary ghosting window when a current range switch is detected and at least one of the features satisfies a ghosting trigger condition. The ghosting trigger condition is at least one of the following: current step slope is greater than a preset threshold, power factor abrupt change is greater than a power factor abrupt change threshold, waveform distortion characterization shows a continuous decreasing trend after range switching, or the cumulative decrease ratio of the waveform distortion characterization is greater than a preset decrease ratio threshold. The range boundary ghosting window is... This refers to the time window after current range switching where the sampling front-end gain switching, holding capacitor release, analog filter link recovery, or residual historical state of the digital filter makes the cycle sample unsuitable for participating in calibration coefficient updates. The calibration update freezing module is used to freeze the update of calibration coefficients for the corresponding cycle sample within the range boundary afterimage window. The template management module is used to generate or call afterimage fading templates. The afterimage fading template is a control template used to describe the gradual fading of the influence of the range boundary afterimage with the cycle, and includes at least the default afterimage window length, the maximum afterimage window length, the calibration update weight sequence, and the stability judgment rule. The weight release module is used to assign calibration update weights to subsequent cycle samples one cycle at a time according to the calibration update weight sequence output by the afterimage fading template after the range boundary afterimage window ends. The calibration update weight of the weight release sample is greater than 0 and less than 1, and the calibration update weight is restored to 1 after the stability condition is met. The calibration parameter management module is used to multiply the candidate correction amount of the calibration coefficient obtained by the conventional calibration algorithm by the calibration update weight corresponding to the current cycle sample, as the actual correction amount participating in the update, and restore the full weight update of the calibration coefficient of the corresponding current range after the stability condition is met; the stability condition is that the fluctuation of the effective value of the current is less than the first stability threshold, the fluctuation of the power factor is less than the second stability threshold, the fluctuation of the waveform distortion characterization is less than the third stability threshold, and the current current range and sampling gain level remain unchanged.

Citation Information

Patent Citations

  • Automatic switching metering method suitable for multiple ranges of pressure gauge

    CN120403961A

  • Method and system for optimizing metering front end of intelligent electric meter

    CN121540928A