A method and system for testing software of smart electric energy meter

By using the virtual bus coordinator and the virtual hard bus/soft bus test channel in the software test of the intelligent IoT electric energy meter, the problem of insufficient comprehensive software testing of the intelligent IoT electric energy meter in the existing technology is solved, and a more comprehensive test is achieved. and accurate software testing.

CN114020622BActive Publication Date: 2025-01-21WUHAN SAN FRAN ELECTRONICS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111295939.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-03
Publication Date
2025-01-21
Estimated Expiration
2041-11-03

AI Technical Summary

Technical Problem

The existing smart IoT meter software testing methods mainly use black box testing, making it difficult to achieve comprehensive testing of smart IoT meter software.

Method used

Initiate the command to be tested through the PC, and send the test command to the functional module of the intelligent IoT energy meter through the virtual bus coordinator. The virtual hard bus and virtual soft bus test channels are used to implement multi-faceted testing of the intelligent IoT energy meter software.

Benefits of technology

A comprehensive test of the smart IoT energy meter software was achieved, the scope of software testing was expanded, and the accuracy and coverage of the test were improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020622B_ABST
    Figure CN114020622B_ABST
Patent Text Reader

Abstract

The present application provides a method and system for testing software of a smart electric energy meter. The method is applied to a test system, wherein the test system includes a PC and a virtual bus coordinator, wherein the virtual bus coordinator is connected to the PC and the smart Internet of Things electric energy meter, and the method includes: initiating a test command through the PC, and sending the test command to the virtual bus coordinator through the PC; judging whether it is a virtual hard bus according to the virtual bus class identifier through the virtual bus coordinator; if so, sending the test command to the functional module corresponding to the smart Internet of Things electric energy meter through the virtual hard bus test channel; if not, sending the test command to the virtual functional module corresponding to the PC through the virtual soft bus test channel. The two test channels are switched and tested through the virtual bus coordinator, thereby realizing a comprehensive test of the smart Internet of Things electric energy meter, making the test results more accurate and effective.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent measurement, and more specifically, to a software testing method and system for an intelligent electric energy meter. Background Art

[0002] At present, the commonly used smart energy meters include smart IoT energy meters, which introduce embedded operating systems and realize richer functions through software. Due to the iteration of demand and development, software testing for smart IoT energy meters is particularly important.

[0003] The method for testing the software of smart IoT electric energy meters is usually to use an external test device to read the debug test log printed on the electric energy meter through the Bluetooth module, and test the software of the smart IoT electric energy meter according to the debug test log, or directly display the debug test log on the LCD display, and view the debug test log through the LCD display. In other words, the existing smart IoT electric energy meter software testing methods are all carried out in a black box testing manner, which can maximize the guarantee of protocol consistency, but the scope of software testing is not comprehensive and in-depth enough, and it is difficult to fully test the software of smart IoT electric energy meters. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a smart electric energy meter software testing method and system to achieve comprehensive testing of the smart Internet of Things electric energy meter software.

[0005] In the first aspect, an embodiment of the present application provides a smart energy meter software testing method, which is applied to a test system, wherein the test system includes a PC and a virtual bus coordinator, and the virtual bus coordinator is connected to the PC and the smart IoT energy meter. The method includes: initiating a command to be tested through the PC, and sending the command to be tested to the virtual bus coordinator through the PC, wherein the command to be tested includes a virtual bus class identifier, an interface subclass identifier, and a test item, and the virtual bus class identifier is a virtual hard bus or a virtual soft bus; judging whether it is a virtual hard bus according to the virtual bus class identifier by the virtual bus coordinator, and the virtual bus coordinator is provided with A virtual hard bus test channel and a virtual soft bus test channel; if yes, the command to be tested is sent to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel to test the functional module corresponding to the smart IoT electric energy meter, and the smart IoT electric energy meter includes multiple functional modules; if not, the command to be tested is sent to the virtual functional module corresponding to the PC end through the virtual soft bus test channel to simulate the functional module corresponding to the smart IoT electric energy meter, and the PC end runs multiple virtual functional modules, each of which is used to simulate the operation of the functional module corresponding to the smart IoT electric energy meter.

[0006] In the embodiment of the present application, a test command is initiated by the PC and sent to the virtual bus coordinator. The two test channels are switched by the virtual bus coordinator according to the virtual bus identifier in the test command. The data transmission between the PC and the smart IoT power meter is realized through the virtual test hard channel and the virtual test soft channel respectively. The smart IoT power meter can be subjected to various software tests, thereby realizing a comprehensive test of the smart IoT power meter.

[0007] Further, the PC end is provided with a first virtual bus interface, and the virtual bus coordinator also includes a virtual bus bearer coordination conversion channel and a virtual bus bearer channel. The initiating a command to be tested through the PC end and sending the command to be tested to the virtual bus coordinator through the PC end includes: packaging the command to be tested through the first virtual bus interface to obtain the packaged command to be tested, and sending the packaged command to be tested to the virtual bus bearer coordination conversion channel; accordingly, judging whether it is a virtual hard bus according to the virtual bus class identifier through the virtual bus coordinator includes: unpacking the packaged command to be tested through the virtual bus bearer coordination conversion channel to obtain the command to be tested; identifying the virtual bus class identifier through the virtual bus bearer channel to judge whether the virtual bus class identifier is a virtual hard bus.

[0008] In the embodiment of the present application, since a first virtual bus interface is provided in the PC end, the virtual bus coordinator includes a virtual bus bearer coordination conversion channel and a virtual bus bearer channel, the command to be tested is packaged through the first virtual bus interface, and the command to be tested is sent to the virtual bus bearer coordination conversion channel, and then the command to be tested is unpacked through the virtual bus bearer coordination conversion channel, and the virtual bus class identifier in the command to be tested is identified through the virtual bus bearer channel, and it is possible to determine whether the virtual bus class identifier is a virtual hard bus, thereby realizing that the virtual bus coordinator is used as a medium for test channel identification, switching between two test channels according to the virtual bus class identifier, expanding the scope of software testing, and ensuring the accuracy of software testing of smart IoT electric energy meters.

[0009] Furthermore, the PC runs multiple test applications, each of which corresponds to a functional module to be tested or a virtual functional module to be tested, and initiating a command to be tested through the PC includes: initiating a command to be tested through a target test application, and the target test application is one of the multiple test applications.

[0010] In an embodiment of the present application, multiple test applications are running on the PC side, and each test application corresponds to a functional module to be tested or a virtual functional module. Since the target test application is one of the multiple test applications, a command to be tested can be initiated through the target test application. The PC side initiates the command to be tested based on the functional module to be tested or the virtual functional module, thereby realizing accurate testing of the functional modules and achieving the purpose of comprehensively covering the software testing content of the electric energy meter.

[0011] Furthermore, the virtual bus coordinator is provided with a second virtual bus interface, and the virtual hard bus test channel is provided with a virtual hard bus interface. The sending of the command to be tested to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel includes: identifying the interface subclass identifier through the second virtual bus interface to determine the corresponding functional module in the smart IoT electric energy meter; sending the command to be tested to the virtual hard bus interface through the second virtual bus interface; and sending the command to be tested to the corresponding functional module in the smart IoT electric energy meter through the virtual hard bus interface.

[0012] In an embodiment of the present application, a second virtual bus interface is provided in the virtual bus coordinator, and a virtual hard bus interface is provided in the virtual hard bus test channel. The interface subclass identifier in the command to be tested can be identified through the second virtual bus interface, and the corresponding functional module in the smart IoT electric energy meter can be determined through the interface subclass identifier, so that the command to be tested is sent to the corresponding functional module in the smart IoT electric energy meter through the virtual hard bus interface, and the corresponding functional module can be determined through the interface subclass identifier, thereby realizing data transmission of the command to be tested in the virtual hard bus test channel, and achieving hardware-related software testing of the corresponding functional module.

[0013] Furthermore, the virtual soft bus test channel is provided with a virtual soft bus interface, and sending the command to be tested to the virtual function module corresponding to the PC end through the virtual soft bus test channel includes: identifying the interface subclass identifier through the virtual soft bus interface to determine the corresponding virtual function module; sending the command to be tested to the corresponding virtual function module through the virtual soft bus interface.

[0014] In an embodiment of the present application, a virtual soft bus interface is provided in the virtual soft bus test channel, and the interface subclass identifier in the command to be tested is identified through the virtual soft bus interface to determine the virtual function module running in the PC end, so that the command to be tested can be sent to the corresponding virtual function module through the virtual soft bus interface, thereby realizing data transmission of the command to be tested in the virtual soft bus test channel, and simulating the corresponding function module through the virtual function module, thereby achieving software testing of the corresponding function module.

[0015] Further, after sending the command to be tested to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel, it includes: sending first test data to the virtual hard bus interface through the virtual bus bearer channel, the first test data being test data obtained after testing the corresponding functional module of the smart IoT electric energy meter according to the test item, and the first test data including a first interface subclass identifier; receiving the first test data through the virtual hard bus interface, and sending the first test data to the second virtual bus interface; encapsulating the first test data through the second virtual bus interface, and sending the first test data to the virtual bus bearer coordination conversion channel; packaging the first test data through the virtual bus bearer coordination conversion channel to obtain packaged first test data, and sending the packaged first test data to the first virtual bus interface; unpacking the packaged first test data through the first virtual bus interface to obtain first test data, and sending the first test data to the target test application according to the first interface subclass identifier.

[0016] In an embodiment of the present application, after the smart IoT electric energy meter is tested, first test data is sent to the virtual hard bus interface through the virtual bus bearer channel, and the first test data is the first test data obtained after the corresponding functional module is tested according to the test item, and then the first test data is received through the virtual hard bus interface, and the first test data is sent to the second virtual bus interface, the first test data is encapsulated through the second virtual bus interface, and the first test data is sent to the virtual bus bearer coordination conversion channel, and then the first test data is packaged and sent to the first virtual bus interface through the virtual bus bearer coordination conversion channel, and finally the packaged first test data is unpacked through the first virtual bus interface, and sent to the target test application according to the first interface subclass identifier, and the first test data is transmitted from the smart IoT electric energy meter, through the virtual bus coordinator, and finally to the corresponding target test application in the PC end, thereby realizing the reply of the test result in the virtual hard bus test channel.

[0017] Further, after sending the command to be tested to the virtual function module corresponding to the PC end through the virtual soft bus test channel, it includes: sending second test data to the virtual soft bus interface through the virtual bus coordinator, the second test data is the test data generated by the virtual function module corresponding to the PC end according to the test item, and the second test data includes a second interface subclass identifier; encapsulating the second test data through the virtual soft bus interface, and sending the second test data to the virtual bus bearer coordination conversion channel; packing the second test data through the virtual bus bearer coordination conversion channel to obtain the packed second test data, and sending the packed second test data to the first virtual bus interface; unpacking the packed second test data through the first virtual bus interface to obtain the second test data, and sending the second test data to the corresponding test application according to the second interface subclass identifier.

[0018] In an embodiment of the present application, after sending a command to be tested to a virtual function module through a virtual soft bus test channel, second test data is sent to a virtual soft bus interface through a virtual bus coordinator, and the second test data is the second test data generated by a virtual function module corresponding to the PC according to a test item, and the second test data includes a second interface subclass identifier, and the second test data is encapsulated through the virtual soft bus interface and sent to a virtual bus bearer coordination conversion channel, and then the second test data is packaged and sent to a first virtual bus interface through a virtual bus bearer coordination conversion channel, and then the packaged second test data is unpacked through the first virtual bus interface, and sent to a target test application according to the first interface subclass identifier. The second test data is sent from the smart IoT electric energy meter through the virtual bus coordinator to the test reply of the target test application on the PC, thereby realizing the reply of the second test data in the virtual soft bus test channel.

[0019] Furthermore, the PC runs a test analysis application, and the method also includes: storing the first test data through the PC; reading the first test data through the test analysis application, and obtaining a test conclusion of a functional module corresponding to the smart IoT electric energy meter based on the first test data.

[0020] In the embodiment of the present application, since a test analysis application is running on the PC, the first test data is stored through the PC, and the first test data is read through the test analysis application to obtain the test conclusion of the functional module corresponding to the smart IoT electricity meter, thereby realizing the persistence of the test data, and analyzing based on the first test data to obtain accurate test conclusions.

[0021] Furthermore, the PC runs a test analysis application, and the method also includes: storing the second test data through the PC; reading the second test data through the test analysis application, and obtaining a test conclusion of the virtual function module corresponding to the PC based on the second test data.

[0022] In an embodiment of the present application, the second test data is stored in the PC, read through a test analysis application, and the test conclusion of the virtual function module is obtained through the second test data, thereby achieving persistence of the second test data, and the test conclusion of the corresponding virtual function module can be obtained based on the second test data, thereby improving the accuracy of the test results.

[0023] In a second aspect, an embodiment of the present application provides a smart electric energy meter software testing system, the testing system comprising a PC, a virtual bus coordinator and a smart IoT electric energy meter; wherein the virtual bus coordinator is connected to the PC and the smart IoT electric energy meter respectively; the PC is used to initiate a command to be tested, and sends the command to be tested to the virtual bus coordinator through the PC, the command to be tested comprising a virtual bus class identifier, an interface subclass identifier and a test item, the virtual bus class identifier being a virtual hard bus or a virtual soft bus; the virtual bus coordinator is used to determine whether the virtual bus class identifier is a virtual hard bus, and the virtual bus coordinator is provided with a virtual hard bus test channel and a virtual soft bus test channel; if so, the virtual bus coordinator is used to send the command to be tested to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel, and the smart IoT electric energy meter includes multiple functional modules; the smart IoT electric energy meter is used to run the functional module according to the command to be tested, obtain the first test data, and send the first test data to the PC end; if not, the virtual bus coordinator is used to send the command to be tested to the virtual functional module corresponding to the PC end through the virtual soft bus test channel, and the PC end runs multiple virtual functional modules, and each of the virtual functional modules is used to simulate the operation of the functional module corresponding to the smart IoT electric energy meter.

[0024] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a bus, wherein the processor and the memory communicate with each other through the bus;

[0025] The memory stores program instructions that can be executed by the processor, and the processor can execute the method of the first aspect by calling the program instructions.

[0026] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including:

[0027] The computer-readable storage medium stores computer instructions, which cause the computer to execute the method of the first aspect.

[0028] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0030] Figure 1 A flowchart of a smart energy meter software testing method provided in an embodiment of the present application;

[0031] Figure 2 A schematic diagram of an overall software test flow of a smart electric energy meter provided in an embodiment of the present application;

[0032] Figure 3 A schematic diagram of the structure of a smart electric energy meter software testing system provided in an embodiment of the present application;

[0033] Figure 4 A schematic diagram of another smart energy meter software testing system structure provided in an embodiment of the present application;

[0034] Figure 5 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0036] Figure 1A flow chart of a method for testing software of a smart electric energy meter provided in an embodiment of the present application. It can be understood that the smart IoT electric energy meter provided in the embodiment of the present application refers to a smart IoT electric energy meter that introduces an embedded operating system, and can support functions such as installation, uninstallation, upgrade, and stop of multiple applications. The embodiment of the present application does not specify the model and type of the smart IoT electric energy meter. The present application is applied to a test system, and the test system includes a PC and a virtual bus coordinator. The virtual bus coordinator is connected to the PC and the smart IoT electric energy meter. The PC is a personal computer (PC) for providing computer services. The virtual bus coordinator can be in the form of hardware or software, and is used to switch the test channels between the PC and the smart IoT electric energy meter. The command to be tested can be transmitted through the test channel, thereby realizing the testing of the smart IoT electric energy meter software through the PC, thereby expanding the scope of software testing. Figure 1 As shown, the method includes:

[0037] Step 101: Initiate a command to be tested through the PC end, and send the command to be tested to the virtual bus coordinator through the PC end, wherein the command to be tested includes a virtual bus class identifier, an interface subclass identifier, and a test item, and the virtual bus class identifier is divided into a virtual hard bus or a virtual soft bus.

[0038] In the specific implementation process, the command to be tested can be a program instruction, which is initiated by the PC side and is used to test the software of the smart IoT electric energy meter. This application does not limit the content of the command to be tested. For example, the PC side can turn on the communication detection function with the metering core, send a communication test command to the smart IoT electric energy meter, and so on. The command to be tested includes a virtual bus class identifier, an interface subclass identifier, and a test item. The virtual bus class identifier includes two types: a virtual hard bus and a virtual soft bus, which are used to distinguish test channels. The interface subclass identifier includes: an electrically erasable programmable read-only memory module (ElectricErasable Programmable Read-Only Memory, EEPROM, hereinafter referred to as E2), Flash, metering core, Bluetooth, LCD, button, type A expansion module, type B expansion module, etc. The test item can be a functional test case for a functional module of the smart IoT electric energy meter, which is used to test whether a certain function of the functional module works normally. For example: the test item is a storage function test, which is used to test whether the data stored in the E2 memory is intact.

[0039] Step 102: The virtual bus coordinator determines whether it is a virtual hard bus according to the virtual bus class identifier, and the virtual bus coordinator is provided with a virtual hard bus test channel and a virtual soft bus test channel.

[0040] In the specific implementation process, the virtual bus coordinator can be in the form of a hardware device or in the form of an application for simulation. The virtual bus coordinator includes a virtual hard bus test channel and a virtual soft bus test channel. The virtual hard bus test channel can be a real hardware channel, which transmits the test command through the hardware channel to test the functional module of the smart IoT electric energy meter. The virtual soft bus test channel does not need to transmit the test command through the hardware channel, so the virtual soft bus test channel can be a communication channel for data transmission. For example: the test channel that the PC side uses to test the E2 memory in the smart IoT electric energy meter is the virtual hard bus test channel, and the test channel that the PC side uses to test the management core simulation software is the virtual soft bus test channel.

[0041] Step 103: If yes, the command to be tested is sent to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel to test the functional module corresponding to the smart IoT electric energy meter, where the smart IoT electric energy meter includes multiple functional modules.

[0042] In the specific implementation process, the smart IoT electricity meter includes multiple functional modules, each functional module represents a different hardware device of the smart IoT electricity meter, and is used to complete different functions of the smart IoT electricity meter. The functional module can be an electrically erasable read-only memory module (Electric Erasable Programmable Read-Only Memory, EEPROM, hereinafter referred to as E2), an LCD liquid crystal display module, a Flash memory module, a metering core module, a type A expansion module module, a type B expansion module module 1, a type B expansion module module 2, a local Bluetooth and button and other functional modules. This application does not limit the types of functional modules.

[0043] Step 104: If not, the command to be tested is sent to the virtual function module corresponding to the PC side through the virtual soft bus test channel to realize a simulation test on the function module corresponding to the smart IoT electric energy meter. The PC side runs multiple virtual function modules, and each of the virtual function modules is used to simulate the operation of the function module corresponding to the smart IoT electric energy meter.

[0044] In the specific implementation process, corresponding to the various functional modules of the smart IoT electricity meter, multiple virtual functional modules are running on the PC side. Each virtual functional module can simulate the operating environment of the corresponding functional module in the smart IoT electricity meter, thereby simulating the actual operating environment of each functional module. It should be noted that when the virtual functional module is tested through a virtual soft test channel, the virtual bus coordinator can be completely implemented by software, and the simulation test of the smart IoT electricity meter can be completed without hardware support. The error conditions of various functional modules are simulated without providing complex test conditions, which not only ensures the personal safety of the testers, but also does not cause damage to the hardware of the smart IoT electricity meter itself.

[0045] For example: when the command to be tested is an E2 storage function test, the virtual bus identifier of the command to be tested is a virtual hard bus, and the virtual bus class identifier is detected as a virtual hard bus through the virtual bus coordinator, and the command to be tested is sent to the E2 memory of the smart IoT power meter through the virtual hard bus test channel. When the command to be tested is a management core overcurrent event test, since the overcurrent event will damage the management core module, the management core module needs to be simulated at this time, so the virtual bus coordinator can be software, and the virtual bus coordinator identifies the current virtual bus identifier as a virtual soft bus, and sends the command to be tested to the management core virtual function module in the PC end through the virtual soft bus test channel.

[0046] On the basis of the above embodiment, the PC end is provided with a first virtual bus interface, the virtual bus coordinator further includes a virtual bus bearer coordination conversion channel and a virtual bus bearer channel, the initiating a command to be tested through the PC end, and sending the command to be tested to the virtual bus coordinator through the PC end, comprises:

[0047] Packing the command to be tested through the first virtual bus interface to obtain a packed command to be tested, and sending the packed command to be tested to the virtual bus bearer coordination conversion channel;

[0048] Accordingly, the determining, by the virtual bus coordinator, whether it is a virtual hard bus according to the virtual bus class identifier includes:

[0049] Unpacking the packaged command to be tested through the virtual bus bearer coordination conversion channel to obtain the command to be tested;

[0050] The virtual bus class identifier is identified through the virtual bus bearer channel to determine whether the virtual bus class identifier is a virtual hard bus.

[0051] In a specific implementation, the first virtual bus interface is set at the PC end, which is used to realize the connection between the PC end and the virtual bus coordinator. The first virtual bus interface can be implemented by software, which is equivalent to the middle layer, and is mainly used to abstract the relationship between the PC end application and the hardware platform, provide a hardware platform for the PC end application, hide the hardware interface details between the PC end and the virtual bus coordinator, and facilitate the cross-platform porting of the application. The virtual bus coordinator includes a virtual bus bearer coordination conversion channel and a virtual bus bearer channel. The virtual bus bearer coordination conversion channel is a communication channel for data transmission between the PC end and the virtual bus coordinator. The communication channel can be a network data transmission channel. By packaging the commands to be tested, efficient transmission of the commands to be tested can be achieved. The virtual bus bearer channel is a physical channel between the virtual bus coordinator and the intelligent IoT electric energy meter, which is used to send the commands to be tested to the corresponding functional modules. The virtual bus bearer channel has an identification function, which can be judged according to the virtual bus class identifier in the command to be tested, so as to correctly switch the test channel of the current command to be tested.

[0052] The second virtual bus interface is set in the virtual bus coordinator and can also be implemented by software, and is used to identify the target functional module according to the interface subclass identifier. The interface subclass identifiers include: E2, Flash, metering core, Bluetooth, LCD, button, type A expansion module, type B expansion module, etc., corresponding to the functional module. The target functional module of the smart IoT electric energy meter is determined by identifying the interface subclass identifier through the second virtual bus interface, and the data interaction between the PC and the target functional module of the smart IoT electric energy meter is realized, and the data interaction channel of the instruction to be developed is determined.

[0053] On the basis of the above embodiment, the PC terminal runs multiple test applications, each of which corresponds to a functional module to be tested or a virtual functional module to be tested, and the initiating a test command through the PC terminal includes:

[0054] A command to be tested is initiated through a target test application, where the target test application is one of the multiple test applications.

[0055] In the specific implementation process, the test application may include multiple application applications. The test application may send a test command to the functional module to be tested, or send a test command to the virtual functional module to be tested. The test application may be: a metering test application, a display test application, a storage test application, a signal input test application, and an extended communication application. The metering test application may test the metering core functional module, or the metering core virtual functional module, which is related to the virtual bus identifier identified in the test command. For example: On the PC side, the overcurrent event monitoring function is enabled through the management core test application, the overcurrent event trigger lower limit value is set, the current value is set using the simulated metering core virtual functional module, and an overcurrent event is generated when the current value is greater than the trigger lower limit value, and an overcurrent event monitoring command is sent through the management core test application.

[0056] On the basis of the above embodiment, the virtual bus coordinator is provided with a second virtual bus interface, the virtual hard bus test channel is provided with a virtual hard bus interface, and the sending of the command to be tested to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel includes:

[0057] Identify the interface subclass identifier through the second virtual bus interface, and determine the corresponding functional module in the smart IoT electric energy meter;

[0058] Sending the command to be tested to the virtual hard bus interface through the second virtual bus interface;

[0059] The command to be tested is sent to the corresponding functional module in the smart IoT electric energy meter through the virtual hard bus interface.

[0060] In the specific implementation process, the second virtual bus interface is set on the virtual bus coordinator to identify the interface subclass identifier. The second virtual bus interface mainly includes: virtual bus identifier, virtual bus control interface, virtual bus data storage interface, virtual bus input interface, virtual bus output interface, wherein the virtual bus identifier includes the interface subclass identifier of each functional module (E2, Flash, metering core, Bluetooth, LCD, button, type A expansion module, type B expansion module, etc.). Add a subclass identifier id to each functional module, and the second virtual bus interface judges the interface subclass identifier to select the functional module corresponding to the identifier to realize data interaction with each functional module. For example: if the interface subclass identifier is identified as E2 memory by the virtual bus coordinator, the command to be tested is sent to the E2 memory through the second virtual bus interface.

[0061] On the basis of the above embodiment, the virtual soft bus test channel is provided with a virtual soft bus interface, and the step of sending the command to be tested to the virtual function module corresponding to the PC end through the virtual soft bus test channel includes:

[0062] Identify the interface subclass identifier through the virtual soft bus interface to determine the corresponding virtual function module;

[0063] The command to be tested is sent to the corresponding virtual function module through the virtual soft bus interface.

[0064] In the specific implementation process, the virtual soft bus interface can be a unified data interaction interface, which simulates the functions of each hardware functional module through software, thereby providing various data such as power, parameters, freezing, etc. required for the test, simulating the actual operating environment of the smart IoT electric energy meter, and the virtual functional module can be a simulation software used to simulate the corresponding functional module, which can read and view the data inside the interface in real time. For example: the virtual soft bus interface reads the interface subclass identifier in the command to be tested and determines it as a management core interface device, and sends the command to be tested to the management core virtual functional module, thereby completing the test.

[0065] On the basis of the above embodiment, after sending the command to be tested to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel, the method includes:

[0066] Sending first test data to the virtual hard bus interface through the virtual bus bearer channel, wherein the first test data is test data obtained after testing a corresponding functional module of the smart IoT electric energy meter according to the test item, and the first test data includes a first interface subclass identifier;

[0067] receiving the first test data through the virtual hard bus interface, and sending the first test data to the second virtual bus interface;

[0068] encapsulating the first test data through the second virtual bus interface, and sending the first test data to the virtual bus bearer coordination conversion channel;

[0069] Packing the first test data through the virtual bus bearer coordination conversion channel to obtain the packed first test data, and sending the packed first test data to the first virtual bus interface;

[0070] The packaged first test data is unpacked through the first virtual bus interface to obtain first test data, and the first test data is sent to the target test application according to the first interface subclass identifier.

[0071] In the specific implementation process, the first test data can be the test data required by the corresponding functional module in the smart IoT electric energy meter, which is sent to the target test application on the PC through various channels and interfaces of the virtual bus coordinator. It can be understood that the target test application matches the functional module. For example, the first test data sent by the E2 memory is sent to the corresponding memory test application after passing through the virtual bus coordinator.

[0072] The implementation of the above embodiment is, for example, to test the E2 memory using a memory test application, and the implementation includes:

[0073] S111: Sending a memory test command through a PC-side memory test application;

[0074] S112: After receiving the memory test command through the first virtual bus interface of the PC, the command (including the virtual bus class identifier, the memory interface subclass identifier, the test item, etc.) is packaged according to the virtual bus interface communication requirements, and sent to the virtual bus bearer coordination conversion channel of the virtual bus coordinator;

[0075] S113: unpacking the command to be tested after receiving it through the virtual bus bearer coordination conversion channel, and sending the unpacked command to be tested to the virtual bus bearer channel;

[0076] S114: identifying the virtual bus class identifier in the command to be tested through the virtual bus bearer channel, identifying it as a virtual hard bus, and then sending it to the second virtual bus interface;

[0077] S115: Reading the interface subclass identifier in the data through the second virtual bus interface determines that the device is an E2 memory device, calling the corresponding virtual hard bus interface and sending the command to be tested to the memory device;

[0078] S116: reply and run the first test data through the E2 memory device, send the first test data to the virtual hard bus interface through the virtual bus bearer channel, and send it to the virtual bus bearer coordination conversion channel of the virtual bus coordinator after abstract encapsulation through the virtual hard bus interface and the second virtual bus interface;

[0079] S117: Packing the first test data through the virtual bus bearer coordination conversion channel, and then sending it to the first virtual bus interface;

[0080] S118: unpacking the first test data through the first virtual bus interface and sending the unpacked first test data to the memory test application on the PC.

[0081] The total number of erase and write times of each address space of E2 and the maximum number of erase and write times within the monthly interval, weekly interval, daily interval, and hourly interval can be monitored and counted over a long period of time through the memory test application. Once it is detected that the number of erase and write times within E2 is greater than the average maximum number of erase and write times calculated above, the reasons for operating the EEPROM of the smart IoT energy meter during this period can be combined with analysis, and the total maximum number of erase and write times within 16 years of use can be further calculated to determine whether there is a situation where the erase and write limit is exceeded and the service life is affected.

[0082] On the basis of the above embodiment, after sending the command to be tested to the virtual function module corresponding to the PC end through the virtual soft bus test channel, the method includes:

[0083] Sending second test data to the virtual soft bus interface through the virtual bus coordinator, where the second test data is test data generated by the virtual function module corresponding to the PC end according to the test item, and the second test data includes a second interface subclass identifier;

[0084] Encapsulating the second test data through the virtual soft bus interface, and sending the second test data to the virtual bus bearer coordination conversion channel;

[0085] Packing the second test data through the virtual bus bearer coordination conversion channel to obtain the packed second test data, and sending the packed second test data to the first virtual bus interface;

[0086] The packaged second test data is unpacked through the first virtual bus interface to obtain second test data, and the second test data is sent to the corresponding test application according to the second interface subclass identifier.

[0087] In the specific implementation process, the second test data can be the test data obtained by the virtual function module running in the PC side by simulating the operating environment of the corresponding function module. It can be understood that the virtual function module corresponds to the function module of the smart IoT electric energy meter. The second test interface subclass identifier can be identified through the second virtual bus interface to send the second test data to the corresponding test application, thereby completing the simulation test of the corresponding function module of the smart IoT electric energy meter.

[0088] An implementation of the above embodiment, for example, uses a management core test application to test an overcurrent event, and the implementation includes:

[0089] S121: Enable the overcurrent event detection function in the PC management core test application, set the overcurrent event trigger lower limit, and use the analog metering core software to set the current value. If the current value is greater than the trigger lower limit, an overcurrent event will be generated.

[0090] S122: Wait for 60 seconds, send an event read command through the management core test application, and after receiving the event read command through the first virtual bus interface, package the command to be tested (including the virtual bus class identifier, the management core interface subclass identifier, the test item, etc.) according to the virtual bus interface communication requirements, and send it to the virtual bus bearer coordination conversion channel of the virtual bus coordinator;

[0091] S123: After receiving the command to be tested through the virtual bus bearer coordination conversion channel, the command is unpacked and then transmitted to the virtual bus bearer channel. The command to be tested after unpacking is identified as a virtual soft bus through the virtual bus class identifier in the command to be tested, and then sent to the virtual soft bus interface;

[0092] S124: Reading the interface subclass identifier in the data through the virtual soft bus interface determines that it is a management core function module, calling the corresponding management core virtual soft bus interface and sending the data to the management core virtual function module;

[0093] S125: reply the second test data through the management core virtual function module, and send it to the virtual bus bearer coordination conversion channel of the virtual bus coordinator after abstract encapsulation by the virtual soft bus interface;

[0094] S126: Packing the second test data through the virtual bus bearer coordination conversion channel, and then sending it to the first virtual bus interface;

[0095] S127: Unpack the data through the first virtual bus interface and send it to the management core test application.

[0096] Another implementation of the above embodiment is to test the avoidance of dual-core communication failure using a management core test application, and the implementation includes:

[0097] S131: Enable the communication detection function with the metering chip in the management chip test application on the PC, and send a communication test command;

[0098] S132: After receiving the communication test command through the first virtual bus interface, the communication test command (including the virtual bus class identifier, the metering core interface subclass identifier, the test items, etc.) is packaged according to the virtual bus interface communication requirements, and sent to the virtual bus bearer coordination conversion channel of the virtual bus coordinator;

[0099] S133: unpacking the communication test command received through the virtual bus bearer coordination conversion channel, identifying the data as a virtual soft bus through the virtual bus class identifier in the unpacked data, and then sending it to the virtual soft bus interface;

[0100] S134: Reading the interface subclass identifier in the data through the virtual soft bus interface determines that it is a metering core device, calling the corresponding metering core virtual soft bus interface and sending the data to the metering core virtual function module;

[0101] S135: replying the error data through the virtual function module of the metering core, so that the management core generates an array out-of-bounds segment error, and sending the data to the virtual bus bearer coordination conversion channel of the virtual bus coordinator after abstract encapsulation by the virtual soft bus interface;

[0102] S136: Packing the data through the virtual bus bearer coordination conversion channel and then sending it to the PC-side virtual bus interface;

[0103] S137: unpacking the data through the first virtual bus interface and sending it to the management core test APP. After receiving the error data, the management core test APP stops at the error position;

[0104] S138: By checking the memory and call stack information, you can quickly locate the error and modify the management core program.

[0105] Based on the above embodiment, the PC runs a test analysis application, and the method further includes:

[0106] Storing the first test data through the PC;

[0107] The first test data is read through the test analysis application, and a test conclusion of a functional module corresponding to the smart IoT electric energy meter is obtained based on the first test data.

[0108] In the specific implementation process, the PC side can store the first test data through the storage virtual soft bus, and the saved form can be a file or a database, and the first test data can be read from the file or database through the test analysis application to draw a conclusion on the software design reliability of the corresponding functional module.

[0109] Based on the above embodiment, the PC runs a test analysis application, and the method further includes:

[0110] Storing the second test data through the PC;

[0111] The second test data is read through the test analysis application, and a test conclusion of the virtual function module corresponding to the PC end is obtained according to the second test data.

[0112] In the specific implementation process, the second test data is the data required for the test that is returned after the virtual function module is tested. The PC side can also save the second test data to a file or database by storing the virtual soft bus to achieve a persistent effect. Then, the test analysis application can be used to obtain the design reliability conclusion of the smart IoT electricity meter.

[0113] See also Figure 2 The schematic diagram of the overall software test process of a smart energy meter provided by the embodiment of the present application is shown, showing two virtual bus test channels composed of a PC, a virtual bus coordinator, and a smart IoT energy meter, including a virtual hard bus test channel and a virtual soft bus test channel, which are used to implement the reliability test of the smart IoT energy meter software. The switching of the two test channels is completed through the virtual bus coordinator, thereby expanding the scope of software testing. The implementation method of the overall software test process includes:

[0114] S201: Initiate a test command through a test application on the PC, and package it through the first virtual bus interface, unpack it through the virtual bus bearer coordination conversion channel, and identify the virtual bus class identifier through the virtual bus bearer channel to determine whether it is a virtual hard bus;

[0115] S202: If yes, identify the interface subclass identifier through the second virtual bus interface of the virtual bus coordinator, send it to the virtual hard bus interface through the second virtual bus interface, send it to the corresponding functional module of the smart IoT electric energy meter through the virtual hard bus interface, reply the first test data according to the command to be tested through the corresponding functional module, and send it to the test application on the PC through the virtual bus bearer channel, the virtual hard bus interface, the second virtual bus interface, and the virtual bus bearer coordination conversion channel in sequence;

[0116] S203: If not, identify the interface subclass identifier through the virtual soft bus interface and send it to the virtual function module, reply the second test data according to the command to be tested through the virtual function module, and send it to the test application on the PC through the virtual soft bus interface and the virtual bus bearer coordination conversion channel in sequence;

[0117] S204: Store test data through a test application on the PC, the test data including first test data and second test data, read the test data through a test analysis application, and output a test report.

[0118] See also Figure 3A structural schematic diagram of a smart electric energy meter software testing system provided by an embodiment of the present application is shown, and the structural schematic diagram is used to represent a virtual hard bus test channel of the test system; the system includes: a PC terminal 310, a virtual bus coordinator 320 and a smart IoT electric energy meter 330; the virtual bus coordinator 320 is electrically connected to the PC terminal 310 and the smart IoT electric energy meter 330 respectively, that is, the software test channel of the PC terminal 310 and the smart IoT electric energy meter 330 can be realized through the virtual bus coordinator 320.

[0119] The PC terminal 310 is used to initiate a command to be tested and send the command to be tested to the virtual bus coordinator through the PC terminal 310. The command to be tested includes a virtual bus class identifier, an interface subclass identifier and a test item. The virtual bus identifier is a virtual hard bus or a virtual soft bus.

[0120] The virtual bus coordinator 320 is used to determine whether the virtual bus class identifier is a virtual hard bus, and the virtual bus coordinator 320 is provided with a virtual hard bus test channel and a virtual soft bus test channel;

[0121] If it is a virtual hard bus, the virtual bus coordinator 320 is used to send the test command to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel, and the smart IoT electric energy meter includes multiple functional modules;

[0122] The smart IoT electric energy meter 330 is used to run the corresponding functional module according to the command to be tested, obtain first test data, and send the first test data to the PC terminal 310;

[0123] Specifically, the virtual bus coordinator is composed of a separate microcontroller unit (MCU) and various peripheral communication units, which not only realizes the physical connection between the smart IoT electric energy meter and the PC, but also realizes the virtual hard bus test channel between the virtual hard bus and the functional modules corresponding to the smart IoT electric energy meter through the encapsulated first virtual bus interface. The virtual bus coordinator realizes the software test function related to the hardware of the smart IoT electric energy meter through the virtual hard bus test channel.

[0124] See also Figure 4 A structural schematic diagram of another smart electric energy meter software testing system provided by an embodiment of the present application is shown, and the structural schematic diagram is used to represent a virtual soft bus test channel of the test system.

[0125] When the virtual bus is identified as a virtual soft bus, the virtual bus coordinator is used to send the test command to the virtual function module corresponding to the PC side through the virtual soft bus test channel. The PC side runs multiple virtual function modules, and each virtual function module is used to simulate the operation of the function module corresponding to the smart IoT electric energy meter.

[0126] If the virtual bus interface does not involve data interaction with the virtual hard bus, the virtual bus coordinator can directly interact with multiple virtual function modules through the virtual soft bus interface.

[0127] The PC side can simulate the operating environment of each functional module of the smart IoT electric energy meter through the virtual functional module, thereby simulating the complex experimental environment of the hardware platform of the smart IoT electric energy meter to achieve the effect of simulation test. Among them, the virtual soft bus varies according to the connected virtual functional modules, including: metering virtual bus, display virtual soft bus, storage virtual soft bus, signal virtual soft bus and extended communication virtual soft bus, etc. By switching the test channel to the virtual soft bus test channel and simulating these actual operating data through the virtual soft bus interface, the actual operating environment of the smart electric energy meter can be simulated in a software way, providing conditions for realizing the reliability test of the smart electric energy meter software. After the test is completed, the test data will be saved through the storage virtual soft bus, and the test analysis application will read the saved test data, perform data analysis, and draw test conclusions. Thus, the software test of the smart electric energy meter is realized.

[0128] Combination Figure 3 and Figure 4 It can be concluded that by controlling the switching of test channels through the virtual bus coordinator, a more comprehensive testing method is provided for the software reliability test of the smart IoT electric energy meter through the virtual hard bus test channel and the virtual soft bus test channel respectively, thereby improving the accuracy of the software reliability test of the smart IoT electric energy meter.

[0129] Figure 5 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present application, such as Figure 5 As shown, the electronic device includes: a processor (processor) 501, a memory (memory) 502 and a bus 503; wherein,

[0130] The processor 501 and the memory 502 interact with each other via the bus 503;

[0131] The processor 501 is used to call the program instructions in the memory 502 to execute the methods provided by the above method embodiments.

[0132] The processor 501 can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 501 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. It can implement or execute various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0133] The memory 502 may include, but is not limited to, random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), etc.

[0134] This embodiment discloses a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments.

[0135] This embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the methods provided by the above-mentioned method embodiments.

[0136] In the embodiments provided in the present application, it should be understood that the disclosed methods and systems can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or interactive connection shown or discussed can be through some interactive interfaces, and the indirect coupling or interactive connection of devices or units can be electrical, mechanical or other forms.

[0137] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0138] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0139] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0140] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for testing software of a smart electric energy meter, characterized in that: Applied to a test system, the test system includes a PC and a virtual bus coordinator, the virtual bus coordinator is connected to the PC and a smart IoT electric energy meter, and the method includes: Initiate a command to be tested through the PC end, and send the command to be tested to the virtual bus coordinator through the PC end, wherein the command to be tested includes a virtual bus class identifier, an interface subclass identifier, and a test item, and the virtual bus class identifier is a virtual hard bus or a virtual soft bus; The virtual bus coordinator determines whether it is a virtual hard bus according to the virtual bus class identifier, and the virtual bus coordinator is provided with a virtual hard bus test channel and a virtual soft bus test channel; If so, the command to be tested is sent to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel to test the functional module corresponding to the smart IoT electric energy meter, wherein the smart IoT electric energy meter includes multiple functional modules; If not, the command to be tested is sent to the virtual function module corresponding to the PC end through the virtual soft bus test channel to implement a simulation test on the function module corresponding to the smart IoT electric energy meter. The PC end runs multiple virtual function modules, and each virtual function module is used to simulate the operation of the function module corresponding to the smart IoT electric energy meter. The PC end is provided with a first virtual bus interface, the virtual bus coordinator further includes a virtual bus bearer coordination conversion channel and a virtual bus bearer channel, and the initiating a command to be tested through the PC end and sending the command to be tested to the virtual bus coordinator through the PC end includes: Packing the command to be tested through the first virtual bus interface to obtain a packed command to be tested, and sending the packed command to be tested to the virtual bus bearer coordination conversion channel; Accordingly, the determining, by the virtual bus coordinator, whether it is a virtual hard bus according to the virtual bus class identifier includes: Unpacking the packaged command to be tested through the virtual bus bearer coordination conversion channel to obtain the command to be tested; Identify the virtual bus class identifier through the virtual bus bearer channel, and determine whether the virtual bus class identifier is a virtual hard bus; The PC terminal runs a plurality of test applications, each of which corresponds to a functional module to be tested or a virtual functional module to be tested, and the initiating a command to be tested through the PC terminal includes: Initiating a command to be tested through a target test application, wherein the target test application is one of the multiple test applications; the virtual bus coordinator is provided with a second virtual bus interface, the virtual hard bus test channel is provided with a virtual hard bus interface, and sending the command to be tested to a functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel includes: Identify the interface subclass identifier through the second virtual bus interface, and determine the corresponding functional module in the smart IoT electric energy meter; Sending the command to be tested to the virtual hard bus interface through the second virtual bus interface; Sending the command to be tested to the corresponding functional module in the smart IoT electric energy meter through the virtual hard bus interface; After sending the command to be tested to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel, the method includes: Sending first test data to the virtual hard bus interface through the virtual bus bearer channel, wherein the first test data is test data obtained after testing a corresponding functional module of the smart IoT electric energy meter according to the test item, and the first test data includes a first interface subclass identifier; receiving the first test data through the virtual hard bus interface, and sending the first test data to the second virtual bus interface; encapsulating the first test data through the second virtual bus interface, and sending the first test data to the virtual bus bearer coordination conversion channel; Packing the first test data through the virtual bus bearer coordination conversion channel to obtain the packed first test data, and sending the packed first test data to the first virtual bus interface; The packaged first test data is unpacked through the first virtual bus interface to obtain first test data, and the first test data is sent to the target test application according to the first interface subclass identifier.

2. The method according to claim 1, characterized in that The virtual soft bus test channel is provided with a virtual soft bus interface, and sending the command to be tested to the virtual function module corresponding to the PC end through the virtual soft bus test channel includes: Identify the interface subclass identifier through the virtual soft bus interface to determine the corresponding virtual function module; The command to be tested is sent to the corresponding virtual function module through the virtual soft bus interface.

3. The method according to claim 2, characterized in that After sending the command to be tested to the virtual function module corresponding to the PC end through the virtual soft bus test channel, the method includes: Sending second test data to the virtual soft bus interface through the virtual bus coordinator, where the second test data is test data generated by the virtual function module corresponding to the PC end according to the test item, and the second test data includes a second interface subclass identifier; Encapsulating the second test data through the virtual soft bus interface, and sending the second test data to the virtual bus bearer coordination conversion channel; Packing the second test data through the virtual bus bearer coordination conversion channel to obtain the packed second test data, and sending the packed second test data to the first virtual bus interface; The packaged second test data is unpacked through the first virtual bus interface to obtain second test data, and the second test data is sent to the corresponding test application according to the second interface subclass identifier.

4. The method according to claim 1, characterized in that The PC terminal runs a test analysis application, and the method further includes: Storing the first test data through the PC; The first test data is read through the test analysis application, and a test conclusion of a functional module corresponding to the smart IoT electric energy meter is obtained based on the first test data.

5. The method according to claim 3, characterized in that: The PC terminal runs a test analysis application, and the method further includes: Storing the second test data through the PC; The second test data is read through the test analysis application, and a test conclusion of the virtual function module corresponding to the PC end is obtained according to the second test data.

6. A smart electric energy meter software testing system, characterized in that: The test system includes a PC, a virtual bus coordinator and an intelligent IoT electric energy meter; Wherein, the virtual bus coordinator is connected to the PC terminal and the smart IoT electric energy meter respectively; The PC end is used to initiate a command to be tested, and send the command to be tested to the virtual bus coordinator through the PC end, wherein the command to be tested includes a virtual bus class identifier, an interface subclass identifier, and a test item, and the virtual bus class identifier is a virtual hard bus or a virtual soft bus; The virtual bus coordinator is used to determine whether the virtual bus class identifier is a virtual hard bus, and the virtual bus coordinator is provided with a virtual hard bus test channel and a virtual soft bus test channel; If so, the virtual bus coordinator is used to send the test command to the functional module corresponding to the smart IoT electric energy meter through the virtual hard bus test channel, and the smart IoT electric energy meter includes multiple functional modules; The smart IoT electric energy meter is used to run the functional module according to the command to be tested, obtain first test data, and send the first test data to the PC; If not, the virtual bus coordinator is used to send the command to be tested to the virtual function module corresponding to the PC end through the virtual soft bus test channel, and the PC end runs multiple virtual function modules, each of which is used to simulate the operation of the function module corresponding to the smart IoT electric energy meter; The PC end is provided with a first virtual bus interface, and the virtual bus coordinator further includes a virtual bus bearer coordination conversion channel and a virtual bus bearer channel. The PC end is used to package the command to be tested through the first virtual bus interface, obtain the packaged command to be tested, and send the packaged command to be tested to the virtual bus bearer coordination conversion channel; The virtual bus coordinator is used to unpack the packaged command to be tested through the virtual bus bearer coordination conversion channel to obtain the command to be tested; identify the virtual bus class identifier through the virtual bus bearer channel to determine whether the virtual bus class identifier is a virtual hard bus; The PC terminal runs a plurality of test applications, each of which corresponds to a functional module to be tested or a virtual functional module to be tested, and the PC terminal is further used to initiate a command to be tested through a target test application, and the target test application is one of the plurality of test applications; The virtual bus coordinator is provided with a second virtual bus interface, the virtual hard bus test channel is provided with a virtual hard bus interface, and the virtual bus coordinator is further used to identify the interface subclass identifier through the second virtual bus interface to determine the corresponding functional module in the smart IoT electric energy meter; send the command to be tested to the virtual hard bus interface through the second virtual bus interface; send the command to be tested to the corresponding functional module in the smart IoT electric energy meter through the virtual hard bus interface; Sending first test data to the virtual hard bus interface through the virtual bus bearer channel, the first test data being test data obtained after testing the corresponding functional module of the smart IoT electric energy meter according to the test item, and the first test data including a first interface subclass identifier; receiving the first test data through the virtual hard bus interface, and sending the first test data to the second virtual bus interface; encapsulating the first test data through the second virtual bus interface, and sending the first test data to the virtual bus bearer coordination conversion channel; packaging the first test data through the virtual bus bearer coordination conversion channel to obtain packaged first test data, and sending the packaged first test data to the first virtual bus interface; unpacking the packaged first test data through the first virtual bus interface to obtain first test data, and sending the first test data to the target test application according to the first interface subclass identifier.

Citation Information

Patent Citations

  • A method and a device for adapting a universal bus interface

    CN109189704A

  • Electric energy meter-oriented virtualization test method and system

    CN110907882A

  • Reliability testing method and device for electric energy meter operating system and computer equipment

    CN112882877A

  • Intelligent electric energy meter design method and system

    CN114019230A