Distributed automatic test method and system for state grid ammeter
By utilizing a distributed automated testing system and connecting the testing cloud platform with the testing client network, automated functional testing of State Grid meters was achieved, solving the problems of long testing cycles, limited scope, and low efficiency, and improving testing efficiency and automation.
Patent Information
- Application Number
- CN202511703684.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-02-17
AI Technical Summary
The existing functional testing of State Grid meters suffers from problems such as long testing cycles due to reliance on manual operation, limited coverage, insufficient use of hardware resources, and low efficiency due to reliance on manual judgment of test results.
Design a distributed automatic testing system for State Grid electricity meters. The system connects to multiple test clients via a test cloud platform and uses encapsulated keywords to drive the automatic execution of test scripts, thereby achieving distributed automated functional testing.
It improved testing efficiency, shortened the testing cycle, expanded the testing scope, increased the degree of automation, and reduced labor costs.
Smart Images

Figure CN121541129A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electricity meter technology, specifically to a distributed automatic testing method and system for State Grid electricity meters. Background Technology
[0002] As the functions of State Grid electricity meters continue to upgrade, the number of test functions for current concentrators or meter equipment is gradually increasing. At the same time, because State Grid electricity meters do not support network communication and can only communicate via serial ports, there are still challenges in building a network communication system. Therefore, in functional testing scenarios for various electricity meters, the workload of manual testing is increasing, and the testing cycle is becoming longer.
[0003] Furthermore, existing automated testing platforms for hardware devices primarily rely on host computers, requiring testers to manually send command codes via host computer software to perform functional tests on the devices. This testing method has the following drawbacks:
[0004] 1. Due to the limitations of manual operation, the testing cycle is relatively long;
[0005] 2. The functional testing coverage is limited, and only the existing testing solutions on the host computer can be used;
[0006] 3. The test involves a large number of hardware devices, which lack unified management and result in insufficient utilization of hardware resources;
[0007] 4. Test results rely entirely on manual judgment, which is inefficient.
[0008] Therefore, there is an urgent need for a functional testing scheme for State Grid meters that can overcome the above-mentioned shortcomings. Summary of the Invention
[0009] The technical problem to be solved by this invention is to provide a distributed automatic testing method and system for State Grid electricity meters, which can reduce labor costs, shorten the testing cycle, and significantly improve the testing efficiency for State Grid electricity meters.
[0010] To solve the above-mentioned technical problems, the first technical solution adopted by the present invention is as follows:
[0011] A distributed automatic testing method for State Grid electricity meters includes: a test cloud platform and two or more test client networks; a test client network includes a test client, at least one programmable power supply, and two or more State Grid electricity meters; in a test client network, the test client is wirelessly connected to the test cloud platform, and the test client is also connected to the programmable power supply and the State Grid electricity meter respectively, with each State Grid electricity meter connected to one programmable power supply.
[0012] The test cloud platform pre-stores two or more test scripts, and each script is encapsulated to obtain encapsulation keywords that can drive the corresponding test scripts to execute automatically;
[0013] Create a test case through the test cloud platform; the creation of a test case includes:
[0014] A1. The test cloud platform extracts keywords based on the steps described by the user;
[0015] A2. The test cloud platform displays encapsulated keywords that match the extracted keywords;
[0016] A3. Based on the encapsulation keywords and operation objects selected by the user, as well as the test data input by the user, generate the corresponding test steps;
[0017] A4. Obtain test cases obtained by combining each test step in sequence;
[0018] Create a test task and select its corresponding test object, test cases, and test environment; the test environment includes a programmable power supply; the test object is the meter number of the State Grid electricity meter under test;
[0019] The test cloud platform distributes the test task to the corresponding test client based on the test environment selected in the test task;
[0020] The test client uses the corresponding test cases to test the corresponding test objects based on the received test tasks.
[0021] Optionally, it also includes:
[0022] After the test is completed, the test client obtains the corresponding test results and sends them to the test cloud platform; the test results include test results and log records; the test cloud platform generates a test report for the corresponding test task based on the test results; or
[0023] After the test is completed, the test client obtains the corresponding test results and generates a test report for the corresponding test task based on the test results.
[0024] Optionally, the operation targets include electricity meters using the State Grid 698 protocol and electricity meters using the State Grid 645 protocol.
[0025] Optionally, the creation of the test task includes:
[0026] Create a test project, and add the project name and authorized users.
[0027] Create a test task under the test project and add a test task name.
[0028] Optionally, it also includes:
[0029] The test cloud platform is developed based on the Python pytest framework, resulting in a keyword-driven framework.
[0030] The test cloud platform, based on the keyword-driven framework, encapsulates the keywords to obtain encapsulated keywords that can drive the corresponding test programs to execute automatically.
[0031] Optionally, testing the corresponding test object using the corresponding test cases includes:
[0032] The test client controls the power supply of the programmable power supply corresponding to the test environment in the test task based on the test cases in the test task.
[0033] The test client controls the test objects in the test task based on the test cases in the test task.
[0034] Another technical solution provided by this invention is:
[0035] A distributed automatic testing system for State Grid electricity meters includes: a test cloud platform and two or more test client networks; each test client network includes a test client, at least one programmable power supply and two or more State Grid electricity meters; in a test client network, the test client is wirelessly connected to the test cloud platform, and the test client is also connected to the programmable power supply and the State Grid electricity meters one by one, with each State Grid electricity meter connected to one programmable power supply.
[0036] The test cloud platform is configured to have the following functions:
[0037] There are two or more test programs pre-stored, and each is encapsulated to obtain encapsulation keywords that can drive the corresponding test programs to execute automatically;
[0038] Create a test case; creating a test case includes:
[0039] A1. The test cloud platform extracts keywords based on the steps described by the user;
[0040] A2. The test cloud platform displays encapsulated keywords that match the extracted keywords;
[0041] A3. Based on the encapsulation keywords and operation objects selected by the user, as well as the test data input by the user, generate the corresponding test steps;
[0042] A4. Obtain test cases obtained by combining each test step in sequence;
[0043] Create a test task and select its corresponding test object, test cases, and test environment; the test environment includes a programmable power supply; the test object is the meter number of the State Grid electricity meter under test;
[0044] Based on the test environment selected in the test task, the test task is sent to the corresponding test client;
[0045] The test client is configured to test the corresponding test object using the corresponding test cases based on the received test task.
[0046] Optionally, the test cloud platform is developed based on the Python pytest framework to obtain a keyword-driven framework;
[0047] The test cloud platform, based on the keyword-driven framework, encapsulates the configured keywords to obtain encapsulated keywords that can drive the corresponding test programs to execute automatically.
[0048] Optionally, the test cloud platform includes:
[0049] The backend management system is configured with a menu management module, a department management module, a user management module, a role management module, a dictionary data module, a message management module, an interface whitelist management module, and a device management module;
[0050] The front-end testing system includes a test project management module, a project environment configuration management module, a test case management module, a test execution module, a test result statistics module, and a test equipment management module.
[0051] The public service system is equipped with a log service module, a file service module, and a message queue service module.
[0052] The data storage management system is equipped with a test data module, a file data module, a device data module, a custom script data module, and a keyword data module, all with data storage capabilities.
[0053] And a test client management system, which connects to the test clients and is configured to manage the connected test clients and distribute test tasks.
[0054] Optionally, the test cloud platform further includes:
[0055] External interface systems are configured to connect to external platforms, including a requirements management platform, a defect management platform, and a code building platform, via external communication interfaces.
[0056] The beneficial effects of this invention are as follows: This invention specifically designs a distributed automatic testing system architecture consisting of a test cloud platform and multiple test client networks. The test cloud platform can wirelessly communicate with the test clients acting as host computers in the multiple test client networks. Each test client in the test client network directly communicates with multiple tested meters and programmable power supplies using the proprietary State Grid standard communication protocol. Based on the above distributed automatic testing system architecture, the test cloud platform can: pre-store encapsulation keywords that drive corresponding custom test scripts; efficiently and conveniently create custom test cases based on the encapsulation keywords; create test tasks with selected test environments, test objects, and test cases; and autonomously identify the destination of test tasks and distribute them to the test clients in the corresponding test client networks. The test clients will automatically execute functional tests on the tested State Grid meters. Thus, by managing and controlling multiple test clients through a single test cloud platform, and then having the test clients control meters and programmable power supplies with different State Grid protocols, distributed automated functional testing of State Grid meters is achieved, offering advantages such as high testing efficiency, short cycle time, wide testing scope, and high degree of automation. Attached Figure Description
[0057] Figure 1 This is a schematic diagram of the distributed automatic testing system architecture for State Grid electricity meters as described in this embodiment of the invention;
[0058] Figure 2 This is a timing diagram for distributed automatic testing in a specific embodiment of the present invention;
[0059] Figure 3 A business logic block diagram of a distributed automatic testing system for State Grid electricity meters, provided as another embodiment of the present invention;
[0060] Figure 4 This is a schematic diagram of the web-based display interface of the test cloud platform in a specific example of the present invention. Figure 1 ;
[0061] Figure 5 This is a schematic diagram of the web-based display interface of the test cloud platform in a specific example of the present invention. Figure 2 ;
[0062] Figure 6 This is a schematic diagram of the web-based display interface of the test cloud platform in a specific example of the present invention. Figure 3 ;
[0063] Figure 7 This is a schematic diagram of the web-based display interface of the test cloud platform in a specific example of the present invention. Figure 4 . Detailed Implementation
[0064] To explain in detail the technical principles, specific implementable solutions, possible application scenarios, and achievable objectives and effects of the present invention, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. It is understood that the embodiments described herein and the embodiments shown in the accompanying drawings are only used to more clearly illustrate the technical solutions of the present invention, and are therefore only examples intended to explain the present invention, and should not be construed as limiting the present invention. It should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0065] This invention utilizes a specially designed distributed automated testing system architecture, enabling the management of multiple testing clients through a single testing cloud platform. These clients then control meters and programmable power supplies using different State Grid protocols, thus achieving distributed automated functional testing of State Grid meters. This solves the problems of low efficiency, long testing cycles, and limited testing scope in existing State Grid meter testing due to their inability to communicate externally.
[0066] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0067] Figure 1 This is a schematic diagram of the distributed automatic testing system architecture for State Grid electricity meters as described in this embodiment of the invention.
[0068] Figure 2 This is a timing diagram for distributed automatic testing in a specific embodiment of the present invention.
[0069] This invention provides a distributed automatic testing method for State Grid electricity meters, based on... Figure 1 The distributed automated testing system architecture shown is implemented.
[0070] like Figure 1 As shown, the distributed automatic testing system architecture for State Grid meters includes a test cloud platform and two or more test client networks; each test client network includes a test client, at least one programmable power supply, and two or more State Grid meters; in one test client network, the test client is wirelessly connected to the test cloud platform, and the programmable power supply and State Grid meters are respectively connected to the test client via serial ports, with each State Grid meter connected to one programmable power supply.
[0071] In each test client network, the test client, acting as the host computer, can control the electricity meters and programmable power supplies of different State Grid protocols (State Grid 698 protocol and State Grid 645 protocol) in its network. Based on the test tasks issued by the test cloud platform, it can perform functional tests step by step on the selected test objects according to the test case requirements and obtain the test results.
[0072] Specifically, each test client network can contain multiple State Grid meters, and a single test cloud platform can manage multiple test clients. Therefore, the test cloud platform enables simultaneous functional testing and management of hundreds of State Grid meters under test.
[0073] Based on the above-described distributed automatic testing system architecture, the distributed automatic testing method for State Grid meters provided in this embodiment includes at least the following steps:
[0074] S1: The test cloud platform pre-stores two or more test scripts, and each script is encapsulated to obtain encapsulation keywords that can drive the corresponding test scripts to execute automatically.
[0075] Here, it is supported to pre-import user-defined test scripts and / or existing regular / common test scripts into the test cloud platform for storage and management. One test script corresponds to a control command for the electricity meter, such as calling a specific meter parameter. As a specific example, one pre-stored test script in the test cloud platform, after being executed by the host computer, can "read the electricity meter time"; another test script, after being executed by the host computer, can "control the programmable power supply to start according to specified power start parameters (such as voltage 220V, current 5A)".
[0076] The test cloud platform in this embodiment can encapsulate each test script into a corresponding keyword. This encapsulated keyword can then directly drive the automatic execution of the corresponding test script. For example, the test cloud platform encapsulates the key control instruction "read meter time" in a test script into an encapsulated keyword, such as "read meter time"; it also encapsulates a key control instruction in another test script into the encapsulated keyword "power control". Therefore, by calling the "encapsulated keyword" within the test cloud platform, the corresponding test script can be invoked and automatically executed.
[0077] It is important to note that existing conventional keyword-driven frameworks are primarily based on the Robot Framework. However, the Robot Framework lacks a web-based version, making it unsuitable for cloud platforms. This invention specifically redevelops and implements the underlying keyword-driven framework using Python's pytest framework. Then, it uses Django Framework + Vue 3.0 + MySQL for front-end and back-end integration, thereby enabling the implementation of a keyword-driven framework on a web platform. This allows for the encapsulation of keywords to automatically drive the corresponding test programs.
[0078] S2: Create a test case through the test cloud platform;
[0079] Users can write custom test cases in the test cloud platform to perform specified functional tests on meters with specified numbers.
[0080] Specifically, this step includes the following sub-steps:
[0081] A1. The test cloud platform extracts keywords based on the steps described by the user;
[0082] A2. The test cloud platform displays encapsulated keywords that match the extracted keywords;
[0083] Here, the step descriptions correspond to the control instructions that the user expects to execute. Specifically, the step descriptions can be in plain language or technical terminology. The test cloud platform will perform feature analysis on the step descriptions entered by the user, extract their keywords, and match them with stored "encapsulation keywords," providing the user with all matching "encapsulation keywords" to choose from.
[0084] As can be seen, the test cloud platform in this embodiment can provide accurate automatic proofreading, identification, and matching support during the user's test case writing process. This helps simplify the writing process and improve the efficiency of test case writing.
[0085] A3. Based on the user-selected encapsulation keywords and operation objects, as well as the user-input test data and expected results, generate the corresponding test steps;
[0086] The operation object refers to the object operated by the control command of this test step. For example, "power supply device serial port" or "698 protocol meter".
[0087] The test data corresponds to the specific data executed by the control command of this test step. For example, "input the specified power start parameters (e.g., voltage 220V, current 5A)" or "read the electricity data for a specific time period from the meter." It should be noted that the test script, called by encapsulated keywords, clearly defines "what to do"; while the test data clearly defines "how to do it."
[0088] The expected result refers to the ideal result to be obtained after the control command for this test step is executed. This parameter is optional; if configured, the comparison between the expected result and the actual result will be reflected in the test results for this test.
[0089] A4. Obtain the test cases obtained by combining each test step in sequence, and store the test cases in the test case library;
[0090] Specifically, users configure the generated test steps sequentially on the test cloud platform, and the tests will be automatically combined according to the configuration order to obtain a complete custom test case.
[0091] As can be seen, when users write the required automated test cases on the test cloud platform, they only need to enter the relevant step descriptions, select the target encapsulation keywords and operation objects, and enter the test data and expected results (optional) to automatically generate the corresponding test steps.
[0092] As a concrete example, write a test case for "reading the current time of the electricity meter", including the following steps:
[0093] 1. Go to Test Case Management and click "New";
[0094] 2. Enter the test case title, priority, project, and module;
[0095] 3. Add test step 1, adding the step description "Power on, set voltage 220V"; then, the test platform will automatically identify, analyze and match the added step description, and display the matching package keywords; the user selects the package keyword "power control", selects the operation object "power device serial port", and then enters the test data "power start parameters (voltage 220V, current 5A)"; thus completing the configuration of test step 1;
[0096] 4. Add test step 2, adding the step description "Read State Grid meter time"; then, the test platform displays the matching encapsulation keywords; the user selects the encapsulation keyword "698 protocol meter control", selects the operation object "698 protocol meter", enters the test data "Send meter communication command Read Time", and enters the expected result "2025-04-01 12:20:00"; complete the configuration of test step 2;
[0097] 5. Click "Submit", and the testing system will automatically generate a test case for "reading the current time of the electricity meter".
[0098] As shown above, users can easily and quickly write an automated test case by performing just a few simple operations on the testing cloud platform. This significantly simplifies the test case writing process and improves efficiency during testing.
[0099] S3: Create a test task and select its corresponding test object, test cases, and test environment; the test environment includes a programmable power supply; the test object is the meter number of the State Grid meter under test;
[0100] Here, the test object is the target test object for the entire test task, such as the electricity meter with the meter number "041011011".
[0101] The test environment configuration specifies which environment the currently created test task targets for automatic testing of the test object. In this embodiment, the test environment corresponds to a programmable power supply or a concentrator (the electricity meter can be connected to the test client via the concentrator). By identifying the "test environment" parameter in the test task, the test cloud platform can determine which test client network the test task should be distributed to for execution.
[0102] In a specific example, the test cloud platform provides the following options for the test environment: "Programmable power supply cabinet 1, programmable power supply cabinet 2... programmable power supply cabinet N, gateway 1, gateway 2... gateway N".
[0103] In some specific implementations, creating a test task includes the following sub-steps:
[0104] B1. Create a test project, add the project name and authorized users;
[0105] As a specific example, add a project named "698 Protocol Shandong State Grid Project", add a project member named "Zhang San", associate the project name with the personnel with project permissions, and assign "Zhang San" project permissions;
[0106] B2. Create a test task under the test project and add a test task name;
[0107] As a specific example, add a test task named "698 Protocol Shandong State Grid 0410 Version Test".
[0108] B3. Select the test object, test cases, and test environment corresponding to the test task;
[0109] As a specific example, select the target test case in the test case library, add the test object as the meter with the meter number "041011011", and select the corresponding test environment as "programmable power cabinet 1".
[0110] S4: The test cloud platform distributes the test task to the corresponding test client based on the test environment selected in the test task;
[0111] Here, combined with Figure 2 To understand this, after the user starts the test task in the test cloud platform, the test cloud platform begins to execute the test task. First, based on the selected test environment, the corresponding test client network is identified, and then the test task is sent to the test client in that test client network as the host computer.
[0112] S5: The test client uses the corresponding test cases to test the corresponding test objects based on the received test tasks.
[0113] Here, combined with Figure 2 Once the test client receives the test task, it will use the configured test cases to test the "test object" in the test environment, based on the test environment configured therein.
[0114] As a specific example, the test client will use the "test cases" configured in the test task to automatically perform the corresponding functional tests on the meter with meter number "041011011" in "programmable power cabinet 1".
[0115] In some specific implementations, combined with Figure 2 To understand this, the use of corresponding test cases to test the corresponding test object includes two aspects of control:
[0116] (1) Power Control: The test client controls the power supply corresponding to the "test environment" in the test task according to the test cases in the test task. For example, it controls the power supply to start with a voltage of 220V and a current of 5A. Through power control, power can be supplied to the test object, ensuring the smooth conduct of functional testing of the test object;
[0117] (2) Meter Control: The test client controls the test objects in the test task according to the test cases in the test task. For example, it reads the current time of the meter that uses the 698 protocol and has the meter number 041011011.
[0118] In some other specific embodiments, the distributed automated testing method further includes:
[0119] S6: After the test is completed, the test client obtains the corresponding test results and sends them to the test cloud platform; the test results include test results and log records; the test cloud platform generates a test report for the corresponding test task based on the test results; or
[0120] After the test is completed, the test client obtains the corresponding test results and generates a test report for the corresponding test task based on the test results.
[0121] Preferably, whether the test report is generated by the test client or the test cloud platform, it supports displaying the test report in a visual format.
[0122] In other words, the test report corresponding to the test task can be configured to be generated directly by the test client based on its measured test results; or it can be configured to have the test client return the test results to the test cloud platform in real time, and the test cloud platform will then generate the report. The specific configuration can be flexibly adjusted according to actual needs or resource requirements.
[0123] In some other specific embodiments, the distributed automated testing method further includes:
[0124] S7: View the status of each test client through the test cloud platform. The status includes the test task execution status (testing, standby, test completed) and the network connection architecture of each test client.
[0125] As described above, the distributed automatic testing method for State Grid meters provided in this embodiment, targeting meters using the State Grid 698 and State Grid 645 protocols, utilizes a specially configured test cloud platform. This platform enables efficient and convenient creation of custom test cases driven by keywords. It allows for the creation of test tasks with selected test environments, test objects, and test cases, and automatically identifies the destination of test tasks, distributing them to test clients within the corresponding test client network. Through this specially constructed distributed test client network, automated functional testing of the meters is achieved under the management and control of the test cloud platform. Therefore, this embodiment allows for the management and control of multiple test clients through a single test cloud platform, while a single test client can simultaneously control multiple meters and programmable power supplies using different protocols. This enables a distributed automatic testing solution that simultaneously manages hundreds of meters under test for automated functional testing via the test cloud platform, offering advantages such as high testing efficiency, short cycle time, wide testing scope, and high degree of automation.
[0126] Figure 3 This is a business logic block diagram of a distributed automatic testing system for State Grid electricity meters, provided as another embodiment of the present invention.
[0127] Another embodiment of the present invention, based on the previous embodiment, provides a distributed automatic testing system for State Grid electricity meters.
[0128] The distributed automatic testing system for State Grid meters in this embodiment has the following system architecture: Figure 1 As shown, it includes a test cloud platform and two or more test client networks; a test client network includes a test client, at least one programmable power supply, and two or more State Grid meters; in a test client network, the test client is wirelessly connected to the test cloud platform, and the test client is also connected to the programmable power supply and the State Grid meters one by one, with each State Grid meter connected to one programmable power supply.
[0129] In this embodiment, the test cloud platform is configured to have the following functions:
[0130] There are two or more test programs pre-stored, and each is encapsulated to obtain encapsulation keywords that can drive the corresponding test programs to execute automatically;
[0131] Create a test case; creating a test case includes:
[0132] A1. The test cloud platform extracts keywords based on the steps described by the user;
[0133] A2. The test cloud platform displays encapsulated keywords that match the extracted keywords;
[0134] A3. Based on the encapsulation keywords and operation objects selected by the user, as well as the test data input by the user, generate the corresponding test steps;
[0135] A4. Obtain test cases obtained by combining each test step in sequence;
[0136] Create a test task and select its corresponding test object, test cases, and test environment; the test environment includes a programmable power supply; the test object is the meter number of the State Grid electricity meter under test;
[0137] Based on the test environment selected in the test task, the test task is sent to the corresponding test client;
[0138] The test client is configured to test the corresponding test object using the corresponding test cases based on the received test task.
[0139] In some specific implementations, the test cloud platform is further configured as follows:
[0140] After receiving the test results sent by the test client, the test cloud platform generates a test report for the corresponding test task based on the test results.
[0141] In some specific implementations, when the test cloud platform implements the function of creating test tasks, it specifically includes:
[0142] Create a test project, and add the project name and authorized users.
[0143] Create a test task under the test project and add a test task name.
[0144] In some specific implementations, the test cloud platform develops a keyword-driven framework based on the Python pytest framework. Accordingly, the test cloud platform specifically implements the function of encapsulating keywords to drive the automatic execution of corresponding test programs based on the keyword-driven framework.
[0145] In some specific implementations, the test client is configured to perform the test task as follows:
[0146] The test client controls the power supply of the programmable power supply corresponding to the test environment in the test task based on the test cases in the test task.
[0147] The test client controls the test objects in the test task based on the test cases in the test task.
[0148] The business logic framework of the test cloud platform in this embodiment will be described in detail below through a specific implementation method.
[0149] like Figure 3 As shown, the test cloud platform includes:
[0150] (1) Backend management system, which is configured with menu management module, department management module, user management module, role management module, dictionary data module, message management module, interface whitelist management module and device management module, etc.;
[0151] Specifically, the menu management module is used to manage the display of all menus on the platform, including functions such as menu creation, menu hierarchy management, and menu interface binding;
[0152] The department management module is used to manage the departmental organizational structure of the entire platform;
[0153] The user management module is used for managing platform user accounts, including functions such as creating users, editing user information, deleting users, and freezing users;
[0154] The role management module is used to assign different roles to users, and each role has its own permissions.
[0155] The dictionary data module is used to manage various power-related technical terms, units, and other data used in the platform.
[0156] The message management module is used to manage various broadcast events of the platform server;
[0157] The API whitelist management module is used to manage the whitelist of all APIs on the platform to prevent external attacks.
[0158] The equipment management module is used to manage the test equipment (electricity meters), including the collection of equipment status information and the configuration of communication protocols for different devices.
[0159] (2) The front-end testing system is configured with a test project management module, a project environment configuration management module, a test case management module, a test execution module, a test result statistics module, and a test equipment management module, etc.
[0160] Specifically, the test project management module mainly includes creating / modifying / deleting test projects, as well as managing users associated with test projects;
[0161] The project environment configuration management module is used to manage the common environment configuration parameters used by the test project, such as database, FTP server, test account and other data.
[0162] The test case management module is used to write and maintain automated test cases, set test case status, etc.
[0163] The test execution module is used to combine keywords and test data to generate automated test case scripts and execute them, as well as debug test cases.
[0164] The test result statistics module is used to collect statistics on the results after test case execution and generate reports for project statistics.
[0165] The test equipment management module is used to assign test equipment to corresponding testers to avoid equipment conflicts during the execution of automated test cases.
[0166] (3) Public service system, which is equipped with log service module, file service module and message queue service module, etc.
[0167] Specifically, the log service module is used to record platform user operation logs, such as login and data creation.
[0168] The file service module is used to manage the service files that the platform depends on for operation.
[0169] The message queue service is used to process message queues sequentially when multiple users make concurrent requests.
[0170] (4) Data storage management system, which is equipped with a test data module, file data module, device data module, custom script data module and keyword data module, etc., which have data storage management functions;
[0171] (5) A test client management system, which is connected to the test client and configured to manage the multiple connected test clients and distribute test tasks;
[0172] (6) External interface systems are configured to connect to external systems, including requirement management platforms (such as ZenTao), defect management platforms (such as ZenTao and JIRA), and code building platforms (Jeckins and Git) through external communication interfaces.
[0173] Specifically, both ZenTao and Jenkins have external communication interfaces. The test cloud platform can synchronize test requirements and test case information with ZenTao through these interfaces configured by the external system, and build scheduled tasks through Jenkins.
[0174] As a concrete example, this can be seen in the web-based display interface of the test cloud platform, specifically through methods such as... Figures 4 to 7 The interface shown allows you to configure the relevant parameters required for the distributed automated testing method.
[0175] in, Figure 4 To configure the relevant parameters of the tested electricity meter on the test cloud platform; Figure 5 To configure the relevant parameters of the meter under test in the test cloud platform.
[0176] As described above, the distributed automatic testing system for State Grid meters provided in this embodiment is specifically designed for meters using the State Grid 698 and State Grid 645 protocols. It features a distributed automatic testing system architecture comprised of a test cloud platform and multiple test client networks. The test cloud platform can wirelessly communicate with the test clients acting as host computers in the multiple test client networks. Each test client in the network directly communicates with multiple meters and programmable power supplies under test using the proprietary State Grid standard communication protocol. Based on this distributed automatic testing system architecture, multiple test clients can be managed and controlled through a single test cloud platform. These test clients then control meters and programmable power supplies using different State Grid protocols, enabling distributed automated functional testing of State Grid meters. This system offers advantages such as high testing efficiency, short cycle time, wide testing range, and high degree of automation.
[0177] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0178] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0179] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
[0180] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0181] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0182] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0183] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0184] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A distributed automatic testing method for State Grid electric meters, characterized in that, The utility model relates to a test cloud platform and two or more test client networks. One test client network includes one test client, at least one programmable power supply, and two or more national grid meters. In one test client network, the test client is wirelessly connected to the test cloud platform, and the test client is also connected to each programmable power supply and national grid meter one by one. The test cloud platform pre-stores two or more test scripts and encapsulates them to obtain encapsulated keywords that can drive the corresponding test scripts to be automatically executed. The test cloud platform creates a test case. The creation of a test case includes: A1, the test cloud platform extracts the keywords according to the step description added by the user; A2, the test cloud platform displays the encapsulated keywords that match the extracted keywords; A3, the test cloud platform generates corresponding test steps according to the selected encapsulated keywords, selected operation objects, and input test data; A4, the test cloud platform obtains the test case obtained by sequentially combining the test steps; The test cloud platform creates a test task and selects the corresponding test object, test case, and test environment. The test environment includes a programmable power supply, and the test object is the meter number of the national grid meter to be tested. The test cloud platform sends the test task to the corresponding test client according to the selected test environment in the test task. The test client uses the corresponding test case to test the corresponding test object according to the received test task.
2. The distributed automatic testing method of the state grid electric meter according to claim 1, characterized in that, The test client obtains the corresponding test results after the test is completed and sends the test results to the test cloud platform. The test results include test results and log records. The test cloud platform generates a test report for the corresponding test task according to the test results. Alternatively The test client obtains the corresponding test results after the test is completed and generates a test report for the corresponding test task according to the test results. The operation objects include national grid 698 protocol meters and national grid 645 protocol meters.
3. The distributed automatic testing method of the state grid electric meter according to claim 1, wherein, The creation of a test task includes:
4. The distributed automatic testing method of the state grid electric meter according to claim 1, wherein, Creating a test project, adding a project name and project authority personnel; Creating a test task under the test project and adding a test task name. The test cloud platform is based on the pytest framework of python to develop a keyword-driven framework.
5. The distributed automatic testing method of the power grid meter of claim 1, wherein, The test cloud platform implements the encapsulated keywords that can drive the corresponding test scripts to be automatically executed based on the keyword-driven framework. The test client uses the corresponding test case to test the corresponding test object, including: The test client controls the programmable power supply corresponding to the test environment in the test task according to the test case in the test task.
6. The distributed automatic testing method of the state grid electric meter according to claim 1, wherein, The test client controls the test object in the test task according to the test case in the test task. The utility model relates to a test cloud platform and two or more test client networks. One test client network includes one test client, at least one programmable power supply, and two or more national grid meters.
7. A distributed automatic testing system of State Grid electric meter, characterized in that, In a test client network, the test client is wirelessly connected to the test cloud platform, and the test client is also connected to the program-controlled power supply and the State Grid electric meter one by one, and each State Grid electric meter is connected to a program-controlled power supply; The test cloud platform is configured to have the following functions: More than two test programs are pre-stored and encapsulated to obtain encapsulated keywords capable of driving automatic execution of the corresponding test programs; A test case is created; The creation of a test case includes: A1, the test cloud platform extracts the keywords according to the step description added by the user; A2, the test cloud platform displays the encapsulated keywords matched with the extracted keywords; A3, the corresponding test steps are generated according to the selected encapsulated keywords and the selected operation object, and the test data input by the user; A4, a test case is obtained by sequentially combining each test step; A test task is created, and the corresponding test object, test case and test environment are selected; the test environment includes a program-controlled power supply; and the test object is the meter number of the measured State Grid electric meter; According to the selected test environment in the test task, the test task is sent to the corresponding test client; The test client is configured to use the corresponding test case to test the corresponding test object according to the received test task.
8. The distributed automatic testing system of power grid meters of claim 7, wherein, The test cloud platform is developed based on the pytest framework of python to obtain a keyword-driven framework; The test cloud platform realizes the encapsulation of the configured encapsulated keywords capable of driving automatic execution of the corresponding test programs based on the keyword-driven framework.
9. The distributed automatic testing system of power grid meters of claim 7, wherein, The test cloud platform includes: A backend management system configured with a menu management module, a department management module, a user management module, a role management module, a dictionary data module, a message management module, an interface white list management module, and a device management module; A front-end test system configured with a test project management module, a project environment configuration management module, a test case management module, a test execution module, a test result statistics module, and a test device management module; A public service system configured with a log service module, a file service module, and a message queue service module; A data storage management system configured with a test data module, a file data module, a device data module, a custom script data module, and a keyword data module having data storage functions; And a test client management system connected with the test client and configured to manage the connected test client and distribute test tasks.
10. The distributed automatic testing system of power grid meters of claim 7, wherein, The test cloud platform further includes: An external interface system configured to externally communicate with a demand management platform, a defect management platform, and a code construction platform.