Electric working condition detection method and system of electric energy metering device, and storage medium

By using a phased self-test timing threshold and automatic triggering mechanism, combined with adaptive periodic adjustment and abnormal alarms, the problem of reliance on manual self-testing of electricity metering devices has been solved, realizing unmanned self-testing of electrical operating conditions throughout the entire cycle, and improving the automation level and management efficiency of electricity metering devices.

CN121995301APending Publication Date: 2026-05-08MOHONG ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
MOHONG ELECTRIC CO LTD
Filing Date
2026-03-26
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

The existing electrical condition self-checks of electricity metering devices rely on manual triggering, which is difficult to implement in a standardized manner in decentralized scenarios, thus affecting the validity and reliability of electricity metering data.

Method used

By adopting a phased self-inspection timing threshold and automatic triggering mechanism, combined with adaptive cycle adjustment and abnormal alarm, the system achieves full-cycle electrical condition self-inspection without human intervention. Furthermore, it enables orderly and synchronous control of multiple metering devices through location zoning and adaptive control of dispersion.

Benefits of technology

It has achieved automation, accuracy, stability and safety of power metering devices, ensured the timeliness and standardization of electrical condition verification, reduced the interference of centralized self-inspection on power grid operation, and facilitated operation and maintenance management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121995301A_ABST
    Figure CN121995301A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electric power system metering and detection, and discloses an electric working condition detection method and system of an electric energy metering device and a storage medium, and the method comprises the steps: presetting a self-inspection timing value, triggering self-inspection through a first set value in a factory detection stage, and generating a self-inspection normal mark when the number of accumulated reset times reaches the standard; after installation is completed, a second set value larger than the first set value is called, and the self-checking period is adjusted in a self-adaptive mode according to the second reset times; and responding to the self-checking signal, triggering a self-checking program through the self-checking action module, resetting the timing value or setting the timing value as an abnormal value according to a result, and giving an alarm prompt when the timing value is abnormal. According to the invention, full-period automation and unmanned intervention self-inspection of the device are realized, the detection efficiency and the monitoring accuracy are considered, the problem that traditional manual self-inspection depends on professional operation and is difficult to execute normatively is solved, and the accuracy and the reliability of electric energy metering operation are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of power system metering and testing, and in particular to a method, system and storage medium for detecting the electrical operating conditions of an energy metering device. Background Technology

[0002] As a core infrastructure device for electricity metering, trade settlement, and grid operation monitoring in power systems, the accuracy and reliability of electricity metering devices directly affect the fairness and impartiality of electricity market transactions and impact the vital interests of power supply companies and electricity users. With the rapid development of new power systems, the application scenarios of electricity metering devices are becoming increasingly widespread, and the stability of their electrical operating conditions directly determines the validity of electricity metering data.

[0003] Currently, the electrical condition self-testing of existing electricity metering devices mainly relies on built-in standard signals. Typically, a standard signal module, such as a reference voltage source, is integrated within the device. This module outputs a standard signal to verify core electrical condition parameters such as the sampling channel and the metering chip's calculation logic. This self-test operation must be manually triggered strictly according to the instructions in the device manual. After manual triggering, the measured signal value collected by the sampling channel is compared with the built-in standard signal value to determine whether the electrical condition of the electricity metering device is normal and whether the metering accuracy meets the requirements.

[0004] However, the effective execution of manually triggered self-test operations relies heavily on passive human intervention, requiring relevant personnel to periodically trigger the hardware simulation module to start the self-test process according to the instruction manual. Because electricity metering devices are used in diverse scenarios, and most users lack the professional knowledge and skills to operate electrical equipment, they are unable to accurately execute the self-test trigger operation. Summary of the Invention

[0005] In order to enable the active self-testing of electricity metering devices, this application provides a method, system and storage medium for detecting the electrical operating conditions of electricity metering devices.

[0006] In a first aspect, this application provides a method for detecting the electrical operating conditions of an electricity metering device, employing the following technical solution: A method for detecting the electrical operating conditions of an electricity metering device includes the following steps: A preset self-test timing value is used for timing during the factory testing of the electricity metering device; if the self-test timing value is greater than the preset first setting value, a self-test signal is triggered. In response to a self-test signal, a preset self-test action module is invoked to perform a self-test action. The self-test action triggers a preset self-test program operation and obtains the self-test result generated by the self-test program operation. If the self-test result is passed, the self-test timer value is reset; otherwise, the self-test timer value is set to an abnormal value. The self-test timer value is not the same as the abnormal value during the timing process. The cumulative number of times the self-test time value is reset is the first reset count. When the first reset count is greater than the preset number, a self-test normal mark is generated. The system acquires the installation mark generated after the electricity metering device is installed at the factory, and calls the second set value in response to the installation mark and the self-test normal mark; if the self-test timing value is greater than the preset second set value, a self-test signal is triggered; wherein, the second set value is greater than the first set value; In response to a self-test signal, the self-test action module is invoked to execute a self-test action. The self-test action triggers the self-test program operation and obtains the self-test result generated by the self-test program operation. If the self-test result is passed, the self-test timer value is reset; otherwise, the self-test timer value is set to an abnormal value. The number of times the cumulative self-test timer value is reset is the second reset count. The second set value is adjusted according to the second reset count. The larger the second reset count, the larger the second set value, and the smaller the second reset count, the smaller the second set value. If the self-test time value is abnormal, a self-test anomaly alarm will be triggered.

[0007] By adopting the above technical solution and setting phased self-test timing thresholds and automatic triggering mechanisms, the entire lifecycle of the electricity metering device, from factory testing to installation and commissioning, is achieved with automated, unmanned electrical condition self-testing. No manual passive operation is required for triggering. Furthermore, the self-testing cycle is adaptively adjusted based on the number of self-test resets, balancing testing efficiency and the accuracy of condition monitoring. It also provides timely alarm prompts for self-testing anomalies. This effectively solves the problems of traditional manual self-testing relying on professional operation and being difficult to implement in a standardized manner due to dispersed scenarios, while ensuring the timeliness and standardization of electrical condition verification for the electricity metering device.

[0008] Optionally, the steps following the self-test anomaly alarm prompt may also include the following sub-steps: Obtain the corresponding inspection instructions for self-test anomaly alarm prompts; According to the inspection instructions, the number of times the self-test program is triggered within the preset detection time is obtained. If the number of triggers is greater than the preset reference number, the self-test time value is reset.

[0009] By adopting the above technical solution, after a self-test anomaly alarm, the reset conditions are determined by combining the inspection command, the preset detection duration, and the number of self-test program triggers, thus realizing a standardized and accurate manual reset of the power metering device after abnormal maintenance.

[0010] Optionally, the method further includes the following steps: Obtain the location data of the electricity metering device, divide the area into multiple setting areas based on the location data, and set the maximum span within each area as a preset distance span; Obtain the self-test timing values ​​of multiple electricity metering devices located within the designated area; The difference between the self-test timing values ​​is calculated as the timing difference. If the timing difference is less than the preset timing reference difference, the energy metering device corresponding to the timing difference is marked as a synchronous timing device. Use the smallest self-test timing value in the synchronization timing device as the synchronization timing value; Obtain the synchronization command from the operating terminal, and in response to the synchronization command, synchronize the self-test timing value of the synchronization timing device to the synchronization timing value.

[0011] By adopting the above technical solution, the self-test timing values ​​of the electricity metering devices in the area are compared, marked and synchronously calibrated by dividing the area into regions using location data. This enables unified and orderly management of the self-test timing of multiple metering devices in the same area, effectively avoiding the problems of chaotic self-test times, clustered triggering or repeated testing of dispersed devices. It reduces the potential interference of centralized self-testing to the power grid operation and facilitates the batch and standardized management of metering devices in the area by operation and maintenance personnel.

[0012] Optionally, the method further includes the following steps: Within the set area, before synchronously setting the self-test timing value, the dispersion value of the self-test timing value in the synchronous timing device is calculated based on a preset discrete value algorithm; The distance span is adjusted based on the dispersion value; the larger the dispersion value, the smaller the distance span, and vice versa.

[0013] By adopting the above technical solution, the discreteness of the self-test timing value of the synchronization timing device is calculated by the discrete value algorithm and the regional distance span is adaptively and dynamically adjusted. The regional division standard can be flexibly optimized according to the actual timing distribution of the equipment in the region, effectively reducing the synchronization control deviation caused by unreasonable fixed distance span settings.

[0014] Optionally, the method further includes the following steps: Within the set area, before synchronously setting the self-test timing value, the dispersion value of the self-test timing value in the synchronous timing device is calculated based on a preset discrete value algorithm; The timing reference difference is adjusted based on the dispersion value. The larger the dispersion value, the smaller the timing reference difference; the smaller the dispersion value, the larger the timing reference difference.

[0015] By adopting the above technical solution, the timing reference difference can be adaptively adjusted according to the dispersion of the self-test timing value of the synchronization timing device. This can dynamically adapt to the timing distribution status of devices in different areas, optimize the synchronization judgment threshold, strictly screen when the dispersion is high, and reasonably relax when the dispersion is low, effectively improving the accuracy and adaptability of the synchronization timing device marking.

[0016] Optionally, the self-test procedure includes the following steps: The built-in signal generation module generates detection voltage and detection current, and the built-in acquisition switching switch connects the output of the signal generation module to the metering sampling channel of the power metering device. The metering unit sequentially samples, performs analog-to-digital conversion, and calculates the power of the signals in the metering sampling channel in real time to obtain the self-detected value. The main control unit compares the self-test values ​​with the preset standard theoretical values ​​and outputs the self-test results; If the self-tested value and the standard theoretical value are within the preset allowable error range, the self-test result is passed, and the electrical conditions of the metering sampling channel, metering unit and main control unit are determined to be normal; otherwise, the self-test result is failed, and the electrical conditions of the metering sampling channel, metering unit and main control unit are determined to be abnormal.

[0017] By adopting the above technical solution, a closed-loop self-testing system is constructed based on the built-in signal generation module and acquisition switching switch of the device. The entire process of the metering sampling channel, metering unit and main control unit can be tested without the need for external standard testing equipment. Through real-time sampling, analog-to-digital conversion, power calculation and accurate error comparison with standard theoretical values, it is possible to objectively and accurately determine whether the electrical condition of the core components is normal.

[0018] Optionally, the method further includes the following steps: The self-test action module is set as an electromagnetic relay module that performs preset actions by executing self-test signals. The electromagnetic relay module is used to power the signal generation module and change the switching state of the switch. When the self-test module starts, it first supplies power to the signal generation module and then controls the switching switch; when the self-test module stops, it first controls the switching switch and then supplies power to the signal generation module.

[0019] By adopting the above technical solution, using an electromagnetic relay module as the self-test action module, and strictly standardizing the sequence of its power supply and control switching for the signal generation module during startup and shutdown, the power supply control and state switching of the self-test circuit can be reliably realized, effectively avoiding signal interference, equipment malfunction or circuit damage caused by timing errors, and ensuring the stability and safety of the self-test process.

[0020] Optionally, the method further includes the following steps: Configure the self-test action module as a pulse generation module that generates a pulse width modulation signal by executing the self-test signal.

[0021] The signal generation module identifies the pulse width and pulse frequency of the pulse width modulation signal, adjusts the voltage value of the detection voltage according to the pulse width, and adjusts the current value of the detection current according to the pulse frequency; the wider the pulse width, the higher the voltage value, and the narrower the pulse width, the lower the voltage value; the higher the pulse frequency, the lower the current value, and the lower the pulse frequency, the higher the current value. The power value calculated by the power metering device when it is in operation is obtained, and the pulse width modulation signal is adjusted according to the power value; wherein, the larger the power value, the wider the pulse width and the lower the pulse frequency; the smaller the power value, the narrower the pulse width and the higher the pulse frequency.

[0022] By adopting the above technical solution, a pulse generation module is used to generate pulse width modulation signals, which enables precise and adjustable control of the detection voltage and current. The pulse parameters are adaptively adjusted according to the actual working power of the power metering device, which can dynamically match the actual operating conditions of the device to generate suitable self-test signals. This not only improves the flexibility and control accuracy of self-test parameter adjustment, but also makes the self-test process more in line with the actual working state of the device.

[0023] Secondly, this application provides an electrical condition detection system for an electricity metering device, which adopts the following technical solution: An electrical condition detection system for an electricity metering device includes a processor, wherein the processor executes the steps of the electrical condition detection method for an electricity metering device as described in any one of the preceding claims.

[0024] Thirdly, this application provides a storage medium, which adopts the following technical solution: A storage medium storing a program, which, when executed by a processor, implements the steps of the electrical condition detection method for the power metering device described in any one of the preceding claims.

[0025] In summary, this application includes at least one of the following beneficial technical effects: by constructing a phased automatic triggering and adaptive periodic adjustment full-cycle intelligent self-testing mechanism, combined with standardized reset logic after abnormal alarms, it completely eliminates the reliance on passive manual intervention. At the same time, relying on location zoning and adaptive control of discreteness, it achieves orderly synchronous control of self-testing timing of multiple metering devices. Furthermore, by adopting a built-in closed-loop self-testing, standardized timing electromagnetic relay control, and a pulse width modulation adaptive detection signal adjustment scheme adapted to actual working conditions, it comprehensively improves the automation level, accuracy, stability, and safety of electrical condition self-testing of power metering devices, effectively ensuring the reliable operation of metering devices and the accuracy and effectiveness of power metering data. Attached Figure Description

[0026] Figure 1 This is a step diagram of an electrical condition detection method for an electricity metering device.

[0027] Figure 2 This is a flowchart illustrating the steps of the self-test procedure. Detailed Implementation

[0028] The embodiments of this application are described in detail below, and examples of the embodiments are shown in the accompanying drawings.

[0029] In the description of this specification, the references to "certain embodiments," "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples" refer to specific features, structures, materials, or characteristics described in connection with the described embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0030] This application discloses an electrical condition detection method for an energy metering device, applicable to the entire lifecycle electrical condition monitoring scenario of energy metering devices in new power systems, from factory testing to on-site installation and commissioning. Through a phased automatic triggering mechanism and adaptive periodic adjustment, it achieves precise and standardized self-testing without human intervention. This method relies on hardware upgrades of the energy metering device, adding a self-testing action module and a high-precision timing module to the traditional device (including metering unit, main control unit, and storage unit). The main control unit uses an STM32L476 series microcontroller, responsible for core functions such as self-testing logic control and timing management. The high-precision timing module adopts an RTC + external crystal oscillator calibration design, with a timing accuracy ≤ ±1 second / day, and supports backup power supply after power failure (endurance ≥ 72 hours). The self-testing action module uses an HH53P electromagnetic relay or a micro DC motor mechanical pressing mechanism, with a response time ≤ 10ms and a contact lifespan... This device supports two self-test methods: mechanical pressing or TTL level triggering. The storage unit is a 16MB Flash module, used to store critical data that is retained even after power loss. The alarm module integrates local audible and visual alarms with 4G / LoRa remote alarms, providing multi-dimensional alerts for self-test anomalies. (Refer to...) Figure 1 The specific steps of this method are as follows: Step 1: Initialization configuration and factory testing phase, timer start After the main control unit is powered on, it automatically initializes the self-test timing value. The initial value is set to 0 seconds, the timing unit is seconds, and the timing accuracy is 0.1 seconds. The high-precision timing module is responsible for accumulating the timing. The timing logic is: it continues to accumulate after power-on and is only interrupted in case of reset or abnormality. Preset first setting value: Based on the high-frequency verification requirements of factory testing, the first setting value is set to 3600 seconds, i.e. 1 hour. It can be flexibly adjusted to 1800 seconds to 7200 seconds through the debugging interface of the main control unit, serving as the time threshold for triggering self-test during the factory testing stage. Preset abnormal value: Set to -1 second or other non-negative timing values ​​that cannot be reached, such as 99999 seconds, to ensure that the self-test timing value will not conflict with the abnormal value during normal accumulation (non-negative increment) and avoid misjudgment of abnormal state; After the electricity metering device enters the factory testing line, the main control unit starts the self-test timing value accumulation and officially enters the self-test cycle of the factory testing stage.

[0031] Step 2: Self-test signal triggering and self-test action execution during factory shipment. The high-precision timing module feeds back the current self-test timing value to the main control unit in real time. The main control unit continuously compares this value with the first set value. When the self-test timing value > the first set value, such as 3600 seconds, a self-test trigger signal is immediately generated, such as a low-level transition signal, which lasts for 50ms. The main control unit responds to the self-test trigger signal and sends a start command to the self-test action module: if it is a mechanical press-type module, the module drives the micro motor to complete one self-test button press, and resets after 200ms of pressing; if it is an electrical signal trigger-type module, the module outputs a 100ms high-level trigger signal to the metering unit. The self-test action directly triggers the self-test program built into the power metering device. After the self-test program is completed, it sends a "pass" or "fail" self-test result back to the main control unit.

[0032] Step 3: Processing of self-inspection results and statistics of reset counts during factory shipment. If the self-test result received by the main control unit is "pass", it immediately sends a reset command to the timing module to clear the self-test timing value to zero, and the timing module restarts the accumulation; at the same time, the main control unit accumulates the first reset count, with an initial value of 0, and increments by 1 after each reset; If the self-test result is "fail", the main control unit will forcibly update the self-test timing value to the preset abnormal value (-1 second), pause the timing accumulation, and trigger the local alarm of the factory test line. This can be indicated by the LED indicator light being constantly on and the buzzer sounding continuously, prompting the test personnel to troubleshoot the fault. After troubleshooting and repair, the testing personnel issue a "fault clearing command" through the debugging interface. The main control unit restores the self-test timer value to 0 seconds, restarts the accumulation, and retains the current accumulated value for the first reset count without resetting.

[0033] Step 4: Generation of normal self-inspection mark during factory shipment Preset number of times: According to the factory stability verification requirements, the number of times is set to 5 times, which can be adjusted to 3 to 10 times. That is, the device can be judged to be stable under factory conditions only after passing the self-test multiple times. The main control unit monitors the first reset count in real time. When the first reset count is greater than the set count (e.g., 5 times), it determines that the electrical condition of the power metering device is continuously stable during the factory testing phase. It immediately generates a self-test normal mark with a data format of "1" and "0" when it fails to meet the standard. The mark is stored in the Flash storage unit as the core basis for switching the self-test strategy after subsequent installation and commissioning. If the number of self-tests during the factory inspection phase is less than the set number after 10 tests, and the first reset count is less than or equal to the set number, the main control unit determines that the device has a potential fault, locks the factory inspection process, pushes a "factory failure" signal to the inspection system, and prohibits the device from leaving the factory.

[0034] Step 5: Switching self-test thresholds and starting timing during installation and commissioning phase After the electricity metering device leaves the factory and is transported to the site, an installation mark is generated after wiring, fixing, debugging and other installation work are completed. There are two ways to generate the mark: ① Manual triggering: The installer presses and holds the "Installation Confirmation" button on the device for 3 seconds. The main control unit detects this operation and generates an installation mark with the data format "1"; ② Automatic judgment: The device detects that the power supply voltage fluctuates by ≤±5% for 10 consecutive minutes and the three-phase current is balanced with an imbalance of ≤10%. It automatically judges that the installation is complete and generates an installation mark. The main control unit monitors the installation flag and self-test normal flag in the storage unit in real time: when both are "1", it automatically switches the self-test control strategy and calls the second set value; The second setting value is initially set to 86,400 seconds, or 24 hours, which is greater than the first setting value. This is to meet the low-frequency self-test requirements after on-site commissioning and avoid frequent self-tests occupying metering resources. At the same time, the main control unit resets the self-test timing value to 0 seconds and starts the cumulative timing during the commissioning phase.

[0035] Step 6: Self-test execution and adaptive adjustment of the second setpoint during commissioning. The self-test triggering logic during the commissioning phase is the same as that during the factory delivery phase: when the self-test timing value > the second set value, the main control unit triggers the self-test signal, calls the self-test action module to perform the self-test, and obtains the self-test result; The result processing rules are the same as those at the factory stage: if the self-test passes, the self-test timer value is reset, and the second reset count is accumulated. The initial value is 0, and it is incremented by 1 with each reset; if the self-test fails, it is set to an abnormal value and an alarm is triggered. The adaptive adjustment logic for the second setpoint is dynamically optimized based on the second reset count. The core principle is: the more stable the operating condition, the longer the self-check cycle; the more unstable the operating condition, the shorter the self-check cycle. The specific adjustment method is as follows: Preset adjustment formula: D2=D2 初始 +k×(N2-N0), where: D2 初始 =86400 seconds, k=8640 seconds, i.e. 2.4 hours, k is the adjustment coefficient, N2 is the current second reset count, which is not 0; N0 is the base count, such as 10 times; Adjustment boundary: D2 should be no less than 86,400 seconds (24 hours) and no more than 604,800 seconds (7 days) to avoid the monitoring effect being affected by the cycle being too short or too long. The adjusted second setting value is stored in the storage unit in real time and takes effect automatically when the next self-test is triggered, so as to achieve dynamic matching between the self-test cycle and the actual operating conditions of the device.

[0036] Step 7: Self-test anomaly alarm prompts and fault tracing Whether at the manufacturing or commissioning stage, when the main control unit determines that the self-test timing value is abnormal, it immediately initiates a multi-dimensional alarm: Local alarm: The red LED indicator flashes at a frequency of 2 times per second, and the buzzer sounds intermittently with a rhythm of "sounding for 1 second and pausing for 2 seconds"; Remote alarm: If it is in the commissioning phase, the 4G / LoRa module pushes alarm information to the operation and maintenance management platform, including device ID, installation address, time of anomaly occurrence, current self-test time value, and the results of the last 3 self-tests; Local storage: Exception information (including exception type, time, and self-test results) is stored in the Flash storage unit, retaining the most recent 100 records, and can be exported and queried through the debugging interface; After receiving an alarm, maintenance or testing personnel can locate the faulty device based on the alarm information and carry out targeted repairs or troubleshooting. After the repair is completed, the normal self-test cycle can be restored by using the "fault clearing command".

[0037] In this embodiment, the high-precision timing module uses an external 8MHz crystal oscillator for calibration, combined with an RTC temperature compensation algorithm, to ensure that the timing error is ≤±1 second / day under operating conditions of -40℃~85℃. After power failure, it is powered by a 3.6V lithium-ion battery, providing a battery life of ≥72 hours, preventing timing interruptions due to power loss. The self-test action module has built-in fault detection logic. After the main control unit issues a start command, if no action feedback (such as a motor reset signal or level feedback) is detected within 50ms, the module is deemed faulty, generating a "self-test action module abnormal" alarm to prevent the self-test process from stalling. Parameters such as the first setpoint, second setpoint, set number of times, abnormal value, and adjustment coefficient k can all be remotely configured through the main control unit's UART debugging interface or wireless communication module to adapt to the needs of metering devices from different manufacturers and in different application scenarios (such as residential electricity and industrial electricity). The self-test trigger signal uses a dual determination of "level transition + duration" to avoid false triggering caused by electromagnetic interference. The start voltage of the self-test action module is DC12V±10%, with overvoltage and overcurrent protection to prevent module damage.

[0038] To further improve the full lifecycle self-inspection and control system, this embodiment includes the following sub-steps in the self-inspection anomaly alarm process: This solution adds a reset judgment logic module with a computation latency of ≤100ms; the operation unit supports both local and remote operation modes; the storage unit can store reset judgment-related parameters and retain them even after power failure; the alarm module can start and stop alarms based on the reset status to form a feedback loop. Key parameters are preset: the detection duration is 5-30 minutes (default 15 minutes), and the reference number of times is 2-5 times (default 3 times), both of which are flexibly adjustable. The inspection commands are divided into local combined actions and remote JSON commands with permission verification.

[0039] Sub-step 1: Obtaining and verifying self-check anomaly inspection instructions When an electricity metering device triggers an abnormal alarm (local audible and visual alarm + remote alarm push) due to a self-test failure, maintenance personnel arrive at the site or confirm the fault through a remote operation and maintenance platform and carry out targeted maintenance work, such as replacing the faulty sampling resistor, repairing loose wiring, calibrating the metering unit, etc. After maintenance is completed, maintenance personnel shall input inspection instructions in any of the following ways: This button can be operated by pressing and holding for 3 seconds and then pressing twice, or by entering a preset operation password (6 digits, supporting hierarchical permission management) on the touchscreen and then clicking the "Reset Request" icon. Remote input: Log in to the corresponding device management interface through the operation and maintenance management platform. After identity verification (account and password + verification code), click the "Abnormal Reset Request" button. The platform will then send an encrypted check command to the device's main control unit. After receiving the inspection command, the main control unit immediately performs validity verification: local command verification checks whether the operation timing matches, and remote command verification checks whether the permission code and device ID are consistent. If the verification passes, the reset judgment process is initiated; if the verification fails, the command is ignored and the alarm status is maintained. At the same time, an invalid command log is recorded, including the operation time, operation method, and reason for failure.

[0040] Sub-step 2: Statistics on the number of times the self-test program is triggered within the detection time. After the main control unit passes the verification and inspection command, it immediately starts the built-in timing module to accumulate the preset detection time, such as 15 minutes, and sends a "reset judgment start" prompt to the operation unit. The local LED indicator flashes at a frequency of 1 time / second, and the remote platform displays "countdown XX minutes". During the testing period, maintenance personnel trigger the self-test program through the operating unit. Triggering methods include: Local trigger: Single press of the self-test button (press duration ≥ 500ms, supports debounce processing to avoid accidental touch); Remote triggering: Click the "Single Self-Test" button on the operation and maintenance platform, and the platform will send a self-test trigger command to the device; The main control unit monitors the trigger signals of the self-test program in real time, performs anti-shake filtering on the trigger actions (excluding false presses ≤200ms), accumulates the number of valid triggers, and forms a "trigger count counter". The initial value is 0, and it increments by 1 after each valid trigger. The count result is synchronized to the local display interface and the remote operation and maintenance platform in real time for easy viewing by maintenance personnel.

[0041] Sub-step 3: Reset condition determination and execution When the detection timer ends or the maintenance personnel actively click the "End Judgment" button, the main control unit immediately stops counting and compares the accumulated valid trigger count with the preset reference count (e.g., 3 times): If the number of valid triggers is greater than the reference number (e.g., 4 cumulative triggers): it is determined that the electrical condition of the device has returned to normal after maintenance, and the main control unit immediately performs a reset operation; the self-test timing value is cleared from the abnormal value (e.g., -1 second) and the normal cumulative timing is restored; the abnormal status mark in the storage unit is cleared and the "abnormal identifier" is set from "1" to "0"; local audible and visual alarms and remote alarm push are stopped, and the LED indicator returns to normal (solid green); a "reset successful" feedback message is pushed to the operation and maintenance platform, including the number of triggers, detection duration, and reset time; If the number of valid triggers is less than or equal to the reference number (e.g., 2 cumulative triggers): the determination device has not completed a valid reset. The main control unit maintains the abnormal state of the self-test time value and continues to trigger the alarm. At the same time, it outputs a "reset failed" prompt to the operation unit. For example, if the local buzzer sounds 3 times, the remote platform displays "Insufficient number of triggers, ≥X times required" and retains the current number of triggers record. Maintenance personnel are allowed to re-enter the inspection command within 30 minutes to restart the reset determination process. A maximum of 3 re-applications are supported. If more than 3 are exceeded, the reset function will be locked and the administrator must be contacted to unlock it.

[0042] Sub-step 4: Exception handling and logging If the main control unit does not detect any valid triggers within the detection period (trigger count = 0): after the timer ends, it is determined as "reset verification not performed", the abnormal alarm status is maintained, and a warning message "no verification after maintenance, reset failed" is pushed to the operation and maintenance platform to remind the management personnel to follow up and verify; After the reset operation is executed, the main control unit automatically records the entire reset process log, including: check command reception time, detection duration, number of valid triggers, reset result, and reset time. The log is retained for ≥1 year and can be exported through the debugging interface or remote platform for easy fault tracing and operation and maintenance auditing. If the self-test fails again after a reset, i.e. the first self-test result after a reset is "failed": the main control unit resets the self-test timing value to an abnormal value, restarts the alarm process, marks "retest failed after reset", and pushes a higher priority warning message to the operation and maintenance platform to indicate that the device may have a hidden fault.

[0043] In addition, this embodiment also includes features to prevent accidental operation: verification of instruction permissions: remote operation requires identity verification, and local operation requires a combination of actions or password verification to avoid unauthorized personnel from entering incorrect information; anti-bounce processing of trigger counts: filtering out short-term accidental presses to ensure accurate counting; and a reset and lock mechanism: locking the function after three consecutive failed reset requests to prevent malicious operation.

[0044] The detection duration and reference count can be adjusted according to the application scenario. For example, the detection duration for industrial electrical equipment can be set to 30 minutes and the reference count to 5 times, while the detection duration for residential electrical equipment can be set to 5 minutes and the reference count to 2 times. It allows maintenance personnel to proactively terminate the assessment within the inspection time and re-enter the inspection command to restart the process, adapting to different maintenance progress requirements.

[0045] To optimize regional cluster management, this embodiment also includes the following steps: In this embodiment, the power metering device has a built-in Beidou / GPS dual-mode positioning module and a multi-mode wireless communication module, which can upload positioning and self-test timing data and receive remote synchronization commands. The operation and maintenance terminal includes a back-end management platform and a field handheld terminal, which has the functions of area division, data comparison and command issuance. At the same time, it presets a flexibly adjustable distance span (default 100 meters) and timing reference difference (default 60 seconds) as the basic parameters for area synchronization control.

[0046] Sub-step 1: Delineate the installation area for electricity metering devices based on location data. Each installed and operational electricity metering device collects its own latitude and longitude coordinates, distribution area number, geographical installation location, and other location data in real time through its built-in positioning module. The data is then uploaded to the back-end operation and maintenance management platform every 5 minutes via a wireless communication module to ensure that the location data is real-time and valid. After receiving the location data of all devices, the back-end operation and maintenance management platform automatically performs geographical partitioning of all electricity metering devices with a preset distance span as the maximum coverage threshold, dividing them into multiple independent setting areas. Using any device within the area as a reference point, all devices whose straight-line distance from the reference point does not exceed the distance span are grouped into the same setting area, ensuring that the equipment in each setting area belongs to the same operation and maintenance unit and the same power distribution network.

[0047] Sub-step 2: Collect and set the self-test timing values ​​of the devices within the designated area. The back-end operation and maintenance management platform retrieves the real-time self-test timing values ​​of all power metering devices in the corresponding area through a wireless communication network, according to the divided set areas. The platform verifies the validity of the received self-test timing values, removes invalid data with abnormal values ​​or communication interruptions, and collects, organizes and stores the self-test timing values ​​of valid devices in the same setting area to form a regional self-test timing database. The collected results are synchronized to the operation and maintenance terminal, allowing operation and maintenance personnel to view the timing status of equipment in the area.

[0048] Sub-step 3: Calculate the timing difference and mark the synchronization timing device. The back-end operation and maintenance management platform performs pairwise traversal calculations on all power metering devices in the same setting area, and defines the absolute difference between the self-test timing values ​​of any two devices as the timing difference. The timing difference is used to quantify the degree of deviation between the self-test timing of the two devices. The platform will compare all the calculated timing differences with the preset timing reference differences one by one; If the timing difference between two or more electricity metering devices is less than the timing reference difference, it is determined that the self-inspection timing progress of these devices is highly similar and meets the conditions for synchronous control. The platform will uniformly mark all electricity metering devices corresponding to this timing difference as synchronous timing devices and generate a list of synchronous timing devices.

[0049] Sub-step 4: Determine the unified synchronization timing value for the region. The back-end operation and maintenance management platform retrieves the self-test timing values ​​of all devices from the list of synchronized timing devices, and filters out the self-test timing value with the smallest value through numerical comparison; Set the minimum self-test timing value as the synchronization timing value for the current setting area; by using the minimum value as the synchronization benchmark, all synchronization timing devices can be forced to align with an earlier timing node, thus avoiding the problem of multiple devices triggering their self-test times in a concentrated manner.

[0050] Sub-step 5: Respond to the synchronization command to complete the batch synchronization of self-test timing. Maintenance personnel can issue self-test timing synchronization commands to the target area through the back-end maintenance management platform or on-site handheld maintenance terminals; the commands include synchronization timing values, a list of synchronization timing device IDs, and execution timestamps. The synchronization timing device within the set area receives synchronization commands via a wireless communication module. After the main control unit parses the commands, it immediately responds and executes a calibration operation. All synchronous timing devices will forcibly synchronize their current self-test timing values ​​to the synchronous timing values ​​issued by the platform, thus completing the unified calibration of the self-test timing of multiple devices in the same area; After each device completes calibration, it sends a synchronization success signal to the operation and maintenance terminal, and the platform updates the timing status of the regional equipment, forming a closed-loop management system.

[0051] In addition, this embodiment also includes an anomaly handling and protection mechanism: If some devices fail to synchronize due to communication interruption, the platform will automatically trigger a 3-retry mechanism with a retry interval of 30 seconds. If it still fails, it will be marked as a synchronization abnormal device and an alarm will be pushed. If the number of valid synchronization timing devices in the set area is less than 2, the platform will automatically cancel the synchronization operation to avoid invalid calibration. Synchronization operation is performed only during idle periods when the device is not undergoing metrology or self-testing, thus preventing conflicts between synchronous calibration and normal metrology and self-testing processes.

[0052] In this optional embodiment, in order to achieve regional synchronous management and control of multiple power metering devices, two implementation methods are set up. The first implementation method includes the following sub-steps: Sub-step 1: Obtain the self-test timing value of the synchronization timing device and construct the dataset. After completing the synchronization timing device marking and before executing the synchronization timing value setting step, the cloud-based operation and maintenance management platform or regional concentrator initiates the dispersion analysis process: The platform sends timing value collection instructions to all energy metering devices marked as "synchronous timing devices" within the current setting area through a wireless communication network. The collection frequency is real-time, and the device data upload delay is ≤500ms. After receiving the instruction, each device will simultaneously upload its current real-time self-test timing value (unit: seconds) and positioning data (latitude and longitude coordinates) to the platform; The platform verifies the validity of the received data, removes invalid samples with abnormal timing values ​​or missing positioning data, and constructs a dedicated timing-positioning dataset {(X1, L1), (X2, L2), ..., (Xi, Li), ..., (Xn, Ln)}, where n is the number of valid synchronized timing devices in the area, n≥2. If n<2, the adjustment process is paused and the default distance span is maintained. Xi is the real-time self-test timing value of the i-th device, and Li is the latitude and longitude positioning data of the i-th device.

[0053] Sub-step 2: Calculate the degree of dispersion based on the preset discrete value algorithm In this embodiment, the preset discrete value algorithm preferentially adopts the coefficient of variation algorithm, which takes into account both the degree of data dispersion and the influence of numerical magnitude, and avoids misjudgment caused by the overall offset of timing values. It can also be replaced by equivalent discrete metric algorithms such as standard deviation and interquartile range. The cloud platform uses this algorithm to calculate the self-test timing values ​​of the above dataset to obtain the dispersion value CV, which characterizes the degree of dispersion of the timing distribution of the synchronous timing devices in the region. The specific calculation process is as follows: Calculate the average value μ of the timing data set: μ = (X1 + X2 + ... + Xn) / n, which represents the average level of device timing within the region; Calculate the standard deviation σ of the timing dataset: σ = √[Σ(Xi - μ)]2 / (n-1)], calculated using the sample standard deviation, is suitable for small sample data scenarios and characterizes the absolute deviation between the timing value and the mean; Calculate the coefficient of variation (CV): CV = (σ / μ) × 100%, eliminating the influence of the magnitude of the time value and achieving horizontal comparability of different regions with varying degrees of dispersion; The larger the CV value, the higher the relative dispersion of the self-test timing values ​​of the synchronization timing devices in the area, that is, the timing progress of some devices is significantly lagging behind or ahead; The smaller the CV value, the lower the relative dispersion of the self-test timing value of the synchronization timing device in the area, that is, the timing progress of all devices tends to be consistent.

[0054] Sub-step 3: Set the threshold for dispersion level and the distance span adjustment rules The cloud platform pre-configures dispersion level thresholds and distance span adjustment parameters, dividing the dispersion value CV into three levels: high, medium, and low. Each level corresponds to a differentiated distance span adjustment strategy. An initial distance span D0 is also preset, with D0 set based on the distribution network coverage area and equipment deployment density, ranging from 50m to 200m. For example, the default D0 = 100m serves as the adjustment benchmark. Specific leveling and adjustment rules are as follows: 1. High Discreteness Level: When CV ≥ CV1, CV1 is the high-level threshold, preset to 30%, which can be adjusted according to the operational accuracy requirements. Judgment logic: The timing differences of devices within the area are extremely large. The original distance span is too large, causing devices with different timing rhythms to be included in the same area. The distance span needs to be reduced to refine the zoning. Adjustment strategy: The adjusted distance span D1 = D0 × k1, where k1 is a reduction coefficient, ranging from 0.4 to 0.6. For example, if k1 = 0.5, then D1 = 50m. 2. Medium Discrete Level: When CV2 < CV < CV1, CV2 is the medium level threshold, preset to 15%. Judgment logic: The timing differences between devices within the area are moderate, and the original distance span is basically compatible, so no major adjustments are needed; Adjustment strategy: The adjusted distance span D2 = D0 × k2, where k2 is the leveling coefficient, with a value range of 0.9 to 1.1. For example, if k2 = 1.0, then D2 = 100m. 3. Low discrete level: when CV≤CV2 Judgment logic: If the timing rhythm of devices within the area is highly consistent, the original distance span can be appropriately expanded to improve the efficiency of regional management; Adjustment strategy: The adjusted distance span D3 = D0 × k3, where k3 is the amplification factor, with a value range of 1.5 to 2.0. For example, k3 = 1.8, which means D3 = 180m.

[0055] The aforementioned grading thresholds (CV1, CV2) and adjustment coefficients (k1, k2, k3) can all be flexibly modified through the configuration interface of the cloud platform, which can adapt to different deployment scenarios such as dense urban transformer areas and scattered rural transformer areas.

[0056] Sub-step 4: Re-divide the setting area based on the adjusted distance span The cloud platform determines the target distance span D based on the dispersion value CV, and redivides the area to which the power metering device belongs based on the geographical center of the regional equipment location and the straight-line distance. It updates the equipment list and synchronizes it to the device and operation and maintenance terminal. If the number of synchronous timing devices in the area is less than 2, the platform automatically merges the nearest adjacent areas and recalculates the relevant parameters to ensure that the area division is reasonable.

[0057] Sub-step 5: Stability Guarantee Mechanism To avoid instability in regional division caused by frequent adjustments to the distance span, the following safeguards are implemented in this embodiment: The time interval between two adjustments to the distance span of the same setting area shall not be less than 24 hours. The adjustment operation shall only be triggered when the dispersion values ​​collected in three consecutive samples are all at the same level, so as to avoid erroneous adjustment caused by instantaneous dispersion fluctuations. The target distance span D is limited to a range of 50m to 200m. When the adjusted D exceeds this range, the boundary value is automatically taken. For example, when D0=100m and k3=2.5, D=200m is actually used to prevent extreme adjustments from causing the area division to be too large or too small. If the data loss rate of device positioning within a certain area is ≥30%, or the number of valid time value samples n<2, the platform will suspend distance span adjustment, maintain the current distance span, and push a "Data abnormal, area cannot be adjusted temporarily" prompt message to the operation and maintenance terminal to remind users to check for device communication or positioning failures.

[0058] The second implementation method includes the following sub-steps: Sub-step 1: Obtain the self-test timing value of the synchronization timing device and construct the dataset. After the initial marking of the synchronization timing devices is completed and before the synchronization timing value is set, the cloud-based operation and maintenance management platform or regional concentrator retrieves the real-time self-test timing values ​​of all energy metering devices that have been initially marked as "synchronization timing devices" in the current setting area from the local database, and constructs a dedicated timing value dataset {X1, X2, X3, ... Xi, ..., Xn}, where n is the number of synchronization timing devices initially marked in the setting area, and Xi (i=1, 2, ..., n) is the real-time self-test timing value (unit: seconds) of the i-th device. The dataset covers the timing parameters of all devices to be synchronized and calibrated in the area, providing a complete data foundation for the calculation of the degree of dispersion.

[0059] Sub-step 2: Calculate the degree of dispersion based on the preset discrete value algorithm In this embodiment, the preset discrete value algorithm adopts the standard deviation algorithm, which balances computational complexity and the accuracy of discreteness representation. It can also be replaced by variance, coefficient of variation, or other equivalent discreteness measurement algorithms. The cloud-based operation and maintenance management platform or regional concentrator uses this algorithm to calculate the above timing value dataset to obtain the discreteness value σ, which represents the dispersion of the self-test timing values ​​of the synchronization timing device in the region. The specific calculation process is as follows: Calculate the average value μ of the dataset: μ = (X1 + X2 + ... + Xn) / n, which represents the average level of device timing within the region; Calculate the sum of squares of the deviations of each timing value from the average value: Σ(Xi-μ) 2 =(X1-μ) 2 +(X2-μ) 2 +...+(Xn-μ) 2 ; Calculate the variance S 2 :S 2 =Σ(Xi-μ) 2 / (n-1), using the sample variance calculation method to avoid bias caused by small sample data; Calculate the standard deviation σ: σ = √S 2 The larger the σ value, the more dispersed the self-test timing values ​​of the synchronization timing device in the area are, and the higher the degree of dispersion; the smaller the σ value, the more concentrated the timing values ​​are, and the lower the degree of dispersion.

[0060] Sub-step 3: Set the dispersion level threshold and reference difference adjustment rules The cloud platform pre-configures dispersion level thresholds, dividing the dispersion value σ into three levels: high, medium, and low, each corresponding to a different timing reference difference adjustment strategy. Simultaneously, it presets an initial timing reference difference ΔT0 (set according to the regional synchronization control accuracy requirements, with a value range of 5-10 seconds, e.g., default ΔT0=8 seconds) as the adjustment benchmark. The specific grading and adjustment rules are as follows: High dispersion level: When σ≥σ1, σ1 is the high level threshold, which is preset to 5 seconds. This indicates that the timing deviation of the equipment in the area is extremely large and the distribution is scattered. It is necessary to reduce the timing reference difference to strictly screen the synchronization objects. The adjusted timing reference difference ΔT1=ΔT0×k1, where k1 is the attenuation coefficient, and the value range is 0.3~0.5. For example, k1=0.4, that is, ΔT1=3.2 seconds. Medium Discrete Level: When σ2 < σ < σ1, σ2 is the medium level threshold, preset to 2 seconds, indicating that the timing deviation of the equipment in the area is moderate, keeping the timing reference difference basically unchanged. The adjusted timing reference difference ΔT2 = ΔT0 × k2, where k2 is the balancing coefficient, with a value range of 0.8 to 1.2. For example, k2 = 1.0, that is, ΔT2 = 8 seconds. Low dispersion level: When σ≤σ2, it indicates that the timing deviation of the equipment in the area is very small and the distribution is concentrated. The timing reference difference can be expanded to broaden the range of synchronization objects. The adjusted timing reference difference ΔT3=ΔT0×k3, where k3 is the amplification factor, and the value range is 1.5~2.0. For example, k3=1.8, that is, ΔT3=14.4 seconds.

[0061] The aforementioned grading thresholds (σ1, σ2) and adjustment coefficients (k1, k2, k3) can be flexibly configured and modified through the cloud platform according to the needs of scenarios such as distribution network operation and maintenance accuracy and equipment deployment density, and have strong adaptability.

[0062] Sub-step 4: Re-verify the synchronization timing device based on the adjusted reference difference. The cloud platform matches the corresponding adjustment strategy based on the calculated dispersion value σ, and generates a dynamically adjusted timing reference difference value ΔT. Then, using ΔT as the new criterion, it re-compares the timing differences of all electricity metering devices in the current setting area pairwise. If the timing difference value |Xi-Xj| < ΔT between any two devices, they are maintained or marked as synchronous timing devices. If |Xi-Xj| ≥ ΔT, their synchronous timing device marking is canceled, and they are excluded from the synchronous control range.

[0063] After re-verification, the cloud platform updates the list of synchronized timing devices and synchronizes the adjusted timing reference difference ΔT to the local storage unit of all devices in the region as the basis for subsequent synchronization control. If the number of synchronized timing devices is lower than the preset threshold after re-verification (e.g., n≥3), the cloud platform pushes a prompt message to the operation and maintenance terminal, suggesting optimization of the region division or discrete level threshold.

[0064] In this embodiment, the self-test procedure includes the following sub-steps: Sub-step 1: Detection signal generation and sampling channel switching After responding to the self-test trigger signal, the main control unit sends a start control command to the built-in signal generation module. The signal generation module employs a high-precision DDS (Direct Digital Synthesis) signal generator, capable of accurately outputting voltage and current signals. It can generate detection voltage and current suitable for the rated operating conditions of the energy metering device based on preset detection parameters. The output range of the detection voltage is 0~220V (suitable for single-phase metering devices) or 0~380V (suitable for three-phase metering devices), with a voltage amplitude accuracy ≤±0.05%. The output range of the detection current is 0~100A, with a current amplitude accuracy ≤±0.05%. The signal frequency is fixed at 50Hz, conforming to my country's power frequency system standards, with a frequency stability ≤±0.01Hz, ensuring consistency between the detection signal and the actual operating signal.

[0065] After the signal generation module starts and outputs a stable detection signal, a delay time of 100ms is preset to avoid transient interference. The main control unit sends a switching control command to the acquisition switching switch. The acquisition switching switch is an electromagnetic switching switch or a solid-state relay. Its input terminal is connected to the voltage and current output terminals of the signal generation module, and its output terminal is connected to the metering sampling channel of the energy metering device, including a voltage sampling branch and a current sampling branch. After receiving the command, the switching switch disconnects the metering sampling channel from the external power grid to avoid power grid signal interference during self-testing. At the same time, it closes the path between the signal generation module and the metering sampling channel, accurately connecting the stable detection voltage and detection current to the input interface of the metering sampling channel, completing the closed-loop access of the self-test signal.

[0066] Sub-step 2: Signal sampling, conversion, and power calculation After the acquisition switching switch is completed, the metering unit initiates the signal processing flow to perform full-process processing on the detection signals in the metering sampling channel, specifically including: The metering unit has a built-in high-precision differential sampling circuit. It uses voltage divider sampling for the input detection voltage signal and shunt or Rogowski coil sampling for the detection current signal. The sampling frequency is preset to 1kHz~10kHz, which can be adjusted according to the metering accuracy requirements. 10kHz is selected for high-precision scenarios to ensure complete capture of the periodic characteristics and amplitude information of the signal and avoid sampling distortion.

[0067] The sampled analog signal is transmitted to the built-in 24-bit high-precision ADC chip (conversion rate ≥1MSPS) of the metering unit. The ADC chip converts the analog voltage and current signals into digital signals. During the conversion process, a built-in low-pass filter is used to filter out high-frequency noise. The digital signal output format is binary two's complement, which ensures conversion accuracy and anti-interference capability.

[0068] The digital signal converted by the ADC is input to the digital signal processor (DSP) of the metering unit. The DSP performs power calculation based on the instantaneous power integration algorithm: first, it calculates the instantaneous power p(t) = u(t) × i(t), where u(t) is the real-time voltage digital signal and i(t) is the real-time current digital signal. Then, it integrates the instantaneous power over one power frequency cycle (20ms) to obtain the active power value P. At the same time, it separates the fundamental voltage and current signals through the fundamental frequency extraction algorithm to calculate the fundamental reactive power value Q. Finally, the self-detection values ​​output by the metering unit include: the effective value of the detected voltage U, the effective value of the detected current I, the active power P, and the reactive power Q. Each parameter is retained to 4 decimal places to ensure calculation accuracy.

[0069] Sub-step 3: Compare the self-tested value with the standard theoretical value The main control unit's local storage module pre-stores the standard theoretical values ​​corresponding to the detection signals. These standard theoretical values ​​are calculated based on the preset output parameters of the signal generation module and the ideal measurement model. For example, when the signal generation module is preset to output a pure resistive load signal of 220V (RMS) and 5A (RMS), the standard theoretical values ​​are U0=220.0000V, I0=5.0000A, P0=1100.0000W, and Q0=0.0000var. The generation process of the standard theoretical values ​​has taken into account the output accuracy correction coefficient of the signal generation module to ensure the accuracy of the theoretical values.

[0070] The main control unit obtains the self-detection values ​​(U, I, P, Q) from the measurement unit, and simultaneously retrieves the preset standard theoretical values ​​(U0, I0, P0, Q0), calculating the relative error of each parameter one by one: Voltage relative error δ_U = |U - U0| / U0 × 100%; The relative error of the current δ_I = |I - I0| / I0 × 100%; The relative error of active power δ_P = |P - P0| / P0 × 100%; Reactive power relative error δ_Q=|Q-Q0| / Q0×100% (when Q0≠0); The main control unit has a preset allowable error range, which conforms to the national standard GB / T17215 "AC Electricity Measuring Equipment": For 0.2 class electricity metering devices, the allowable error range is set as δ_U≤±0.2%, δ_I≤±0.2%, δ_P≤±0.2%, δ_Q≤±0.5%; for 0.5 class devices, the allowable error range is set as δ_U≤±0.5%, δ_I≤±0.5%, δ_P≤±0.5%, δ_Q≤±1.0% (which can be flexibly adjusted through the main control unit configuration interface).

[0071] The main control unit determines whether the relative error of all parameters is within the allowable error range: if all parameters meet the error requirements, it outputs a "self-test passed" result (in the form of a high-level signal or a "PASS" data frame); if any parameter exceeds the allowable error range, it outputs a "self-test failed" result (in the form of a low-level signal or a "FAIL" data frame), and simultaneously records the name and error value of the out-of-tolerance parameter to provide a basis for fault location.

[0072] Sub-step 4: Determining the electrical operating conditions of core components Normal operating condition determination: If the self-test result is "pass", then the core electrical components of the electricity metering device are considered to be operating normally. Metering sampling channel: No short circuits, open circuits, poor contact or other faults, and signal transmission attenuation meets requirements; Metering unit: ADC conversion accuracy meets standards, DSP operation logic is correct, and there are no hardware faults; Main control unit: Signal control, data comparison, and logic judgment functions are normal, with no operational abnormalities.

[0073] Abnormal operating condition determination: If the self-test result is "fail", then locate the abnormal component by combining the out-of-tolerance parameters: If the voltage / current sampling value is out of tolerance: first determine if the metering sampling channel is faulty (such as aging sampling resistor, loose wiring) or the signal generation module output is abnormal; If the power value is out of tolerance but the voltage / current value is normal: the metering unit's operation logic is faulty, such as abnormal DSP algorithm or incorrect integration coefficient; If all parameters are out of tolerance and the signal generation module self-test is normal: it is determined that the main control unit comparison logic or standard theoretical value storage is abnormal.

[0074] The anomaly determination results are synchronously stored in the fault log of the main control unit, providing accurate guidance for subsequent maintenance.

[0075] Reference Figure 2 This embodiment addresses the coordination issue between power supply control and channel switching during the self-test process by clearly defining the hardware selection and timing rules of the self-test action module, ensuring the stability and reliability of the self-test circuit during startup and shutdown. Specifically, it includes the following steps: The self-test module in this embodiment uses an HH52P dual-channel electromagnetic relay module, which consists of a power supply control relay K1 and a switch switching relay K2. These are independently controlled by the main control unit and are hardware-interlocked. The coil rated voltage is DC12V, the contact rated current is ≥5A, the response time is ≤10ms, and the mechanical life is [not specified]. Next; the K1 coil is connected to the main control unit's IO port, and the contacts are connected in series to control the power supply of the signal generation module; the K2 coil is connected to another IO port, and the contacts control the channel switching of the acquisition switching switch; the module is independently powered by an auxiliary power supply and isolated from other circuits; this module can realize the power supply on / off control of the signal generation module and the state switching of the sampling channel, ensuring that there is no external signal interference during the self-test process and that it is energy-saving and reliable.

[0076] This embodiment strictly regulates the sequence of actions during the start-up and stop phases of the electromagnetic relay module, avoiding loop conflicts, signal interference, or circuit damage through timing coordination. The specific timing flow is as follows: 1. Self-test startup sequence (power supply first, then switching): After the main control unit generates a self-test trigger signal (from a self-test command during factory delivery or commissioning), it drives the electromagnetic relay module to perform actions according to the following timing sequence: The main control unit first outputs a high-level control signal (DC12V) to the coil of the power supply control relay K1. After the coil of K1 is energized, its normally open contact closes within 10ms, connecting the power supply circuit of the signal generation module. The main control unit has a built-in delay timer. The start-up delay time is set to t1=100ms. This delay time can be adjusted through the main control unit software. The core purpose is to ensure that the signal generation module completes initialization after power-on and outputs stable detection voltage and current, avoiding sampling distortion caused by the signal not being ready during switching. After the delay time t1 ends, the main control unit outputs a high-level control signal to the coil of the switch switching relay K2. The coil of K2 is energized, its normally open contact closes, and a switching command is sent to the data acquisition switching switch. The acquisition switching switch completes its action within 30ms after the K2 contact is engaged, disconnecting the connection with the external power grid, closing the path between the signal generation module and the metering sampling channel, formally connecting the self-test signal to the sampling circuit, and starting the self-test program.

[0077] The entire startup sequence is precisely controlled by the timer of the main control unit, with a timing error of ≤5ms, ensuring the orderly connection between power supply readiness and channel switching.

[0078] 2. Timing of actions during the self-test stop phase (switching first, then power off): After the self-test program completes the test and outputs the self-test result, the main control unit generates a self-test stop signal and drives the electromagnetic relay module to reset according to the following timing sequence: The main control unit first stops outputting a high level to the coil of the switch switching relay K2. The K2 coil is de-energized, its normally open contact opens within 10ms, and its normally closed contact closes again, sending a reset command to the data acquisition switch. The main control unit starts the stop delay timer and sets the stop delay time t2=150ms. This delay time is used to ensure that the acquisition switching switch is completely reset, disconnect the self-test signal channel, and reconnect the power grid signal channel to avoid circuit impact or signal crosstalk caused by live switching. After the delay time t2 ends, the main control unit stops outputting a high level to the coil of the power supply control relay K1. The coil of K1 is de-energized, its normally open contact opens, and the power supply circuit of the signal generation module is cut off. After the signal generation module is powered off, it stops outputting detection signals, the entire self-test module returns to normal, and the power metering device returns to normal metering operation mode.

[0079] 3. Timing protection mechanism: To further ensure timing reliability, the electromagnetic relay module is also equipped with the following hardware protection measures: Coil back EMF protection: A freewheeling diode is connected in parallel across the coils of K1 and K2 to absorb the back EMF generated when the coil is de-energized, thus preventing damage to the main control unit's I / O port. Contact arc suppression: An RC absorption circuit is connected in parallel across the contacts of K1 and K2 to suppress the arc generated when the contacts are closed / opened, extend the contact life, and avoid signal distortion caused by arc interference; Timing Interlock: Interlock logic is set in the main control unit software. If K1 is not engaged, the K2 engagement command output is prohibited. If K2 is not reset, the K1 disconnect command output is prohibited, thus preventing timing errors from the software level.

[0080] This optional embodiment generates a pulse width modulation (PWM) signal through a pulse generation module, enabling precise adjustment of the detected voltage and current. It also adaptively optimizes the self-test signal parameters based on the actual operating power of the device, resolving the distortion of self-test results caused by the mismatch between traditional fixed detection signals and actual operating conditions, thus further improving the fit and accuracy of the self-test. The specific steps are as follows: The self-test module in this embodiment uses a high-precision pulse generation module, which can be an STM32F103 series MCU or a dedicated PWM generator such as SG3525 or TL494. The pulse width adjustment range is 1ms~10ms with an accuracy of ≤0.1ms, and the pulse frequency adjustment range is 1kHz~10kHz with an accuracy of ≤100Hz. It outputs a 5VTTL level signal, receives commands via I2C / SPI bus with a response time of ≤5ms, and is independently powered by the device's built-in DC5V / 12V auxiliary power supply and electrically isolated from other circuits. The signal generation module is equipped with a PWM parameter analysis unit, which can accurately analyze the pulse width and frequency, and generate detection voltage and current with an amplitude error of ≤±0.05% through a DDS circuit. At the same time, noise is filtered out by a signal conditioning circuit. The pulse generation module communicates with the main control unit via an I2C bus and is connected to the signal generation module via a PWM signal line. The signal generation module is then connected to the metering sampling channel via a data acquisition switch, forming a complete closed-loop self-test hardware system.

[0081] Sub-step 1: Pulse generation module startup and initial PWM signal generation After the main control unit generates a self-test trigger signal, it immediately sends a start command and initial PWM parameters to the pulse generation module: Initial pulse width: preset to 5ms, corresponding to an initial detection voltage of 110V, compatible with 50% of the rated voltage of a single-phase metering device; Initial pulse frequency: preset to 5kHz, corresponding to an initial detection current of 50A, which is compatible with the common load current range of metering devices; After responding to the start command, the pulse generation module generates a PWM signal that meets the initial parameters within 10ms and continuously outputs it to the PWM parsing unit of the signal generation module.

[0082] Sub-step 2: The signal generation module parses the PWM parameters and generates the detection signal. The PWM parsing unit of the signal generation module captures the PWM signal output by the pulse generation module in real time, and converts the pulse parameters into amplitude commands for detecting voltage and current according to a preset mapping rule. The specific mapping logic is as follows: 2. Mapping relationship between pulse width and detection voltage Using a linear mapping algorithm, the pulse width is positively correlated with the detection voltage, and the mapping formula is: U = k_U × T_W + U_0; where: U is the effective value of the detection voltage (unit: V), with a range of 0~220V (single-phase) / 0~380V (three-phase); T_W is the pulse width (unit: ms), with a range of 1ms~10ms; k_U is the voltage adjustment coefficient, preset to 22V / ms, that is, for every 1ms increase in pulse width, the detection voltage increases by 22V; U_0 is the voltage reference value, preset to 0V, ensuring that the detected voltage is 22V when the pulse width is 1ms, covering light load conditions. Example: When the pulse width is 10ms, the detected voltage U = 22 × 10 + 0 = 220V (rated voltage); when the pulse width is 1ms, the detected voltage U = 22 × 1 + 0 = 22V (light load voltage).

[0083] 2. Mapping relationship between pulse frequency and detection current Using a linear mapping algorithm, the pulse frequency is negatively correlated with the detected current, and the mapping formula is: I = -k_I × f + I_{max}; where: I is the effective value of the detected current (unit: A), ranging from 0 to 100A; f is the pulse frequency (unit: kHz), ranging from 1kHz to 10kHz; k_I is the current adjustment coefficient, preset to 11.11A / kHz, meaning that for every 1kHz increase in pulse frequency, the detected current decreases by 11.11A; I_{max} is the maximum detected current, preset to 111.11A, ensuring that the detected current is 100A at a pulse frequency of 1kHz, covering heavy-load conditions. Example: When the pulse frequency is 1kHz, the detected current I = -11.11 × 1 + 111.11 = 100A (heavy-load current); when the pulse frequency is 10kHz, the detected current I = -11.11 × 10 + 111.11 = 0A (no-load current).

[0084] After generating stable detection voltage and current according to the above mapping rules, the signal generation module connects to the metering sampling channel through the acquisition switching switch to start the sampling and processing process of the self-test signal.

[0085] Sub-step 3: Obtaining the actual operating power value of the electricity metering device During the self-test procedure, the main control unit synchronously acquires the real-time operating power value of the power metering device. This power value is the active power data obtained by the device under normal metering conditions in the current power grid environment. The specific acquisition method is as follows: Sampling frequency: Samples are collected every 500ms to ensure the capture of dynamic power change trends; Data source: retrieved from the real-time calculation results of the metering unit, with power values ​​retained to 4 decimal places (unit: W). Data preprocessing: Power fluctuation noise is filtered out by a moving average filtering algorithm (window size of 5 sampling points) to obtain the smoothed actual operating power value P_{real}, avoiding erroneous adjustment of PWM parameters caused by instantaneous power surges.

[0086] Sub-step 4: Adaptive adjustment of PWM signal based on actual power The main control unit dynamically optimizes the PWM parameters (pulse width, pulse frequency) of the pulse generation module according to the preprocessed actual operating power value P_{real} and preset adjustment rules, so that the detected voltage and current are accurately matched with the actual operating conditions of the device. The specific adjustment logic is as follows: Power grading and preset adjustment thresholds: Three preset power grading thresholds are available to adapt to different load conditions: Heavy load condition: P_{real}≥P_1, where P_1 is preset to 8000W and can be flexibly adjusted according to the rated power of the device; Medium load condition: P_2 < P_{real} < P_1, P_2 is preset to 2000W; Light load condition: P_{real}≤P_2.

[0087] Tiered adjustment strategy: Heavy load conditions (P_{real}≥8000W): High voltage and high current detection signals need to be generated to adapt to heavy load operation; the adjustment direction is to increase the pulse width and decrease the pulse frequency, with the adjustment range being: Pulse width T_{W0} is the current pulse width, ΔT_{W1} = 0.5ms, and the maximum is no more than 10ms; The pulse frequency f = f_0 - Δf_1, where f_0 is the current pulse frequency and Δf_1 = 1kHz, with a minimum of 1kHz. Under medium load conditions (2000W < P_{real} < 8000W): Maintain the detection signal parameters basically stable, making only minor adjustments to adapt to power fluctuations; the adjustment range is: The pulse width T_W = T_{W0} ± 0.1ms, which increases when the power rises and decreases when the power falls. The pulse frequency f = f_0∓0.2kHz decreases when the power increases and increases when the power decreases. Light load condition (P_{real}≤2000W): A low voltage and low current detection signal needs to be generated to adapt to light load operation; the adjustment direction is to decrease the pulse width and increase the pulse frequency, with the adjustment range being: The pulse width T_W = T_{W0} - ΔT_{W2}, where ΔT_{W2} = 0.5ms and the minimum is not less than 1ms; The pulse frequency is f = f_0 + Δf_2, where Δf_2 = 1 kHz and the maximum is no more than 10 kHz.

[0088] Adjustment execution and parameter synchronization: The main control unit generates PWM parameter adjustment instructions according to the above strategy and sends them to the pulse generation module through the I2C communication bus. The pulse generation module updates the pulse width and frequency of the output PWM signal within 5ms and feeds back the updated parameters to the main control unit. The main control unit simultaneously sends the new parameters to the signal generation module, which adjusts the detection voltage and current amplitude in real time to achieve dynamic adaptation between the self-test signal and the actual working conditions.

[0089] In this embodiment, a timing control and stability guarantee mechanism is also provided: To avoid unstable detection signals caused by sudden changes in PWM parameters, an adjustment interval time (preset to 2s) is set, meaning that the time interval between two PWM parameter adjustments is no less than 2s, ensuring that the signal generation module has enough time to stabilize the amplitude of the detection signal. At the same time, the parameter adjustment adopts a "stepped" strategy, with each adjustment not exceeding 10% of the maximum range, to avoid sampling distortion or circuit impact caused by sudden changes in detection voltage and current.

[0090] Parameter boundary limits: When the pulse width reaches 1ms (minimum) or 10ms (maximum), or the pulse frequency reaches 1kHz (minimum) or 10kHz (maximum), the main control unit stops adjusting in the corresponding direction to avoid exceeding the hardware output range; Power anomaly handling: If the actual power value exceeds ±20% of the device's rated power for 3 consecutive samplings, it is determined to be a power anomaly. PWM parameter adjustment is paused, the current detection signal parameters are maintained, and a power anomaly prompt is pushed to the operation and maintenance terminal. Communication fault protection: If the communication between the pulse generation module and the main control unit is interrupted for more than 10 seconds, the pulse generation module will automatically switch to the preset default PWM parameters (pulse width 5ms, frequency 5kHz) to ensure that the self-test process continues to be executed.

[0091] This application also discloses an electrical condition detection system for an electricity metering device, including a processor, wherein the processor executes the steps of the electrical condition detection method for an electricity metering device as described in any of the above embodiments.

[0092] This application also discloses a storage medium storing a program, which, when executed by a processor, implements the steps of the electrical condition detection method for the power metering device described in any of the above embodiments.

[0093] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A method for detecting the electrical operating conditions of an electricity metering device, characterized in that, Includes the following steps: A preset self-test timing value is used for timing during the factory testing of the electricity metering device; if the self-test timing value is greater than the preset first setting value, a self-test signal is triggered. In response to a self-test signal, a preset self-test action module is invoked to perform a self-test action. The self-test action triggers a preset self-test program operation, and the self-test result generated by the self-test program operation is obtained. If the self-test result is passed, the self-test timer value is reset; otherwise, the self-test timer value is set to an abnormal value, wherein the self-test timer value is not the same as the abnormal value during the timing process. The cumulative number of times the self-test time value is reset is the first reset count. When the first reset count is greater than the preset number, a self-test normal mark is generated. The system acquires the installation mark generated after the electricity metering device is installed at the factory, and calls the second set value in response to the installation mark and the self-test normal mark; if the self-test timing value is greater than the preset second set value, a self-test signal is triggered; wherein, the second set value is greater than the first set value; In response to a self-test signal, the self-test action module is invoked to execute a self-test action. The self-test action triggers the self-test program operation and obtains the self-test result generated by the self-test program operation. If the self-test result is passed, the self-test timer value is reset; otherwise, the self-test timer value is set to an abnormal value. The number of times the cumulative self-test timer value is reset is the second reset count. The second set value is adjusted according to the second reset count. The larger the second reset count, the larger the second set value, and the smaller the second reset count, the smaller the second set value. If the self-test time value is abnormal, a self-test anomaly alarm will be triggered.

2. The method for detecting the electrical operating conditions of an energy metering device according to claim 1, characterized in that, The steps following the self-test anomaly alarm prompt also include the following sub-steps: Obtain the corresponding inspection instructions for self-test anomaly alarm prompts; According to the inspection instructions, the number of times the self-test program is triggered within the preset detection time is obtained. If the number of triggers is greater than the preset reference number, the self-test time value is reset.

3. The method for detecting the electrical operating conditions of an energy metering device according to claim 1, characterized in that, The method also includes the following steps: Obtain the location data of the electricity metering device, divide the area into multiple setting areas based on the location data, and set the maximum span within each area as a preset distance span; Obtain the self-test timing values ​​of multiple electricity metering devices located within the designated area; The difference between the self-test timing values ​​is calculated as the timing difference. If the timing difference is less than the preset timing reference difference, the energy metering device corresponding to the timing difference is marked as a synchronous timing device. Use the smallest self-test timing value in the synchronization timing device as the synchronization timing value; Obtain the synchronization command from the operating terminal, and in response to the synchronization command, synchronize the self-test timing value of the synchronization timing device to the synchronization timing value.

4. The method for detecting the electrical operating conditions of an energy metering device according to claim 3, characterized in that, The method also includes the following steps: Within the set area, before synchronously setting the self-test timing value, the dispersion value of the self-test timing value in the synchronous timing device is calculated based on a preset discrete value algorithm; The distance span is adjusted based on the dispersion value; the larger the dispersion value, the smaller the distance span, and vice versa.

5. The method for detecting the electrical operating conditions of an energy metering device according to claim 3, characterized in that, The method also includes the following steps: Within the set area, before synchronously setting the self-test timing value, the dispersion value of the self-test timing value in the synchronous timing device is calculated based on a preset discrete value algorithm; The timing reference difference is adjusted based on the dispersion value. The larger the dispersion value, the smaller the timing reference difference; the smaller the dispersion value, the larger the timing reference difference.

6. The method for detecting the electrical operating conditions of an energy metering device according to claim 1, characterized in that, The self-test procedure includes the following steps: The built-in signal generation module generates detection voltage and detection current, and the built-in acquisition switching switch connects the output of the signal generation module to the metering sampling channel of the power metering device. The metering unit sequentially samples, performs analog-to-digital conversion, and calculates the power of the signals in the metering sampling channel in real time to obtain the self-detected value. The main control unit compares the self-test values ​​with the preset standard theoretical values ​​and outputs the self-test results; If the self-tested value and the standard theoretical value are within the preset allowable error range, the self-test result is passed, and the electrical conditions of the metering sampling channel, metering unit and main control unit are determined to be normal; otherwise, the self-test result is failed, and the electrical conditions of the metering sampling channel, metering unit and main control unit are determined to be abnormal.

7. The method for detecting the electrical operating conditions of an energy metering device according to claim 1, characterized in that, The method also includes the following steps: The self-test action module is set as an electromagnetic relay module that performs preset actions by executing self-test signals. The electromagnetic relay module is used to power the signal generation module and change the switching state of the switch. When the self-test module starts, it first supplies power to the signal generation module and then controls the switching switch; when the self-test module stops, it first controls the switching switch and then supplies power to the signal generation module.

8. The method for detecting the electrical operating conditions of an energy metering device according to claim 1, characterized in that, The method also includes the following steps: Configure the self-test action module as a pulse generation module that generates a pulse width modulation signal by executing the self-test signal; The signal generation module identifies the pulse width and pulse frequency of the pulse width modulation signal, adjusts the voltage value of the detection voltage according to the pulse width, and adjusts the current value of the detection current according to the pulse frequency; The wider the pulse width, the higher the voltage; the narrower the pulse width, the lower the voltage. The higher the pulse frequency, the lower the current value; the lower the pulse frequency, the higher the current value. The power value calculated by the power metering device when it is in operation is obtained, and the pulse width modulation signal is adjusted according to the power value; wherein, the larger the power value, the wider the pulse width and the lower the pulse frequency; the smaller the power value, the narrower the pulse width and the higher the pulse frequency.

9. An electrical condition detection system for an electricity metering device, characterized in that, Includes a processor, wherein the steps of the electrical condition detection method for an energy metering device as described in any one of claims 1-8 are executed.

10. A storage medium, characterized in that, The storage medium stores a program, which, when executed by a processor, implements the steps of the electrical condition detection method for the power metering device according to any one of claims 1-8.