Electric energy meter test simulation method and system based on experimental environment
By configuring virtual electricity meters and pre-setting scheduling algorithms to generate virtual test scenarios, the problems of high cost and low efficiency in electricity meter testing are solved, and efficient testing and multiple reuse of electricity meter networks are realized.
Patent Information
- Application Number
- CN202511493873.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-10-20
AI Technical Summary
Existing technologies are costly and inefficient in electricity meter testing, requiring the deployment of a large number of electricity meters in real-world scenarios, resulting in long testing cycles and low efficiency.
By configuring multiple virtual energy meters for each energy meter under test, virtual test scenarios are generated using virtual communication relationships and preset scheduling algorithms to simulate actual test scenarios, thereby reducing the number of physical energy meters and enabling multiple reuse of physical hardware resources.
It reduces the deployment cost of electricity meter networks, improves testing efficiency, and enables various testing needs to be met in virtual testing scenarios, solving the problems of low testing efficiency and limited testing scenarios in traditional electricity meter networks.
Smart Images

Figure CN120949153B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electric energy meter, in particular to an electric energy meter test simulation method and system based on an experimental environment. BACKGROUND
[0002] With the construction of smart grid, a master station may manage thousands of electric energy meters, and even in a small community, a large number of electric energy meters are installed. Before building an electric energy meter network in a certain area, testing is generally required, such as testing data acquisition, remote control, cost calculation, fault diagnosis, etc.
[0003] The prior art generally needs to build a test environment in a real scene, such as actually deploying electric energy meters in a community to complete the test.
[0004] The test method using the prior art not only has high cost, but also has low test efficiency. SUMMARY
[0005] The present application aims at the deficiencies in the prior art, and provides an electric energy meter test simulation method and system based on an experimental environment to solve the problem that the test method in the prior art has high cost and low test efficiency.
[0006] To achieve the above-mentioned purpose, the technical solution adopted by the present application is as follows:
[0007] In a first aspect, the present application provides an electric energy meter test simulation method based on an experimental environment, applied to a processor in an electric energy meter simulation system, the electric energy meter simulation system comprising: the processor, a plurality of to-be-tested electric energy meters, each to-be-tested electric energy meter being in communication connection with the processor; each to-be-tested electric energy meter being configured with a plurality of virtual electric energy meters, each virtual electric energy meter being provided with a virtual identifier and a corresponding virtual address, the method comprising:
[0008] According to an actual test scene, a virtual communication relationship between a plurality of virtual electric energy meters is built to generate a virtual test scene;
[0009] According to a preset test requirement and a preset scheduling algorithm, a test task of each virtual electric energy meter is determined;
[0010] According to the test task of each virtual electric energy meter and the corresponding virtual address, a test parameter is sent to the corresponding virtual electric energy meter, and a test result is collected, wherein each virtual electric energy meter executes the test by using the to-be-tested electric energy meter according to the test parameter.
[0011] Optionally, before the test task of each virtual electric energy meter is calculated according to the preset test requirement and the preset scheduling algorithm, the method further comprises:
[0012] According to the actual test scene and the preset scene model, configuration parameters of each virtual electric energy meter are generated, wherein the preset scene model is obtained according to sample data sets, and the sample data sets include working data of a large number of electric energy meters collected historically, electric energy meter basic data, and corresponding configuration parameters.
[0013] According to the configuration parameters, each corresponding virtual electric energy meter is configured.
[0014] Optionally, the configuration parameters include response logic of each electric energy meter to external instructions, data reporting strategies, and electric load data with time sequence characteristics.
[0015] Optionally, the test tasks of each virtual electric energy meter are determined according to preset test requirements and a preset scheduling algorithm, including:
[0016] The grouping of virtual electric energy meters and the test types corresponding to each virtual electric energy meter are determined according to preset test requirements and virtual distribution relationships of virtual electric energy meters.
[0017] The test tasks of each virtual electric energy meter are determined according to the test types corresponding to each virtual electric energy meter and the preset scheduling algorithm.
[0018] Optionally, the test tasks of each virtual electric energy meter are determined according to the test types corresponding to each virtual electric energy meter and the preset scheduling algorithm, including:
[0019] If the test type is a fault test, the fault types and fault parameters corresponding to each virtual electric energy meter are allocated according to a plurality of preset fault states and a preset scheduling algorithm, and the fault types include one or a combination of the following: communication module offline, data metering abnormality, device clock drift, and memory error.
[0020] Optionally, the test tasks of each virtual electric energy meter are determined according to the test types corresponding to each virtual electric energy meter and the preset scheduling algorithm, including:
[0021] If the test type is a link test, the transmission packets between each virtual electric energy meter and the processor are simulated according to the preset scheduling algorithm, and communication data in the transmission packet process is collected, and the communication data includes one or more of the following: communication delay, data packet loss rate, and signal strength attenuation.
[0022] Optionally, the test results are collected, including:
[0023] The electrical parameters reported by each virtual electric energy meter after performing tests on the to-be-tested electric energy meter according to test parameters are received, wherein each virtual electric energy meter is configured with autonomous reporting capability and a trigger reporting condition.
[0024] According to the electrical parameter, a test result is analyzed and obtained.
[0025] Optionally, the method further comprises:
[0026] Identity information of a plurality of virtual electric energy meters in each of the to-be-tested electric energy meters is created, and the identity information comprises a virtual identifier and a corresponding virtual address.
[0027] According to the identity information of each of the virtual electric energy meters, an interface multiplexing relationship between each of the virtual electric energy meters and each communication interface of the to-be-tested electric energy meter is established.
[0028] Information transmission logic is configured for an input / output interface of the to-be-tested electric energy meter.
[0029] Optionally, the method further comprises:
[0030] A virtual network simulator is configured for each virtual electric energy meter by using a virtual engine, so as to simulate current network environment data of each virtual electric energy meter according to a preset test requirement, and the current network environment data comprises one or more of network delay, packet loss rate, and signal strength.
[0031] In a second aspect, the present application provides an electric energy meter simulation system, comprising: a processor, a plurality of to-be-tested electric energy meters, each of which is in communication connection with the processor; each of the to-be-tested electric energy meters is configured with a plurality of virtual electric energy meters, each of which is provided with a virtual identifier and a corresponding virtual address.
[0032] When the electric energy meter simulation system is running, the processor is configured to execute the steps of the electric energy meter test simulation method based on an experimental environment according to the first aspect.
[0033] The present application has the following beneficial effects: by configuring a plurality of virtual electric energy meters for a to-be-tested electric energy meter, multiple reuse of a set of physical hardware resources of the to-be-tested electric energy meter is achieved, the number of entity electric energy meters required in the electric energy meter network is reduced, and the deployment cost of the electric energy meter network is saved. During electric energy meter network testing, the actual test scene can be simulated by using the virtual electric energy meters in the virtual test scene, the test task of each virtual electric energy meter is determined by using a preset test requirement and a preset scheduling algorithm, and then the test parameters are sent to the virtual electric energy meters and the test results are collected according to the test task of each virtual electric energy meter and the virtual address. In this process, the user does not need to disassemble the entity electric energy meter multiple times, but only needs to change the virtual communication relationship of the virtual electric energy meter, so that multiple test requirements can be tested, and the problems of low efficiency and single scene of traditional electric energy meter network entity testing are solved.
[0034] In order to make the above objectives, characteristics and advantages of the present application more apparent, more comprehensible, the following preferred embodiments are specifically described in detail below, together with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments, and it should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0036] Figure 1 A schematic diagram of the architecture of an electric energy meter simulation system provided by an embodiment of the present application is shown;
[0037] Figure 2 A flowchart of an electric energy meter test simulation method based on an experimental environment provided by an embodiment of the present application is shown;
[0038] Figure 3 A flowchart of configuring a virtual electric energy meter provided by an embodiment of the present application is shown;
[0039] Figure 4 A flowchart of determining a test task provided by an embodiment of the present application is shown;
[0040] Figure 5 A flowchart of obtaining a test result provided by an embodiment of the present application is shown;
[0041] Figure 6 A flowchart of configuring a virtual electric energy meter for a to-be-tested electric energy meter provided by an embodiment of the present application is shown;
[0042] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0043] In order to make the objectives, technical solutions and advantages of the embodiments of the present application more apparent, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.
[0044] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the presence of the features that follow, but not to exclude the presence of other features.
[0045] Before building an electric energy meter network, testing is generally required. The current testing method generally builds a test environment in a real environment, and then performs testing data acquisition, remote control, cost calculation, fault diagnosis and other tests in the test environment. In the prior art, testing can be completed by building an electric energy meter network using an electric energy meter in a laboratory or by actually deploying an electric energy meter in a cell.
[0046] However, when the electric energy meter network is complex, a large number of electric energy meters need to be deployed for the test environment, and a large amount of labor cost needs to be paid for actually building the electric energy meter network. The existing technology has the problem of high cost. In addition, the deployment, debugging and parameter configuration of the physical electric energy meter all need manual operation, so when different environments need to be tested, the test personnel need to repeatedly disassemble and reassemble the electric energy meter hardware, which leads to the problems of long test period and low efficiency.
[0047] Based on this, the present application proposes an electric energy meter test simulation method based on an experimental environment. By mapping one physical smart electric energy meter to multiple logically independent virtual entities, the physical hardware resources and logical business identities of the smart electric energy meter are decoupled, so that a complex electric energy meter network can be built with fewer physical electric energy meters, the cost of building the electric energy meter network is reduced, and the test efficiency of the electric energy meter network is improved.
[0048] The method of the present application can be applied to a processor of an electric energy meter simulation system, Figure 1 is a schematic diagram of the architecture of an electric energy meter simulation system provided by the embodiments of the present application.
[0049] Referring to Figure 1 , the system includes a processor and multiple electric energy meters to be tested. The electric energy meters to be tested are all in communication connection with the processor. Each electric energy meter to be tested can be configured with multiple virtual electric energy meters. The number of virtual electric energy meters configured by each electric energy meter to be tested can be the same or different. Each virtual electric energy meter is provided with a virtual identifier and a corresponding virtual address.
[0050] Among them, the electric energy meter to be tested can be a physical smart electric energy meter. The smart electric energy meter is a new type of electric energy metering device integrating digital metering, data storage, two-way communication and intelligent control functions. The virtual identifier is used to uniquely identify the virtual electric energy meter, and the virtual address is used to realize data communication between the virtual electric energy meter and the electric energy meter to be tested connected with the virtual electric energy meter, or between the virtual electric energy meter and other virtual electric energy meters.
[0051] The following will be described in combination with Figure 2The flow of the power meter test simulation method based on the experimental environment of the present application is described with reference to Figure 2 The method comprises:
[0052] S201. According to the actual test scene, a virtual communication relationship between multiple virtual power meters is established, and a virtual test scene is generated.
[0053] The actual test environment is the environment in which the smart meter operates in the real power grid, such as "the meter network of three buildings in a residential area" and "the high-load meter cluster in an industrial park". The actual test environment includes multiple power meters and can represent the topological relationship and communication interaction logic of each power meter.
[0054] Optionally, the actual test environment can be automatically generated by inputting the scene relationship, or an operable interface can be provided for the user to configure the actual test environment on the operable interface.
[0055] In one possible implementation, based on the number of power meters in the actual test environment, multiple virtual power meters can be configured for each entity's power meter to be tested, and then the virtual power meters are configured based on the communication topology relationship of the power meters in the actual test environment, so that the topology relationship and communication interaction logic of the virtual power meters are the same as those of the actual test environment, and a virtual test scene can be generated. Each virtual power meter is used to simulate an entity power meter in the actual test environment.
[0056] Optionally, when configuring virtual power meters for each entity's power meter to be tested, a virtual power meter data structure can be recorded in an instance registry. The data structure includes a virtual identifier, a virtual address, a state machine, and a behavior model. The state machine records the current cumulative power of the virtual power meter, the instantaneous voltage / current, the power factor, the last settlement data, the event flag register (such as opening the cover and losing voltage), and the behavior model defines the response logic of the virtual power meter to external instructions and the autonomous data reporting strategy. When there are N virtual power meters, there are N such independent data structures in the memory, which do not interfere with each other, and independently evolve the state according to their own behavior model and update the data recorded in the state machine.
[0057] Optionally, the virtual communication relationship between the virtual power meters can be established by connecting the virtual power meters corresponding to the entity power meters according to the connection relationship of the entity power meters in the actual test environment, and configuring the virtual power meters corresponding to the entity power meters according to the configuration information of the entity power meters in the communication link in the actual test environment.
[0058] It is worth mentioning that in some actual test scenarios, the electric energy meter network not only includes electric energy meters, but also includes concentrators and other communication nodes on the communication link. When there are multiple concentrators and other communication nodes, multiple virtual concentrators can also be configured for one concentrator, and the virtual concentrators and virtual electric energy meters are connected and configured according to the connection relationship and communication relationship of the actual test scenario, so as to realize the construction of the virtual test scenario.
[0059] For example, assuming that the actual test scenario is the electric energy meter network of three buildings in a certain community, the electric energy meter network includes: building concentrators and 20 household electric energy meters. The number of electric energy meters to be tested is 6. One of the electric energy meters to be tested can be used to simulate a building concentrator, and the remaining 5 electric energy meters to be tested can be configured with 4 virtual electric energy meters respectively. Each virtual electric energy meter is used to simulate a household electric energy meter in the actual test environment, and the virtual electric energy meters are connected and configured according to the topological relationship and communication interaction link of the electric energy meter network in the actual test environment, to obtain a virtual test environment.
[0060] Optionally, the virtual test scenario is a software test environment finally generated, which is composed of virtual electric energy meters and virtual communication relationship of the virtual electric energy meters. No physical electric energy meter needs to be deployed, and the electric meter operating environment of the real power grid can be reproduced only by using virtual electric energy meters and virtual communication relationship.
[0061] S202, according to the preset test requirement and the preset scheduling algorithm, determine the test task of each virtual electric energy meter.
[0062] Optionally, the preset test requirement includes at least one of the following: data acquisition test, fault tolerance test, remote control test, link stability test, etc. In one possible implementation, the user can input the test target of this time or the functional requirement of the electric energy meter network in the operable interface, and the processor can generate the test requirement according to the content input by the user.
[0063] Among them, the data acquisition test is to test whether the electric energy meter can accurately report voltage, current and power data, the fault tolerance test is to test whether the electric energy meter can save data after communication disconnection, the remote control test is to test whether the electric energy meter can execute after receiving the instruction, and the link stability test is to test whether the electric energy meter network loses packets when multiple meters report concurrently.
[0064] Optionally, the preset scheduling algorithm can be a control logic for resource allocation and priority control of virtual electric energy meters in the virtual test scenario, for example, processing critical tasks first and then processing non-critical tasks, or making each virtual electric energy meter execute the test task without conflict and efficiently.
[0065] The test task can be a specific test content assigned to each virtual energy meter. In a real power grid, the main station needs to assign different tasks to different energy meters, such as issuing a meter reading instruction to a residential meter and issuing a fault troubleshooting instruction to a fault meter.
[0066] After the tester inputs the preset test requirement, the processor can analyze the test requirement and determine the virtual energy meter related to the test requirement, and call the preset scheduling algorithm to assign the test task according to the task priority and the identifier and virtual address of the virtual energy meter, and ensure that the test tasks of each virtual energy meter have no conflict through the preset scheduling algorithm, and then send the test task to each virtual energy meter.
[0067] S203, according to the test task and the corresponding virtual address of each virtual energy meter, send the test parameter to the corresponding virtual energy meter, and collect the test result.
[0068] Each virtual energy meter executes the test according to the test parameter by using the energy meter to be tested. It should be understood that the virtual energy meter is a virtual instance and does not have independent hardware, and needs to rely on the physical energy meter of the virtual energy meter, i.e. the energy meter to be tested, to execute the test.
[0069] For example, assuming that the virtual energy meter needs to simulate data metering abnormality, the virtual energy meter is configured on the energy meter to be tested A, the metering chip of the energy meter to be tested A can be called, the metering coefficient of the energy meter to be tested A is temporarily modified, and the data is reported through the communication module of the energy meter to be tested A.
[0070] Optionally, the test parameter can be an instruction parameter for the virtual energy meter to execute the test task, including a specific configuration value required for executing the test task. For example, assuming that the test task is to simulate communication offline, the test parameter can be an offline duration of 30 seconds.
[0071] The virtual address can be a virtual communication address of the virtual energy meter, and the processor can determine the virtual energy meter through the virtual address, so as to accurately send the test parameter of the test task to the virtual energy meter.
[0072] In the embodiments of the present application, multiple virtual electric energy meters are configured for a to-be-tested electric energy meter, thereby realizing multiple reuse of a set of physical hardware resources of the to-be-tested electric energy meter, reducing the number of entity electric energy meters required in the electric energy meter network, and further saving the deployment cost of the electric energy meter network. In the process of electric energy meter network testing, the actual test scene can be simulated through the virtual electric energy meters in the virtual test scene, and the test task of each virtual electric energy meter is determined through the preset test requirement and the preset scheduling algorithm, and then the test parameters are sent to the virtual electric energy meters and the test results are collected according to the test task of each virtual electric energy meter and the virtual address. In this process, the user does not need to disassemble the entity electric energy meter multiple times, and only needs to change the virtual communication relationship of the virtual electric energy meter to realize the test of multiple test requirements, thereby solving the problems of low test efficiency and single scene of the traditional electric energy meter network entity test.
[0073] Before the test task of each virtual electric energy meter is calculated and obtained according to the preset test requirement and the preset scheduling algorithm, in order to further improve the authenticity of the power consumption simulation of the virtual electric energy meter, the virtual electric energy meter can be configured with parameters according to the actual test scene, such as Figure 3 As shown in the method of the present application also includes:
[0074] S301, generating configuration parameters of each virtual electric energy meter according to an actual test scene and a preset scene model.
[0075] The preset scene model is obtained by training according to a sample data set, and the sample data set includes working data of a large number of electric energy meters collected in history, electric energy meter basic data, and corresponding configuration parameters.
[0076] The working data of the electric energy meter includes time series data collected when the entity electric energy meter is running, including voltage / current fluctuation, power accumulation value, and fault occurrence record, etc. The electric energy meter basic data includes the model, metering accuracy, user type, installation area, etc. of the entity electric energy meter. The configuration parameters are the parameter settings when the entity electric energy meter is actually running, which are used as label data when the preset scene model is trained.
[0077] Optionally, the preset scene model can be a scene-parameter mapping model trained based on the sample data set, which is used to learn the association rule between the actual test scene and the electric meter configuration parameters.
[0078] The behavior model of each virtual electric energy meter can be dynamically generated through a pre-trained preset scene model. The preset scene model can be a generative adversarial network model. The preset scene model generates configuration parameters based on the test requirement, and sends the configuration parameters to each virtual electric energy meter. The configuration parameters are converted into behavior models in the virtual electric energy meter, and the behavior models are trained based on the real power consumption data to generate configuration parameters.
[0079] Optionally, the tester can input the scene characteristics of the actual test scene 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 perform parameter prediction based on the scene characteristics, and output the configuration parameters of each virtual electric energy meter in the virtual test scene.
[0080] In a possible implementation, a preset scene model can be used to predict the configuration parameters of all virtual electric energy meters in the virtual test scene, obtain the configuration parameters of each virtual electric energy meter, and distribute the configuration parameters to each virtual electric energy meter to generate a behavior model in each virtual electric energy meter.
[0081] For example, assuming that the scene characteristics are "scene type - residential community, scene parameters - 200 households, power consumption peak 18:00-22:00, meter type DT123, special requirements - including 10% of elderly users and 90% of ordinary users", after inputting the scene characteristics into the preset scene model, the preset scene model can predict the general configuration parameters and the individualized parameters of the special requirements, wherein the general configuration parameters can be applied to all virtual electric energy meters, and the individualized parameters can be applied to part of the virtual electric energy meters.
[0082] S302, according to the configuration parameters, configure each corresponding virtual electric energy meter.
[0083] Optionally, the processor can send the configuration parameters to the virtual electric energy meter based on the virtual address of the virtual electric energy meter, and decompose the configuration parameters into the data structure fields of the instance registration table, and write the configuration parameters into the data structure of the corresponding virtual electric energy meter.
[0084] After the processor completes the parameter configuration of all virtual electric energy meters, a test instruction can be sent to each virtual electric energy meter, and it is verified whether each virtual electric energy meter responds according to the configuration parameters, to verify whether the configuration takes effect.
[0085] The configuration parameters include the response logic of each electric energy meter to external instructions, the data reporting strategy, and the electric load data with time sequence characteristics.
[0086] Optionally, the response logic of the electric energy meter to the external instruction refers to the rule of how the electric energy meter processes, executes the instruction, and feeds back the result when receiving the external instruction. It includes the response time limit rule, the exception handling rule, and the execution priority rule.
[0087] The data reporting strategy refers to the rule of the virtual electric energy meter actively reporting data to the processor, including what data to report, when to report, and the processing method of reporting failure.
[0088] The electric load data with time sequence characteristics refers to data simulating the change rule of the electric load of a real electric meter with time by a virtual electric meter, and includes time information and the electric load corresponding to each time.
[0089] If the electric power consumption scenario of a residential area is simulated by a virtual test environment, in order to match the peak-valley characteristics and low-frequency interaction requirements of household power consumption, the response logic in the configuration parameters includes: returning data after 3 seconds after receiving the meter reading instruction of the master station, and returning an invalid instruction identifier if the master station instruction format is incorrect; the data reporting strategy includes: reporting the cumulative power once at the preset time point every day, and actively reporting only when a preset abnormal event occurs; the electric load data with time sequence characteristics is generated by a preset scene model, and the data characteristics match the peak-valley of residential power consumption, for example, "0:00-6:00 current 1.2A, voltage 220V; 19:00 current 9.5A, voltage 218V", and the time granularity is 5 minutes per piece.
[0090] It should be noted that in different test environments, the roles of each virtual electric meter may be different, for example, the electric meter of an office and the electric meter of a factory in an industrial environment have different power consumption rules, and therefore their configuration parameters are different.
[0091] If the electric power consumption scenario of an industrial park is simulated by a virtual test environment, in order to match the high load and high frequency monitoring requirements of industrial production, the data characteristics of the electric load data in the configuration parameters can be "8:00-20:00 current 18.5±1A, voltage 380V (industrial power consumption), 20:00 current 2.5A", and the time granularity is 1 minute per piece (to meet the high frequency monitoring requirements); the response logic to external instructions is: when receiving the "overload trip instruction", it is executed and fed back within 0.5 seconds, if the reported data is lost, it is automatically retried for 5 times, and if the retry fails, a local alarm log is triggered; the data reporting strategy includes: reporting the current, voltage, power factor every 5 minutes, when "current exceeds 20A (overload)" and "metering error exceeds ±1%", reporting immediately (within 1 second) and attaching the electrical parameters at the fault time.
[0092] If the electricity consumption scenario of the commercial complex is simulated through the virtual test environment, in order to match the high fluctuation and multi-device linkage demand during business hours, the data characteristics of the electric load data in the configuration parameters are "9:00 current surge 12A, 22:00 sudden drop 4A, fluctuation ±2A every 30 minutes during business hours", and include "associated field with virtual POS machine data"; the data reporting strategy includes: reporting electric quantity + POS machine transaction number every 15 minutes, reporting immediately when "communication disconnection exceeds 5 minutes" and "current sudden drop exceeds 5A (may be abnormal closing)"; the response logic includes: receiving "air conditioner start-stop control instruction", feeding back the execution result within 1 second, simulating "signal strength-85dBm" (signal attenuation characteristics in dense human flow area, the document technology implementation details mention "network simulator modifies RSSI value"), and increasing 10-20ms delay (simulate signal interference) in the response packet.
[0093] The above process of determining and obtaining the test task of each virtual electric energy meter according to the preset test requirement and the preset scheduling algorithm is as shown in Figure 4 , which includes:
[0094] S401, according to the preset test requirement and the virtual distribution relationship of the virtual electric energy meter, the grouping of the virtual electric energy meter and the test type corresponding to each virtual electric energy meter are determined.
[0095] Optionally, the virtual distribution relationship can be a logical topology relationship formed by simulating the physical distribution of real electric meters, which is generated based on the virtual communication relationship established in the above S201 step, and is used to reflect the hierarchical relationship and regional association between virtual electric energy meters.
[0096] According to the preset test requirement and the virtual distribution relationship, the virtual electric energy meters in the virtual test environment can be divided into multiple groups, and the virtual electric energy meters in each group have the same test target.
[0097] The test type of the virtual electric energy meter can be a classification test direction for the function of the virtual electric energy meter, including: fault test, link test, remote control test, data acquisition test, etc.
[0098] In one possible implementation, the tester can input multiple test requirements, and the processor can group the virtual electric energy meters according to the virtual distribution relationship of the virtual electric energy meters after receiving the multiple test requirements, each group is used to implement one test requirement, and the test type of each virtual electric energy meter in each group is determined.
[0099] Among them, when grouping the virtual electric energy meters, the virtual electric energy meters can be grouped according to the virtual distribution relationship of the virtual electric energy meters, and each virtual electric energy meter is used to simulate a real electric energy meter, so the virtual electric energy meters can be grouped based on the location distribution of the real electric energy meters, for example, grouped according to the building where the real electric energy meter is located.
[0100] For example, assuming that link testing of building 1 and building 2 and data collection testing of building 3 are required for the virtual test scene, the processor can divide the virtual electric energy meters according to the virtual distribution relationship into three groups, group 1 simulates building 1, group 2 simulates building 2, and group 3 simulates building 3, and save the grouping result in the instance registry for subsequent calling. Among them, the test type of the virtual electric energy meters in group 1 and group 2 is link testing, and the test type of the virtual electric energy meters in group 3 is data collection testing.
[0101] Optionally, when grouping the virtual electric energy meters, the grouping can also be combined with the user type and the electric meter model. For example, for a commercial and residential mixed building, the grouping can be performed according to the distribution relationship of the electric energy meters and the user type of the electric energy meters. Assuming that building 1 and building 2 include residential virtual electric energy meters and commercial virtual electric energy meters, they can be grouped into a building 1 residential virtual electric energy meter group, a building 2 residential virtual electric energy meter group, a building 1 commercial virtual electric energy meter group, and a building 2 commercial virtual electric energy meter group. By combining the virtual distribution relationship and the user type in two dimensions for grouping, the influence of the region and the user type on the test result can be verified at the same time, thereby improving the authenticity of the test scene.
[0102] S402, according to the test type corresponding to each virtual electric energy meter and the preset scheduling algorithm, determine the test task of each virtual electric energy meter.
[0103] Optionally, different test types correspond to different processing priorities, the preset scheduling algorithm can determine the processing priority of the virtual electric energy meter based on the test type, and the test task of each virtual electric energy meter is obtained according to the processing priority of each virtual electric energy meter through the preset scheduling algorithm.
[0104] In one possible implementation, the test types are arranged in order of priority from high to low as follows: fault testing, link testing, remote control testing, and data collection testing.
[0105] The processor can obtain the test task for each virtual electric energy meter in order of priority from high to low based on the preset scheduling algorithm, for example, first obtaining the test task of the test type of fault testing, and then obtaining the test task of link testing, remote control testing, and data collection testing in turn to the corresponding electric energy meter.
[0106] Among them, the test task of the virtual electric energy meter obtained by the processor can be a configuration parameter for assigning the test task to the virtual electric energy meter. For example, when the test task is data collection testing, the virtual electric energy meter can be assigned the frequency of data collection, the measurement accuracy, etc., so that the virtual electric energy meter can execute the data collection task based on the configuration parameter.
[0107] It should be noted that the priority of the above test type can not only take effect in the stage of assigning test tasks, but also take effect in the process of task execution. After the virtual electric energy meter uploads data to the processor in the process of executing the task, the processor can process the data in turn according to the priority of the test type from high to low based on the test type of the virtual electric energy meter, for example, when the waiting time of the data is the same, the data of the fault test is processed first, and then the data of the link test, the remote control test and the data acquisition test is processed in turn.
[0108] In the embodiment of the application, by grouping the virtual electric energy meters and assigning test tasks according to the test type, the test task assignment of the virtual electric energy meters can be more orderly and controllable, and the network test demand of the electric energy meter under complex scenarios can be met.
[0109] The following is a specific description of determining the test task of each virtual electric energy meter according to the test type corresponding to each test electric energy meter and the preset scheduling algorithm. The above S402 step includes:
[0110] If the test type is fault test, the fault type and fault parameter corresponding to each virtual electric energy meter are assigned according to the plurality of preset fault states and the preset scheduling algorithm.
[0111] The preset fault state can be a pre-defined fault mode, including fault triggering condition, fault performance and fault recovery rule, etc. The fault parameter can be a quantitative index for defining the fault. The fault type includes one or a combination of the following: communication module offline, data metering abnormality, device clock drift, memory error.
[0112] The fault parameter of the communication module offline includes offline duration, offline triggering event and recovery condition, the fault parameter of the data metering abnormality includes deviation direction, deviation value and duration, the fault parameter of the device clock drift includes drift rate and cumulative drift upper limit, and the fault parameter of the memory error includes error data type and error proportion.
[0113] In a possible implementation, the preset fault state corresponding to the test demand can be obtained from the fault mode library based on the test demand of the test personnel, and the corresponding fault type and fault parameter are assigned to each virtual electric energy meter according to the preset scheduling algorithm and the preset fault state.
[0114] The following describes another implementation of determining the test task of each virtual electric energy meter according to the test type corresponding to each test electric energy meter and the preset scheduling algorithm. The above S402 step includes:
[0115] If the test type is link test, according to the preset scheduling algorithm, each virtual electric energy meter simulates the transmission of the message between the processor and the virtual electric energy meter, and collects the communication data in the transmission process.
[0116] The communication data includes one or more of the following: communication delay, data packet loss rate, and signal strength attenuation. The communication delay refers to the time difference between sending and receiving a message, the data packet loss rate refers to the proportion of lost messages to the total number of sent messages, and the signal strength attenuation refers to the degree of signal attenuation during message transmission.
[0117] Optionally, the virtual energy meter can simulate the transmission of messages between the real energy meter and the master station, including uplink messages reported by the virtual energy meter to the processor and downlink messages issued by the processor to the virtual energy meter.
[0118] In the embodiments of the present application, the preset scheduling algorithm can control the message sending timing in the message transmission process, avoid the congestion of the virtual link caused by the simultaneous sending of messages by multiple virtual energy meters, and thus ensure the accuracy of the communication data collection.
[0119] The following is a further description of the above-mentioned test results, as shown in FIG. 5, the above-mentioned S203 step includes: Figure 5
[0120] S501, receiving the electrical parameters reported by each virtual energy meter according to the test parameters after the test performed by the virtual energy meter in the to-be-tested energy meter.
[0121] Each virtual energy meter is configured with autonomous reporting capability and a trigger reporting condition.
[0122] Optionally, the electrical parameters can be quantitative data when the virtual energy meter performs a test task, such as fault type, fault occurrence time, fault duration, fault recovery status, and metering deviation value during fault testing, communication delay, data packet loss rate, signal strength, and total number of message sending / receiving during link testing.
[0123] Optionally, the virtual energy meter can call the hardware resources of the to-be-tested energy meter to perform the test and generate electrical parameters corresponding to the test task. Specifically, the virtual energy meter inputs the test parameters into the corresponding to-be-tested energy meter, and the physical hardware resources of the to-be-tested energy meter run according to the test parameters and generate electrical parameters. The to-be-tested energy meter sends the electrical parameters to the virtual energy meter, and the virtual energy meter can judge the electrical parameters to determine whether to report the electrical parameters to the processor. When the electrical parameters of the virtual energy meter meet the reporting condition, the virtual energy meter can report the electrical parameters to the processor.
[0124] S502, according to the electrical parameters, analyzing and obtaining the test results.
[0125] 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.
[0126] In another possible implementation, the processor can also actively acquire the electrical parameters of the virtual electric energy meter, and calculate the test result based on the electrical parameters.
[0127] The process of configuring a virtual electric energy meter for each to-be-tested electric energy meter in the application will be described below, as shown in Figure 6 The method of the application also includes:
[0128] S601, creating identity information of a plurality of virtual electric energy meters in each to-be-tested electric energy meter.
[0129] The identity information includes a virtual identifier and a corresponding virtual address. The identity information also includes user type, user coordinates, security certificate / key, etc.
[0130] S602, establishing an interface multiplexing relationship between each virtual electric energy meter and each communication interface of the to-be-tested electric energy meter according to the identity information of each virtual electric energy meter.
[0131] The to-be-tested electric energy meter includes a plurality of communication interfaces for interacting with external processors and master station devices, etc. The communication interfaces of the to-be-tested electric energy meter can include an RS485 interface (short-distance wired communication), a power line carrier interface (power line communication), a wireless module interface (LoRa / 4G), etc.
[0132] The plurality of virtual electric energy meters can time-multiplex the same physical communication interface of the to-be-tested electric energy meter, and distinguish data streams through the identity information of the virtual electric energy meter. For example, the RS485 interface of the to-be-tested electric energy meter can be connected to 10 virtual electric energy meters at the same time, and the processor determines which virtual electric energy meter the current data stream belongs to through the virtual address.
[0133] S603, configuring information transmission logic for the input / output interface of the to-be-tested electric energy meter.
[0134] The information transmission logic can be a rule that defines how the I / O interface distinguishes different virtual electric energy meter data streams, including encapsulation protocols and decapsulation protocols of data frames.
[0135] In the embodiments of the application, by multiplexing the interfaces of the to-be-tested electric energy meter, one physical electric energy meter can carry multiple virtual electric energy meters, thereby reducing the hardware procurement and deployment cost and improving the resource utilization rate of the physical electric energy meter. By creating identity information for the virtual electric energy meter and configuring information transmission logic for the input / output interface of the to-be-tested electric energy meter, the processor can distinguish different virtual electric energy meter data streams, avoiding confusion of different virtual electric energy meter data or instructions by the processor.
[0136] Optionally, the method of the application also includes:
[0137] The virtual engine is configured with a virtual network simulator for each virtual electric energy meter to simulate current network environment data of each virtual electric energy meter according to preset test requirements, and the current network environment data includes one or more of the following: network delay, packet loss rate, signal strength.
[0138] The virtual engine is in communication connection with the processor in the electric energy meter simulation system and in communication connection with each virtual electric energy meter in the electric energy meter simulation system, and is configured with a virtual network simulator for the virtual electric energy meter. The virtual network simulator can simulate the current network environment data of the virtual electric energy meter according to preset test requirements and configuration parameters of each virtual electric energy meter.
[0139] In a possible implementation, when the virtual electric energy meter needs to respond to the master station, the network simulator can process the response data packet according to the preset test requirements before the response data packet is sent to the processor, including changing the delay, simulating the packet loss, modifying the signal strength indication, etc.
[0140] In the embodiments of the present application, the network environment of the virtual electric energy meter is simulated through the virtual engine and the virtual network simulator, which can more realistically restore the network environment of the virtual electric energy meter and perform more complex network robustness testing.
[0141] Based on the same inventive concept, the embodiments of the present application also provide an electric energy meter simulation system corresponding to the electric energy meter test simulation method based on an experimental environment, and the system architecture diagram is shown in Figure 1 The system includes a processor, a to-be-tested electric energy meter, and a plurality of virtual electric energy meters configured for each to-be-tested electric energy meter. The processor can be in communication connection with the to-be-tested electric energy meter, and can issue instructions to the virtual electric energy meter through the virtual address of the virtual electric energy meter. The virtual electric energy meter controls the to-be-tested electric energy meter to run according to the task instructions, and reports the data to the processor after generating the test data.
[0142] Figure 7 A structure schematic diagram of an electronic device provided by the embodiments of the present application is shown, which can be an electronic device integrated with a processor of an electric energy meter simulation system, or an electronic device connected with a processor of an electric energy meter simulation system, and 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 a method for testing and simulating an electric energy meter based on an experimental environment as in the embodiments, the processor 701 communicates with the storage medium 702 through the bus 703. The processor 701 executes the machine readable instructions, and the processor 701 executes the pre-sequential part of the method item to perform the steps in the above-mentioned method for testing and simulating an electric energy meter based on an experimental environment.
[0143] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to perform the steps in the power meter test simulation method based on an experimental environment.
[0144] In the embodiment of the present application, the computer program executed by the processor can also execute other machine readable instructions to perform the method as described in the embodiment. For the specific method steps and principles, refer to the description of the embodiment, which will not be described in detail here.
[0145] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other manners. The described device embodiments are only schematic. For example, the division of the units is only a logical function division. There can be another division manner for the actual implementation, and some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0146] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.
[0147] In addition, each functional unit in the embodiments provided by the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0148] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0149] It should be noted that like reference numerals and letters refer to like elements throughout the several views of the drawings, and that, unless otherwise indicated, like reference numerals and letters are used consistently throughout the drawings and the description and have meanings ascribed to them even when doing so incurs redundancy. In addition, the terms "first", "second", "third", etc. are used merely as identifiers, and are not intended to signify or imply relative importance.
[0150] Finally, it should be noted that the above-described embodiments are merely exemplary of the application and should not be used to limit the present application, the present application is not intended to be limited to the embodiments described but is intended to encompass any variation that falls within the spirit and scope of the technical range disclosed herein. Although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that any modifications or changes can be made to the technical solutions described in the foregoing embodiments or can be easily thought of, or some technical features can be replaced by equivalent ones, without departing from the spirit and scope of the technical range disclosed herein. All of these modifications, changes or replacements should be encompassed within the scope of the present application. Therefore, the scope of the present application should be determined by the scope of the claims.
Claims
1. A method for testing and simulating an electric energy meter based on an experimental environment, characterized by, The application relates to a processor applied to an electric energy meter simulation system, wherein the electric energy meter simulation system comprises the processor, a plurality of to-be-tested electric energy meters, the to-be-tested electric energy meters are in communication connection with the processor, each to-be-tested electric energy meter is configured with a plurality of virtual electric energy meters, each virtual electric energy meter is provided with a virtual identifier and a corresponding virtual address, when the virtual electric energy meters of each entity are configured, the data structure of each virtual electric energy meter is recorded through an instance registration table, the data structures of the virtual electric energy meters are independent of each other, and the data structure comprises a virtual identifier, a virtual address, a state machine and a behavior model; and the method comprises the following steps: According to an actual test scene, a virtual communication relationship among the virtual electric energy meters is established, and a virtual test scene is generated; According to a preset test demand and a virtual distribution relationship of the virtual electric energy meters, grouping of the virtual electric energy meters and a test type corresponding to each virtual electric energy meter are determined; According to the test type corresponding to each virtual electric energy meter and a preset scheduling algorithm, a test task of each virtual electric energy meter is determined; According to the test task of each virtual electric energy meter and the corresponding virtual address, a test parameter is sent to the corresponding virtual electric energy meter, and a test result is collected, wherein each virtual electric energy meter executes the test by using the to-be-tested electric energy meter according to the test parameter.
2. The method of claim 1, wherein, Before the test task of each virtual electric energy meter is calculated according to the preset test demand and the preset scheduling algorithm, the method further comprises the following steps: According to an actual test scene and a preset scene model, configuration parameters of each virtual electric energy meter are generated, wherein the preset scene model is obtained by training according to a sample data set, and the sample data set comprises working data of a large number of electric energy meters collected in the past, electric energy meter basic data and corresponding configuration parameters; Each virtual electric energy meter is configured according to the configuration parameters.
3. The method of claim 2, wherein, The configuration parameters comprise response logic of each electric energy meter to an external instruction, a data reporting strategy and electric load data with time sequence characteristics.
4. The method of claim 1, wherein, According to the test type corresponding to each virtual electric energy meter and the preset scheduling algorithm, a test task of each virtual electric energy meter is determined, comprising the following steps: If the test type is a fault test, according to a plurality of preset fault states and a preset scheduling algorithm, a fault type and fault parameters corresponding to each virtual electric energy meter are allocated, and the fault type comprises one or a combination of the following: a communication module offline, data metering abnormality, device clock drift and memory error.
5. The method of claim 1, wherein, According to the test type corresponding to each virtual electric energy meter and the preset scheduling algorithm, a test task of each virtual electric energy meter is determined, comprising the following steps: If the test type is a link test, according to the preset scheduling algorithm, transmission packets between each virtual electric energy meter and the processor are controlled, and communication data in the transmission packet process is collected, wherein the communication data comprises one or more of the following: communication delay, data packet loss rate and signal strength attenuation.
6. The method of claim 1, wherein, The test result is collected, comprising the following steps: Electrical parameters reported by each virtual electric energy meter after the test is executed by using the to-be-tested electric energy meter according to the test parameter are received, wherein each virtual electric energy meter is configured with autonomous reporting capability and a trigger reporting condition. According to the electrical parameter, a test result is analyzed and obtained.
7. The method of claim 1, wherein, The method further comprises: Identity information of a plurality of virtual electric energy meters in each of the to-be-tested electric energy meters is created, and the identity information comprises a virtual identifier and a corresponding virtual address. According to the identity information of each of the virtual electric energy meters, an interface multiplexing relationship between each of the virtual electric energy meters and each communication interface of the to-be-tested electric energy meter is established. Information transmission logic is configured for an input / output interface of the to-be-tested electric energy meter.
8. The method of claim 7, wherein, The method further comprises: A virtual network simulator is configured for each virtual electric energy meter by using a virtual engine, so as to simulate current network environment data of each virtual electric energy meter according to a preset test requirement, and the current network environment data comprises one or more of network delay, packet loss rate, and signal strength.
9. An electric energy meter simulation system, characterized by, The electric energy meter simulation system comprises the processor, a plurality of to-be-tested electric energy meters, the to-be-tested electric energy meters are all in communication connection with the processor, each of the to-be-tested electric energy meters is configured with a plurality of virtual electric energy meters, each virtual electric energy meter is provided with a virtual identifier and a corresponding virtual address. When the electric energy meter simulation system is running, the processor is configured to perform the steps of the electric energy meter test simulation method based on an experimental environment according to any one of claims 1 to 8.
Citation Information
Patent Citations
Multi-meter simulation method and device based on entity electric energy meter
CN119653259A
Automatic virtual table platform and method for simulating acquisition environment of intelligent equipment
CN119690823A