An automatic testing method for electricity meter event recording
By constructing an event condition matrix to automatically generate and verify electricity meter event records, the problems of high resource consumption and low efficiency of manual testing in existing technologies are solved. This achieves automated testing of electricity meter event records, reduces costs, and improves testing efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WASION GROUP HLDG
- Filing Date
- 2022-11-03
- Publication Date
- 2026-06-30
Smart Images

Figure CN115754883B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart meter technology, and in particular relates to an automatic testing method for electricity meter event recording. Background Technology
[0002] Electricity meters have hundreds of event records. These events are characterized by their unpredictable occurrence; they happen randomly and suddenly, unlike periodically frozen records which exhibit clear cyclical patterns. This difference makes frozen records very easy to automate, while randomly generated event records are much more difficult. The inability to automate testing can negatively impact product quality and stability during development. Sometimes, changes to the code of one event record are assumed to have no effect on another event, thus neglecting testing, but this can actually lead to quality problems and risks.
[0003] Currently, there are few methods for automatically testing electricity meter event logs. The industry generally uses manual testing, checking each event log one by one to identify potential quality issues during development. However, manual testing is costly and may not detect problems in all event logs. Sometimes, poorly designed test cases may miss some event logs, leading to quality risks. Alternatively, the electricity meter can be connected to a test bench, and a test program written on a PC can control the power supply, outputting voltage and current that meet specific event log requirements to the meter, causing it to generate specific event logs. These logs are then read and their accuracy is determined, achieving the testing objective. However, this method requires purchasing expensive test bench equipment, setting up a complex environment, writing specialized test software, and running the test bench with the meter connected to the actual grid power consumption environment for real-time current readings. This consumes a significant amount of electricity and manpower resources. Patent CN105279952A discloses a smart meter event acquisition and testing system based on a virtual energy meter module, including a virtual energy meter module, a novel data collector, a data collector carrier communication module, a terminal carrier communication module, a data acquisition terminal, and an electricity consumption information acquisition master station. This patent requires the construction of a test platform using an actual on-site electricity consumption information acquisition master station and acquisition terminal, resulting in significant consumption of human and material resources and a complex testing process.
[0004] Therefore, how to provide a simple, reliable, resource-efficient, and low-cost method for testing electricity meter event recording is a problem that urgently needs to be solved by those in this technical field. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the purpose of this invention is to provide an automatic testing method for electricity meter event recording, thereby solving the problems of high resource consumption and high cost associated with manual testing or the need for electricity meter connection to a testing platform in existing technologies.
[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0007] In a first aspect, the present invention provides an automatic testing method for electricity meter event recording, comprising:
[0008] S10, Event log generation;
[0009] The event log generation includes the following steps:
[0010] S101. Assign the values of each data object of the energy meter in the event occurrence condition matrix to each of the data objects to trigger the event occurrence;
[0011] S102. Using the hour T as the event record occurrence time, generate event record data at the time of the event occurrence;
[0012] S103. Assign the values of each data object of the energy meter in the event termination condition matrix to each of the data objects to trigger the event termination.
[0013] S104. Repeat steps S101 to S103, incrementing the hourly time T by 1 hour each time the process is repeated, until the maximum number of records is generated.
[0014] S105. Store the data recorded when the event occurred;
[0015] S20, Event Log Verification;
[0016] The event log verification includes the following steps:
[0017] S201. If the occurrence time T1 of the previous event record is obtained, then the occurrence time of the next event record is T2 = T1 + 1 hour.
[0018] S202, Obtain the occurrence time Tn of the previous nth record of the event log;
[0019] S203. Determine if T2-Tn is equal to n hours. If yes, continue testing; otherwise, return test failure.
[0020] S204. For the previous n recorded data, calculate the theoretical complete recorded data based on the obtained occurrence time Tn, compare the theoretical complete recorded data with the current actual recorded data obtained, and determine whether the current actual recorded data is correct. If it is incorrect, return test failure.
[0021] S205, n is incremented by 1, and steps S201 to S204 are repeated until n equals the maximum number of records.
[0022] Furthermore, in step S10, the event record occurrence time T is converted into century seconds, where a century second is the number of seconds from 00:00:00 on January 1, 2000. Then, this century second is used to obtain the specific value of each data object at the time of the event by taking the remainder of the values of the data object when the electricity meter is operating under the maximum voltage and maximum current conditions.
[0023] Furthermore, in step S10, when recording the event end data, T+1 minutes is used as the event recording end time.
[0024] Furthermore, for event records with event end data, when the energy meter determines that the event has ended, the event end time T+1 minutes is converted into century seconds. Then, this century second is moduloed by the values of each data object when the energy meter is operating under the maximum voltage and maximum current conditions to obtain the specific value of each data object at the end of the event.
[0025] Furthermore, the data objects of the electricity meter include voltage, current, active power, reactive power, and power factor.
[0026] Furthermore, in step S20, the event recording occurrence time at the hour T is used as a factor to generate the values of each data object that all other event records need to be stored. At the end of the event recording, the event recording end time T+1 minutes is used as a factor to generate the values of each data object at the end of the event recording.
[0027] Furthermore, in step S20, the occurrence time of the last record of each event record is obtained, and the search for all event records is completed in reverse order, starting from this time.
[0028] In a second aspect, the present invention also provides a computer device, the computer device including at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, it can implement the method described in any of the above-mentioned embodiments.
[0029] Thirdly, the present invention also provides a non-volatile computer-readable storage medium storing a computer program that, when executed by at least one processor, can implement the method described in any of the preceding claims.
[0030] The automatic testing method for electricity meter event recording provided by this invention has at least the following advantages compared with the prior art:
[0031] This invention is simple, reliable, and convenient. By assigning specific values from the energy meter data objects in the event occurrence condition matrix to the energy meter data objects, the energy meter is made capable of generating a certain event. The energy meter can be made capable of generating an event at any time. It can automatically generate all event records, automatically search and verify all event records, and automatically test all object values in each event record. It eliminates the need for manual testing or complex control methods, greatly reducing resource consumption and labor costs, and improving the efficiency of event record generation and verification. Attached Figure Description
[0032] To more clearly illustrate the solutions of the present invention, a brief introduction will be given to the drawings used in the description of the embodiments below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0033] Figure 1 This invention provides a general flowchart of an automatic testing method for recording events in an electricity meter.
[0034] Figure 2 The present invention provides a flowchart of an automatic testing method for electricity meter event recording, including an event record generation process.
[0035] Figure 3 This invention provides an event recording verification flowchart for an automatic testing method for electricity meter event recording. Detailed Implementation
[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. For example, terms such as “length,” “width,” “upper,” “lower,” “left,” “right,” “front,” “rear,” “vertical,” “horizontal,” “top,” “bottom,” “inner,” and “outer” indicate orientations or positions based on the orientations or positions shown in the accompanying drawings and are for ease of description only, and should not be construed as limiting the technical solution.
[0037] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this invention are intended to cover non-exclusive inclusion; the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a particular order. In the specification, claims, and accompanying drawings of this invention, when an element is referred to as "fixed to," "mounted to," "disposed of," or "connected to" another element, it may be directly or indirectly located on that other element. For example, when an element is referred to as "connected to" another element, it may be directly or indirectly connected to that other element.
[0038] Furthermore, the reference to "embodiment" herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0039] This invention provides an automatic testing method for electricity meter event recording, applied to the testing of event recording in smart meters. The automatic testing method for electricity meter event recording includes:
[0040] S10, Event log generation;
[0041] Event log generation includes the following steps:
[0042] S101. Assign the values of each data object of the energy meter in the event occurrence condition matrix to each data object to trigger the event occurrence.
[0043] S102. Using the hour T as the event record occurrence time, generate event record data at the time of the event occurrence;
[0044] S103. Assign the values of each data object of the energy meter in the event termination condition matrix to each data object to trigger the event termination.
[0045] S104. Repeat steps S101 to S103, incrementing the hour T by 1 hour each time the process is repeated, until the maximum number of records is generated.
[0046] S105. Store data when an event occurs;
[0047] S20, Event Log Verification;
[0048] Event log verification includes the following steps:
[0049] S201. If the occurrence time T1 of the previous event record is obtained, then the occurrence time of the next event record is T2 = T1 + 1 hour.
[0050] S202, Obtain the occurrence time Tn of the previous nth record of the event log;
[0051] S203. Determine if T2-Tn is equal to n hours. If yes, continue testing; otherwise, return test failure.
[0052] S204. For the previous n recorded data, calculate the theoretical complete recorded data based on the obtained occurrence time Tn, compare the theoretical complete recorded data with the current actual recorded data obtained, and determine whether the current actual recorded data is correct. If it is incorrect, return test failure.
[0053] S205, n increments by 1, repeat steps S201 to S204 until n equals the maximum number of records.
[0054] This invention is simple, reliable, and convenient. By assigning specific values from the energy meter data objects in the event occurrence condition matrix to the energy meter data objects, the energy meter is made capable of generating a certain event. The energy meter can be made capable of generating an event at any time. It can automatically generate all event records, automatically search and verify all event records, and automatically test all object values in each event record. It eliminates the need for manual testing or complex control methods, greatly reducing resource consumption and labor costs, and improving the efficiency of event record generation and verification.
[0055] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0056] This invention provides an automatic testing method for event recording in electricity meters, applied to the testing of event recording in smart meters, combined with... Figures 1 to 3 In this embodiment, the automatic testing method for electricity meter event recording includes:
[0057] S10, Event log generation;
[0058] Customers have specific requirements regarding the number of recent records that event logs should support storing. Generally, each type of event log should be able to store and retrieve the 10 or 100 most recent records (that is, when the number of event logs is greater than 10, the 10 most recent records should always be saved). In this embodiment of the invention, step S10 is for generating these automatically testable records. To test the event logs, at least the number of records required by the customer must be generated.
[0059] The characteristic of event logging is that the occurrence conditions are irregular; an event record is only generated when the event's conditions are met. Unlike periodic freeze records, which are generated periodically and exhibit obvious periodicity, irregular records cannot be automatically tested. Examining the occurrence and termination conditions of event records reveals that the occurrence and termination of electricity meter event records depend on a subset of the main data objects of the electricity meter (different event records may depend on different subsets). Each data object in the subset experiences or terminates an event when it falls within a specific value range.
[0060] The main data objects of an electricity meter include: voltage, current, active power, reactive power, and power factor; the occurrence or termination of an electricity meter event record depends entirely on the values of these data objects.
[0061] For example, the specification defines overcurrent events in event logs as follows:
[0062] In a three-phase (or single-phase) power supply system, if the load current of a certain phase exceeds the set lower limit for triggering an overcurrent event and the duration exceeds the set overcurrent event determination delay time, this operating condition is called overcurrent.
[0063] The specification defines undervoltage events in the event log as follows:
[0064] In a three-phase (or single-phase) power supply system, if the voltage of a certain phase is less than the set upper limit for triggering an undervoltage event, and the duration is greater than the set delay time for determining the undervoltage event, this condition is called undervoltage.
[0065] Therefore, overcurrent depends on the current as the energy meter object, and undervoltage depends on the voltage as the energy meter object.
[0066] In this embodiment of the invention, an event occurrence condition matrix and an event termination condition matrix are constructed. The occurrence condition matrix contains the event occurrence conditions, which is to put a set of specific values of a set of electricity meter data objects that meet the event occurrence conditions into the occurrence condition matrix. The termination condition matrix contains the event termination conditions, which is to put a set of specific values of a set of electricity meter data objects that meet the event termination conditions into the termination condition matrix.
[0067] In this embodiment of the invention, by assigning a specific value of the electricity meter data object in the event occurrence condition matrix to the electricity meter data object, the electricity meter is made to have the conditions for an event to occur, thereby generating an event. Through the method of the present invention, the electricity meter can be made to have the conditions for an event to occur at any time without the need for a complex control body, without consuming actual electricity, without connecting the electricity meter to an environment that actually consumes electricity, and without generating actual electricity loss.
[0068] Another starting point of this invention is to make irregular event records occur regularly and periodically. Only when they occur regularly and periodically can automatic testing be performed based on time.
[0069] Therefore, the method for achieving periodic and regular occurrence of event recordings according to embodiments of the present invention includes the following steps:
[0070] S101. Assign the values of each data object of the energy meter in the event occurrence condition matrix to each data object to trigger the event. In this way, if the energy meter meets the occurrence conditions of this event, it will store the event record data when this event occurs in accordance with the energy meter specification.
[0071] S102. Using the hour T as the event record occurrence time, generate event record data at the time of event occurrence, so that the event record occurrence time will be an hour.
[0072] S103. After the event occurs, the values of each data object of the energy meter in the event termination condition matrix are assigned to each data object to trigger the event termination. This satisfies the termination condition of the event and the event record data at the end of the event will be recorded in accordance with the energy meter specification.
[0073] S104. Repeat steps S101 to S103, incrementing the hour T by 1 hour each time the process is repeated, until the maximum number of records is generated.
[0074] S105. Store data when an event occurs;
[0075] The event logs generated by the above steps have a time difference of one hour between the occurrence times of the events recorded in the two consecutive records, thus turning the irregular event logs into records of periodic occurrences.
[0076] In this embodiment, overcurrent records are generated according to step S10. The times of the most recent 10 overcurrent records are shown in the following example:
[0077] 22 / 03 / 24 14:00:00
[0078] 22 / 03 / 24 15:00:00
[0079] 22 / 03 / 24 16:00:00
[0080] 22 / 03 / 24 17:00:00
[0081] 22 / 03 / 24 18:00:00
[0082] 22 / 03 / 24 19:00:00
[0083] 22 / 03 / 24 20:00:00
[0084] 22 / 03 / 24 21:00:00
[0085] 22 / 03 / 24 22:00:00
[0086] 22 / 03 / 24 23:00:00
[0087] Step S10 realizes the periodic triggering of irregular event records, turning irregular event records into periodic records. Furthermore, in order to maximize automatic testing and realize automatic search and testing of all data content of the generated record data (that is, to automatically verify the correctness of a record data), this embodiment of the invention uses the event record occurrence time at the above-mentioned hour as a factor when triggering event record data to generate the values of each data object that all other event records need to be stored. At the end of the event record, the event record end time is used as a factor to generate the data at the end of the event record.
[0088] Specifically, the event record occurrence time T is converted into century seconds (that is, the number of seconds since January 1, 2000, 00:00:00). Then, this century second is divided by the values of each data object under the maximum voltage and maximum current conditions of the electricity meter to obtain the specific value of each data object at the time of the event. In this way, the specific value of each data object recorded at the time of the event is different for each record (it will be a definite value related to the event record occurrence time of this record that can be automatically calculated). However, the specific value of each data object is also a verifiable definite value, so that it can be automatically checked for correctness (only a definite value that can be automatically calculated can be automatically compared to verify the correctness of the recorded data).
[0089] Of course, for event records with event end data, when the energy meter determines that the event has ended, the event end time T+1 minutes is converted into century seconds, and event end record data is generated according to step S10. That is, the specific value of each data object at the end of the event is obtained by taking the remainder of this century second with the value of each data object when the energy meter is working under the maximum voltage and maximum current conditions.
[0090] The main data objects of an electricity meter are: voltage, current, active power, reactive power, power factor, etc. Each data object has its maximum value, which is a fixed value related to the hardware specifications of the electricity meter. It is a constant in the electricity meter. For example, the 220V, 5(60)A specification has a rated voltage of 220V, a rated current of 5A, a maximum voltage of 380V, and a maximum current of 60A.
[0091] Electricity can also be converted into a specific value based on the century-second of the event occurrence by multiplying the maximum power by the century-second of the event occurrence.
[0092] In this embodiment of the invention, the value of each data object at the occurrence or end of an event is obtained by taking the remainder of the constants corresponding to the century second of the event record occurrence time of the electricity meter. These values are then stored according to customer requirements at the occurrence or end of the event, thereby forming an event record data.
[0093] S20, Event Log Verification;
[0094] After the event log is generated, the required event log search function needs to be verified, and the ability of the electricity meter to correctly store the event log needs to be verified.
[0095] As described in step S10, the time difference between the previous and next highlighted records of the event records generated in this embodiment of the invention is one hour. Therefore, by obtaining the record occurrence time of the last record of each event record and using this time as the starting point, the search for all records can be completed in reverse order.
[0096] In this embodiment, the test is for an overcurrent event. The last record of the overcurrent event is dated March 24, 2022, at 23:00:00. According to the design of this invention, the time difference between two consecutive records is one hour. Therefore, the occurrence times of the most recent 10 overcurrent records are:
[0097] The time of the previous record 22 / 03 / 24 23:00:00 The time of occurrence of the previous two records 22 / 03 / 24 22:00:00 The occurrence time of the above 3 records 22 / 03 / 24 21:00:00 The occurrence time of the above 4 records 22 / 03 / 24 20:00:00 The occurrence time of the above 5 records 22 / 03 / 24 19:00:00 The occurrence time of the above 6 records 22 / 03 / 24 18:00:00 The above 7 records occurred at the time 22 / 03 / 24 17:00:00 The occurrence time of the above 8 records 22 / 03 / 24 16:00:00 The above 9 records occurred at the time 22 / 03 / 24 15:00:00 The time of occurrence of the previous 10 records 22 / 03 / 24 14:00:00
[0098] Each record's occurrence time data is generated using the occurrence time as a factor, and its end time data is generated using the end time data as a factor. Furthermore, the automatic test record generated in this embodiment of the invention has an end time of occurrence time + 1 minute. Based on the construction method of each data object in this event record, each time the occurrence time of a record is obtained, the theoretical complete record data can be calculated based on the occurrence time. By comparing the theoretical complete record data with the currently found actual record, it can be determined whether a record data is correct.
[0099] In step S20, the event log verification includes the following steps:
[0100] S201. If the occurrence time T1 of the previous event record is obtained, then the occurrence time of the next event record is T2 = T1 + 1 hour.
[0101] S202. Obtain the occurrence time Tn of the previous n-th record data (n starts from 1) of the event record;
[0102] S203. Determine if T2-Tn is equal to n hours. If yes, continue testing; otherwise, return test failure.
[0103] S204. For the previous n recorded data, calculate the theoretical complete recorded data based on the obtained occurrence time Tn, compare the theoretical complete recorded data with the current actual recorded data obtained, and determine whether the current actual recorded data is correct. If it is incorrect, return test failure.
[0104] S205, n increments by 1, repeat steps S201 to S204 until n equals the maximum number of records.
[0105] The automatic testing method for electricity meter event recording described in the above embodiments constructs an event occurrence condition matrix and an event termination condition matrix. The values of each electricity meter data object in the occurrence condition matrix are assigned to each object. When the electricity meter meets the occurrence condition of the event, it will store the event recording data according to the electricity meter specifications. Similarly, the values of each electricity meter data object in the termination condition matrix are assigned to each object, thus meeting the termination condition of the event and recording the event recording data at the end of the event according to the electricity meter specifications. The method uses a full hour (T) as the event recording occurrence time and T+1 minutes as the event recording termination time. T is incremented by one hour to determine the next recording time. This method generates the required number of records. The time difference between the event occurrence times of consecutive records generated by this method is one hour, thus transforming irregular event recordings into periodic records. This makes the irregular event recordings more consistent. Automated testing becomes possible. When event log data is triggered, the event log occurrence time at the top of the hour is used as a factor to generate the values of all data objects that need to be stored in the current event log. At the end of the event log, the event log end time is used as a factor to generate the data at the end of the event log. This method makes each generated record data automatically verifiable and testable. By determining whether the time difference between two consecutive records is one hour, all records are searched. For each found record, the theoretical complete record data can be calculated based on its occurrence time. By comparing the theoretical complete record data with the found current actual record data, it can be determined whether a record data is correct and complete. The entire solution is simple, reliable, and convenient, eliminating the need for manual testing or complex control systems, greatly reducing resource consumption and labor costs, and improving the efficiency of event log generation and verification.
[0106] Based on the above embodiments, the present invention also provides a computer device, wherein the computer device includes: a memory and one or more processors. This embodiment uses one processor as an example. The processor and the memory can be connected via a communication bus or other means. The processor is used to perform various control logic of the computer device, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a microcontroller, an ARM (Acorn RISC Machine) or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Furthermore, the processor can also be any conventional processor, microprocessor, or state machine. The processor can also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.
[0107] Memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the computer program corresponding to the automatic testing method for recording electricity meter events in the embodiments of the present invention. The processor executes various functional applications and data processing of the computer device by running the non-volatile software programs, instructions, and units stored in the memory, thereby implementing the automatic testing method for recording electricity meter events in the above method embodiments.
[0108] The memory may include a program storage area and a data storage area, wherein the program storage area may store application programs required for operating the device and at least one function; and the data storage area may store data created based on the use of the computer device. Furthermore, the memory may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0109] One or more units are stored in memory, and when executed by one or more processors, they can implement the automatic testing method for recording electricity meter events as described in any of the above method embodiments. For example, the method described above can be implemented. Figure 1 Method steps S10 to S20.
[0110] Based on the above embodiments, the present invention also provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, it can implement the automatic testing method for electricity meter event recording as described in any of the above method embodiments, for example, it can implement the above-described method. Figure 1 Method steps S10 to S20.
[0111] As an example, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchronous ink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The memory components or memories disclosed in the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.
[0112] Another embodiment of the present invention provides a computer program product comprising a computer program stored on a non-volatile computer-readable storage medium, the computer program including program instructions that, when executed by a processor, can implement the automatic testing method for recording electricity meter events as described in any of the above method embodiments, for example, can implement the above-described method. Figure 1 Method steps S10 to S20.
[0113] Obviously, the embodiments described above are merely preferred embodiments of the present invention, and not all embodiments. The accompanying drawings illustrate preferred embodiments of the present invention, but do not limit the scope of the patent. The present invention can be implemented in many different forms; rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this invention.
Claims
1. An automatic testing method for electricity meter event recording, characterized in that, include: S10, Event log generation; The event log generation includes the following steps: S101. Assign the values of each data object of the energy meter in the event occurrence condition matrix to each of the data objects to trigger the event occurrence; S102. Using the hour T as the event record occurrence time, generate event record data at the time of the event occurrence; S103. Assign the values of each data object of the energy meter in the event termination condition matrix to each of the data objects to trigger the event termination. S104. Repeat steps S101 to S103, incrementing the hourly time T by 1 hour each time the process is repeated, until the maximum number of records is generated. S105. Store the data recorded when the event occurred; In step S10, the event record occurrence time T is converted into century seconds, which is the number of seconds from 00:00:00 on January 1, 2000. Then, this century second is moduloed by the values of each data object when the electricity meter is operating under the maximum voltage and maximum current conditions to obtain the specific value of each data object when the event occurs. In step S10, when recording the event end data, T+1 minutes is used as the event recording end time. For event records with event end data, when the energy meter determines that the event has ended, the event end time T+1 minutes is converted into century seconds. Then, this century second is moduloed by the values of each data object when the energy meter is operating under the maximum voltage and maximum current conditions to obtain the specific value of each data object at the end of the event. S20, Event Log Verification; The event log verification includes the following steps: S201. If the occurrence time T1 of the previous event record is obtained, then the occurrence time of the next event record is T2 = T1 + 1 hour. S202, Obtain the occurrence time Tn of the previous nth record of the event log; S203. Determine if T2-Tn is equal to n hours. If yes, continue testing; otherwise, return test failure. S204. For the previous n recorded data, calculate the theoretical complete recorded data based on the obtained occurrence time Tn, compare the theoretical complete recorded data with the current actual recorded data obtained, and determine whether the current actual recorded data is correct. If it is incorrect, return test failure. S205, n is incremented by 1, and steps S201 to S204 are repeated until n equals the maximum number of records.
2. The automatic testing method for electricity meter event recording according to claim 1, characterized in that, The data objects of the electricity meter include voltage, current, active power, reactive power, and power factor.
3. The automatic testing method for electricity meter event recording according to claim 1, characterized in that, In step S20, the event recording occurrence time at the hour T is used as a factor to generate the values of each data object that all other event records need to be stored. At the end of the event recording, the event recording end time T+1 minutes is used as a factor to generate the values of each data object at the end of the event recording.
4. The automatic testing method for recording electricity meter events according to claim 1, characterized in that, In step S20, the occurrence time of the last record of each event record is obtained, and the search for all event records is completed in reverse order, starting from this time.
5. A computer device, characterized in that, The computer device includes at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and when executed by the at least one processor, the computer program can implement the method as described in any one of claims 1 to 4.
6. A non-volatile computer-readable storage medium, characterized in that, The non-volatile computer-readable storage medium stores a computer program that, when executed by at least one processor, can implement the method as described in any one of claims 1 to 4.