Method and system for testing power failure of electric energy meter

By working together with the host computer and hardware driver, the real working conditions of the electricity meter under multiple superimposed factors are simulated, which solves the shortcomings of the existing technology for electricity meter power failure testing, enables the earlier detection of potential problems in the electricity meter software design, and improves the accuracy and efficiency of testing.

CN120993309APending Publication Date: 2025-11-21WUHAN SAN FRAN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511035854.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing power outage testing methods for electricity meters cannot accurately reflect the real operating conditions of electricity meters under multiple overlapping factors, leading to malfunctions during field operation, especially software issues such as sudden changes in power consumption and data loss.

Method used

Through the collaborative work of the host computer and hardware driver, various power outage conditions of the electricity meter in the actual operating environment are simulated. The voltage drop parameters and ambient temperature are flexibly controlled by the script instruction set and control instructions to simulate the problems that the electricity meter may encounter at the user's site.

Benefits of technology

By exposing potential problems in the electricity meter software design through repeated testing in a short period of time, the accuracy and efficiency of testing are improved, potential faults are detected early, and problems in field operation are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120993309A_ABST
    Figure CN120993309A_ABST
Patent Text Reader

Abstract

The invention provides an electric energy meter power failure test method and system, and the method comprises the steps: obtaining a script instruction set, and enabling script instructions in the script instruction set to be used for indicating a test scheme and enabling the format to be predefined; calling a script analysis module to load and analyze the script instruction set, and converting a non-communication instruction in the script instruction set into a control instruction; the driving execution module is called to issue the control instruction to the hardware driving device for a power failure test; wherein the control instruction is used for indicating one or more of the power failure test time point of the electric energy meter, the voltage drop parameter and the environment temperature of the electric energy meter. According to the method, the script instruction set which indicates the test scheme and is formed by the script instructions with predefined formats is imported through the upper computer, the script instructions are analyzed, the non-communication instructions are converted into the control instructions, and the control instructions are issued to the hardware driving device to execute the power-down test; therefore, the power failure test can simulate the environment condition of field operation and the power failure occurrence condition.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power meter power failure detection, and in particular to a power meter power failure testing method and system. BACKGROUND

[0002] In recent years, the requirement of the State Grid for the reliability of smart meters is gradually increasing. In the batch supply of the market of the provincial companies over the years, there have been many cases of serious faults of the meters in the field operation. These faults often occur after the power failure of the power meter, and the software running in the power meter has problems, such as sudden change of electric quantity, data loss, communication failure, etc., which reduces the accuracy of the metering of the power meter and has a great impact on the residential electricity and electricity settlement.

[0003] The software of the power meter has been strictly tested for compliance performance and function in each manufacturer, and a large number of tests have been conducted for power failure. However, faults still exist after the field operation, which cannot be tested, identified and improved at the production test end. The reasons are as follows: first, the test stress is not enough, and the test conditions do not cover the actual extreme working conditions, and the mass production equipment is easy to fail in the critical environment; second, the cross combination of each stress and function precondition is not sufficient, and multi-dimensional stress cross verification is not conducted, and the hidden coupling defects cannot be exposed; third, the internal test is often conducted by using a single power failure mode, and the voltage directly drops from a specific value or slowly drops to a voltage value below, and the single power failure mode cannot cover the real power failure scene, such as jitter and burr; fourth, during the control of the power failure process, the power meter is added with power supply or power failure by using the way of opening and closing the mechanical switch controlled by the upper computer, or by using the way of sending fixed instructions through the meter calibration table software, and the power meter is added with power supply or power failure according to the boosting and voltage reduction mode fixed by the meter calibration table, which cannot be flexibly used according to the needs, and the complex power failure waveform control cannot be realized.

[0004] In summary, the power failure testing method and the matching system in the related art cannot truly reflect the real working conditions of the superposition of multiple factors in the actual operation of the power meter. SUMMARY

[0005] The present application provides a power meter power failure testing method and system, which solves the defect that the power failure testing of the power meter in the prior art cannot reflect the real working conditions of the superposition of multiple factors in the actual operation of the power meter, and realizes the simulation of the field operation environment conditions and the power failure occurrence in the power failure testing process of the power meter.

[0006] In a first aspect, the present application provides a power meter power failure testing method applied to a main program module in an upper computer, which comprises: obtaining a script instruction set, and the script instruction in the script instruction set is used to indicate a test scheme and the format is predefined; The script parsing module is called to load and parse the script instruction set, and non-communication instructions in the script instruction set are converted into control instructions; The driving execution module is called to issue the control instructions to the hardware driving device for power-off testing; The control instructions are used to indicate one or more of the power-off testing time point of the electric energy meter, the voltage drop parameter, and the environment temperature of the electric energy meter.

[0007] In a second aspect, the application further provides a power-off testing method, applied to an MCU master control chip in a hardware driving device, and comprising the following steps of: Receiving control instructions issued by an upper computer, the control instructions being used to indicate one or more of the power-off testing time point of the electric energy meter, the voltage drop parameter, and the environment temperature of the electric energy meter; Based on the control instructions, one or more of the following operations is performed to simulate different power-off working conditions for power-off testing: Capturing the power-off testing time point of the electric energy meter; Outputting a power-off voltage waveform; Adjusting the environment temperature of the electric energy meter.

[0008] In a third aspect, the application further provides an electric energy meter power-off testing system, comprising an upper computer and a hardware driving device, a main program module in the upper computer is used to implement the power-off testing method according to the first aspect, and an MCU master control chip in the hardware driving device is used to implement the power-off testing method according to the second aspect.

[0009] The electric energy meter power-off testing method and system provided by the application can import a script instruction set composed of script instructions indicating a testing scheme and having a predefined format, analyze the script instructions, convert non-communication instructions into control instructions, and issue the control instructions to the hardware driving device to perform power-off testing. The instruction content indicates one or more of the power-off testing time point of the electric energy meter, the voltage drop parameter, and the environment temperature of the electric energy meter, so that the power-off testing can simulate the environmental conditions and power-off occurrence conditions of field operation. Therefore, the power-off testing system can perform repeated tests by automatic testing means through a large number of repetitive and flexible testing schemes, simulate possible faults in the field in a short time, and expose problems that may occur in the long-term operation of the electric energy meter in the test environment in a few hours or days, so that the problems that may exist in the software design of the electric energy meter can be found earlier. BRIEF DESCRIPTION OF DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0011] Figure 1 is a schematic diagram of the principle of the power meter power failure test system provided by the embodiments of the present application; Figure 2 is a schematic diagram of the structure of the host computer provided by the embodiments of the present application; Figure 3 is one of the flowcharts of the power meter power failure test method provided by the embodiments of the present application; Figure 4 is a schematic diagram of the structure of the hardware driving device provided by the embodiments of the present application; Figure 5 is the second flowchart of the power meter power failure test method provided by the embodiments of the present application; Figure 6 is one of the waveform diagrams of the power failure voltage provided by the embodiments of the present application; Figure 7 is the second waveform diagram of the power failure voltage provided by the embodiments of the present application; Figure 8 is the third waveform diagram of the power failure voltage provided by the embodiments of the present application; Figure 9 is the fourth waveform diagram of the power failure voltage provided by the embodiments of the present application; Figure 10 is the fifth waveform diagram of the power failure voltage provided by the embodiments of the present application; Figure 11 is the third flowchart of the power meter power failure test method provided by the embodiments of the present application. DETAILED DESCRIPTION

[0012] In order to make the purpose, technical solutions and advantages of the present application more clear, the technical solutions in the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0013] Figure 1 is a schematic diagram of the principle of the power meter power failure test system provided by the embodiments of the present application, such as Figure 1As shown, the power meter power failure test system includes an upper computer and a hardware driving device, and the power meter is the object to be tested. Specifically, script instructions indicating a test scheme are input to the upper computer, are converted into control instructions by the upper computer, and are then sent to the hardware driving device. The hardware driving device simulates environmental conditions and power failure occurrence in the actual operation of the power grid based on the control instructions. The instruction content integrates various factors that affect the power failure reliability of the power meter, thereby realizing a power meter power failure test scheme that can be quickly and accurately controlled, is flexible and variable, and is close to a real operating environment.

[0014] Next, the structure and operation process of the upper computer and the hardware driving device are introduced.

[0015]

[0019] FIG. 1 is a structural schematic diagram of an upper computer according to an embodiment of the present application, as shown in FIG. 1, the upper computer includes a script instruction input module, a protocol analysis module, a synchronous control module, a hardware driving device control module, a hardware driving device test data acquisition module, a hardware driving device state display module, and a hardware driving device test data display module. Figure 2 The functions implemented by the upper computer are receiving script instructions, analyzing and executing script instructions, controlling the hardware driving device to execute, acquiring hardware driving device test data, and displaying the state and test data of the hardware driving device. The upper computer is designed in a modular manner, and each functional module has a clear responsibility and works cooperatively. The following is a description of each functional module and the interaction process thereof: The encryption and decryption interface (optional) is the first pass for communication between the upper computer and the outside, and is responsible for performing encryption or decryption operations on data packets as needed, so that the data packets become ciphertext or plaintext data for subsequent module processing. Specifically, when the upper computer communicates with the power meter in an encrypted manner, the encryption and decryption interface needs to be called. If encrypted communication is needed, the communication instructions sent to the power meter need to be encrypted before being sent, and the communication responses received from the power meter need to be decrypted before being parsed and used. If plaintext communication is needed, the interface does not need to be called. The encryption and decryption interface guarantees the security and integrity of data transmission.

[0016] The protocol analysis module receives data (including commands, configurations, query requests, etc.) from the encryption and decryption interface or the outside, and analyzes the data according to a predefined communication protocol. For different power meter communication protocols, such as the DL / T645-2007 communication protocol and the DL / T698.45 object-oriented communication protocol, different protocol analysis modules are called to parse the read, set, and operation communication instructions according to the requirements of the standard protocol, and the communication instructions are transmitted to the synchronous control module to send and wait for responses to the power meter. This module is responsible for understanding the communication instructions, disassembling and converting the communication instructions into standardized instructions or data formats that are easy to process internally. The protocol analysis module realizes the communication specification, and converts the original script instructions into meaningful internal data structures.

[0017] The main program module is a core control module of the host computer, responsible for configuring a test scheme, receiving input, loading script instructions, loading multi-datum data, configuring system parameters, encryption parameters, multi-datum communication serial port parameters, etc. In runtime, it creates multiple threads in a multi-datum configuration mode and executes control commands, and the multiple data points run independently. It is mainly responsible for: ① process scheduling: coordinating the running sequence of other modules according to the instruction content; ② logical processing: executing the core business logic (including determining which test to execute and how to perform the test steps); ③ thread management: creating and managing multiple datum point thread loops, which is the key to parallel processing, enabling simultaneous control of multiple test points (data points); ④ result output: summarizing the synchronization status of each datum point thread, the execution results of the communication instruction steps with the electric energy meter, the execution results of calling the drive execution module to control the hardware drive device, etc. The main program module implements overall control, logical decision-making, resource management (especially datum point threads), and result processing. Optionally, the result output is displayed through a graphical interface.

[0018] The drive execution module encapsulates the underlying details of communication with the hardware drive device. The drive execution module obtains the synchronized control instructions from the synchronization control module, sends control instructions to the hardware drive device through the USB serial interface or the RS485 communication interface, controls the hardware drive device to output various working condition source signals required for testing, simulates the running working condition of the electric energy meter in the real running environment, and collects electric energy meter signal quantities, electric energy meter internal state data, memory data, etc. to feed back to the host computer main program module. The drive execution module is an abstraction layer for hardware operation, providing a unified control interface to the upper layer and directly controlling the hardware drive device, and is a bridge from software instructions to hardware actions. In addition, the drive execution module obtains the synchronized electric energy meter communication instructions from the synchronization control module, sends them to the electric energy meter through RS485 / PLC / infrared, etc. and receives the response instructions from the electric energy meter.

[0019] The synchronization control module (optional) plays the role of a key coordinator between the main program module and the hardware drive device (and the drive execution module), strictly controls the asynchronous or synchronous process of script instructions in the entire test process, controls the communication sending and receiving with the electric energy meter, is responsible for the communication synchronization logic of the hardware drive device, and outputs the test results to the main program module. It is mainly responsible for: ① receiving control instructions (which can be a control instruction set) from the main program module; ② performing synchronization or coordination actions to ensure that device actions that need to occur simultaneously (such as multiple electric energy meters being powered on at the same time) can be accurately coordinated, or handling timing logic involving multiple electric energy meters; ③ finally sending the coordinated control commands to the drive execution module for execution; ④ receiving device execution results and state feedback from the drive execution module and feeding these information back to the main program module. The synchronization control module ensures the timing accuracy and synchronization of multiple device operations, and serves as a collection point for state feedback.

[0020] A plurality of epitope thread cycles (optional), created and started by the main program module, each thread is usually responsible for managing a complete test process of an independent test point (epitope), and its cyclic nature means that it continuously performs the process of "getting script instructions-controlling hardware drivers to perform test actions-collecting device feedback data-making basic logical judgments-reporting the results to the main program module". Multiple epitope thread cycles can achieve true parallel processing, multiple threads run simultaneously, can independently control multiple units under test (epitopes), greatly improving overall test efficiency and system throughput. The main program module is responsible for starting / notifying threads, distributing test tasks to threads, and receiving thread results.

[0021] The script parsing module is the key module to realize flexible test logic, including a logical analysis unit and a script execution unit. After the script instructions are parsed by the logical analysis unit, the script logic of the entire test scheme is constructed, and the execution needs of different epitopes under different operating conditions are met. The script execution unit executes scripts according to the actual state of different epitopes and provides structured display of test results. The script parsing module usually receives calls from the main program module and is mainly responsible for: ① loading and parsing specific script instructions (format predefined); ② understanding test steps, condition judgments, loops, variable settings, and data processing logic in script instructions; ③ according to the parsed script logic, generating specific instruction execution sequences, control instructions or logical judgment basis, and providing these outputs to the main program module, thereby driving threads to perform test actions or data processing. The script parsing module enables the system to define complex test processes and data processing rules according to configurable script instructions, greatly improving the flexibility and scalability of the system.

[0022] The running process of the main program module in the host computer is described in the following data flow manner.

[0023] Figure 3 is one of the flowcharts of the power meter power failure test method provided by the embodiment of the application, as Figure 3 shown, the execution subject of the method is the main program module in the host computer, and the method comprises the following steps: S301, a set of script instructions is obtained, and the script instructions in the set of script instructions are used to indicate a test scheme and have a predefined format; S302, a script parsing module is called to load and parse the set of script instructions, and non-communication instructions in the set of script instructions are converted into control instructions; S303, a driving execution module is called to issue the control instructions to the hardware driver for power failure test; Among them, the control instruction is used to indicate one or more of the power meter power failure test time point, the voltage drop parameter and the power meter environment temperature.

[0024] Specifically, the script instruction set indicating the test scheme is imported from the outside, the script instruction format is predefined, so that the script parsing module can parse the script instruction, identify the logical composition and semantics of the script instruction, and perform logical, mathematical operations or conversion into control instructions and issue to the hardware driving device.

[0025] The script instructions in the script instruction set can be divided into two categories, communication instructions and non-communication instructions. The communication instruction refers to the instruction for communication purpose, and the non-communication instruction refers to the instruction for non-communication purpose (the instruction for controlling the device), which does not involve communication protocol interaction and data transmission between devices, including but not limited to device control, data processing, logical judgment and delay operation, etc.

[0026] In the host computer, the main program module obtains the script instruction set, calls the script parsing module to load and parse, converts the non-communication instruction into the control instruction, and calls the driving execution module to issue the control instruction to the hardware driving device for power-off test.

[0027] The instruction content is the core of implementing the simulated power-off working condition. In the embodiment of the application, the instruction content contains one or more of the power meter power-off test time point, the voltage drop parameter and the power meter environment temperature, so that the integration of multiple factors affecting the power-off reliability of the power meter can be realized through one or more control instructions.

[0028] In some embodiments, S303 specifically includes: The control instruction is sent to the synchronization control module, so that the synchronization control module synchronizes and coordinates the control instruction, and sends the coordinated control instruction to the driving execution module.

[0029] Specifically, the synchronization control module plays the role of a key coordinator between the main program module and the hardware driving device and the driving execution module, and strictly controls the asynchronous or synchronous process of the script instruction in the entire test process.

[0030] In some embodiments, S303 specifically includes: A multi-table bit thread cycle of different to-be-tested power meters is created or started; The control instruction is sent to the multi-table bit thread cycle, so that the multi-table bit thread cycle calls the driving execution module in parallel based on the control instruction.

[0031] Specifically, the multi-table bit thread cycle is created and started by the main program module, and each thread is usually responsible for managing the complete test process of an independent table bit. The multi-table bit thread cycle can realize true parallel processing, multiple threads can run simultaneously, multiple table bits can be independently controlled, and the overall test efficiency and system throughput are greatly improved.

[0032] In some embodiments, the method further includes: The hardware driver receives the execution result of the multi-table position thread loop feedback, and generates a test result; the execution result of the multi-table position thread loop feedback is directly fed back by the driving execution module or indirectly fed back through the synchronization control module.

[0033] Specifically, the execution result of the control instruction of the hardware driver is collected by the driving execution module, and then directly fed back to the thread loop of the corresponding table position or indirectly fed back to the thread loop of the corresponding table position through the synchronization execution module, and finally output to the main program module for summary.

[0034] In some embodiments, S301 specifically includes: The script instruction set parsed by the encryption decryption interface and the protocol parsing module according to the predefined communication protocol is obtained.

[0035] Specifically, the communication instruction contained in the externally imported script instruction set may indicate that it needs to be encrypted, and then the encryption operation is performed through the encryption decryption interface to obtain the ciphertext communication instruction for use by the driving execution module when sending. At the same time, a large number of communication instructions are contained in the script instruction set, which need to be parsed by the protocol parsing module according to the predefined communication protocol to be converted into standardized instructions or data formats that are easy to process internally.

[0036] In some embodiments, the method further includes: The protocol parsing module is called to load and parse the script instruction set, and the communication instructions in the script instruction set are issued to the electric energy meter to be tested through the synchronization control module to set parameters and / or read data of the electric energy meter to be tested.

[0037] Specifically, the upper computer and the electric energy meter can be directly communicatively connected to facilitate the upper computer to set parameters and / or read data of the electric energy meter to be tested.

[0038] The operation process of the upper computer is briefly described in the following data flow manner: Step a, script instruction and configuration file input (test start).

[0039] Step b, test execution core: the main program module creates or starts a corresponding number of table position thread loops; the main program module loads and parses the script instruction by calling the script parsing module according to the script instruction and the configuration file, and returns the parsing result to the main program module; the main program module sends control instructions to the multiple table position thread loops and the synchronization control module according to the script logic obtained by parsing, and the thread loop in the thread loop will call the driving instruction module to operate the hardware according to the control instruction; the synchronization control module coordinates the control instructions that need to be synchronized and sends them to the driving instruction module for execution; the driving execution module operates the bottom layer hardware driver module to execute the control instruction.

[0040] Step c, data collection and feedback: the hardware execution result and test data are collected by the driving execution module, the driving execution module feeds back the result data to the synchronous control module (state / synchronization confirmation) and / or directly / indirectly feeds back to the corresponding table position thread cycle; the table position thread cycle executes the basic logic judgment / data processing (according to the script requirements) and reports the result data to the main program module; the main program module performs the final result summary and decision (may need to call the script analysis module again to process complex logic), and may also actively request the script analysis module for more complex data processing.

[0041] Step d, result output: the final test result is output by the main program module.

[0042] The power meter power failure test method provided by the embodiment of the application, by the host computer importing the script instruction set composed of the script instruction indicating the test scheme and the format predefined, the script instruction is analyzed and the non-communication instruction is converted into the control instruction and is issued to the hardware driving device to execute the power failure test, the instruction content indicates one or more of the power meter power failure test time point, the voltage drop parameter and the power meter environment temperature, so that the power failure test can simulate the environmental conditions and the power failure occurrence conditions of the field operation; thereby, the repeated test can be performed by the automatic test means through a large number of repetitive flexible test schemes combined with the power failure test system, the possibility of failure is simulated in a short time, and the problems that may occur in the long-term operation of the power meter in the user field are exposed in the test environment within a few hours or days, and the possible problems in the software design of the power meter are found earlier.

[0043] Figure 4 is the structural schematic diagram of the hardware driving device provided by the embodiment of the application, as Figure 4 shown, the hardware driving device receives the control instruction from the host computer, drives the hardware to produce mechanical action, electrical control, signal measurement, data collection, communication forwarding function, etc. The following is the explanation of its structure and internal interaction process: The microcontroller unit (MCU) master control chip communicates with the host computer through the USB communication interface or the RS485 communication interface; receives the control instruction issued by the host computer, converts it into internal control instruction logic, automatically calculates and captures the power meter power failure test time point according to the measured power meter signal and the read power meter state data, and executes other test operations at the power meter power failure test time point. Optionally, the communication instruction issued by the host computer is received and forwarded to the power meter; or the communication request of the power meter is received and forwarded to the host computer.

[0044] The signal collection module measures the power meter clock signal and the like.

[0045] Temperature control module, monitoring and adjusting the temperature of the electric energy meter environment.

[0046] Modulation voltage waveform output module, generating pulse width modulation (PWM) waveform and phase control through MCU, controlling the conduction and blocking of thyristor, modulating different voltage signals to the electric energy meter, simulating the working condition of the electric energy meter under different voltage supply conditions.

[0047] Figure 5 is a flowchart of the electric energy meter power failure test method provided by the embodiment of the application, as shown in Figure 5 The execution subject of the method is the MCU master chip in the hardware driving device, and the method includes the following steps: S501, receiving the control instruction issued by the upper computer, the control instruction being used to indicate one or more of the electric energy meter power failure test time point, voltage drop parameter and electric energy meter environment temperature; S502, performing one or more operations based on the control instruction to simulate different power failure working conditions for power failure test: capturing the electric energy meter power failure test time point; outputting the power failure voltage waveform; adjusting the electric energy meter environment temperature.

[0048] Specifically, the MCU master chip adjusts the electric energy meter environment temperature based on the electric energy meter environment temperature indicated by the control instruction, captures the electric energy meter power failure test time point based on the electric energy meter power failure test time point indicated by the control instruction, and outputs the power failure voltage waveform based on the voltage drop parameter indicated by the control instruction, thereby realizing the specified working condition output.

[0049] In some embodiments, the output of the power failure voltage waveform in S502 includes: outputting the power failure voltage waveform based on the voltage drop parameter indicated by the control instruction, the voltage drop parameter being used to represent the voltage drop mode, and the voltage drop mode including linear drop mode, step drop mode, instantaneous drop mode, multiple voltage interruption mode and voltage interruption mode.

[0050] Specifically, different voltage drop parameters correspond to different power failure modes or power failure voltage waveforms. The voltage drop parameter includes voltage drop mode / power failure mode indication and specific parameters under different voltage drop modes / power failure modes. The following describes five possible power failure voltage waveforms, and the voltages represent the root mean square values: Figure 6 is one of the waveform diagrams of the power failure voltage provided by the embodiment of the application, as shown in Figure 6As shown, the first power-down voltage waveform is a linear drop mode. After working at the normal working voltage V1 for a duration of t1, the voltage uniformly drops to V2 for a duration of t2. V2 is below the normal working voltage range of the electric energy meter. After working at V2 for a duration of t3, the voltage uniformly rises to the normal working voltage V1 for a duration of t4. Thus, one cycle of the power-down voltage waveform is completed, and the next cycle of the voltage waveform is entered.

[0051] For the linear drop mode, the voltage drop parameters include: the linear drop upper limit voltage value V1, the linear drop lower limit voltage value V2, the linear drop upper limit voltage holding duration t1, the linear drop voltage falling duration t2, the linear drop lower limit voltage holding duration t3, the linear drop voltage rising duration t4, and the linear drop repetition number. The durations t1, t2, t3, and t4 can be configured to be the same or different.

[0052] Figure 7 is a waveform diagram of the power-down voltage provided by the embodiments of the present application, as shown in Figure 7 As shown, the second power-down voltage waveform is a step drop mode. After working at the normal working voltage V1 for a duration of t1, the voltage instantaneously drops by a first drop voltage difference ΔV, and is held at this voltage level for a first duration of Δt. Then, the voltage instantaneously drops by a second drop voltage difference ΔV, and is held at this voltage level for a second duration of Δt. Then, the voltage instantaneously drops by a third drop voltage difference ΔV, and is held at this voltage level for a third duration of Δt. Finally, the voltage instantaneously drops to V2, which is below the normal working voltage range of the electric energy meter. After working at V2 for a duration of t2, the voltage instantaneously rises by a first rise voltage difference ΔV, and is held at this voltage level for a first duration of Δt. Then, the voltage instantaneously rises by a second rise voltage difference ΔV, and is held at this voltage level for a second duration of Δt. Then, the voltage instantaneously rises by a third rise voltage difference ΔV, and is held at this voltage level for a third duration of Δt. Finally, the voltage instantaneously rises to the normal working voltage V1. Thus, one cycle of the power-down voltage waveform is completed, and the next cycle of the voltage waveform is entered.

[0053] For the step drop mode, the voltage drop parameters include: the step drop upper limit voltage value V1 and the lower limit voltage value V2, the drop number and the rise number K=(V1-V2) / ΔV, the V1 working duration t1 and the V2 working duration t2, the voltage drop duration and the voltage rise duration T=KΔt, and the step drop repetition number. The instantaneously dropped difference ΔV (step) is constant in the same test, but variable in different tests.

[0054] Figure 8 is a waveform diagram of the power-down voltage provided by the embodiments of the present application, as shown in Figure 8As shown, the third power-off voltage waveform is a transient drop mode. After working at the normal working voltage V1 for a duration of t1, the voltage is instantaneously dropped to V2, which is below the normal working voltage range of the electric energy meter. After being kept at the voltage level V2 for a duration of t2, the voltage is instantaneously raised to the normal working voltage V1. Thus, one cycle of the power-off voltage waveform is completed, and the next cycle of the voltage waveform is entered.

[0055] For the transient drop mode, the voltage drop parameters include: the upper limit voltage value V1 and the lower limit voltage value V2 of the transient drop, the upper limit voltage holding duration t1 and the lower limit voltage holding duration t2, and the number of transient drop repetitions. The durations t1 and t2 can be configured to be the same or different.

[0056] Figure 9 Fig. 4 is a waveform diagram of a power-off voltage provided by an embodiment of the present application, as shown in the figure, Figure 9 As shown, the fourth power-off voltage waveform is a multiple voltage interruption mode. After working at the normal working voltage 100% for a certain duration, the voltage is instantaneously dropped from 100% to 0. After being kept at the voltage 0 for 1 s, the voltage is instantaneously raised to 100%. The voltage 100% is kept for 50 ms (two half cycles at 50 Hz). Then, the voltage is instantaneously dropped from 100% to 0. After being kept at the voltage 0 for 1 s, the voltage is instantaneously raised to 100%. The voltage 100% is kept thereafter, and thus one cycle of the power-off voltage waveform is completed, and the next cycle of the voltage waveform is entered.

[0057] The voltage drop parameters of the multiple voltage interruption mode include: the interruption time, the interruption time interval, the number of voltage interruptions, and the number of repetitions of the multiple voltage interruptions.

[0058] Figure 10 Fig. 5 is a waveform diagram of a power-off voltage provided by an embodiment of the present application, as shown in the figure, Figure 10 As shown, the fifth power-off voltage waveform is a voltage interruption mode. After working at the normal working voltage 100% for a certain duration, the voltage is instantaneously dropped from 100% to 0. After one cycle (20 ms at 50 Hz), the voltage is instantaneously raised to 100%, and the voltage 100% is kept for continuous output. Thus, one cycle of the power-off voltage waveform is completed, and the next cycle of the voltage waveform is entered.

[0059] For the voltage interruption mode, the voltage drop parameters include: the interruption time, the interruption time interval, and the number of interruptions. Figure 10 The mode in the middle is a special voltage interruption mode waveform. The interruption time is set to one cycle of the rated frequency, and the number of interruptions is set to 1.

[0060] In some embodiments, the power-off test time point in S502 is captured, including: sending a set-copying time instruction to the electric energy meter and monitoring the second pulse signal of the electric energy meter terminal to determine the theoretical time of the real-time clock of the electric energy meter; aligning the real-time clock time of the electric energy meter and the system test time based on the theoretical time to generate a synchronization time axis; capturing the power-off test time point of the electric energy meter indicated by the control instruction based on the synchronization time axis.

[0061] Specifically, the MCU master chip sends a set-copying time instruction to the electric energy meter first, and immediately monitors the second pulse signal of the electric energy meter terminal to calculate the theoretical time of the real-time clock (RTC) of the electric energy meter. Align the RTC time of the electric energy meter and the test system time to generate a synchronization time axis. Based on the synchronization time axis, output a specific power-off voltage waveform at the test time point of the electric energy meter indicated by the control instruction to test the power-off data storage and running reliability of the electric energy meter. Optionally, a plurality of busy time points are preset, and a time trigger time is generated after analyzing the control instruction. Based on the synchronization time axis, output a specific power-off voltage waveform at the test time point of the electric energy meter indicated by the control instruction to achieve testing at multiple busy time points of the electric energy meter. For example, the control instruction indicates that the power-off test time is "0 o'clock at the beginning of the next day of the electric energy meter time", which means that the control command of power-off is really executed only when the time reaches 00:00:00 of the next day of the current electric energy meter time.

[0062] In some embodiments, the environment temperature of the electric energy meter in S502 is adjusted, including: adjusting the environment temperature of the electric energy meter to the environment temperature of the electric energy meter indicated by the control instruction by heating or air cooling.

[0063] Specifically, the environment temperature of the electric energy meter is adjusted to the set temperature value indicated by the control instruction by heating or air cooling to simulate the high-temperature environment or low-temperature environment in the field.

[0064] The power meter power-off test method provided by the embodiment of the application is used in combination with a hardware driving device and a script instruction, automatically captures a special task time point, and realizes output of a power-off voltage waveform at a precise time. For example, if a 0 o'clock time point at the beginning of a month needs to be captured, a specific script instruction is input to an upper computer, is analyzed by an upper computer script analysis module, is converted into a control instruction of the hardware driving device, is sent to the hardware driving device, and after the hardware driving device recognizes the control instruction, the hardware driving device calculates a millisecond-level theoretical time point by repeatedly reading a power meter clock time and detecting a multifunctional end second pulse signal, and controls a special voltage source to output; the hardware driving device generates a PWM waveform and phase control through an MCU, drives a thyristor to be turned on and turned off, and accurately modulates a waveform of a voltage output signal; through dynamic self-defined programming delay time and amplitude two types of parameters, several special voltage waveforms can be realized, the power meter power-off test is more targeted, and the device cost is also lower.

[0065] Figure 11 is a flowchart of a third power meter power-off test method provided by the embodiment of the application, as shown in the figure, the test method includes the following flow: Figure 11 The upper computer part: import a software test scheme (a script instruction set), a script analysis module of the upper computer identifies a type and an indication value of a script instruction in the script instruction set, and enters different flows respectively: when the script instruction is identified as an instruction for communication with the power meter, point-to-point communication with the power meter is realized through an RS485 / PLC / infrared communication mode, parameter setting, data reading and the like of the power meter are realized, when the script instruction is identified as an instruction for the hardware driving device (indicating a power-off test time point / voltage drop parameter / environmental temperature), the instruction is converted into a control instruction that can be recognized by the hardware driving device, is sent to a main control MCU of the hardware driving device through a USB or RS485 communication channel, and the hardware is driven by the main control MCU to complete specified working condition output.

[0066] The hardware device driving part: receives a control instruction from the upper computer, and performs one or more operations based on the content indicated by the control instruction: ①Adjust the environmental temperature of the power meter; ②Capture the power-off test time point; ③Output a voltage waveform based on the voltage drop parameter.

[0067] ​The power meter power-off test method and system provided by the embodiment of the application can configure a test scheme by receiving simple script instructions, and when complex working condition control needs to be implemented, the required working condition can be accurately and orderly added and superimposed on the power meter to be tested, which is closer to real environmental conditions. The voltage signal control mode based on MCU has the characteristics of low cost, high real-time performance and flexible control compared with programmable power supplies on the market, and is more targeted in power meter power-off test. According to the operation rules input by the script instructions, life acceleration verification of data storage can be automatically performed, each time point such as cross-15 minutes, cross-hour, cross-day, cross-month, etc. can be automatically calculated, and the power meter can be time-set, so that the power meter generates minute freezing, hour freezing, day freezing and month freezing data, which are sequentially stored on the memory. After multiple rounds of repeated data generation and repeated erasing and writing of the memory, the data storage life situation of the power meter after years of operation is simulated. The script instruction format is predefined, and the mathematical or logical operation in the host computer is more flexible and convenient.

[0068] The technical solutions provided by the application are further described below through several specific script instruction code examples.

[0069] Example 1: Freezing time linear voltage drop test 99 times The following script instruction code is input to the host computer, and after analysis by the host computer and control of the hardware driving device, the voltage drop test can be realized at the frozen special time for 99 times.

[0070] Take the meter time Comm: proto = 698, apdu = 050100 40000200 00; Transfer the meter time Transfer: this(8501.40000200); Set the global variable Global: nowyear = $MeterYear; Start the loop body, and drop the voltage 99 times for:99; Set the time zone table switching time to January 1, 0 o'clock of the next year Comm: proto = 698, apdu = 060100 400802001C{Global(nowyear)+$CycleNum×12×month}00; Set the day time period table switching time to January 1, 0 o'clock of the next year Comm: proto = 698, apdu = 060100 400902001C{Global(nowyear)+$CycleNum×12×month}00; Time to current year 12 / 31 / 23:59:55 Comm: proto=698, apdu=060100400002001C{Global(nowyear)+$CycleNumx12xmonth-5sec} 00; Random delay 0-2 seconds Delay:rand(0,2)sec; Drop 2 times, first phase linear drop from source voltage 4 seconds to 0%, second phase hold 0% for 0 seconds, third phase linear rise 4 seconds from 0% to 100%, fourth phase hold 100% for 0 seconds CtrDev: type=dlsource, 1,0, 4, 0, 0, 0, 0, 100, 4, 0, 100, 0, 0; Delay 12 seconds Delay:12sec; End of loop body for:end.

[0071] Example 2: Memory life acceleration loss power-down data storage test Enter the following script instruction code into the host computer, which can realize the data storage test of the memory of the electric energy meter after 10 years under the voltage step drop through the analysis of the host computer and the control of the hardware driving device.

[0072] Take the meter time Comm:proto=698, apdu=050100 40000200 00; Transfer the meter time Transfer: this(8501.40000200); Accelerate to generate the current time to the data that will theoretically be generated after 10 years Comm:proto=698, apdu=070100FF888A00 1C{$Metertime+10x12month} 00; Voltage drop 2 times, first phase drop from source voltage to 40% (2 seconds drop 6 steps); second phase hold 40% for 3 seconds; third phase rise 3 steps to 100% for 3 seconds; fourth phase hold 100% for 3 seconds CtrDev: type=dlsource, 2, 40, 2, 6, 40, 3, 0, 100, 3, 3, 100, 3, 0; Delay 12 seconds Delay:12sec.

[0073] Example 3: Memory life acceleration loss power-down data storage test under high temperature The input script instruction code is as follows: through the analysis of the host computer and the control of the hardware driver, the data storage test of the power meter memory under the voltage step drop after 10 years in the 65-degree high temperature environment can be realized.

[0074] Take the meter time Comm: proto = 698, apdu = 050100 40000200 00; Transfer the meter time Transfer: this (8501.40000200); Heating meter box temperature rises to 65 degrees CtrDev: type = temp, 65.0; Accelerate to generate the current time to the data generated in theory after 10 years Comm: proto = 698, apdu = 070100 FF888A00 1C {$ Metertime + 10 x 12 month} 00; Voltage drop 2 times, the first stage drops to 40% (2 seconds drop 6 steps) from the control source voltage; the second stage maintains 40% for 3 seconds; the third stage rises 3 steps to 100% for 3 seconds; the fourth stage maintains 100% for 3 seconds; CtrDev: type = dlsource, 2, 40, 2, 6, 40, 3, 0, 100, 3, 3, 100, 3, 0; Delay 12 seconds Delay: 12 seconds.

[0075] The device embodiments described above are only schematic, wherein the units illustrated as separate components can or can not be physically separate, and the components illustrated as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. Those skilled in the art can understand and implement without creative labor.

[0076] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of software products, which can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including a plurality of instructions to make a computer device (which can be a personal computer, server, or network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0077] Finally, it should be noted that the above examples are only used to illustrate the technical solutions of the present application, and are not intended to limit the same; although the present application has been described in detail with reference to the foregoing examples, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing examples, or make equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for testing the power failure of an electricity meter, characterized in that, The method, applied to the main program module in a host computer, includes: Obtain a set of script instructions, wherein the script instructions in the set are used to indicate the test plan and have a predefined format; The script parsing module is invoked to load and parse the script instruction set, converting non-communication instructions in the script instruction set into control instructions. The driver execution module is invoked to send the control command to the hardware driver device for power-down testing. The control command is used to indicate one or more of the following: the power outage test time of the electricity meter, the voltage drop parameter, and the ambient temperature of the electricity meter.

2. The method for testing the power outage of an electricity meter according to claim 1, characterized in that, The call driver execution module sends the control command to the hardware driver device for power-down testing, including: The control command is sent to the synchronization control module so that the synchronization control module can synchronize and coordinate the control command, and then send the coordinated control command to the drive execution module.

3. The method for testing the power outage of an electricity meter according to claim 2, characterized in that, The step of calling the driver execution module to send the control command to the hardware driver device for power-down testing also includes: Create or start a multi-position thread loop for different energy meters under test; The control instructions are sent to the multi-tablet thread in a loop so that the multi-tablet thread can call the driver execution module in parallel based on the control instructions.

4. The method for testing the power outage of an electricity meter according to claim 3, characterized in that, The method further includes: The execution results of the hardware driver device, which are cyclically fed back by the multi-tablet thread, are received, and test results are generated. The execution results cyclically fed back by the multi-tablet thread are either directly fed back by the driver execution module after being collected, or indirectly fed back by the synchronization control module.

5. The method for testing the power outage of an electricity meter according to claim 1, characterized in that, The set of script instructions to be acquired includes: Obtain the set of script instructions encrypted through the encryption / decryption interface and parsed by the protocol parsing module according to the predefined communication protocol.

6. The method for testing the power outage of an electricity meter according to claim 1, characterized in that, The method further includes: The protocol parsing module loads and parses the script instruction set, and the communication instructions in the script instruction set are sent to the energy meter under test through the synchronization control module to set parameters and / or read data from the energy meter under test.

7. A method for testing the power failure of an electricity meter, characterized in that, The method, applied to an MCU main control chip in a hardware driver device, includes: Receive control commands from the host computer, the control commands being used to indicate one or more of the following: power outage test time point of the energy meter, voltage drop parameters, and ambient temperature of the energy meter; Based on the control commands, perform one or more of the following operations to simulate different power failure conditions for power failure testing: Capture the power outage test time point of the electricity meter; Output power-down voltage waveform; Adjust the ambient temperature of the electricity meter.

8. The method for testing the power outage of an electricity meter according to claim 7, characterized in that, The output power-down voltage waveform includes: The power-down voltmeter waveform is output based on the voltage drop parameters indicated by the control command. The voltage drop parameters are used to characterize the voltage drop mode, which includes linear drop mode, stepped drop mode, instantaneous drop mode, multiple voltage interruption mode, and voltage interruption mode.

9. The method for testing the power outage of an electricity meter according to claim 7, characterized in that, The time points for capturing power outage tests include: Send a time setting command to the electricity meter and monitor the second pulse signal at the electricity meter terminals to determine the theoretical time of the electricity meter's real-time clock; Based on the theoretical time shown, align the real-time clock time of the energy meter with the system test time to generate a synchronized time axis; The power outage test time point indicated by the control command is captured based on the synchronous time axis.

10. A power outage testing system for electricity meters, characterized in that, It includes a host computer and a hardware driver; the host computer includes a main program module for implementing the power failure test method for electricity meters as described in any one of claims 1 to 6; the hardware driver includes an MCU main control chip for implementing the power failure test method for electricity meters as described in any one of claims 7 to 9.