Test method and device, equipment, storage medium and program product

By building a simulated power system, using the coordination of the simulated concentrator and the simulated power meter and the actual communication unit, the problem of low efficiency of communication unit testing in the existing technology is solved, and automated and efficient functional testing is achieved.

CN119135583APending Publication Date: 2024-12-13CHINA GRIDCOM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411125421.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, the software structure of the communication unit is complex, resulting in low testing efficiency, and requires frequent switching of different hardware environments for functional testing, which affects the upgrade, debugging and fault diagnosis of the communication unit.

Method used

By generating analog concentrators and analog power meters, we can build a simulated power system with the communication units of the actual concentrators and power meters, and realize the testing of the functions of any communication unit without frequent switching of the hardware environment, and use simulated power data and messages to quickly use simulated power data and messages. Determine the test results.

Benefits of technology

It improves the efficiency of functional testing of communication units, realizes automated testing, simplifies the process of testing different functions, and significantly improves the testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119135583A_ABST
    Figure CN119135583A_ABST
Patent Text Reader

Abstract

The invention discloses a test method and device, equipment, a storage medium and a program product. The method comprises the steps that a simulation concentrator and a simulation electric energy meter are generated to construct a simulation power utilization system, the simulation power utilization system comprises the simulation concentrator, the simulation electric energy meter, an actual concentrator and a communication unit of the actual electric energy meter, and the simulation concentrator communicates with the communication unit of the actual concentrator. The simulation electric energy meter is used for generating simulation power consumption data and communicating with the communication unit of the actual electric energy meter; running a test case corresponding to a to-be-tested function to obtain a message of the simulated power utilization system; and determining a test result of the to-be-tested function based on the message. According to the invention, the complete simulation power utilization system can be constructed, the function test of any communication unit in the simulation power utilization system can be realized, the hardware environment does not need to be switched frequently, and the test efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of testing power systems, and in particular, relates to a testing method, a testing device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] In the power consumption information collection system, the communication unit is the core unit for data collection. Whether it can operate correctly, efficiently and stably will have a huge impact on the power business. With the continuous expansion of business scenarios, the software structure of communication equipment is becoming increasingly complex. How to test the software functions of the communication unit has become the key to supporting the upgrade, iteration, debugging and fault diagnosis of the communication unit.

[0003] In the current test plan, test tasks are divided into different test environments based on the test content. The hardware required in different test environments is different, resulting in frequent switching of different software and hardware when testing different functions, resulting in low test efficiency. Summary of the invention

[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a test method, a test device, an electronic device, a computer-readable storage medium and a computer program product, which can build a complete simulated power consumption system and realize the functional test of any communication unit in the simulated power consumption system without frequently switching the hardware environment, and the test efficiency is high.

[0005] In a first aspect, the present application provides a testing method, comprising generating a simulated concentrator and a simulated electric energy meter to construct a simulated power consumption system, wherein the simulated power consumption system comprises a simulated concentrator, a simulated electric energy meter, an actual concentrator, and a communication unit of the actual electric energy meter, wherein the simulated concentrator communicates with the communication unit of the actual concentrator, and the simulated electric energy meter is used to generate simulated power consumption data and communicate with the communication unit of the actual electric energy meter; running a test case corresponding to a function to be tested to obtain a message of the simulated power consumption system; and determining a test result of the function to be tested based on the message.

[0006] In some embodiments, the method further includes displaying a use case configuration interface; obtaining at least one of a selection operation received by a use case selection module and an editing operation received by a use case editing module of the use case configuration interface to generate a test case corresponding to the function to be tested.

[0007] In some embodiments, the method further includes saving the test case to the test case selection module.

[0008] In some embodiments, the method further includes serializing the test case to generate and store an extensible markup language file corresponding to the test case.

[0009] In some embodiments, the message of the simulated power consumption system includes a first message, a second message and a third message, and the running of the test case corresponding to the function to be tested to obtain the message of the simulated power consumption system includes: obtaining the first message between the simulated concentrator and the actual concentrator through the simulated concentrator; obtaining the second message between the communication unit of the simulated power meter and the actual power meter through the simulated power meter; and monitoring the third message of the power line between the communication unit of the actual concentrator and the actual power meter.

[0010] In some embodiments, the running of the test case corresponding to the function to be tested to obtain the message of the simulated power consumption system also includes: parsing the first message based on a first communication class corresponding to the communication protocol between the simulated concentrator and the actual concentrator; parsing the second message based on a second communication class corresponding to the communication protocol between the simulated electric energy meter and the actual electric energy meter; parsing the third message based on a third communication class corresponding to the communication protocol between the actual concentrator and the actual electric energy meter.

[0011] In some embodiments, determining the test result of the function to be tested based on the message includes: judging whether the message satisfies a preset test condition; and determining the test result of the function to be tested based on the preset test condition that has been satisfied.

[0012] In some embodiments, determining the test result of the function to be tested based on the preset test conditions that have been met includes: when all of the preset test conditions are met, determining the test result of the function to be tested as a passed test; when any of the preset test conditions are not met, determining the test result of the function to be tested as a failed test.

[0013] In some embodiments, the preset test conditions include at least one of the following: whether the message corresponding to the function to be tested is received; whether the message corresponding to the function to be tested is received within a specified time; whether the number of received messages corresponding to the function to be tested is greater than a preset ratio; whether the received message corresponding to the function to be tested complies with the corresponding communication protocol standard; whether the received message corresponding to the function to be tested is consistent with the configuration parameters of the test case; whether the received message corresponding to the function to be tested is consistent with the simulated power consumption data; and whether the function of the test case is executed normally.

[0014] In some embodiments, the method further comprises displaying information based on the test results.

[0015] In some embodiments, the function to be tested includes at least one of the preset functions of the communication unit, and each of the preset functions is configured with a corresponding test case.

[0016] In some embodiments, the preset functions corresponding to the communication unit of the actual electric energy meter include at least one of the following functions: module networking function, full network upgrade function, remote upgrade function, phase identification function, indicator light function, meter reading function, event active reporting function, communication process function, data transmission function, power outage event reporting function, version information setting and query function, module identification setting and query function, local code setting and query function, and baud rate negotiation function;

[0017] The preset functions corresponding to the communication unit of the actual concentrator include at least one of the following functions: module networking function, whole network upgrade function, remote upgrade function, indicator light function, meter reading function, 1376.2 protocol function, 1376.2 extended protocol function, phase identification function, power outage and restoration event reporting function, version information setting and query function, module identification setting and query function, and local code setting and query function.

[0018] In a second aspect, the present application provides a testing device, the testing device comprising:

[0019] A generation module, used to generate a simulated concentrator and a simulated electric energy meter to construct a simulated power consumption system, wherein the simulated power consumption system includes a simulated concentrator, a simulated electric energy meter, an actual concentrator, and a communication unit of the actual electric energy meter, wherein the simulated concentrator communicates with the communication unit of the actual concentrator, and the simulated electric energy meter is used to generate simulated power consumption data and communicate with the communication unit of the actual electric energy meter;

[0020] A running module, used for running the test case corresponding to the function to be tested to obtain the message of the simulated power consumption system;

[0021] A determination module is used to determine the test result of the function to be tested based on the message.

[0022] In a third aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned test method when executed by a processor.

[0023] In a fourth aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned test method when executing the program.

[0024] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the above-mentioned testing method when executed by a processor.

[0025] The test method, test device, electronic device, computer-readable storage medium and computer program product provided in the embodiment of the present application, by generating a simulated concentrator and a simulated electric energy meter, together with the communication unit of the actual concentrator and the actual electric energy meter, constitute a complete simulated power consumption system, wherein the simulated electric energy meter generates simulated power consumption data, and the communication unit of the simulated electric energy meter and the actual electric energy meter together constitute a complete electric energy meter. After completing the construction of the simulated power consumption system, the test case corresponding to the function to be tested that needs to be tested can be run, and the message in the simulated power consumption system during the running of the test case can be obtained. The test result of the function to be tested can be quickly determined by the message of the simulated power consumption system, and the automated test of the function to be tested can be realized. Moreover, since a complete simulated power consumption system is constructed, when testing different functions to be tested, it is only necessary to replace the corresponding test case without switching the accompanying test device (i.e., the device that is essential for the communication unit to be tested to realize the function). Compared with the low test efficiency of switching the corresponding accompanying test device when testing different functions, the test efficiency is significantly improved.

[0026] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0028] Figure 1 It is an application scenario diagram of the test method provided in the embodiment of the present application;

[0029] Figure 2 is a schematic diagram of the structure of the test system provided in the embodiment of the present application;

[0030] Figure 3 It is a flow chart of the testing method provided in the embodiment of the present application;

[0031] Figure 4 is a communication schematic diagram of a simulated power consumption system provided in an embodiment of the present application;

[0032] Figure 5 It is a flow chart of the testing method provided in the embodiment of the present application;

[0033] Figure 6 It is a flow chart of the testing method provided in the embodiment of the present application;

[0034] Figure 7 It is a flow chart of the testing method provided in the embodiment of the present application;

[0035] Figure 8 It is a flow chart of the testing method provided in the embodiment of the present application;

[0036] Fig. 9 It is a flow chart of the test method for testing the meter reading function provided in the embodiment of the present application;

[0037] Fig.10 It is a flowchart of the test method provided in the embodiment of the present application for testing the communication process function;

[0038] Fig.11 It is a flowchart of the test setting and query module identification function of the test method provided in the embodiment of the present application;

[0039] Fig.12 is a schematic diagram of a module of a testing device provided in an embodiment of the present application;

[0040] Fig.13 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application; and

[0041] Fig.14 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0042] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0043] See also Figure 1 , Figure 1 This is an application scenario diagram of a test system provided in an embodiment of the present application. The application scenario provided in the present application includes a test system 100 and a power consumption system 200, the power consumption system 200 includes a central concentrator 201 and an electric energy meter 202, the central concentrator 201 and the electric energy meter 202 are connected via a power line, and the central concentrator 201 is used to communicate with each electric energy meter 202 to obtain power data collected by each electric energy meter 202.

[0044] The central coordinator 201 (CCO) is a core control unit in the entire power system, responsible for coordinating and managing the communication and data exchange between multiple devices or nodes.

[0045] The energy meter 202 may be a smart meter installed at the user end, which can monitor power data in real time, such as voltage, current, power factor, etc., and collect information such as switch status and transformer temperature.

[0046] The power system 200 also includes a communication unit 210 under test, which can be at least one of a communication unit of the central concentrator 201 and a communication unit (Station, STA) of the electric energy meter. The STA can be a single-phase STA or a three-phase STA. A one-way STA refers to a station module for single-phase electric energy metering. A three-phase STA refers to a station module for three-phase electric energy metering.

[0047] That is, the test system 100 can test at least one of the communication unit of the central concentrator 201 and the communication unit of the electric energy meter.

[0048] See also Figure 2 The test system 100 includes a host computer 10 , a test device 20 , a listening device 30 and a companion test device 40 .

[0049] The host computer 10 may be a terminal device or a server, and the test device 20 may be connected to the host computer 10 after being connected to the network by connecting to the switch 50 .

[0050] Among them, the terminal device may include but is not limited to: smart phones (such as Android phones, IOS phones, etc.), tablet computers, laptops, desktop computers, portable personal computers, mobile Internet devices (Mobile Internet Devices, referred to as MID), vehicle-mounted terminals, etc., and the embodiments of the present application do not limit this.

[0051] Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms, but the embodiments of the present application do not limit this.

[0052] The function limitation method involved in this application can be implemented based on cloud technology, that is, the host computer is a cloud server.

[0053] Among them, cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data calculation, storage, processing and sharing.

[0054] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0055] The function restriction method of the present application can be implemented based on cloud computing. Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, expanded at any time, and paid for by use.

[0056] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.

[0057] The host computer 10 is used to run the test software, which includes a plurality of test cases.

[0058] For example, when the communication unit 210 under test is the communication unit of the electric energy meter 202, corresponding test cases can be written according to the functions that can be realized by the communication unit of the electric energy meter 202, thereby facilitating the testing of the functions of the communication unit of the electric energy meter 202 separately, achieving complete testing of each function of the communication unit of the electric energy meter 202, and improving the test effect.

[0059] Optionally, the communication unit of the electric energy meter 202 may implement at least one of the following functions:

[0060] Module networking function, full network upgrade function, remote upgrade function, phase identification function, indicator light function, meter reading function, active event reporting function, communication process function, data transmission function, power outage and restoration event reporting function, version information setting and query function, module identification setting and query function, local code setting and query function and baud rate negotiation function.

[0061] The following is an introduction to the various functions of the communication unit of the electric energy meter 202:

[0062] (1) Module networking function:

[0063] Meaning: The STA module can automatically join a predefined network to form a complete communication network.

[0064] Function: Enable the STA module to work with other devices to achieve efficient data transmission.

[0065] (2) Network-wide upgrade function:

[0066] Meaning: Allows software updates of the STA module via the network.

[0067] Function: The firmware of all STA modules can be upgraded remotely to simplify the maintenance process.

[0068] (3) Remote upgrade function:

[0069] Meaning: Allows the STA module's software or firmware to be updated remotely.

[0070] Function: Software version can be updated without on-site operation, improving maintenance efficiency.

[0071] (4) Phase recognition function:

[0072] Meaning: The STA module can identify the phase information of the circuit where the energy measurement is located.

[0073] Purpose: Helps with grid management and troubleshooting, especially in three-phase systems.

[0074] (5) Indicator light function:

[0075] Meaning: The indicator light on the STA module is used to display the working status of the device.

[0076] Function: It is convenient for operation and maintenance personnel to quickly understand the working status of the equipment.

[0077] (6) Meter reading function:

[0078] Meaning: The STA module can automatically collect data from the energy meter.

[0079] Function: Realize automatic meter reading and improve meter reading efficiency.

[0080] (7) Active event reporting function:

[0081] Meaning: The STA module can actively report specific events when it detects them.

[0082] Function: Notify operation and maintenance personnel of abnormal situations in a timely manner to improve response speed.

[0083] (8) Communication process function:

[0084] Meaning: Defines the communication process between the STA module and other devices.

[0085] Function: Ensure smooth data transmission.

[0086] (9) Data transmission function:

[0087] Meaning: The STA module is able to send the collected data to the specified receiving device.

[0088] Function: To achieve effective data transmission.

[0089] (10) Power outage and power restoration event reporting function:

[0090] Meaning: The STA module is able to report power outage or power restoration events when they are detected.

[0091] Function: Helps grid operators to understand grid status in a timely manner.

[0092] (11) Version information setting and query function:

[0093] Meaning: Allows to set and query the software version information of the STA module.

[0094] Function: Facilitates the management of software versions and ensures that all modules are up to date.

[0095] (12) Setting and querying module identification:

[0096] Meaning: Allows setting and querying the unique identifier of the STA module.

[0097] Function: Ensure that each STA module can be uniquely identified.

[0098] (13) Local code setting and query function:

[0099] Meaning: Allows setting and querying of the local code of the STA module. The local code may be used to distinguish different geographical areas or networks.

[0100] Function: To facilitate the management and differentiation of STA modules in different regions.

[0101] (14) Baud rate negotiation function:

[0102] Meaning: The STA module can negotiate with the communication partner to determine the best communication rate.

[0103] Function: Ensure the efficiency and compatibility of communication.

[0104] For another example, when the communication unit 210 under test is the communication unit of the central concentrator 201, corresponding test cases can be written according to the functions that can be realized by the communication unit of the central concentrator 201, so as to facilitate testing the functions of the communication unit of the central concentrator 201 separately, realize complete testing of each function of the communication unit of the central concentrator 201, and improve the test effect.

[0105] Optionally, the communication unit of the central concentrator 201 may implement at least one of the following functions:

[0106] Module networking function, full network upgrade function, remote upgrade function, indicator light function, meter reading function, 1376.2 protocol (Power Line Communication Protocol) function, 1376.2 extended protocol function, phase identification function, power outage and restoration event reporting function, version information setting and query function, module identification setting and query function, and local code setting and query function.

[0107] The following is an introduction to the various functions of the communication unit of the central concentrator 201:

[0108] (1) Module networking function:

[0109] Meaning: CCO can automatically establish and maintain a network so that STA modules can join this network.

[0110] Function: Ensure that the STA module can effectively communicate with the CCO and achieve efficient data transmission.

[0111] (2) Network-wide upgrade function:

[0112] Meaning: Allows software updates for all STA modules via the network.

[0113] Function: The firmware of all STA modules can be upgraded remotely to simplify the maintenance process.

[0114] (3) Remote upgrade function:

[0115] Meaning: Allows the STA module's software or firmware to be updated remotely.

[0116] Function: Software version can be updated without on-site operation, improving maintenance efficiency.

[0117] (4) Indicator light function:

[0118] Meaning: The indicator light on the CCO is used to display the working status of the device.

[0119] Function: It is convenient for operation and maintenance personnel to quickly understand the working status of the equipment.

[0120] (5) Meter reading function:

[0121] Meaning: CCO can collect and summarize the energy meter data reported by the STA module.

[0122] Function: Realize automatic meter reading and improve meter reading efficiency.

[0123] (6)1376.2 protocol functions:

[0124] Meaning: CCO supports DL / T 1376.2 protocol, which is a power line carrier communication protocol used to achieve data transmission.

[0125] Function: Ensure that data transmission between the STA module and CCO follows a unified standard.

[0126] (7)1376.2 Extended protocol functions:

[0127] Meaning: In addition to the basic 1376.2 protocol, CCO also supports the extended functions of the protocol, providing more features and functions.

[0128] Function: Enhance communication and data processing capabilities.

[0129] (8) Phase recognition function:

[0130] Meaning: CCO can identify the phase information of the circuit where the energy measurement is located.

[0131] Purpose: Helps with grid management and troubleshooting, especially in three-phase systems.

[0132] (9) Power outage and power restoration event reporting function:

[0133] Meaning: CCO is able to report power outage or power restoration events when they are detected.

[0134] Function: Helps grid operators to understand grid status in a timely manner.

[0135] (10) Version information setting and query function:

[0136] Meaning: Allows setting and querying of CCO software version information.

[0137] Function: Facilitates the management of software versions and ensures that all modules are up to date.

[0138] (11) Setting and querying module identification:

[0139] Meaning: Allows setting and querying the unique identifier of the CCO module.

[0140] Function: Ensure that each CCO module can be uniquely identified.

[0141] (12) Local code setting and query function:

[0142] Meaning: Allows setting and querying the CCO local code, which may be used to distinguish different geographical areas or networks.

[0143] Function: To facilitate the management and differentiation of CCO modules in different regions.

[0144] The test device 20 is connected to the host computer 10 in communication. The host computer 10 can issue test instructions to the test device 20 by running test cases. The test device 20 is a hardware device for specific test control. The test device 20 is respectively connected to the communication unit under test, the listening device 30 and the accompanying test device 40 to realize the control and communication of the communication unit under test, the listening device 30 and the accompanying test device 40. The test device 20 can obtain communication data directly with the communication unit under test and the accompanying test device 40.

[0145] The monitoring device 30 is used to monitor the communication data between the communication unit under test 210 and the accompanying device under test 40 .

[0146] It can be understood that the various functions of the communication unit under test 210 generally cannot be implemented independently and can only be used in the constructed power system environment. Therefore, after the power system environment is constructed, the functions of the communication unit under test 210 can be guaranteed to be realized by controlling the communication unit under test 210 and the accompanying test device 40 to perform corresponding test operations, thereby realizing the functional test of the communication unit under test 210.

[0147] The accompanying test device 40 may be one of the communication units of the central concentrator 201 and the electric energy meter 202 , and the accompanying test device 40 may be the other of the communication unit of the central concentrator 201 and the communication unit of the electric energy meter 202 .

[0148] The testing device 20 obtains the communication data with the communication unit under test 210 and the accompanying test device 40, and the communication data between the communication unit under test 210 and the accompanying test device 40 intercepted by the listening device 30, as test data, and uploads the test data to the host computer 10, so that the host computer 10 can quickly evaluate the test results according to the test data, thereby realizing automated testing.

[0149] It should be noted that Figure 1 The number of central concentrators 201 and electric energy meters 202 is only used as an example, and the number of central concentrators 201 and electric energy meters 202 can also be more or less, which is not limited here. The central concentrator 201 and the electric energy meter can be directly or indirectly connected through wired (such as power lines) or wireless communication, which is not limited in this application.

[0150] Based on the introduction of the above-mentioned related scenarios, the embodiment of the present application provides a test method for a communication unit of an electric power system. The test method is described in detail below:

[0151] See also Figure 3 A testing method provided in an embodiment of the present application is implemented by steps 011 to 013, which are described in detail below.

[0152] Step 011: Generate a simulated concentrator and a simulated electric energy meter to construct a simulated power consumption system. The simulated power consumption system includes a simulated concentrator, a simulated electric energy meter, an actual concentrator, and a communication unit of the actual electric energy meter. The simulated concentrator communicates with the communication unit of the actual concentrator, and the simulated electric energy meter is used to generate simulated power consumption data and communicate with the communication unit of the actual electric energy meter.

[0153] The simulated concentrator is a software object that runs in the test software of the host computer and realizes the communication and control of the actual concentrator (i.e., the CCO in the application scenario). The simulated energy meter is a software object that runs in the test software of the host computer and realizes the communication and control of the actual energy meter (i.e., the STA in the application scenario).

[0154] Specifically, see Figure 4 In actual test scenarios, since the actual electric energy meter is generally disconnected from the power grid and the power consumption data collected by the actual electric energy meter is uncontrollable, the power consumption data generated by the actual electric energy meter is generally not used. Therefore, the present application generates a simulated electric energy meter to generate controllable simulated power consumption data, thereby facilitating the testing of the simulated power consumption system. The communication units of the simulated electric energy meter and the actual electric energy meter are used to form a testable electric energy meter that is the same as the actual electric energy meter. The communication units of the simulated electric energy meter and the actual electric energy meter can communicate through the serial port, specifically, the communication units of the test device and the actual electric energy meter communicate through the serial port.

[0155] By controlling the simulated electric energy meter and communicating between the simulated electric energy meter and the actual electric energy meter, it is possible to control the communication unit of the actual electric energy meter and collect communication data, thereby facilitating functional testing.

[0156] By generating a simulated concentrator and establishing a connection between the simulated concentrator and the actual concentrator (which can be serial communication, specifically serial communication between the test device and the actual concentrator), the control of the CCO and the collection of communication data can be achieved through the control of the simulated concentrator and the communication between the simulated concentrator and the actual concentrator, thereby facilitating functional testing.

[0157] In this way, a complete simulated power system environment can be constructed to meet the functional test requirements of any communication unit of the simulated power system (such as the communication unit of the CCO or the STA) without switching the hardware environment, thereby improving the test efficiency.

[0158] Step 012: Run the test case corresponding to the function to be tested to obtain the message of the simulated power consumption system.

[0159] Among them, test cases are a very important component of software testing. It is a set of specific inputs, execution conditions, and expected results, which are used to verify whether a specific function or behavior works as expected.

[0160] In the field of communication and networking, a message refers to a unit of data transmitted on a network. A message can contain different types of information, such as text, images, audio, or control instructions.

[0161] Optionally, the function to be tested is at least one of the preset functions of the communication unit, and each preset function is configured with a corresponding test case. In this way, one or more preset functions of the communication unit that need to be tested can be tested.

[0162] Specifically, after the simulated power consumption system is constructed, the test of the communication unit can be started. The test software has preset test cases for different functions of the communication unit, and different functions of the communication unit can be tested through different test cases.

[0163] Based on the function to be tested currently being tested, the test case corresponding to the function to be tested is run, such as by establishing a separate thread to run the test case. Then, by implementing the factory pattern, the corresponding test case is obtained by the name of the current test case, and the test case is started to be executed.

[0164] After the test case is run, the control of the communication unit under test, accompanying test device and other devices in the simulated power system can be realized, so that the simulated power system can realize the corresponding function to be tested. By realizing the corresponding function to be tested by the simulated power system and collecting various communication messages in the process of the simulated power system realizing the corresponding function to be tested, the test data in the process of realizing the function to be tested can be obtained.

[0165] It can be understood that the test data during the implementation process of the function to be tested can represent the implementation status of the function to be tested, thereby realizing the test evaluation of the function to be tested.

[0166] See also Figure 5 Optionally, the message of the simulated power consumption system includes a first message, a second message and a third message, and step 012 includes:

[0167] Step 0121: obtaining, through the simulated concentrator, a first message between the simulated concentrator and the actual concentrator;

[0168] Step 0122: obtaining, through the simulated electric energy meter, a second message between the communication units of the simulated electric energy meter and the actual electric energy meter;

[0169] Step 0123: Listen to the third message of the power line between the actual concentrator and the communication unit of the actual electric energy meter.

[0170] Specifically, in the simulated power consumption system, the objects for communication mainly include the simulated concentrator, the actual concentrator, the simulated electric energy meter and the communication unit of the actual electric energy meter.

[0171] The communication path includes a communication path between the simulation concentrator and the actual concentrator, a communication path between the simulation electric energy meter and the communication unit of the actual electric energy meter, and a communication path between the actual concentrator and the communication unit of the actual electric energy meter.

[0172] Therefore, the messages of the simulated power consumption system can be divided into three types, namely the first message, the second message and the third message. The first message, the second message and the third message correspond to the communication path between the simulated concentrator and the actual concentrator, the communication path between the simulated electric energy meter and the communication unit of the actual electric energy meter, and the communication path between the actual concentrator and the communication unit of the actual electric energy meter.

[0173] The first message can be obtained through the simulated concentrator, the second message can be obtained through the simulated electric energy meter, and the third message can be obtained through the listening device. The simulated concentrator communicates with the actual concentrator through the test device, and the simulated electric energy meter communicates with the communication unit of the actual electric energy meter through the test device.

[0174] Therefore, when the test device obtains the first message, it will upload it to the simulation concentrator in the host computer, so that the simulation concentrator obtains the first message; when the test device obtains the second message, it will upload it to the simulation electric energy meter in the host computer, so that the simulation electric energy meter obtains the second message.

[0175] The listening device can intercept the third message, and the listening device is connected to the testing device, so as to send the intercepted third message to the testing device. After the testing device obtains the third message, it will also upload it to the host computer, so that the host computer can obtain each communication message in the simulated power consumption system, and realize the acquisition of test data of the whole process of realizing the function to be tested of the simulated power consumption system.

[0176] See also Figure 6 Optionally, the message of the simulated power consumption system includes a first message, a second message and a third message, and step 012 further includes:

[0177] Step 0124: parsing the first message based on the first communication class corresponding to the communication protocol between the simulated concentrator and the actual concentrator;

[0178] Step 0125: parsing the second message based on the second communication type corresponding to the communication protocol between the simulated electric energy meter and the actual electric energy meter;

[0179] Step 0126: Parse the third message based on the third communication class corresponding to the communication protocol between the actual concentrator and the actual electric energy meter.

[0180] Specifically, since the communication protocol between the simulated concentrator and the actual concentrator, the communication protocol between the simulated electric energy meter and the communication unit of the actual electric energy meter, and the communication protocol between the communication unit of the actual electric energy meter and the actual concentrator may be different, in order to process messages of different communication protocols so that the host computer can accurately parse the specific content of each message, corresponding communication protocol classes are set in the host computer for different communication protocols to implement the parsing of the corresponding communication protocols.

[0181] The communication protocol classes set by the host computer include a first communication class (ie, a simulation concentrator class), a second communication class (ie, a simulation electric energy meter class), and a third communication class (ie, a listening device class).

[0182] Among them, the analog concentrator class enables the analog concentrator to process and parse the received first message, the analog electric energy meter class enables the analog electric energy meter to process and parse the received second message, and the listening device class is used to process and parse the third message intercepted by the listening device.

[0183] Optionally, in order to realize communication with the test device, the host computer is further provided with a test communication class, and the test communication class is used to send, receive, and process messages between the test device to realize the sending and receiving of messages and the control of the test device.

[0184] For example, the host computer and the test device communicate through the network port. The test device encapsulates the messages of 1376.2, DLT646, DLT698, 1376.1 and 11612.1 protocols based on the test communication class and sends them to the host computer. After the host computer restores the message, it parses, identifies and filters the correct message and sends it to the corresponding communication class for processing. Based on these classes, the test case processes the message of the corresponding protocol to determine whether the required message is received and the correctness of the message.

[0185] In an example, the analog concentrator class is used to communicate with the CCO, and the communication protocol is 1376.2 (1376.2 concentrator local communication module interface communication protocol). It implements the organization and parsing of 1376.2 protocol messages, sends correct messages to the CCO, and waits for and receives 1376.2 protocol messages sent by the CCO for parsing and judgment.

[0186] The analog energy meter class is used to communicate with STA. The communication protocol is DLT646 (DL_T_645_2007_Multi-function Energy Meter Communication Protocol) and DLT698 (DLT698.45 Electric Energy Information Collection and Management System-Object-oriented Data Exchange Protocol). It implements the organization and parsing of DLT646 and DLT698 protocol messages, sends correct messages to STA, and waits for and receives DLT646 and DLT698 protocol messages sent by STA for parsing and judgment.

[0187] The listening device class is used to obtain power line messages, and the communication protocol is 11612.1 protocol (Low Voltage Power Line Broadband Carrier Communication Interoperability Technical Specification). It realizes receiving power line messages from the listening unit, parsing and judging.

[0188] The test communication class is used to communicate with the baseboard, and the communication protocol is the 1376.1 protocol (QGDW 10376.1—2019 Electricity Consumption Information Collection System Communication Protocol) extended protocol. The baseboard is configured (module power on and off, serial port baud rate switching, GPIO (General-Purpose Input / Output) level control, etc.) by sending 1376.1 protocol messages to the baseboard.

[0189] Step 013: Based on the message, determine the test result of the function to be tested.

[0190] Specifically, after collecting various communication messages in the process of simulating the power consumption system to realize the corresponding function to be tested, a test evaluation can be performed based on the messages to determine the test result of the function to be tested, such as test pass or test fail.

[0191] For example, for the meter reading function test of STA, by judging whether the simulated power consumption data generated by the simulated power meter is consistent with the meter reading power data obtained by the actual concentrator after reading the STA meter, it can be determined whether the meter reading function test of STA is normally implemented, thereby determining the test result. If the simulated power consumption data and the meter reading power data are consistent, it is determined that the test has passed; if the simulated power consumption data and the meter reading power data are inconsistent, it is determined that the test has failed, thereby realizing the test of the meter reading function of STA.

[0192] See also Figure 7 Optionally, step 013 includes:

[0193] Step 0131: Determine each preset test condition satisfied by the message;

[0194] Step 0132: Determine the test result of the function to be tested based on the preset test conditions that have been met.

[0195] Specifically, after the host computer receives the message (such as the first message, the second message and the third message) of the simulated power system during the running of the test case, the message of the simulated power system can be tested and evaluated to obtain the test results.

[0196] The specific process of test evaluation is as follows:

[0197] First, each function to be tested is set with one or more corresponding preset test conditions. The message of the simulated power system can be used to determine whether the function to be tested meets each preset test condition. Based on the preset test conditions met by the message of the simulated power system, the test evaluation of the function to be tested can be realized and the test result can be obtained.

[0198] Optionally, when all preset test conditions are met, the test result of the function to be tested is determined to be a test pass; when any preset test condition is not met, the test result of the function to be tested is determined to be a test fail.

[0199] In other words, the test is considered passed only when all preset test conditions are met. Only then can the next function to be tested be tested. If any preset test condition is not met, the function to be tested is considered to have failed. In this way, by setting higher test requirements, the stability of the functions to be tested that have passed the test is guaranteed.

[0200] Optionally, the preset test condition includes at least one of the following:

[0201] Whether the message corresponding to the function to be tested is received. For example, in the communication process function test at power-on, determine whether the response message is received.

[0202] Whether the message corresponding to the function to be tested is received within the specified time. For example, in the communication process function test of STA, when STA is not communicating with the simulated power meter, it will read the communication address of the power meter every preset period (such as 5 minutes) to maintain the heartbeat, and judge whether the message corresponding to the function to be tested is received within the specified time by judging whether the request message to read the communication address of the power meter is received every 5 minutes.

[0203] Whether the number of received messages corresponding to the function to be tested is greater than a preset ratio. For example, whether the meter reading rate of the CCO for STAs within a preset time period reaches 98%.

[0204] Whether the received message corresponding to the function to be tested complies with the corresponding communication protocol standard. For example, when performing a 1376.2 protocol test, determine whether the received message meets the requirements of the 1376.2 protocol.

[0205] Whether the received message corresponding to the function to be tested is consistent with the configuration parameters of the test case. For example, in the version information setting and query function test, whether the version information set in the test case is consistent with the version information in the message containing the actual queried version information.

[0206] Whether the received message corresponding to the function to be tested is consistent with the simulated power consumption data. For example, in the meter reading function test, whether the power data reported by STA and CCO is consistent with the simulated power consumption data generated by the simulated power meter.

[0207] Whether the functions of the test case are executed normally. For example, in the upgrade function test, after the test is completed, whether the version of CCO or STA is consistent with the version of the upgrade file issued by the test case.

[0208] Optionally, after the test results are determined, information may be displayed based on the test results.

[0209] For example, when testing the meter reading function, if the test result is passed, the host computer can display information through a display screen or speaker or other prompting devices, so that the test personnel can quickly understand the test result of the meter reading function, and then test the next function to be tested when the test passes, so as to improve the test efficiency. If the test fails, the test result is recorded to facilitate the subsequent debugging of the communication unit for the function that failed the test.

[0210] Optionally, the test result display scheme includes at least one of the following:

[0211] (1) In the test interface, the selected test items (i.e., the functions to be tested) are displayed in a table format, showing the test item name, test item duration, test item results, test item result description and other information, which will be updated in real time during the test.

[0212] (2) During the test, the interface will display information such as the number of tests completed and the number of tests passed.

[0213] (3) Record relevant test data, test results, etc. through test logs.

[0214] (4) Test data and results will be saved in the database.

[0215] (5) The test report interface can query historical test records, preview or print test reports.

[0216] Optionally, the test software can manage the test results, the specific process is as follows:

[0217] (1) Log management: The software log contains necessary process information and all communication messages, which are displayed on the graphical interface and saved in the local log file.

[0218] (2) Data management: The software stores test data and test results in the sqlite database. Data management enables the addition, deletion, modification and query of the database.

[0219] (3) Report management: realize the query of test records, preview and print functions of test reports.

[0220] The test method of the communication unit of the present application generates a simulated concentrator and a simulated electric energy meter, which together with the communication unit of the actual concentrator and the actual electric energy meter constitute a complete simulated power consumption system, wherein the simulated electric energy meter generates simulated power consumption data, and the communication unit of the simulated electric energy meter and the actual electric energy meter together constitute a complete electric energy meter. After completing the construction of the simulated power consumption system, the test case corresponding to the function to be tested that needs to be tested can be run, and the message in the simulated power consumption system during the running of the test case can be obtained. The test result of the function to be tested can be quickly determined by the message of the simulated power consumption system, and the automated test of the function to be tested can be realized. Moreover, since a complete simulated power consumption system is constructed, when testing different functions to be tested, it is only necessary to replace the corresponding test case without switching the accompanying test device (i.e., the device that is essential for the communication unit to be tested to realize the function). Compared with the low test efficiency of switching the corresponding accompanying test device when testing different functions, the test efficiency is significantly improved.

[0221] See also Figure 8 In some embodiments, the testing method of the present application further includes:

[0222] Step 014: Display the use case configuration interface;

[0223] Step 015: Obtain at least one of the selection operation received by the use case selection module and the editing operation received by the use case editing module of the use case configuration interface to generate a test case corresponding to the function to be tested.

[0224] Specifically, when testing the function to be tested, the tester can configure the corresponding test case through the host computer.

[0225] During the configuration process, the monitor of the host computer will realize the software interface. The tester can enter the use case configuration interface by controlling the host computer. At this time, the monitor shows the use case configuration interface.

[0226] The use case configuration interface includes a use case selection module and a use case editing module.

[0227] The use case selection module can be a drop-down box. The tester clicks the drop-down box to display the various test cases preset in the test software. The tester can select the test case corresponding to the function to be tested, thereby selecting the test case corresponding to the function to be tested through the selection operation.

[0228] The case editing module can configure the parameters of the selected test case. For example, different customers have different customer version information, and different power grid companies support different extension protocols of power line carrier communication protocols (such as 1376.2 protocol). Targeted configuration is required to achieve targeted testing of different customer versions and power grid companies, thereby ensuring the test effect.

[0229] Optionally, after configuring parameters for different customer versions, different power grid companies, etc., the configured test cases can be saved and saved in the use case selection module, so that when the use cases are subsequently configured for specific customer versions, specific power grid companies, etc., the test cases saved in the use case selection module can be reused, thereby improving the efficiency of the use case configuration, which is conducive to improving the testing efficiency.

[0230] Optionally, the same function of the communication unit may correspond to multiple test cases, and the multiple test cases are set for different customer versions and different power grid companies, thereby reducing the frequency of parameter configuration by testers (i.e., in most cases, only test case selection is required without parameter configuration), further improving test efficiency.

[0231] After the use case selection and parameter configuration are completed, the test case corresponding to the function to be tested can be generated, and the function to be tested can be tested by running the test case.

[0232] Optionally, the test case is serialized to generate and store an XML (eXtensible Markup Language) file corresponding to the test case.

[0233] XML is a standard file format for marking data, designed to transmit and store data. XML is designed for cross-platform and cross-application data exchange, and is widely used in Web services, configuration files, data exchange protocols, and other fields.

[0234] XML serialization and deserialization of test cases refers to the process of converting test case objects into XML formatted text and restoring XML formatted text into test case objects, so as to save the status of test cases, transfer test case information, or exchange data between different systems.

[0235] XML serialization refers to converting an object into a string in XML format, which makes it easy to store or transmit data. XML deserialization refers to converting a string in XML format back into an object.

[0236] In order to facilitate an overall understanding of the present application, specific examples are provided below for illustration.

[0237] In an example, the test system tests the meter reading function of the communication unit of the actual electric energy meter. Fig. 9 , the test process is as follows:

[0238] (1) Initialization steps: simulate the concentrator and simulate the electric energy meter (corresponding to Fig. 9 Virtual electric energy meter in the real concentrator, the communication unit of the real electric energy meter, the test device, the listening device (corresponding to Fig. 9 The listening unit in the device is initialized to configure the communication address, frequency band, etc., and restore the parameters of each device to the initial state.

[0239] (2) Test steps: The test device will send control instructions to the actual concentrator to control the actual concentrator to send meter reading messages to the communication unit of the actual electric energy meter. At this time, the listening device can obtain the communication data between the actual concentrator and the actual electric energy meter by listening to the data of the power line between the actual concentrator and the actual electric energy meter as test data; then, the communication unit of the actual electric energy meter collects simulated power consumption data from the test device (serial port communication data capture), and gives the collected simulated power consumption data to the actual concentrator to complete the meter reading of the simulated power consumption data.

[0240] The communication data between the test device and the actual electric energy meter, and the communication data between the test device and the actual concentrator can be directly obtained by the test device. The communication data between the actual concentrator and the actual electric energy meter can be obtained by the monitoring device monitoring the data of the power line between the actual concentrator and the actual electric energy meter, thereby obtaining the test data in the entire test process (i.e., the communication data between the test device and the actual electric energy meter, the communication data between the test device and the actual concentrator, and the communication data between the actual concentrator and the actual electric energy meter).

[0241] The test device uploads the test data to the host computer, and the host computer evaluates the test data to determine the test results. For example, for the meter reading test, if the power consumption data collected by the actual energy meter and the power consumption data obtained by the actual concentrator meter reading are consistent with the simulated power consumption data generated by the test device, it can be determined that the meter reading function is normal and the meter reading function test has passed. If the power consumption data collected by the actual energy meter or the power consumption data obtained by the actual concentrator meter reading are inconsistent with the simulated power consumption data generated by the test device, it can be determined that the meter reading function is abnormal and the meter reading function test has failed.

[0242] After the host computer determines the test results, it can record and display the test results, which is convenient for testers to view in time and maintain the device under test based on the test results.

[0243] In another example, the test system tests the communication process function of the communication unit of the actual electric energy meter. The description of the communication process function when powered on is as follows:

[0244] After the STA is powered on, it first detects the 645 protocol. After receiving a normal response, it stops detecting the DL / T 645 protocol and detects the DL / T 698 protocol at the same baud rate. If no DL / T 645 protocol response is received, it will actively detect the DL / T 698 protocol.

[0245] STA is not connected to the analog energy meter (corresponding to Fig.10 In the case of communication with the virtual electric energy meter in the example, the communication address of the analog electric energy meter is read at a preset period (such as 5 minutes) to maintain the heartbeat.

[0246] When STA detects the simulated energy meter, normal communication can be carried out and the test verification is carried out by meter reading.

[0247] Please combine Fig.10 , the test process is as follows:

[0248] After power-on, observe whether the detection message of DL / T 645 and DL / T 698 protocols is received through the simulated electric energy meter. If not, the test fails; if yes, no response is made, and wait for the next round of detection by STA to determine whether the detection cycle is consistent with the heartbeat cycle (parameters are configured by the test case editing module of the test case, usually 5 minutes). If not, the test fails. If consistent, respond to the detection message. After receiving the response, STA should no longer continue to detect and wait for two heartbeat cycles to observe whether STA continues to detect during this period. If there is detection, the test fails. If not, perform a round of meter reading and observe whether STA correctly sends the reading message (DL / T645 protocol) through the simulated electric energy meter. If no message is sent, the test fails. Otherwise, the test passes and the next functional test is performed.

[0249] In another example, the test system tests the setting and query module identification (Identity document, ID) function of the actual concentrator. The setting and query module ID function is used to determine whether the module ID information query and setting function of the communication unit of the actual concentrator is normal. Fig.11 , the test process is as follows:

[0250] (1) Initialization steps: simulate the concentrator and simulate the electric energy meter (corresponding to Fig.11 Virtual electric energy meter in the real concentrator, the communication unit of the real electric energy meter, the test device, the listening device (corresponding to Fig.11 The listening unit in the device is initialized to configure the communication address, frequency band, etc., and restore the parameters of each device to the initial state.

[0251] (2) Test steps: During the test, a module ID information query message is sent to the communication unit of the actual concentrator through the test device to observe whether the communication unit of the actual concentrator can normally reply to the query message. If so, the module ID information is saved for restoration of the module ID information after the test is completed; then, according to the ID information configured in the scheme, a module ID setting message is sent to the communication unit of the actual concentrator, and the communication unit of the actual concentrator is waited for to respond with a successful setting message. After the communication unit of the actual concentrator responds, the module ID is queried again.

[0252] The test device can obtain the queried module ID, and upload the queried module ID and the set module ID to the host computer. The host computer determines whether the queried ID information is consistent with the set ID information. If not, the test fails. The test device can control the communication unit of the actual concentrator to restart the module and query again, so as to test whether the module restart will cause the module ID to be lost. If lost, the test fails, otherwise the test passes, and the next test is performed after the module ID is restored.

[0253] According to the method described in the above embodiment, the present application embodiment also provides a testing device 300 for executing the steps in the above testing method. Fig.12 , Fig.12 It is a schematic diagram of the structure of the testing device 300 provided in an embodiment of the present application.

[0254] The testing device 300 comprises:

[0255] A generation module 301 is used to generate a simulated concentrator and a simulated electric energy meter to construct a simulated power consumption system, wherein the simulated power consumption system includes a simulated concentrator, a simulated electric energy meter, an actual concentrator, and a communication unit of the actual electric energy meter, wherein the simulated concentrator communicates with the communication unit of the actual concentrator, and the simulated electric energy meter is used to generate simulated power consumption data and communicate with the communication unit of the actual electric energy meter;

[0256] The running module 302 is used to run the test case corresponding to the function to be tested to obtain the message of the simulated power consumption system;

[0257] The determination module 303 is used to determine the test result of the function to be tested based on the message.

[0258] It should be noted that the specific details of each module unit in the above-mentioned testing device 300 have been described in detail in the embodiment of the above-mentioned testing method, and will not be repeated here.

[0259] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0260] In some embodiments, the testing device in the embodiments of the present application can be implemented in hardware, such as an electronic device, or a component in an electronic device, such as an integrated circuit or a chip; the testing device can also be implemented in software, such as as an application installed in an electronic device.

[0261] In some embodiments, see Fig.13 , Fig.13 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 400 includes a processor 401 and a memory 402. The memory 402 stores a computer program 403 that can be run on the processor 401. When the program 403 is executed by the processor 401, each process of the embodiment of the above-mentioned test method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0262] Optionally, the electronic device 400 may be a host computer in the above-mentioned test system.

[0263] See also Fig.14 , Fig.14 Schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. The electronic device can be a terminal or a server. Exemplarily, the electronic device 500 includes a central processing unit (CPU) 501, a system memory 504 including a random access memory (RAM) 502 and a read-only memory (ROM) 503, and a system bus 505 connecting the system memory 504 and the central processing unit 501.

[0264] In some embodiments, the electronic device 500 may also include a basic input / output system (Input / Output system) 506 for helping to transmit information between various components within the computer, and a large-capacity storage device 507 for storing an operating system 513, a client 514 and other program modules 515.

[0265] In some embodiments, the basic input / output system 506 includes a display 508 for displaying information and an input device 509 such as a touch panel and other input devices for user input information. A touch panel is also called a touch screen. The touch panel may include two parts: a touch test device and a touch controller. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0266] The display 508 and the input device 509 are both connected to the central processing unit 501 via an input / output controller 510 connected to the system bus 505. The basic input / output system 506 may also include an input / output controller 510 for receiving and processing inputs from a touch panel, other input devices, etc. Similarly, the input / output system 506 may also include output devices, such as a display screen, a printer, or other types of output devices.

[0267] The mass storage device 507 is connected to the central processing unit 501 through a mass storage controller (not shown) connected to the system bus 505. The mass storage device 507 and its associated computer-readable medium provide non-volatile storage for the electronic device 500. That is, the mass storage device 507 may include a computer-readable medium (not shown) such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.

[0268] Computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media are not limited to the above. The above-mentioned system memory 504 and mass storage device 507 can be collectively referred to as memory.

[0269] According to various embodiments of the present application, the electronic device 500 can also be connected to a remote computer on the network through a network such as the Internet. That is, the electronic device 500 can be connected to the network 517 through the network interface unit 516 connected to the system bus 505, or the network interface unit 516 can also be used to connect to other types of networks or remote computer systems (not shown).

[0270] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the embodiment of the above-mentioned test method are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0271] The processor may be a processor in the electronic device in the above embodiment. The computer readable storage medium may be a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0272] The embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned test method when executed by a processor. The processor may be a processor in the electronic device in the above-mentioned embodiment. When the computer program is executed by the processor, each process of the embodiment of the above-mentioned test method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0273] In the description of this specification, the description with reference to the terms "in some embodiments", "in an example", "exemplarily", etc. means that the specific features, structures, materials or characteristics described in conjunction with the implementation or example are included in at least one implementation or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same implementation or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more implementations or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0274] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0275] It is understandable that in the specific implementation of this application, data related to user identity or characteristics is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0276] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for testing a communication unit, characterized in that: include: Generate a simulated concentrator and a simulated electric energy meter to construct a simulated power consumption system, wherein the simulated power consumption system includes a simulated concentrator, a simulated electric energy meter, an actual concentrator, and a communication unit of the actual electric energy meter, wherein the simulated concentrator communicates with the communication unit of the actual concentrator, and the simulated electric energy meter is used to generate simulated power consumption data and communicate with the communication unit of the actual electric energy meter; Run the test case corresponding to the function to be tested to obtain the message of the simulated power consumption system; Based on the message, a test result of the function to be tested is determined.

2. The testing method according to claim 1, characterized in that: Also includes: Display the use case configuration interface; At least one of a selection operation received by a use case selection module and an editing operation received by a use case editing module of the use case configuration interface is obtained to generate a test case corresponding to the function to be tested.

3. The testing method according to claim 2, characterized in that: Also includes: The test case with parameter configuration is saved to the test case selection module.

4. The testing method according to any one of claims 1 to 3, characterized in that: Also includes: The test case is serialized to generate and store an extensible markup language file corresponding to the test case.

5. The testing method according to claim 1, characterized in that: The message of the simulated power system includes a first message, a second message and a third message, and the running of the test case corresponding to the function to be tested to obtain the message of the simulated power system includes: Acquire the first message between the simulated concentrator and the actual concentrator through the simulated concentrator; Acquiring, by means of the simulated electric energy meter, the second message between the communication units of the simulated electric energy meter and the actual electric energy meter; The third message of the power line between the actual concentrator and the communication unit of the actual electric energy meter is intercepted.

6. The testing method according to claim 5, characterized in that: The running of the test case corresponding to the function to be tested to obtain the message of the simulated power consumption system also includes: parsing the first message based on a first communication class corresponding to a communication protocol between the simulated concentrator and the actual concentrator; parsing the second message based on a second communication class corresponding to the communication protocol between the simulated electric energy meter and the actual electric energy meter; The third message is parsed based on a third communication class corresponding to the communication protocol between the actual concentrator and the actual electric energy meter.

7. The testing method according to claim 1, characterized in that: The step of determining the test result of the function to be tested based on the message includes: Determining each preset test condition satisfied by the message; Based on the preset test conditions that have been met, a test result of the function to be tested is determined.

8. The testing method according to claim 7, characterized in that: The step of determining the test result of the function to be tested based on the preset test condition being met includes: When all the preset test conditions are met, determining that the test result of the function to be tested is a test pass; When any of the preset test conditions is not met, it is determined that the test result of the function to be tested is a test failure.

9. The testing method according to claim 7, characterized in that: The preset test conditions include at least one of the following: Whether a message corresponding to the function to be tested is received; Whether the message corresponding to the function to be tested is received within the specified time; Whether the number of received messages corresponding to the function to be tested is greater than a preset ratio; Whether the received message corresponding to the function to be tested complies with the corresponding communication protocol standard; Whether the received message corresponding to the function to be tested is consistent with the configuration parameters of the test case; Whether the received message corresponding to the function to be tested is consistent with the simulated power consumption data; Whether the functions of the test case are executed normally.

10. The testing method according to claim 1, characterized in that: Also includes: Information is displayed based on the test results.

11. The testing method according to claim 1, characterized in that: The function to be tested includes at least one of the preset functions of the communication unit, and each of the preset functions is configured with a corresponding test case.

12. The testing method according to claim 1 or 11, characterized in that: The preset functions corresponding to the communication unit of the actual electric energy meter include at least one of the following functions: Module networking function, full network upgrade function, remote upgrade function, phase identification function, indicator light function, meter reading function, active event reporting function, communication process function, data transmission function, power outage and restoration event reporting function, version information setting and query function, module identification setting and query function, local code setting and query function, and baud rate negotiation function; The preset functions corresponding to the communication unit of the actual concentrator include at least one of the following functions: Module networking function, full network upgrade function, remote upgrade function, indicator light function, meter reading function, 1376.2 protocol function, 1376.2 extended protocol function, phase identification function, power outage and restoration event reporting function, version information setting and query function, module identification setting and query function, and local code setting and query function.

13. A testing device, characterized in that: include: A generation module, used to generate a simulated concentrator and a simulated electric energy meter to construct a simulated power consumption system, wherein the simulated power consumption system includes a simulated concentrator, a simulated electric energy meter, an actual concentrator, and a communication unit of the actual electric energy meter, wherein the simulated concentrator communicates with the communication unit of the actual concentrator, and the simulated electric energy meter is used to generate simulated power consumption data and communicate with the communication unit of the actual electric energy meter; A running module, used for running the test case corresponding to the function to be tested to obtain the message of the simulated power consumption system; A determination module is used to determine the test result of the function to be tested based on the message.

14. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the testing method according to any one of claims 1 to 12 is implemented.

15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the testing method according to any one of claims 1 to 12 is implemented.

16. A computer program product, characterized in that The invention comprises a computer program, which implements the testing method according to any one of claims 1 to 12 when being executed by a processor.