Electric energy meter test simulation method and system based on experimental environment
By configuring virtual energy meters and processors in an energy meter simulation system to generate virtual test scenarios, the problems of high cost and low efficiency in energy meter testing are solved, achieving efficient testing and cost savings for energy meter networks.
Patent Information
- Application Number
- CN202511493873.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-10-20
AI Technical Summary
Existing technologies are costly and inefficient in electricity meter testing, requiring the construction of test environments in real-world scenarios, which leads to high labor costs and long testing cycles.
By configuring multiple virtual energy meters in the energy meter simulation system, a virtual test scenario is generated using a processor, and test tasks are determined through preset test requirements and scheduling algorithms. This enables the reuse of physical hardware resources of the energy meters under test multiple times, reduces the number of physical energy meters, and simulates various test requirements.
It reduces the deployment cost of electricity meter networks, improves testing efficiency, and solves the problems of low testing efficiency and limited testing scenarios in traditional electricity meter networks.
Smart Images

Figure CN120949153A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electricity meter technology, and more specifically, to an electricity meter testing simulation method and system based on an experimental environment. Background Technology
[0002] With the development of smart grids, a single master station may need to manage tens of thousands of electricity meters, and even within a single residential community, a large number of electricity meters need to be installed. Before building an electricity meter network within a certain area, testing is generally required, including tests for data acquisition, remote control, cost calculation, and fault diagnosis.
[0003] Existing technologies generally require setting up a test environment in a real-world scenario, such as actually deploying electricity meters in a residential community to complete the test.
[0004] Existing testing methods are not only costly but also inefficient. Summary of the Invention
[0005] The purpose of this application is to provide a method and system for simulating electricity meter testing based on an experimental environment, in order to address the shortcomings of the existing technology mentioned above, and to solve the problems that the existing testing methods are not only costly but also inefficient.
[0006] To achieve the above objectives, the technical solution adopted in this application is as follows: In a first aspect, this application provides a method for simulating electricity meter testing based on an experimental environment, applied to a processor in an electricity meter simulation system. The electricity meter simulation system includes: the processor, multiple electricity meters to be tested, all of which are communicatively connected to the processor; each electricity meter to be tested is configured with multiple virtual electricity meters, each virtual electricity meter being set with a virtual identifier and a corresponding virtual address. The method includes: Based on the actual test scenario, establish virtual communication relationships between multiple virtual energy meters to generate a virtual test scenario; Based on the preset test requirements and preset scheduling algorithm, determine the test task for acquiring each virtual energy meter; Based on the test task and corresponding virtual address of each virtual energy meter, test parameters are sent to the corresponding virtual energy meter, and test results are collected. Each virtual energy meter performs the test using the energy meter under test according to the test parameters.
[0007] Optionally, before calculating and obtaining the test tasks for each virtual energy meter based on preset test requirements and a preset scheduling algorithm, the method further includes: Based on the actual test scenario and the preset scenario model, configuration parameters for each virtual energy meter are generated. The preset scenario model is obtained by training based on a sample dataset, which includes: a large amount of historically collected working data of energy meters, basic data of energy meters, and corresponding configuration parameters. Configure each of the virtual energy meters according to the configuration parameters.
[0008] Optionally, the configuration parameters include: the response logic of each energy meter to external commands, the data reporting strategy, and the electrical load data with time-series characteristics.
[0009] Optionally, determining the test task for each virtual energy meter based on preset test requirements and a preset scheduling algorithm includes: The process involves determining the grouping of virtual energy meters and the test type corresponding to each virtual energy meter based on preset test requirements and the virtual distribution relationship of virtual energy meters. Based on the test type corresponding to each virtual energy meter and the preset scheduling algorithm, the test task for acquiring each virtual energy meter is determined.
[0010] Optionally, determining the test task for each virtual energy meter based on the test type corresponding to each test energy meter and the preset scheduling algorithm includes: If the test type is a fault test, the fault type and fault parameters corresponding to each virtual energy meter are assigned according to multiple preset fault states and preset scheduling algorithms. The fault type includes one or more combinations of the following: communication module offline, data metering abnormality, device clock drift, and memory error.
[0011] Optionally, determining the test task for each virtual energy meter based on the test type corresponding to each test energy meter and the preset scheduling algorithm includes: If the test type is a link test, according to the preset scheduling algorithm, each virtual energy meter is controlled to simulate the transmission of messages with the processor, and communication data during the transmission of messages is collected. The communication data includes one or more of the following: communication delay, data packet loss rate, and signal strength attenuation.
[0012] Optionally, the collected test results include: The system receives electrical parameters reported by each virtual energy meter after performing tests using the energy meter under test according to the test parameters. Each virtual energy meter is configured with autonomous reporting capability and is configured with triggering reporting conditions. Based on the electrical parameters, the test results are analyzed and obtained.
[0013] Optionally, the method further includes: Create identity information for multiple virtual energy meters for each of the energy meters to be tested, wherein the identity information includes: a virtual identifier and a corresponding virtual address; Based on the identity information of each virtual energy meter, establish an interface reuse relationship between each virtual energy meter and the communication interfaces of the energy meter under test. Configure information transmission logic for the input / output interface of the energy meter under test.
[0014] Optionally, the method further includes: A virtual network simulator is configured for each virtual energy meter using a virtual engine to simulate the current network environment data of each virtual energy meter according to preset test requirements. The current network environment data includes one or more of the following: network latency, packet loss rate, and signal strength.
[0015] Secondly, this application provides an electricity meter simulation system, which includes: a processor, a plurality of electricity meters to be tested, all of which are communicatively connected to the processor; each of the electricity meters to be tested is configured with a plurality of virtual electricity meters, and each virtual electricity meter is set with a virtual identifier and a corresponding virtual address; When the energy meter simulation system is running, the processor is used to execute the steps of the energy meter test simulation method based on the experimental environment described in the first aspect.
[0016] The beneficial effects of this application are as follows: By configuring multiple virtual energy meters for a single energy meter under test, the physical hardware resources of the energy meter under test are reused multiple times, reducing the number of physical energy meters required in the energy meter network and thus saving deployment costs. During energy meter network testing, the actual test scenario can be simulated using virtual energy meters in a virtual test scenario. Test tasks for each virtual energy meter are determined through preset test requirements and a preset scheduling algorithm. Then, test parameters are sent to the virtual energy meters and test results are collected based on their test tasks and virtual addresses. In this process, users do not need to disassemble physical energy meters multiple times; they only need to change the virtual communication relationships of the virtual energy meters to achieve testing for various requirements, solving the problems of low efficiency and limited scenarios in traditional physical energy meter network testing.
[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This paper illustrates a schematic diagram of the architecture of an energy meter simulation system provided in an embodiment of this application. Figure 2 A flowchart of a test simulation method for electricity meters based on an experimental environment, provided in an embodiment of this application, is shown. Figure 3 This document illustrates a flowchart of configuring a virtual energy meter according to an embodiment of this application. Figure 4 A flowchart illustrating a method for determining a test task, as provided in an embodiment of this application, is shown. Figure 5 This application provides a flowchart for obtaining test results according to an embodiment of the present application. Figure 6 This document illustrates a flowchart of configuring a virtual energy meter for an energy meter under test, according to an embodiment of this application. Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0021] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0022] Before setting up an electricity meter network, testing is generally required. Current testing methods typically involve building a test environment in a real-world setting, and then performing tests such as data acquisition, remote control, cost calculation, and fault diagnosis within that environment. Existing technologies can be used to complete testing either by building an electricity meter network in a laboratory or by actually deploying electricity meters within a residential community.
[0023] However, when the deployment of electricity meter networks is complex, a large number of electricity meters need to be deployed for the testing environment. Furthermore, actually building an electricity meter network requires significant manpower, making the existing technology prohibitively expensive. In addition, the deployment, debugging, and parameter configuration of physical electricity meters all require manual operation. Therefore, when testing in different environments, testers need to repeatedly disassemble and reassemble the electricity meter hardware, resulting in long testing cycles and low efficiency.
[0024] Based on this, this application proposes a test simulation method for electricity meters based on an experimental environment. By mapping a physical smart meter to multiple logically independent virtual entities, the physical hardware resources and logical business identities of the smart meter are decoupled. This allows for the construction of complex electricity meter networks with fewer physical electricity meters, reducing the cost of building electricity meter networks and improving the testing efficiency of electricity meter networks.
[0025] The method described in this application can be applied to the processor of an electricity meter simulation system. Figure 1 This is a schematic diagram of the architecture of an energy meter simulation system provided in an embodiment of this application.
[0026] Reference Figure 1 The system includes a processor and multiple energy meters under test. Each energy meter under test is connected to the processor. Each energy meter under test can be configured with multiple virtual energy meters. The number of virtual energy meters configured for each energy meter under test can be the same or different. Each virtual energy meter is set with a virtual identifier and a corresponding virtual address.
[0027] The energy meter under test can be a physical smart meter, which is a new type of energy metering device that integrates digital metering, data storage, two-way communication, and intelligent control functions. A virtual identifier is used to uniquely identify a virtual energy meter, and a virtual address is used to enable connection between virtual energy meters and other virtual energy meters, or for data communication between virtual energy meters and other virtual energy meters.
[0028] The following is combined with Figure 2 The flowchart of the energy meter testing simulation method based on the experimental environment in this application is described below, with reference to... Figure 2 The method includes: S201. Based on the actual test scenario, establish virtual communication relationships between multiple virtual energy meters to generate a virtual test scenario.
[0029] The actual test environment is the environment in which smart meters operate in a real power grid, such as "the electricity meter network of three buildings in a residential community" or "the high-load electricity meter cluster in an industrial park". The actual test environment includes multiple electricity meters and can characterize the topological relationship and communication interaction logic of each electricity meter.
[0030] Optionally, the actual test environment can be automatically generated by inputting scenario relationships, or an operable interface can be provided for users to configure the actual test environment.
[0031] In one possible implementation, multiple virtual energy meters can be configured for each physical energy meter under test, based on the number of energy meters in the actual test environment. Then, the virtual energy meters are configured according to the communication topology of the energy meters in the actual test environment, ensuring that the topology and communication interaction logic of the virtual energy meters are identical to those in the actual test environment, thus generating a virtual test scenario. Each virtual energy meter is used to simulate one physical energy meter in the actual test environment.
[0032] Optionally, when configuring a virtual energy meter for each entity's energy meter under test, a registry can be used to record the data structure of each virtual energy meter. Each data structure includes a virtual identifier, virtual address, state machine, and behavioral model. The state machine records information such as the virtual energy meter's current cumulative energy consumption, instantaneous voltage / current, power factor, last settlement data, and event flag registers (e.g., cover opening, voltage loss). The behavioral model defines the virtual energy meter's response logic to external commands and its autonomous data reporting strategy. When there are N virtual energy meters, there are N such independent data structures in memory. Each data structure is independent and evolves its state independently according to its own behavioral model, updating the data recorded in the state machine.
[0033] Optionally, establishing virtual communication relationships between virtual energy meters can be achieved by connecting the virtual energy meters corresponding to the physical energy meters according to the connection relationships of the physical energy meters in the actual test environment, and configuring the virtual energy meters corresponding to the physical energy meters according to the configuration information of the physical energy meters in the communication link in the actual test environment.
[0034] It is worth noting that in some actual test scenarios, the electricity meter network may include not only electricity meters, but also nodes on the communication link such as concentrators. When there are multiple concentrators or other communication nodes, multiple virtual concentrators can be configured for one concentrator, and the virtual concentrators and virtual electricity meters can be connected and configured according to the connection and communication relationships of the actual test scenario, thereby realizing the construction of a virtual test scenario.
[0035] For example, suppose the actual test scenario is an electricity meter network of 3 buildings in a residential community, which includes a building concentrator and 20 household electricity meters. There are 6 electricity meters to be tested. One of these meters can simulate the building concentrator, and the remaining 5 meters can be configured with 4 virtual electricity meters each. Each virtual meter simulates one household electricity meter in the actual test environment. The virtual meters are connected and configured according to the topology and communication links of the electricity meter network in the actual test environment to obtain the virtual test environment.
[0036] Optionally, the virtual test scenario is the final generated software-based test environment, consisting of a virtual electricity meter and virtual communication relationships between the virtual electricity meters. There is no need to deploy physical electricity meters; the operating environment of the electricity meters in the real power grid can be reproduced solely through the virtual electricity meters and virtual communication relationships.
[0037] S202. Based on the preset test requirements and preset scheduling algorithm, determine the test task for each virtual energy meter.
[0038] Optionally, the preset test requirements include at least one of the following: data acquisition testing, fault tolerance testing, remote control testing, link stability testing, etc. In one possible implementation, the user can input the test objective or functional requirements for the electricity meter network in the operable interface, and the processor can generate test requirements based on the user input.
[0039] Among them, the data acquisition test tests whether the electricity meter can accurately report voltage, current, and power data; the fault tolerance test tests whether the electricity meter can save data after communication is lost; the remote control test tests whether the electricity meter can execute commands after receiving them; and the link stability test tests whether the electricity meter network loses packets when multiple meters report concurrently.
[0040] Optionally, the preset scheduling algorithm can be a control logic for resource allocation and priority control of virtual energy meters in a virtual test scenario, such as prioritizing critical tasks and then processing non-critical tasks, or ensuring that each virtual energy meter executes test tasks efficiently without conflict.
[0041] The testing tasks can be specific test content assigned to each virtual electricity meter. In a real power grid, the master station needs to assign different tasks to different electricity meters, such as issuing meter reading instructions to residential meters and issuing fault diagnosis instructions to faulty meters.
[0042] After the tester inputs the preset test requirements, the processor can parse the test requirements and determine the virtual meters related to the test requirements. It then calls the preset scheduling algorithm to allocate test tasks according to task priority, the identifier of the virtual meter, and the virtual address. After ensuring that there are no conflicts in the test tasks of each virtual meter through the preset scheduling algorithm, the test tasks are sent to each virtual meter.
[0043] S203. Based on the test task and corresponding virtual address of each virtual energy meter, send test parameters to the corresponding virtual energy meter and collect test results.
[0044] Each virtual energy meter performs tests using the corresponding physical energy meter under test, based on the test parameters. It should be understood that a virtual energy meter is a virtualized instance and does not have independent hardware. When performing test tasks, it relies on the physical energy meter on which the virtual energy meter is located—that is, the energy meter under test on which the virtual energy meter resides.
[0045] For example, suppose a virtual energy meter needs to simulate a data metering anomaly. If the virtual energy meter is configured on the energy meter under test A, the metering chip of the energy meter under test A can be called to temporarily modify the metering coefficient of the energy meter under test A, and then the data can be reported through the communication module of the energy meter under test A.
[0046] Optionally, the test parameters can be the instruction parameters for the virtual energy meter to execute the test task, including the specific configuration values required to execute the test task. For example, assuming the test task is to simulate offline communication, the test parameter could be the offline duration of 30 seconds.
[0047] The virtual address can be the virtual communication address of the virtual energy meter. The processor can use the virtual address to locate the virtual energy meter and thus accurately send the test parameters of the test task to the virtual energy meter.
[0048] In this embodiment, by configuring multiple virtual energy meters for a single energy meter under test, the physical hardware resources of the energy meter under test are reused multiple times, reducing the number of physical energy meters required in the energy meter network and thus saving deployment costs. During energy meter network testing, the actual test scenario can be simulated using virtual energy meters in a virtual test scenario. Test tasks for each virtual energy meter are determined through preset test requirements and a preset scheduling algorithm. Test parameters are then sent to the virtual energy meters and test results are collected based on their test tasks and virtual addresses. In this process, users do not need to disassemble physical energy meters multiple times; by simply changing the virtual communication relationships of the virtual energy meters, various test requirements can be met, solving the problems of low efficiency and limited scenarios in traditional physical energy meter network testing.
[0049] Before calculating and obtaining the test tasks for each virtual energy meter based on preset test requirements and preset scheduling algorithms, in order to further improve the realism of the virtual energy meter's electricity consumption simulation, the parameters of the virtual energy meter can be configured according to the actual test scenario, such as... Figure 3 As shown, the method of this application further includes: S301. Generate configuration parameters for each virtual energy meter based on the actual test scenario and the preset scenario model.
[0050] The preset scenario model is trained based on a sample dataset, which includes: a large amount of historically collected working data from electricity meters, basic data of electricity meters, and corresponding configuration parameters.
[0051] The operating data of the electricity meter includes time-series data collected by the physical meter during operation, such as voltage / current fluctuations, cumulative electricity consumption, and fault records. Basic meter data includes the meter's model, metering accuracy, user type, and installation area. Configuration parameters refer to the parameter settings of the physical meter during actual operation, serving as label data for training the preset scenario model.
[0052] Optionally, the preset scenario model can be a scenario-parameter mapping model trained on a sample dataset, used to learn the correlation between actual test scenarios and meter configuration parameters.
[0053] The behavior model of each virtual energy meter can be dynamically generated through a pre-trained preset scenario model. The preset scenario model can be a generative adversarial network model. The preset scenario model generates configuration parameters based on test requirements and sends the configuration parameters to each virtual energy meter. The configuration parameters are transformed into a behavior model in the virtual energy meter. The behavior model is trained based on real electricity consumption data to generate configuration parameters.
[0054] Optionally, testers can input the scene characteristics of the actual test scenario into the operable interface, including the scene type, scene parameters, and special requirements of the scene. After the processor inputs the scene characteristics into the preset scene model, the preset scene model can predict parameters based on the scene characteristics and output the configuration parameters of each virtual energy meter in the virtual test scenario.
[0055] In one possible implementation, the configuration parameters of all virtual energy meters in the virtual test scenario can be predicted using a preset scenario model to obtain the configuration parameters of each virtual energy meter. The configuration parameters are then sent to each virtual energy meter to generate a behavioral model in each virtual energy meter.
[0056] For example, suppose the scenario features are "Scenario type - residential community, scenario parameters - 200 households, peak electricity consumption 18:00-22:00, meter model DT123, special needs - including 10% elderly users and 90% ordinary users". After inputting the scenario features into the preset scenario model, the preset scenario model can predict the general configuration parameters and the personalized parameters for special needs. The general configuration parameters can be applied to all virtual electricity meters, and the personalized parameters can be applied to some virtual electricity meters.
[0057] S302. Configure each virtual energy meter according to the configuration parameters.
[0058] Optionally, the processor can send configuration parameters to the virtual energy meter based on the virtual address of the virtual energy meter, decompose the configuration parameters into data structure fields of the instance registry, and write the configuration parameters into the data structure of the corresponding virtual energy meter.
[0059] After the processor completes the parameter configuration for all virtual energy meters, it can send test commands to each virtual energy meter and verify whether each virtual energy meter responds according to the configuration parameters to verify whether the configuration is effective.
[0060] The configuration parameters include: the response logic of each energy meter to external commands, the data reporting strategy, and the electrical load data with time-series characteristics.
[0061] Optionally, the response logic of an electricity meter to external commands refers to the rules governing how the electricity meter processes, executes, and feeds back results when it receives external commands. This includes response timeliness rules, exception handling rules, and execution priority rules.
[0062] The data reporting strategy refers to the rules by which virtual energy meters actively report data to the processor, including what data to report, when to report, and how to handle reporting failures.
[0063] Electricity load data with time-series characteristics refers to the data on how the electricity load of a virtual electricity meter changes over time, simulating the real electricity meter. This includes time information and the electricity load corresponding to each time period.
[0064] If a virtual testing environment is used to simulate the electricity consumption scenario of a residential community, in order to match the peak and valley characteristics of household electricity consumption and the low-frequency interaction needs, the response logic in its configuration parameters includes: after receiving the meter reading command from the master station, return the data within 3 seconds; if the master station command format is incorrect, return an invalid command identifier; the data reporting strategy includes: reporting the cumulative electricity consumption once at a preset time every day, and actively reporting anomalies only when preset abnormal events occur; the time-series characteristic electricity load data is generated by the preset scenario model, and the data characteristics match the peak and valley of residential electricity consumption, for example, "0:00-6:00 current 1.2A, voltage 220V; 19:00 current 9.5A, voltage 218V", with a time granularity of 5 minutes / data.
[0065] It should be noted that the role of each virtual energy meter may be different in different testing environments. For example, the electricity consumption patterns of an office energy meter and a factory energy meter in an industrial environment are different, so their configuration parameters are also different.
[0066] If a virtual testing environment is used to simulate the power consumption scenario of an industrial park, in order to match the high load and high frequency monitoring requirements of industrial production, the data characteristics of the electrical load data in the configuration parameters can be "current 18.5±1A, voltage 380V (industrial power) from 8:00 to 20:00, current 2.5A after 20:00", with a time granularity of 1 minute / item (to meet the high frequency monitoring requirements); the response logic to external commands is as follows: when an "overload trip command" is received, it is executed and feedback is provided within 0.5 seconds. If the reported data is lost, it is automatically retried 5 times. If the retry fails, a local alarm log is triggered; the data reporting strategy includes: reporting current, voltage, and power factor once every 5 minutes; when "current exceeds 20A (overload)" and "metering error exceeds ±1%", it is reported immediately (within 1 second) and the electrical parameters at the time of the fault are attached.
[0067] If a virtual testing environment is used to simulate the power consumption scenario of a commercial complex, in order to match the needs of high fluctuations in business hours and multi-device linkage, the power load data in the configuration parameters is characterized as "current surges by 12A at 9:00 and drops by 4A at 22:00, fluctuating by ±2A every 30 minutes during business hours", and includes "the field associated with virtual POS machine data"; the data reporting strategy includes: reporting power consumption + POS machine transaction count once every 15 minutes, and immediately reporting when "communication disconnection exceeds 5 minutes" or "current drops by more than 5A (possibly due to store closure abnormality)"; the response logic includes: when receiving the "air conditioning start / stop control command", feeding back the execution result within 1 second, simulating "signal strength -85dBm" (signal attenuation characteristics in densely populated areas, the technical implementation details of the document mention "modifying RSSI value in network simulator"), and adding a 10-20ms delay to the response packet (simulating signal interference).
[0068] The above process, based on preset test requirements and a preset scheduling algorithm, determines the test tasks for each virtual energy meter. Figure 4 As shown, it includes: S401. Based on the preset test requirements and the virtual distribution relationship of virtual energy meters, determine the grouping of virtual energy meters and the test type corresponding to each virtual energy meter.
[0069] Optionally, the virtual distribution relationship can be a logical topology formed by virtual energy meters simulating the physical distribution of real energy meters, generated based on the virtual communication relationship established in step S201 above, and used to reflect the hierarchical relationship and regional association between virtual energy meters.
[0070] Based on the preset test requirements and virtual distribution relationships, the virtual energy meters in the virtual test environment can be divided into multiple groups, and the virtual energy meters in each group have the same test objectives.
[0071] The testing types for virtual energy meters can be categorized based on the functions of the virtual energy meter, including: fault testing, link testing, remote control testing, data acquisition testing, etc.
[0072] In one possible implementation, testers can input multiple test requirements. After receiving multiple test requirements, the processor can group the virtual energy meters according to their virtual distribution relationship. Each group is used to fulfill a test requirement, and the test type of each virtual energy meter in each group is determined.
[0073] When grouping virtual energy meters, they can be grouped according to their virtual distribution relationship. Each virtual energy meter is used to simulate a physical energy meter. Therefore, virtual energy meters can be grouped based on the location distribution of physical energy meters, such as by the building where the physical energy meters are located.
[0074] For example, suppose we need to perform link testing on buildings 1 and 2, and data acquisition testing on building 3 in a virtual test scenario. The processor can divide the virtual energy meters into three groups according to their virtual distribution relationship: group 1 simulates building 1, group 2 simulates building 2, and group 3 simulates building 3. The grouping results are then stored in the instance registry for later use. In group 1 and group 2, the test type for the virtual energy meters is link testing, while in group 3, the test type is data acquisition testing.
[0075] Optionally, when grouping virtual electricity meters, grouping can also be done by user type and meter model. For example, for mixed commercial and residential buildings, grouping can be based on the distribution of electricity meters and the user type of the meters. Assuming that Building 1 and Building 2 include both residential and commercial virtual electricity meters, they can be grouped into four groups: Building 1 residential virtual electricity meter group, Building 2 residential virtual electricity meter group, Building 1 commercial virtual electricity meter group, and Building 2 commercial virtual electricity meter group. By combining virtual distribution and user type as two dimensions for grouping, the impact of both regional and user type factors on the test results can be verified simultaneously, thereby improving the realism of the test scenario.
[0076] S402. Based on the test type and preset scheduling algorithm corresponding to each virtual energy meter, determine the test task for acquiring each virtual energy meter.
[0077] Optionally, different test types correspond to different processing priorities. The preset scheduling algorithm can determine the processing priority of the virtual energy meter based on the test type, and obtain the test tasks of each virtual energy meter according to the processing priority of each virtual energy meter through the preset scheduling algorithm.
[0078] In one possible implementation, the test types are arranged in descending order of priority as follows: fault testing, link testing, remote control testing, and data acquisition testing.
[0079] The processor can acquire test tasks for each virtual energy meter in descending order of priority based on a preset scheduling algorithm. For example, it can first acquire test tasks of fault test type, and then acquire test tasks of link test, remote control test, and data acquisition test to the corresponding energy meters in sequence.
[0080] The processor acquires test tasks from the virtual energy meter, which can involve assigning configuration parameters for the test tasks to the virtual energy meter. For example, when the test task is a data acquisition test, the processor can assign data acquisition frequency, metering accuracy, etc., to the virtual energy meter so that the virtual energy meter can perform the data acquisition task based on the configuration parameters.
[0081] It should be noted that the priority of the above test types can take effect not only during the test task allocation phase but also during task execution. During task execution, after the virtual energy meter uploads data to the processor, the processor can process the data sequentially from highest to lowest priority based on the virtual energy meter's test type. For example, if the data waiting time is the same, fault test data will be processed first, followed by link test, remote control test, and data acquisition test data in that order.
[0082] In this embodiment of the application, by grouping virtual energy meters and assigning test tasks according to test types, the allocation of test tasks for virtual energy meters can be made more orderly and controllable, and can meet the energy meter network testing needs in complex scenarios.
[0083] The following is a detailed explanation of how the test task for each virtual energy meter is determined based on the test type and preset scheduling algorithm corresponding to each test energy meter. Step S402 above includes: If the test type is a fault test, the fault type and fault parameters corresponding to each virtual energy meter are assigned according to multiple preset fault states and preset scheduling algorithms.
[0084] The preset fault state can be a predefined fault mode, including fault triggering conditions, fault manifestations, and fault recovery rules. Fault parameters can be quantitative indicators that define the fault. Fault types include one or more combinations of the following: communication module offline, abnormal data metering, device clock drift, and memory error.
[0085] The fault parameters for communication module offline include offline duration, offline trigger event, and recovery conditions. The fault parameters for data metering anomaly include deviation direction, deviation value, and duration. The fault parameters for device clock drift include drift rate and cumulative drift limit. The fault parameters for memory error include erroneous data type and error ratio.
[0086] In one possible implementation, the preset fault states corresponding to the test requirements can be obtained from the fault mode library based on the testers' test requirements, and the corresponding fault types and fault parameters can be assigned to each virtual energy meter according to the preset scheduling algorithm and the preset fault states.
[0087] The following describes another implementation method for determining the test task for each virtual energy meter based on the test type and preset scheduling algorithm corresponding to each test energy meter. Step S402 above includes: If the test type is a link test, according to the preset scheduling algorithm, control each virtual energy meter to simulate the transmission of messages between the processor and the processor, and collect communication data during the transmission of messages.
[0088] The communication data includes one or more of the following: communication delay, packet loss rate, and signal strength attenuation. Communication delay refers to the time difference between sending and receiving a message; packet loss rate refers to the proportion of lost messages out of the total number of messages sent; and signal strength attenuation refers to the degree of signal attenuation during message transmission.
[0089] Optionally, the virtual energy meter can simulate the transmission messages between the real energy meter and the master station, including uplink messages from the virtual energy meter to the processor reporting data and downlink messages from the processor to the virtual energy meter issuing instructions.
[0090] In this embodiment, the preset scheduling algorithm can control the timing of message transmission during message transmission, thereby avoiding virtual link congestion caused by multiple virtual energy meters sending messages at the same time, and thus ensuring accurate collection of communication data.
[0091] The following is a further explanation of the above-mentioned collected test results, such as... Figure 5 As shown, the above step S203 includes: S501: Receive electrical parameters reported by each virtual energy meter after performing tests using the energy meter under test according to the test parameters.
[0092] Each virtual electricity meter is configured with autonomous reporting capability and is configured with conditions to trigger reporting.
[0093] Optionally, the electrical parameters can be quantitative data when the virtual energy meter performs test tasks, such as the fault type, fault occurrence time, fault duration, fault recovery status, and metering deviation value during fault testing, and the communication delay, data packet loss rate, signal strength, and total number of messages sent / received during link testing.
[0094] Optionally, the virtual energy meter can invoke the hardware resources of the energy meter under test to perform tests and generate electrical parameters corresponding to the test task. Specifically, the virtual energy meter inputs the test parameters into the corresponding energy meter under test, and the physical hardware resources of the energy meter under test run according to the test parameters to generate electrical parameters. The energy meter under test sends the electrical parameters to the virtual energy meter, which can judge the electrical parameters to determine whether to report them to the processor. When the electrical parameters of the virtual energy meter meet the reporting conditions, the virtual energy meter can report the electrical parameters to the processor.
[0095] S502. Analyze and obtain test results based on electrical parameters.
[0096] The processor can analyze and calculate the electrical parameters reported by each virtual energy meter to obtain the test results of the test task in the virtual test environment.
[0097] In another possible implementation, the processor can also actively acquire the electrical parameters of the virtual energy meter and calculate the test results based on the electrical parameters.
[0098] The following describes the process of configuring a virtual energy meter for each energy meter under test in this application, such as... Figure 6 As shown, the method of this application further includes: S601. Create the identity information of multiple virtual energy meters for each energy meter under test.
[0099] The identity information includes a virtual identifier and its corresponding virtual address. It also includes user type, user coordinates, and security certificates / keys.
[0100] S602. Based on the identity information of each virtual energy meter, establish the interface reuse relationship between each virtual energy meter and the communication interfaces of the energy meter under test.
[0101] The energy meter under test includes multiple communication interfaces for interacting with external processors and master station equipment. These communication interfaces may include RS485 (short-range wired communication), power line carrier interface (power line communication), and wireless module interface (LoRa / 4G), among others.
[0102] Multiple virtual energy meters can share the same physical communication interface of the energy meter under test in a time-sharing manner, and distinguish data streams by the identity information of the virtual energy meters. For example, the RS485 interface of the energy meter under test can connect to 10 virtual energy meters simultaneously, and the processor determines which virtual energy meter the current data stream belongs to by using the virtual address.
[0103] S603 Configure information transmission logic for the input / output interface of the energy meter under test.
[0104] Among them, the information transmission logic can be the rules for defining how the I / O interface distinguishes the data streams of different virtual energy meters, including the data frame encapsulation protocol and the decapsulation protocol.
[0105] In this embodiment, by reusing the interface of the energy meter under test, a single physical energy meter can support multiple virtual energy meters, thereby reducing hardware procurement and deployment costs and improving the resource utilization of the physical energy meter. By creating identity information for the virtual energy meters and configuring information transmission logic for the input and output interfaces of the energy meter under test, the processor can distinguish the data streams of different virtual energy meters, avoiding confusion between the processor's data or instructions from different virtual energy meters.
[0106] Optionally, the method of this application further includes: A virtual engine is used to configure a virtual network simulator for each virtual energy meter to simulate the current network environment data of each virtual energy meter according to preset test requirements. The current network environment data includes one or more of the following: network latency, packet loss rate, and signal strength.
[0107] The virtual engine communicates with the processor in the electricity meter simulation system and with each virtual electricity meter in the system to configure the virtual network simulator for the virtual electricity meters. The virtual network simulator can simulate the current network environment data of the virtual electricity meters according to preset test requirements and the configuration parameters of each virtual electricity meter.
[0108] In one possible implementation, when the virtual energy meter needs to respond to the master station, the network simulator can process the response data packet according to preset test requirements before it is sent to the processor, including changing the latency, simulating packet loss, and modifying the signal strength indication.
[0109] In this embodiment of the application, the network environment of the virtual energy meter is simulated by a virtual engine and a virtual network simulator, which can more realistically restore the network environment where the virtual energy meter is located and conduct more complex network robustness tests.
[0110] Based on the same inventive concept, this application also provides an energy meter simulation system corresponding to the energy meter test simulation method based on the experimental environment. The system architecture diagram is shown below. Figure 1 The system includes a processor, a test meter (TM) under test (UTP), and multiple virtual meters configured for each TTP. The processor can communicate with the TTP, sending instructions to the virtual meters via their virtual addresses. The virtual meters control the TTP to run according to the task instructions and report the generated test data to the processor.
[0111] Figure 7 This illustration shows a schematic diagram of an electronic device provided in an embodiment of this application. The electronic device may be an electronic device that integrates a processor of an energy meter simulation system, or an electronic device connected to the processor of an energy meter simulation system. It includes: a processor 701, a storage medium 702, and a bus 703. The storage medium 702 stores machine-readable instructions executable by the processor 701. When the electronic device runs an energy meter test simulation method based on an experimental environment as described in the embodiment, the processor 701 communicates with the storage medium 702 through the bus 703. The processor 701 executes the machine-readable instructions. The preamble of the method item of the processor 701 executes the steps in the above-described energy meter test simulation method based on an experimental environment.
[0112] This application also provides a computer-readable storage medium storing a computer program that is executed by a processor, which performs the steps in the above-described experimental environment-based electricity meter test simulation method.
[0113] In this embodiment, the computer program, when run by the processor, can also execute other machine-readable instructions to perform other methods as described in the embodiments. For details on the specific execution steps and principles, please refer to the description of the embodiments, which will not be repeated here.
[0114] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0115] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0116] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0117] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0118] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0119] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method for simulating electricity meter testing based on an experimental environment, characterized in that, A processor is used in an electricity meter simulation system, the electricity meter simulation system comprising: the processor, multiple electricity meters to be tested, each electricity meter to be tested being communicatively connected to the processor; each electricity meter to be tested is configured with multiple virtual electricity meters, each virtual electricity meter being set with a virtual identifier and a corresponding virtual address, the method comprising: Based on the actual test scenario, establish virtual communication relationships between multiple virtual energy meters to generate a virtual test scenario; Based on the preset test requirements and preset scheduling algorithm, determine the test task for acquiring each virtual energy meter; Based on the test task and corresponding virtual address of each virtual energy meter, test parameters are sent to the corresponding virtual energy meter, and test results are collected. Each virtual energy meter performs the test using the energy meter under test according to the test parameters.
2. The method according to claim 1, characterized in that, Before calculating and obtaining the test task for each virtual energy meter based on preset test requirements and a preset scheduling algorithm, the method further includes: Based on the actual test scenario and the preset scenario model, configuration parameters for each virtual energy meter are generated. The preset scenario model is obtained by training based on a sample dataset, which includes: a large amount of historically collected working data of energy meters, basic data of energy meters, and corresponding configuration parameters. Configure each of the virtual energy meters according to the configuration parameters.
3. The method according to claim 2, characterized in that, The configuration parameters include: the response logic of each energy meter to external commands, the data reporting strategy, and the electrical load data with time-series characteristics.
4. The method according to claim 1, characterized in that, The step of determining the test task for each virtual energy meter based on preset test requirements and a preset scheduling algorithm includes: The process involves determining the grouping of virtual energy meters and the test type corresponding to each virtual energy meter based on preset test requirements and the virtual distribution relationship of virtual energy meters. Based on the test type corresponding to each virtual energy meter and the preset scheduling algorithm, the test task for acquiring each virtual energy meter is determined.
5. The method according to claim 4, characterized in that, The step of determining the test task for each virtual energy meter based on the test type corresponding to each virtual energy meter and the preset scheduling algorithm includes: If the test type is a fault test, the fault type and fault parameters corresponding to each virtual energy meter are assigned according to multiple preset fault states and preset scheduling algorithms. The fault type includes one or more combinations of the following: communication module offline, data metering abnormality, device clock drift, and memory error.
6. The method according to claim 4, characterized in that, The step of determining the test task for each virtual energy meter based on the test type corresponding to each virtual energy meter and the preset scheduling algorithm includes: If the test type is a link test, according to the preset scheduling algorithm, each virtual energy meter is controlled to simulate the transmission of messages with the processor, and communication data during the transmission of messages is collected. The communication data includes one or more of the following: communication delay, data packet loss rate, and signal strength attenuation.
7. The method according to claim 1, characterized in that, The collected test results include: The system receives electrical parameters reported by each virtual energy meter after performing tests using the energy meter under test according to the test parameters. Each virtual energy meter is configured with autonomous reporting capability and is configured with triggering reporting conditions. Based on the electrical parameters, the test results are analyzed and obtained.
8. The method according to claim 1, characterized in that, The method further includes: Create identity information for multiple virtual energy meters for each of the energy meters to be tested, wherein the identity information includes: a virtual identifier and a corresponding virtual address; Based on the identity information of each virtual energy meter, establish an interface reuse relationship between each virtual energy meter and the communication interfaces of the energy meter under test. Configure information transmission logic for the input / output interface of the energy meter under test.
9. The method according to claim 8, characterized in that, The method further includes: A virtual network simulator is configured for each virtual energy meter using a virtual engine to simulate the current network environment data of each virtual energy meter according to preset test requirements. The current network environment data includes one or more of the following: network latency, packet loss rate, and signal strength.
10. An electricity meter simulation system, characterized in that, The electricity meter simulation system includes: the processor, multiple electricity meters to be tested, all of which are communicatively connected to the processor; each electricity meter to be tested is configured with multiple virtual electricity meters, and each virtual electricity meter is set with a virtual identifier and a corresponding virtual address; When the energy meter simulation system is running, the processor is used to execute the steps of the energy meter test simulation method based on the experimental environment as described in any one of claims 1-9.
Citation Information
Patent Citations
Electric energy acquisition and operation management system and method based on platform zone centralized service terminal
CN101354408A
Method and system automatically obtaining transformer area topological graph
CN106772499A
Virtual electric energy meter and parameter configuration method for virtual electric energy meter
CN108008339A
System and method for testing concentrator
CN110865251A
Para-virtualization-based electric energy meter automatic test method
CN114217262A