Resource occupancy testing method, device and computer equipment for electric energy meter operating system
Through the automated testing platform, the test application is loaded into the electric energy meter operating system, the operation under different working conditions is simulated, and system resource occupancy data is obtained. This solves the problem of low accuracy of resource occupancy testing in the existing technology and achieves high-accuracy resource utilization. Occupancy test.
Patent Information
- Application Number
- CN202110147372.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-03
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-02-03
AI Technical Summary
In the existing technology, the accuracy of the resource occupancy test results of the electric energy meter operating system is low, mainly due to personal experience limitations and test errors in the manual test method.
The automated test platform is used to send loading instructions and project test instructions, load the electric energy meter operating system through the test application, control the process to stop and simulate different working conditions, obtain system resource occupancy data, and generate resource occupancy test results.
It realizes automated testing of resource occupancy of the electric energy meter operating system, reduces test errors, and improves the accuracy of resource occupancy test results.
Smart Images

Figure CN112882878B
Abstract
Description
Technical Field
[0001] The present application relates to the field of electric power engineering technology, and in particular to a method, device and computer equipment for testing resource occupancy of an electric energy meter operating system. Background Art
[0002] With the development of power engineering technology and the gradual application of electricity meters or smart terminals in people's work and life, due to the different actual application scenarios, such as extremely harsh environments or concurrent environments, the performance requirements for the operating system carried by the electricity meter are increasing.
[0003] In addition to the correctness of basic functions, the energy meter operating system must also consider availability and reliability in different actual situations such as harsh conditions (or extreme conditions), critical conditions, and concurrent conditions. At the same time, it is also necessary to consider the compliance of various performance indicators such as the time performance (such as response time, switching time, etc.) and space resource occupancy of the operating system. Therefore, it is necessary to test the resource occupancy of the energy meter operating system to determine whether the unoccupied resources can guarantee the correctness of the basic functions of the energy meter and the compliance of other key performance indicators in the corresponding actual application scenarios. Among them, the resource occupancy test for the operating system refers to the test of the operating resource occupancy of the tested process group, including middle-layer services, business applications, etc.
[0004] Traditionally, the manual testing method using software simulation is often used to test system resource usage. However, due to the limited personal experience of the staff, or the differences in the manual testing methods and testing processes used by different people, testing errors are prone to occur, resulting in a relatively low accuracy rate of the resource usage test results of the electric energy meter operating system. Summary of the invention
[0005] Based on this, it is necessary to provide a resource occupancy test method, device and computer equipment for an electric energy meter operating system that can improve the resource occupancy test results of the electric energy meter operating system in response to the above technical problems.
[0006] A method for testing resource occupancy of an electric energy meter operating system, the method comprising:
[0007] Receiving a loading instruction sent by the automated test platform, and responding to the loading instruction to load the test application into the operating system of the electric energy meter to be tested;
[0008] When the loading is successful, a process stop instruction is triggered, and all processes of the operating system of the electric energy meter to be tested are controlled to stop according to the process stop instruction;
[0009] Receiving a project test instruction sent by the automated testing platform, responding to the project test instruction, and obtaining a target test item carried by the project test instruction;
[0010] Performing a working condition simulation operation according to the target test item, and obtaining system resource occupancy data after performing the working condition simulation operation;
[0011] Obtain a resource occupancy test result corresponding to the system resource occupancy data.
[0012] In one embodiment, the target test item includes a system startup test item; performing a working condition simulation operation according to the target test item and obtaining system resource occupancy data after performing the working condition simulation operation includes:
[0013] According to the system startup test item, control all processes corresponding to the middle layer service and basic application program of the operating system of the electric energy meter to be tested to start;
[0014] When all processes are confirmed to be started, triggering the system monitoring function of the test application;
[0015] Receiving a power-off instruction / power-on instruction sent by the automated test platform, and responding to the power-off instruction / power-on instruction to control the power-off / power-on of the operating system of the electric energy meter to be tested;
[0016] triggering a system resource occupancy statistics instruction according to the system monitoring function, and performing system resource statistics according to the system resource occupancy statistics instruction;
[0017] Obtaining system resource occupancy data obtained by performing system resource statistics, and uploading the system resource occupancy data to the automated testing platform for storage;
[0018] Return to the step of triggering the system monitoring function of the test application after determining that all processes are started, until the stored system resource usage data reaches a preset target number.
[0019] In one embodiment, the target test item includes a system upgrade test item; performing a working condition simulation operation according to the target test item and obtaining system resource occupancy data after performing the working condition simulation operation includes:
[0020] According to the system upgrade test items, all processes corresponding to the middle layer services and basic application programs of the operating system of the electric energy meter to be tested are controlled to start;
[0021] Receiving an upgrade data packet corresponding to the file to be upgraded sent by the automated testing platform;
[0022] triggering a system monitoring function of the test application;
[0023] Receiving an upgrade parameter setting instruction sent by the automated testing platform, and acquiring target parameters carried by the upgrade parameter setting instruction;
[0024] According to the upgrade parameter setting instruction, the target parameters of the operating system of the electric energy meter to be tested are upgraded;
[0025] triggering a system resource occupancy statistics instruction according to the system monitoring function, and performing system resource statistics according to the system resource occupancy statistics instruction;
[0026] Obtaining system resource occupancy data obtained by performing system resource statistics, and uploading the system resource occupancy data to the automated testing platform for storage;
[0027] Return to the step of receiving the upgrade data packet corresponding to the file to be upgraded sent by the automated testing platform until the stored system resource occupancy data reaches a preset target number.
[0028] In one embodiment, the target test project includes a middle-layer service loading test project; performing a working condition simulation operation according to the target test project and obtaining system resource occupancy data after performing the working condition simulation operation includes:
[0029] When it is detected that all processes of the operating system of the electric energy meter to be tested are stopped, triggering the system monitoring function of the test application program;
[0030] Triggering a middle layer service loading instruction, and loading each middle layer service according to the middle layer service loading instruction;
[0031] triggering a system resource occupancy statistics instruction according to the system monitoring function, and performing system resource statistics according to the system resource occupancy statistics instruction;
[0032] Obtaining system resource occupancy data obtained by performing system resource statistics, and uploading the system resource occupancy data to the automated testing platform for storage;
[0033] Triggering a service deactivation instruction, and controlling the deactivation of the loaded service according to the service deactivation instruction;
[0034] Return to the step of triggering the intermediate layer service loading instruction and loading each intermediate layer service according to the intermediate layer service loading instruction until the stored system resource occupancy data reaches a preset target number.
[0035] In one embodiment, the target test item includes a data concurrency test item; performing a working condition simulation operation according to the target test item and obtaining system resource occupancy data after performing the working condition simulation operation includes:
[0036] According to the data concurrent test items, control the electric energy meter data to be cleared, and set corresponding electric energy meter events and freezing parameters;
[0037] Triggering an electric meter event running instruction, and triggering a single electric meter event or a combination of multiple electric meter events to run according to the electric meter event running instruction;
[0038] When the single meter event or the combination of multiple meter events is running, controlling the electric energy meter to perform data cyclic reading;
[0039] When it is detected that the system resource statistics condition is met, a system resource occupancy statistics instruction is triggered, and system resource statistics are performed according to the system resource occupancy statistics instruction;
[0040] Obtaining system resource occupancy data obtained by performing system resource statistics, and uploading the system resource occupancy data to the automated testing platform for storage;
[0041] Return to the step of triggering the electric meter event execution instruction, and triggering a single electric meter event or a combination of multiple electric meter events to execute according to the electric meter event execution instruction, until the stored system resource occupancy data reaches a preset target quantity.
[0042] A method for testing resource occupancy of an electric energy meter operating system, the method comprising:
[0043] Sending a loading instruction to the test application, wherein the loading instruction is used to instruct the test application to load the operating system of the electric energy meter to be tested;
[0044] When it is detected that the test application is loaded successfully, a project test instruction is sent to the test application, wherein the project test instruction carries a target test item and is used to instruct the test application to perform a working condition simulation operation according to the target test item;
[0045] Receiving system resource occupancy data obtained after the working condition simulation operation is performed and sent by the test application;
[0046] A resource occupancy test is performed based on the system resource occupancy data to generate a corresponding resource occupancy test result.
[0047] In one embodiment, performing a resource occupancy test based on the system resource occupancy data and generating a corresponding resource occupancy test result includes:
[0048] Determine the maximum resource occupancy data from each of the system resource occupancy data;
[0049] The maximum resource occupancy data is compared with a preset resource occupancy threshold to generate a corresponding resource occupancy test result.
[0050] A resource occupancy test device for an electric energy meter operating system, the device comprising:
[0051] A loading module, used to receive a loading instruction sent by the automated test platform, and in response to the loading instruction, load the test application program into the operating system of the electric energy meter to be tested;
[0052] A process stop control module, used for triggering a process stop instruction when the loading is successful, and controlling all processes of the operating system of the electric energy meter to be tested to stop according to the process stop instruction;
[0053] A target test item acquisition module is used to receive a project test instruction sent by the automated test platform, respond to the project test instruction, and acquire the target test item carried by the project test instruction;
[0054] A system resource occupancy data acquisition module, used to perform a working condition simulation operation according to the target test item, and acquire the system resource occupancy data after the working condition simulation operation;
[0055] The resource occupancy test result acquisition module is used to acquire the resource occupancy test result corresponding to the system resource occupancy data.
[0056] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0057] Receiving a loading instruction sent by the automated test platform, and responding to the loading instruction to load the test application into the operating system of the electric energy meter to be tested;
[0058] When the loading is successful, a process stop instruction is triggered, and all processes of the operating system of the electric energy meter to be tested are controlled to stop according to the process stop instruction;
[0059] Receiving a project test instruction sent by the automated testing platform, responding to the project test instruction, and obtaining a target test item carried by the project test instruction;
[0060] Performing a working condition simulation operation according to the target test item, and obtaining system resource occupancy data after performing the working condition simulation operation;
[0061] Obtain a resource occupancy test result corresponding to the system resource occupancy data.
[0062] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0063] Receiving a loading instruction sent by the automated test platform, and responding to the loading instruction to load the test application into the operating system of the electric energy meter to be tested;
[0064] When the loading is successful, a process stop instruction is triggered, and all processes of the operating system of the electric energy meter to be tested are controlled to stop according to the process stop instruction;
[0065] Receiving a project test instruction sent by the automated testing platform, responding to the project test instruction, and obtaining a target test item carried by the project test instruction;
[0066] Performing a working condition simulation operation according to the target test item, and obtaining system resource occupancy data after performing the working condition simulation operation;
[0067] Obtain a resource occupancy test result corresponding to the system resource occupancy data.
[0068] In the resource occupancy test method, device and computer equipment of the above-mentioned electric energy meter operating system, the automated test platform sends a loading instruction to the test application, and loads the test application into the electric energy meter operating system to be tested according to the loading instruction. When the loading is successful, the test application controls all processes of the electric energy meter operating system to be tested to stop. The automated test platform sends a project test instruction to the test application, and the test application responds to the project test instruction, and performs a working condition simulation operation according to the target test project to obtain the system resource occupancy data after the working condition simulation operation. After the automated test platform obtains the system resource occupancy data, it performs a resource occupancy test based on the system resource occupancy data and generates the corresponding resource occupancy test results. The method realizes the automated system resource occupancy test of the electric energy meter operating system when a single service or a combination of multiple services is run by flexibly simulating various working conditions under the operation of the operating system. There is no need for the staff to manually test by means of software simulation, etc., which reduces the test error and further improves the accuracy of the resource occupancy test results of the electric energy meter operating system. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 An application environment diagram of a resource occupancy testing method for an electric energy meter operating system in one embodiment;
[0070] Figure 2 It is a flowchart of a method for testing resource occupancy of an electric energy meter operating system in one embodiment;
[0071] Figure 3It is a flowchart of a resource occupancy testing method of an electric energy meter operating system in another embodiment;
[0072] Figure 4 A schematic diagram of a flow chart of a method for testing resource occupancy of an electric energy meter operating system in yet another embodiment;
[0073] Figure 5 It is a structural block diagram of a resource occupancy testing device of an electric energy meter operating system in one embodiment;
[0074] Figure 6 It is a structural block diagram of a resource occupancy testing device of an electric energy meter operating system in another embodiment;
[0075] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0076] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0077] The resource occupancy test method of the electric energy meter operating system provided in this application can be applied to Figure 1 In the application environment shown. Among them, the electric energy meter 102 to be tested and the automated test platform 104 communicate through the serial port, the test application 106 is loaded in the operating system of the electric energy meter 102 to be tested, and the test application 106 communicates with the automatic test platform 104 through the serial port. The test application 106 receives the loading instruction sent by the automated test platform 104, and responds to the loading instruction to load the test application 106 into the operating system of the electric energy meter 102 to be tested. When it is determined that the test application 106 is successfully loaded in the operating system of the electric energy meter 102 to be tested, the process stop instruction is triggered, and all processes of the operating system of the electric energy meter 102 to be tested are controlled to stop according to the process stop instruction. The test application 106 receives the project test instruction sent by the automated test platform 104, responds to the project test instruction, obtains the target test item carried by the project test instruction, and then performs a working condition simulation operation according to the target test item, and obtains the system resource occupancy data after the working condition simulation operation. The test application 106 sends the system resource occupancy data to the automated test platform 104, and the automated test platform 104 performs a system resource occupancy test based on the system resource occupancy data to obtain a resource occupancy test result corresponding to the system resource occupancy data. The electric energy meter 102 to be tested may be, but is not limited to, various smart meters, smart metering terminals, etc., and the automated test platform 104 may use an independent server or a host computer.
[0078] In one embodiment, Figure 2 As shown, a method for testing resource occupancy of an electric energy meter operating system is provided. Figure 1 The test application end in the example is explained, including the following steps:
[0079] Step S202, receiving a loading instruction sent by the automated testing platform, and responding to the loading instruction to load the test application into the operating system of the electric energy meter to be tested.
[0080] Specifically, before performing the test application loading operation, the automated testing platform needs to power on the control panel, which can be a 220V, 0A current control panel. After the control panel is powered on, the automated testing platform sends a loading instruction for loading the test application to the test application. The test application receives the loading instruction and responds to the loading instruction to load the test application into the operating system of the electric energy meter to be tested.
[0081] Step S204, when the loading is successful, triggering a process stop instruction, and controlling all processes of the operating system of the electric energy meter to be tested to stop according to the process stop instruction.
[0082] Specifically, when it is determined that the test application is successfully loaded in the operating system of the electric energy meter to be tested, a process stop instruction is triggered, and all processes of the operating system of the electric energy meter to be tested are controlled to stop according to the process stop instruction. The purpose of controlling all processes of the operating system of the electric energy meter to be tested to stop is to start only the working condition simulation operation of the corresponding target test project when responding to the project test instruction later, so as to avoid the existence of other processes at the same time, resulting in errors in resource occupation test.
[0083] Step S206, receiving the project test instruction sent by the automated testing platform, responding to the project test instruction, and obtaining the target test item carried by the project test instruction.
[0084] Among them, the project test instructions sent by the automated testing platform carry test projects. Specifically, the target test projects may include system startup test projects, system upgrade test projects, middle-layer service loading test projects, extended application loading test projects, and data concurrency test projects.
[0085] Specifically, by receiving the project test instruction sent by the automated test platform and parsing the project test instruction, the target test item carried by the project test instruction is obtained. Responding to the project test instruction means that the target test item carried by the project test instruction needs to be obtained, and further working condition simulation operation is performed according to the target test item.
[0086] Step S208, performing a working condition simulation operation according to the target test item, and obtaining system resource occupancy data after the working condition simulation operation.
[0087] Specifically, different target test items correspond to different working conditions. After obtaining the target test item, the test application performs working condition simulation operation according to the target test item. Among them, the working conditions corresponding to the target test item include the system startup working condition corresponding to the system startup test item, the system upgrade working condition corresponding to the system upgrade test item, the middle-layer service loading working condition corresponding to the middle-layer service loading test item, the extended application loading working condition corresponding to the extended application loading test item, and the data concurrency working condition corresponding to the data concurrency test item.
[0088] Furthermore, after the working condition simulation operation is performed for different target test items, the system resources occupied by each target test item are inconsistent. By obtaining the system resource occupancy data after the working condition simulation operation, the occupancy of the system resources by each target test item can be further understood.
[0089] Step S210, obtaining a resource occupancy test result corresponding to the system resource occupancy data.
[0090] Specifically, by sending the system resource occupancy data to the automated testing platform, the automated testing platform performs a system resource occupancy test based on the system resource occupancy data to obtain a corresponding resource occupancy test result, and the test application can obtain the corresponding resource occupancy test result after the automated testing platform performs the system resource occupancy test. The system resource occupancy test result includes reasonable resource occupancy and unreasonable resource occupancy.
[0091] In the resource occupancy test method of the above-mentioned electric energy meter operating system, the automated testing platform sends a loading instruction to the test application, and loads the test application into the electric energy meter operating system to be tested according to the loading instruction. When the loading is successful, the test application controls all processes of the electric energy meter operating system to be tested to stop. The automated testing platform sends a project test instruction to the test application, and the test application responds to the project test instruction, and performs a working condition simulation operation according to the target test project to obtain the system resource occupancy data after the working condition simulation operation. After the automated testing platform obtains the system resource occupancy data, it performs a resource occupancy test based on the system resource occupancy data and generates the corresponding resource occupancy test results. This method realizes the automated system resource occupancy test of the electric energy meter operating system when a single service or a combination of multiple services is run by flexibly simulating various working conditions under the operation of the operating system. There is no need for the staff to manually test by means of software simulation, etc., which reduces the test error and further improves the accuracy of the resource occupancy test results of the electric energy meter operating system.
[0092] In one embodiment, the target test project includes a system startup test project, and a working condition simulation operation is performed according to the target test project, and system resource usage data after the working condition simulation operation is obtained, including:
[0093] According to the system startup test project, control the start of all processes corresponding to the middle layer services and basic application programs of the operating system of the electric energy meter to be tested;
[0094] After confirming that all processes are started, trigger the system monitoring function of the test application;
[0095] Receive the power-off command / power-on command sent by the automated test platform, and respond to the power-off command / power-on command to control the power-off / power-on of the operating system of the electric energy meter to be tested;
[0096] Triggering a system resource occupancy statistics instruction according to the system monitoring function, and performing system resource statistics according to the system resource occupancy statistics instruction;
[0097] Obtain system resource usage data obtained through system resource statistics, and upload the system resource usage data to the automated testing platform for storage;
[0098] Return to the step of triggering the system monitoring function of the test application after determining that all processes are started, until the stored system resource usage data reaches a preset target number.
[0099] Among them, when the target test project is a system startup test project, before performing the test application loading operation, the automated test platform needs to power on the console, which can be a 220V, 0A current control console. After the console is powered on, the automated test platform sends a loading instruction for loading the test application to the test application. The test application receives the loading instruction and responds to the loading instruction to load the test application into the operating system of the electric energy meter to be tested.
[0100] Specifically, after the test application is loaded into the operating system of the electric energy meter to be tested, the test application sends a kill command, that is, a process stop instruction, and controls all processes of the operating system of the electric energy meter to be tested to be disabled according to the process stop instruction. After receiving the project test instruction sent by the automated testing platform, the system startup test item carried by the project test instruction is obtained, and then according to the system startup test item, all processes corresponding to the middle layer services and basic applications of the operating system of the electric energy meter to be tested are controlled to start.
[0101] Furthermore, after all processes corresponding to the middle-layer services and basic applications that control the operating system of the electric energy meter to be tested are started, the test application triggers the corresponding system monitoring function for resource statistics. By receiving the platform power-off instruction sent by the automated test platform and responding to the platform power-off instruction, the operating system of the electric energy meter to be tested is controlled to be powered off. After a preset delay time, such as a delay of 5S, the platform power-on instruction sent by the automated test platform is received, and the platform power-on instruction is responded to to control the operating system of the electric energy meter to be tested to be powered on. Then, the system resource occupancy statistics instruction is triggered according to the system monitoring function, and system resource statistics are performed according to the system resource occupancy statistics instruction, the system resource occupancy data obtained by performing system resource statistics is obtained, and the system resource occupancy data is uploaded to the automated test platform for storage.
[0102] Among them, in order to ensure the accuracy of the system resource occupancy data, it is necessary to repeat the statistics of the system resource occupancy data, and obtain multiple copies of the system resource occupancy data by repeatedly executing the steps from "when it is determined that all processes are started, trigger the system monitoring function of the test application" to "obtain the system resource occupancy data obtained by performing system resource statistics, and upload the system resource occupancy data to the automated testing platform for storage" until the number of system resource occupancy data stored in the automated testing platform reaches the preset target number. It is understandable that the number of times the steps are repeated is consistent with the preset target number, and can be modified or adjusted according to the actual application scenario or actual needs, such as executing the cycle more than 1,000 times.
[0103] In this embodiment, according to the system startup test project, all processes corresponding to the middle layer services and basic applications of the operating system of the electric energy meter to be tested are controlled to start. After all processes are determined to be started through repeated execution, the system monitoring function of the test application is triggered, the platform power-off instruction / platform power-on instruction sent by the automated test platform is received, and the platform power-off instruction / platform power-on instruction is responded to to control the power-off / power-on of the operating system of the electric energy meter to be tested. The system resource occupancy statistics instruction is triggered according to the system monitoring function, and the system resource statistics are performed according to the system resource occupancy statistics instruction. The system resource occupancy data obtained by performing system resource statistics is obtained, and the system resource occupancy data is uploaded to the automated test platform for storage, until the stored system resource occupancy data reaches the preset target number, thereby realizing the detailed statistics and calculation of the system resource occupancy of each process corresponding to the system startup test project, reducing the error of the obtained system resource occupancy data, and further improving the accuracy of the resource occupancy test results of the electric energy meter operating system.
[0104] In one embodiment, the target test project includes a system upgrade test project; performing a working condition simulation operation according to the target test project, and obtaining system resource occupancy data after the working condition simulation operation, including:
[0105] According to the system upgrade test items, control the start of all processes corresponding to the middle layer services and basic application programs of the operating system of the electric energy meter to be tested;
[0106] Receive an upgrade data packet corresponding to the file to be upgraded sent by the automated testing platform;
[0107] Trigger the system monitoring function of the test application;
[0108] Receive the upgrade parameter setting instruction sent by the automated test platform, and obtain the target parameters carried in the upgrade parameter setting instruction;
[0109] According to the upgrade parameter setting instruction, the target parameters of the operating system of the electric energy meter to be tested are upgraded;
[0110] Triggering a system resource occupancy statistics instruction according to the system monitoring function, and performing system resource statistics according to the system resource occupancy statistics instruction;
[0111] Obtain system resource usage data obtained through system resource statistics, and upload the system resource usage data to the automated testing platform for storage;
[0112] Return to the step of receiving an upgrade data packet corresponding to the file to be upgraded sent by the automated testing platform until the stored system resource usage data reaches a preset target number.
[0113] Among them, when the target test project is a system upgrade test project, before performing the test application loading operation, the automated test platform needs to power on the control panel, which can be a 220V, 0A current control panel. After the control panel is powered on, the automated test platform sends a loading instruction for loading the test application to the test application. The test application receives the loading instruction, responds to the loading instruction, and loads the test application into the operating system of the electric energy meter to be tested.
[0114] Specifically, after the test application is loaded into the operating system of the electric energy meter to be tested, the test application sends a kill command, that is, a process stop instruction, and controls all processes of the operating system of the electric energy meter to be tested to be disabled according to the process stop instruction. After receiving the project test instruction sent by the automated testing platform, the system upgrade test project carried by the project test instruction is obtained, and then according to the system upgrade test project, all processes corresponding to the middle layer services and basic applications of the operating system of the electric energy meter to be tested are controlled to be started.
[0115] Furthermore, after all processes corresponding to the middle-layer services and basic applications of the operating system of the electric energy meter to be tested are started, the automated test platform loads the files to be upgraded, and sends the files to be upgraded and the upgrade data packets corresponding to the files to be upgraded to the test application, and triggers the system monitoring function of the test application. The automated test platform also needs to set the corresponding target parameters according to the files to be upgraded, that is, determine which specific parameters need to be upgraded.
[0116] Among them, after the test application receives the upgrade parameter setting instruction sent by the automated test platform, it obtains the target parameters carried by the upgrade parameter setting instruction, and upgrades the target parameters of the operating system of the electric energy meter to be tested according to the upgrade parameter setting instruction. Then, the system resource occupancy statistics instruction can be triggered according to the system monitoring function, and the system resource statistics can be performed according to the system resource occupancy statistics instruction, and the system resource occupancy data obtained by performing the system resource statistics is sent to the automated test platform for storage.
[0117] In order to ensure the accuracy of the system resource occupancy data, it is necessary to repeatedly perform statistics on the system resource occupancy data, and obtain multiple copies of the system resource occupancy data by repeatedly executing the steps from "receiving the upgrade data packet corresponding to the file to be upgraded sent by the automated test platform" to "obtaining the system resource occupancy data obtained by performing system resource statistics, and uploading the system resource occupancy data to the automated test platform for storage", until the number of system resource occupancy data stored in the automated test platform reaches the preset target number. It is understandable that the number of times the steps are repeated is consistent with the preset target number, and can be modified or adjusted according to the actual application scenario or actual needs, such as executing the cycle more than 1,000 times.
[0118] In one embodiment, the target test project also includes an extended application loading test project, and the test process of the extended application loading test project is similar to that of the system upgrade test project, with the difference that, in the test process of the extended application loading test project, system resource statistics are performed according to system resource occupancy statistics instructions after the extended application is loaded, while in the test process of the system upgrade test project, system resource statistics are performed after the target parameters of the operating system of the electric energy meter to be tested are upgraded according to the upgrade parameter setting instructions.
[0119] In this embodiment, the system monitoring function of the test application is triggered by repeatedly executing the steps of receiving the upgrade data packet corresponding to the file to be upgraded sent by the automated test platform and triggering the system monitoring function of the test application. The upgrade parameter setting instruction sent by the automated test platform is received, the target parameter carried by the upgrade parameter setting instruction is obtained, and the target parameter of the electric energy meter operating system to be tested is upgraded according to the upgrade parameter setting instruction. Then, the system resource occupancy statistics instruction is triggered according to the system monitoring function, and the system resource statistics are performed according to the system resource occupancy statistics instruction to obtain the system resource occupancy data, and the steps of uploading to the automated test platform for storage are performed until the stored system resource occupancy data reaches the preset target number. The detailed statistics and calculation of the system resource occupancy of each process corresponding to the system upgrade test project are realized, the error of the obtained system resource occupancy data is reduced, and the accuracy of the resource occupancy test results of the electric energy meter operating system can be further improved.
[0120] In one embodiment, the target test project includes a middle-layer service loading test project; performing a working condition simulation operation according to the target test project, and obtaining system resource occupancy data after the working condition simulation operation, including:
[0121] When it is detected that all processes of the operating system of the electric energy meter under test are stopped, the system monitoring function of the test application is triggered;
[0122] Trigger the middle-layer service loading instruction, and load each middle-layer service according to the middle-layer service loading instruction;
[0123] Triggering a system resource occupancy statistics instruction according to the system monitoring function, and performing system resource statistics according to the system resource occupancy statistics instruction;
[0124] Obtain system resource usage data obtained through system resource statistics, and upload the system resource usage data to the automated testing platform for storage;
[0125] Trigger a service deactivation instruction, and control the deactivation of the loaded service according to the service deactivation instruction;
[0126] Return to the step of triggering the middle-layer service loading instruction and loading each middle-layer service according to the middle-layer service loading instruction until the stored system resource usage data reaches a preset target number.
[0127] Among them, when the target test project is an intermediate layer service loading test project, before performing the test application loading operation, the automated test platform needs to control the console to power on, which can be a 220V, 0A current control console. After the console is powered on, the automated test platform sends a loading instruction for loading the test application to the test application. The test application receives the loading instruction, responds to the loading instruction, and loads the test application into the operating system of the electric energy meter to be tested.
[0128] Specifically, after the test application is loaded into the operating system of the electric energy meter to be tested, the test application sends a kill command, i.e., a process stop instruction, and controls all processes of the operating system of the electric energy meter to be tested to be deactivated according to the process stop instruction. When it is determined that all processes of the operating system of the electric energy meter to be tested are stopped, the system monitoring function of the test application is triggered. After receiving the project test instruction sent by the automated testing platform, the intermediate layer service loading test project carried by the project test instruction is obtained, and then the test project is loaded according to the intermediate layer service, and the corresponding intermediate layer service in the operating system of the electric energy meter to be tested is controlled to be loaded. Among them, the intermediate layer services include: virtual bus service, metering management service, communication management service and platform management service, etc. Different intermediate layer services correspond to different intermediate layer service loading test items.
[0129] Furthermore, according to the system monitoring function, a system resource occupancy statistics instruction is triggered, and system resource statistics are performed according to the system resource occupancy statistics instruction to obtain corresponding system resource occupancy data, and the system resource occupancy data is uploaded to the automated testing platform for storage. After the corresponding middle-layer service is loaded, a service deactivation instruction is triggered, and the loaded service is deactivated according to the service deactivation instruction.
[0130] Among them, in order to ensure the accuracy of the system resource occupancy data, it is necessary to repeatedly perform statistics on the system resource occupancy data, and obtain multiple copies of system resource occupancy data by repeatedly executing the steps from "when the middle layer service loading instruction is triggered, and each middle layer service is loaded according to the middle layer service loading instruction" to "triggering the service deactivation instruction, and controlling the deactivation of the loaded service according to the service deactivation instruction", until the number of system resource occupancy data stored in the automated testing platform reaches the preset target number. It is understandable that the number of times the steps are repeated is consistent with the preset target number, and can be modified or adjusted according to the actual application scenario or actual needs, such as executing the cycle more than 1,000 times.
[0131] In this embodiment, the intermediate layer service loading instruction is triggered by repeated execution, and each intermediate layer service is loaded according to the intermediate layer service loading instruction. The system resource occupancy statistics instruction is triggered according to the system monitoring function, and the system resource statistics are performed according to the system resource occupancy statistics instruction to obtain the system resource occupancy data, and the data is uploaded to the automated testing platform for storage. The service deactivation instruction is triggered, and the steps of deactivating the loaded service are controlled according to the service deactivation instruction until the stored system resource occupancy data reaches the preset target number. The detailed statistics and calculations of the system resource occupancy of each process corresponding to the intermediate layer service loading test project are realized, the error of the obtained system resource occupancy data is reduced, and the accuracy of the resource occupancy test results of the electric energy meter operating system can be further improved.
[0132] In one embodiment, the target test project includes a data concurrency test project; performing a working condition simulation operation according to the target test project, and obtaining system resource occupancy data after the working condition simulation operation, including:
[0133] According to the data concurrent test items, control the clearing of the electric energy meter data and set the corresponding electric meter events and freezing parameters;
[0134] Triggering an electric meter event running instruction, and triggering a single electric meter event or a combination of multiple electric meter events to run according to the electric meter event running instruction;
[0135] When a single meter event or a combination of multiple meter events is running, control the electric energy meter to perform data cycle reading;
[0136] When it is detected that the system resource statistics condition is met, the system resource occupancy statistics instruction is triggered, and the system resource statistics are performed according to the system resource occupancy statistics instruction;
[0137] Obtain system resource usage data obtained through system resource statistics, and upload the system resource usage data to the automated testing platform for storage;
[0138] Return to the step of triggering the electric meter event running instruction, and triggering a single electric meter event or a combination of multiple electric meter events to run according to the electric meter event running instruction, until the stored system resource occupancy data reaches a preset target number.
[0139] Specifically, when the target test item is a data concurrency test item, the automated test platform sends a loading instruction for loading the test application to the test application, the test application receives the loading instruction, responds to the loading instruction, loads the test application into the operating system of the electric energy meter to be tested, and then controls the electric energy meter data to be cleared according to the data concurrency test item, applies 220V voltage and 80A current for running, and sets the corresponding electric energy meter events and freezing parameters. Among them, it also includes setting the electric energy meter time to 1 minute before the freezing time.
[0140] Furthermore, the test application triggers the meter event running instruction, and triggers a single meter event or a combination of multiple meter events to run according to the meter event running instruction, wherein the meter event may include power synchronization, clock synchronization, event triggering, timed freeze, agreed freeze, minute freeze, hourly freeze, daily freeze, settlement day freeze, peripheral control command, meter voltage loss, undervoltage, overcurrent, power failure, and upgrade events. When a single meter event or a combination of multiple meter events runs, the electric energy meter is controlled to perform data cycle reading. When it is detected that the system resource statistics condition is met, such as after a delay of 60S, the system resource occupancy statistics instruction is triggered, and system resource statistics are performed according to the system resource occupancy statistics instruction, and the corresponding system resource occupancy data is generated, and uploaded to the automated test platform for storage.
[0141] Among them, in order to ensure the accuracy of the system resource occupancy data, it is necessary to repeat the statistics of the system resource occupancy data, and repeatedly execute the steps from "triggering the meter event running instruction, and triggering a single meter event or a combination of multiple meter events according to the meter event running instruction" to "obtaining the system resource occupancy data obtained by performing system resource statistics, and uploading the system resource occupancy data to the automated testing platform for storage", to obtain multiple copies of system resource occupancy data, until the number of system resource occupancy data stored in the automated testing platform reaches the preset target number. It is understandable that the number of times the steps are repeated is consistent with the preset target number, and can be modified or adjusted according to the actual application scenario or actual needs, such as executing the cycle more than 1,000 times.
[0142] In this embodiment, by repeatedly executing the instruction to trigger the meter event operation, and triggering a single meter event or a combination of multiple meter events to run according to the meter event operation instruction, when the single meter event or the combination of multiple meter events runs, the electric energy meter is controlled to perform data cyclic reading. When it is detected that the system resource statistics condition is met, the system resource occupancy statistics instruction is triggered, and the system resource statistics are performed according to the system resource occupancy statistics instruction to obtain the system resource occupancy data, and the steps of uploading to the automated test platform for storage, until the stored system resource occupancy data reaches the preset target number, the detailed statistics and calculation of the system resource occupancy of each process corresponding to the data concurrency test project is realized, the error of the obtained system resource occupancy data is reduced, and the accuracy of the resource occupancy test results of the electric energy meter operating system can be further improved.
[0143] In one embodiment, Figure 3 As shown, a method for testing resource occupancy of an electric energy meter operating system is provided, which is applied to an automated testing platform and specifically includes the following steps:
[0144] Step S302: sending a loading instruction to the test application, where the loading instruction is used to instruct the test application to load the operating system of the electric energy meter to be tested.
[0145] Specifically, before performing the test application loading operation, the automated testing platform needs to power on the control panel, which can be a 220V, 0A current control panel. After the control panel is powered on, the automated testing platform sends a loading instruction for loading the test application to the test application. The test application receives the loading instruction and responds to the loading instruction to load the test application into the operating system of the electric energy meter to be tested.
[0146] Step S304, when it is detected that the test application is loaded successfully, a project test instruction is sent to the test application, the project test instruction carries a target test project, and is used to instruct the test application to perform a working condition simulation operation according to the target test project.
[0147] Specifically, when it is determined that the test application is successfully loaded in the operating system of the electric energy meter to be tested, the automated test platform sends a project test instruction to the test application, wherein the project test instruction carries a target test item, and the project test instruction is used to instruct the test application to perform a working condition simulation operation according to the target test item.
[0148] Among them, the project test instructions sent by the automated testing platform carry test projects. Specifically, the target test projects may include system startup test projects, system upgrade test projects, middle-layer service loading test projects, extended application loading test projects, and data concurrency test projects.
[0149] Step S306, receiving system resource occupancy data obtained after the working condition simulation operation sent by the test application.
[0150] Specifically, the system resource occupancy data is obtained after the test application performs a working condition simulation according to the target test project.
[0151] Different target test items correspond to different working conditions. After obtaining the target test items, the test application performs working condition simulation operation according to the target test items. The working conditions corresponding to the target test items include the system startup working condition corresponding to the system startup test item, the system upgrade working condition corresponding to the system upgrade test item, the middle-layer service loading working condition corresponding to the middle-layer service loading test item, the extended application loading working condition corresponding to the extended application loading test item, and the data concurrency working condition corresponding to the data concurrency test item.
[0152] Step S308: Perform a resource occupancy test based on the system resource occupancy data to generate a corresponding resource occupancy test result.
[0153] Specifically, the automated testing platform determines the maximum resource occupancy data from the stored system resource occupancy data, and compares the maximum resource occupancy data with a preset resource occupancy threshold to generate a corresponding resource occupancy test result.
[0154] The resource occupancy test results include reasonable resource occupancy and unreasonable resource occupancy. When the maximum resource occupancy data exceeds the preset resource occupancy threshold, the resource occupancy test result is unreasonable resource occupancy. When the maximum resource occupancy data does not exceed the preset resource occupancy threshold, the resource occupancy test result is reasonable resource occupancy.
[0155] In the resource occupancy test method of the above-mentioned electric energy meter operating system, the automated testing platform sends a loading instruction to the test application, and instructs the test application to load the electric energy meter operating system to be tested according to the loading instruction. When it is detected that the test application is loaded successfully, a project test instruction is sent to the test application, and the test application is instructed to perform a working condition simulation operation according to the target test project according to the project test instruction. The system resource occupancy data obtained after the working condition simulation operation sent by the test application is received, and a resource occupancy test is performed based on the system resource occupancy data to generate a corresponding resource occupancy test result. The system resource occupancy data obtained during the working condition simulation operation of different test items of the electric energy meter operating system to be tested is used to perform an automated system resource occupancy test, without the need for manual testing by staff using software simulation and other methods, thereby reducing test errors and further improving the accuracy of the resource occupancy test results of the electric energy meter operating system.
[0156] In one embodiment, Figure 4 As shown, a method for testing resource occupancy of an electric energy meter operating system is provided, which specifically includes the following steps:
[0157] 1) Receive the loading instruction sent by the automated test platform, respond to the loading instruction, and load the test application into the operating system of the electric energy meter to be tested.
[0158] 2) When the loading is successful, the process stop instruction is triggered, and all processes of the operating system of the electric energy meter to be tested are controlled to stop according to the process stop instruction.
[0159] 3) Trigger the system monitoring function of the test application.
[0160] 4) Receive the project test instructions sent by the automated testing platform, respond to the project test instructions, and obtain the target test items carried by the project test instructions.
[0161] Among them, the target test items include system startup test items, system upgrade test items, middle-layer service loading test items, extended application loading test items, data concurrency test items, and dual-core interaction test items (management core and metering core).
[0162] 5) Perform a working condition simulation run according to the target test project, and obtain system resource usage data after the working condition simulation run.
[0163] 6) Send the resource usage data of each system to the automated testing platform.
[0164] 7) Return to step 3) and repeat N times until the stored system resource usage data reaches a preset target number.
[0165] 8) The automated testing platform performs resource occupancy testing based on the system resource occupancy data to determine the maximum resource occupancy data.
[0166] 9) Compare the maximum resource occupancy data with a preset resource occupancy threshold to determine whether the maximum resource occupancy data exceeds the preset resource occupancy threshold.
[0167] 10) When the maximum resource occupancy data exceeds the preset resource occupancy threshold, the resource occupancy test result obtained is that the resource occupancy is unreasonable. When the maximum resource occupancy data does not exceed the preset resource occupancy threshold, the resource occupancy test result obtained is that the resource occupancy is reasonable.
[0168] In the resource occupancy test method of the above-mentioned electric energy meter operating system, the test application is loaded into the electric energy meter operating system to be tested by receiving the loading instruction sent by the automated testing platform and responding to the loading instruction. When the loading is successful, the process stop instruction is triggered, and all processes of the electric energy meter operating system to be tested are controlled to stop according to the process stop instruction. The system monitoring function of the test application is triggered by repeated execution. The project test instruction sent by the automated testing platform is received, the project test instruction is responded to, and the target test item carried by the project test instruction is obtained. According to the target test item, the working condition simulation operation is performed, the system resource occupancy data after the working condition simulation operation is obtained, and the steps of uploading to the automated testing platform are performed until the stored system resource occupancy data reaches the preset target number. The resource occupancy test is performed based on the system resource occupancy data by the automated testing platform, the maximum resource occupancy data is determined, and the resource occupancy test result is obtained according to the maximum resource occupancy data and the preset resource occupancy threshold. The method realizes automatic system resource occupancy test of the electric energy meter operating system when a single service or a combination of multiple services is run by flexibly simulating various working conditions of the operating system running different services, without the need for manual testing by staff using software simulation and other methods, thereby reducing test errors and further improving the accuracy of resource occupancy test results of the electric energy meter operating system.
[0169] It should be understood that, although the steps in each flow chart involved in the above-described embodiment are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in each flow chart involved in the above-described embodiment may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0170] In one embodiment, Figure 5 As shown, a resource occupancy test device for an electric energy meter operating system is provided, comprising: a loading module 502, a process stop control module 504, a target test item acquisition module 506, a system resource occupancy data acquisition module 508 and a resource occupancy test result acquisition module 510, wherein:
[0171] The loading module 502 is used to receive a loading instruction sent by the automated testing platform, and in response to the loading instruction, load the test application program into the operating system of the electric energy meter to be tested.
[0172] The process stop control module 504 is used to trigger a process stop instruction when the loading is successful, and control all processes of the operating system of the electric energy meter to be tested to stop according to the process stop instruction.
[0173] The target test item acquisition module 506 is used to receive a project test instruction sent by the automated test platform, respond to the project test instruction, and acquire the target test item carried by the project test instruction.
[0174] The system resource occupancy data acquisition module 508 is used to perform a working condition simulation operation according to a target test item, and to acquire the system resource occupancy data after the working condition simulation operation.
[0175] The resource occupancy test result acquisition module 510 is used to acquire the resource occupancy test result corresponding to the system resource occupancy data.
[0176] The resource occupancy test device for the above-mentioned electric energy meter operating system realizes the automatic system resource occupancy test of the electric energy meter operating system when a single service or a combination of multiple services is run by flexibly simulating various working conditions of the operating system running different services, without the need for staff to manually test by means of software simulation, etc., thereby reducing test errors and further improving the accuracy of the resource occupancy test results of the electric energy meter operating system.
[0177] In one embodiment, Figure 6 As shown, a resource occupancy test device for an electric energy meter operating system is provided, comprising: a loading instruction sending module 602, a project test instruction sending module 604, a system resource occupancy data receiving module 606 and a resource occupancy test result generating module 608, wherein:
[0178] The loading instruction sending module 602 is used to send a loading instruction to the test application, and the loading instruction is used to instruct the test application to load the operating system of the electric energy meter to be tested.
[0179] The project test instruction sending module 604 is used to send a project test instruction to the test application when it is detected that the test application is loaded successfully. The project test instruction carries a target test project and is used to instruct the test application to perform a working condition simulation operation according to the target test project.
[0180] The system resource occupancy data receiving module 606 is used to receive the system resource occupancy data obtained after the working condition simulation operation is performed and sent by the test application.
[0181] The resource occupancy test result generating module 608 is used to perform a resource occupancy test based on the system resource occupancy data and generate a corresponding resource occupancy test result.
[0182] The resource occupancy test device for the electric energy meter operating system mentioned above realizes the system resource occupancy data obtained by operating condition simulation for different test items of the electric energy meter operating system to be tested, and performs automated system resource occupancy testing without the need for manual testing by staff using software simulation or the like, thereby reducing test errors and further improving the accuracy of the resource occupancy test results for the electric energy meter operating system.
[0183] In one embodiment, the system resource occupancy data acquisition module is further used to:
[0184] According to the system startup test project, control all processes corresponding to the middle-layer services and basic applications of the operating system of the electric energy meter to be tested to start; when it is determined that all processes are started, trigger the system monitoring function of the test application; receive the platform power-off command / platform power-on command sent by the automated testing platform, and respond to the platform power-off command / platform power-on command to control the power-off / power-on of the operating system of the electric energy meter to be tested; trigger the system resource occupancy statistics command according to the system monitoring function, and perform system resource statistics according to the system resource occupancy statistics command; obtain the system resource occupancy data obtained by performing system resource statistics, and upload the system resource occupancy data to the automated testing platform for storage; return to the step of triggering the system monitoring function of the test application after determining that all processes are started, until the stored system resource occupancy data reaches the preset target number.
[0185] In one embodiment, the system resource occupancy data acquisition module is further used to:
[0186] According to the system upgrade test project, control all processes corresponding to the middle-layer services and basic applications of the operating system of the electric energy meter to be tested to start; receive the upgrade data packet corresponding to the file to be upgraded sent by the automated testing platform; trigger the system monitoring function of the test application; receive the upgrade parameter setting instruction sent by the automated testing platform, and obtain the target parameters carried by the upgrade parameter setting instruction; according to the upgrade parameter setting instruction, perform parameter upgrade on the target parameters of the operating system of the electric energy meter to be tested; trigger the system resource occupancy statistics instruction according to the system monitoring function, and perform system resource statistics according to the system resource occupancy statistics instruction; obtain the system resource occupancy data obtained by performing system resource statistics, and upload the system resource occupancy data to the automated testing platform for storage; return to the step of receiving the upgrade data packet corresponding to the file to be upgraded sent by the automated testing platform until the stored system resource occupancy data reaches the preset target number.
[0187] In one embodiment, the system resource occupancy data acquisition module is further used to:
[0188] When it is detected that all processes of the operating system of the electric energy meter to be tested have stopped, the system monitoring function of the test application is triggered; the middle-layer service loading instruction is triggered, and each middle-layer service is loaded according to the middle-layer service loading instruction; the system resource occupancy statistics instruction is triggered according to the system monitoring function, and the system resource statistics are performed according to the system resource occupancy statistics instruction; the system resource occupancy data obtained by the system resource statistics is obtained, and the system resource occupancy data is uploaded to the automated testing platform for storage; the service deactivation instruction is triggered, and the deactivation of the loaded service is controlled according to the service deactivation instruction; the step of triggering the middle-layer service loading instruction and loading each middle-layer service according to the middle-layer service loading instruction is returned until the stored system resource occupancy data reaches the preset target number.
[0189] In one embodiment, the system resource occupancy data acquisition module is further used to:
[0190] According to the data concurrency test items, control the clearing of the electric energy meter data, and set the corresponding electric energy meter events and freezing parameters; trigger the electric energy meter event running instruction, and trigger a single electric energy meter event or a combination of multiple electric energy meter events to run according to the electric energy meter event running instruction; when a single electric energy meter event or a combination of multiple electric energy meter events runs, control the electric energy meter to perform data cyclic reading; when it is detected that the system resource statistics condition is met, trigger the system resource occupancy statistics instruction, and perform system resource statistics according to the system resource occupancy statistics instruction; obtain the system resource occupancy data obtained by performing system resource statistics, and upload the system resource occupancy data to the automated testing platform for storage; return to the step of triggering the electric energy meter event running instruction, and triggering a single electric energy meter event or a combination of multiple electric energy meter events to run according to the electric energy meter event running instruction, until the stored system resource occupancy data reaches the preset target number.
[0191] In one embodiment, the resource occupancy test result generation module is further used to:
[0192] The maximum resource occupation data is determined from the resource occupation data of each system; the maximum resource occupation data is compared with a preset resource occupation threshold value to generate a corresponding resource occupation test result.
[0193] For the specific definition of the resource occupancy test device of the electric energy meter operating system, please refer to the definition of the resource occupancy test method of the electric energy meter operating system in the above text, which will not be repeated here. Each module in the above-mentioned resource occupancy test device of the electric energy meter operating system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0194] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store system resource occupancy data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a resource occupancy test method of an electric energy meter operating system is implemented.
[0195] Those skilled in the art will understand that Figure 7The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0196] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0197] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0198] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0199] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0200] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for testing resource occupancy of an electric energy meter operating system, characterized in that: The method comprises: Receiving a loading instruction sent by the automated test platform, and responding to the loading instruction to load the test application into the operating system of the electric energy meter to be tested; When the loading is successful, a process stop instruction is triggered, and all processes of the operating system of the electric energy meter to be tested are controlled to stop according to the process stop instruction; Receive the project test instruction sent by the automated testing platform, respond to the project test instruction, and obtain the target test items carried by the project test instruction; the target test items include system startup test items, system upgrade test items, middle-layer service loading test items, extended application loading test items, and data concurrency test items; Performing a working condition simulation operation according to the target test item, and obtaining system resource occupancy data after performing the working condition simulation operation; Obtain resource occupancy test results corresponding to the system resource occupancy data; wherein, by sending the system resource occupancy data to an automated testing platform, the automated testing platform performs a system resource occupancy test based on the system resource occupancy data to obtain corresponding resource occupancy test results, and the test application obtains the corresponding resource occupancy test results after performing the system resource occupancy test on the automated testing platform; the system resource occupancy test results include reasonable resource occupancy and unreasonable resource occupancy.
2. The method according to claim 1, characterized in that The target test items include system startup test items; the operating condition simulation operation is performed according to the target test items, and the system resource occupancy data after the operating condition simulation operation is obtained, including: According to the system startup test item, control all processes corresponding to the middle layer service and basic application program of the operating system of the electric energy meter to be tested to start; When all processes are confirmed to be started, triggering the system monitoring function of the test application; Receiving a power-off instruction / power-on instruction sent by the automated test platform, and responding to the power-off instruction / power-on instruction to control the power-off / power-on of the operating system of the electric energy meter to be tested; triggering a system resource occupancy statistics instruction according to the system monitoring function, and performing system resource statistics according to the system resource occupancy statistics instruction; Obtaining system resource occupancy data obtained by performing system resource statistics, and uploading the system resource occupancy data to the automated testing platform for storage; Return to the step of triggering the system monitoring function of the test application after determining that all processes are started, until the stored system resource usage data reaches a preset target number.
3. The method according to claim 1, characterized in that The target test items include system upgrade test items; the operating condition simulation operation is performed according to the target test items, and the system resource occupancy data after the operating condition simulation operation is obtained, including: According to the system upgrade test items, all processes corresponding to the middle layer services and basic application programs of the operating system of the electric energy meter to be tested are controlled to start; Receiving an upgrade data packet corresponding to the file to be upgraded sent by the automated testing platform; triggering a system monitoring function of the test application; Receiving an upgrade parameter setting instruction sent by the automated testing platform, and acquiring target parameters carried by the upgrade parameter setting instruction; According to the upgrade parameter setting instruction, the target parameters of the operating system of the electric energy meter to be tested are upgraded; triggering a system resource occupancy statistics instruction according to the system monitoring function, and performing system resource statistics according to the system resource occupancy statistics instruction; Obtaining system resource occupancy data obtained by performing system resource statistics, and uploading the system resource occupancy data to the automated testing platform for storage; Return to the step of receiving the upgrade data packet corresponding to the file to be upgraded sent by the automated testing platform until the stored system resource occupancy data reaches a preset target number.
4. The method according to claim 1, characterized in that: The target test items include middle-tier service loading test items; The performing of the working condition simulation operation according to the target test item and obtaining the system resource occupancy data after the working condition simulation operation includes: When it is detected that all processes of the operating system of the electric energy meter to be tested are stopped, triggering the system monitoring function of the test application program; Triggering a middle layer service loading instruction, and loading each middle layer service according to the middle layer service loading instruction; triggering a system resource occupancy statistics instruction according to the system monitoring function, and performing system resource statistics according to the system resource occupancy statistics instruction; Obtaining system resource occupancy data obtained by performing system resource statistics, and uploading the system resource occupancy data to the automated testing platform for storage; Triggering a service deactivation instruction, and controlling the deactivation of the loaded service according to the service deactivation instruction; Returning to the triggering middle layer service loading instruction, and loading each middle layer service according to the middle layer service loading instruction, until the stored system resource occupancy data reaches a preset target quantity.
5. The method according to claim 1, characterized in that The target test items include data concurrency test items; the operating condition simulation operation is performed according to the target test items, and the system resource occupancy data after the operating condition simulation operation is obtained, including: According to the data concurrent test items, control the electric energy meter data to be cleared, and set the corresponding electric meter events and freezing parameters; Triggering an electric meter event running instruction, and triggering a single electric meter event or a combination of multiple electric meter events to run according to the electric meter event running instruction; When the single electric meter event or the combination of multiple electric meter events is running, controlling the electric energy meter to perform data cyclic reading; When it is detected that the system resource statistics condition is met, a system resource occupancy statistics instruction is triggered, and system resource statistics are performed according to the system resource occupancy statistics instruction; Obtaining system resource occupancy data obtained by performing system resource statistics, and uploading the system resource occupancy data to the automated testing platform for storage; Return to the step of triggering the electric meter event execution instruction, and triggering a single electric meter event or a combination of multiple electric meter events to execute according to the electric meter event execution instruction, until the stored system resource occupancy data reaches a preset target quantity.
6. A method for testing resource occupancy of an electric energy meter operating system, characterized in that: The method comprises: Sending a loading instruction to the test application, wherein the loading instruction is used to instruct the test application to load the operating system of the electric energy meter to be tested; When it is detected that the test application is loaded successfully, a project test instruction is sent to the test application, wherein the project test instruction carries a target test item and is used to instruct the test application to perform a working condition simulation operation according to the target test item; Receiving system resource occupancy data obtained after the working condition simulation operation is performed and sent by the test application; The maximum resource occupancy data is determined from each of the system resource occupancy data, and the maximum resource occupancy data is compared with a preset resource occupancy threshold to generate a corresponding resource occupancy test result; wherein the resource occupancy test result includes reasonable resource occupancy and unreasonable resource occupancy; when the maximum resource occupancy data exceeds the preset resource occupancy threshold, the obtained resource occupancy test result is unreasonable resource occupancy, and when the maximum resource occupancy data does not exceed the preset resource occupancy threshold, the obtained resource occupancy test result is reasonable resource occupancy.
7. A resource occupancy test device for an electric energy meter operating system, characterized in that: The device comprises: A loading module, used to receive a loading instruction sent by the automated test platform, and in response to the loading instruction, load the test application program into the operating system of the electric energy meter to be tested; A process stop control module, used for triggering a process stop instruction when the loading is successful, and controlling all processes of the operating system of the electric energy meter to be tested to stop according to the process stop instruction; A target test project acquisition module is used to receive a project test instruction sent by the automated test platform, respond to the project test instruction, and acquire the target test project carried by the project test instruction; the target test project includes a system startup test project, a system upgrade test project, an intermediate layer service loading test project, an extended application loading test project, and a data concurrency test project; A system resource occupancy data acquisition module, used to perform a working condition simulation operation according to the target test item, and acquire the system resource occupancy data after the working condition simulation operation; A resource occupancy test result acquisition module is used to obtain resource occupancy test results corresponding to the system resource occupancy data; wherein, by sending the system resource occupancy data to an automated testing platform, the automated testing platform performs a system resource occupancy test based on the system resource occupancy data to obtain corresponding resource occupancy test results, and the test application obtains the corresponding resource occupancy test results after performing the system resource occupancy test on the automated testing platform; the system resource occupancy test results include reasonable resource occupancy and unreasonable resource occupancy.
8. A resource occupancy test device for an electric energy meter operating system, characterized in that: The device comprises: A loading instruction sending module, used for sending a loading instruction to a test application, wherein the loading instruction is used for instructing the test application to load the operating system of the electric energy meter to be tested; A project test instruction sending module, used for sending a project test instruction to the test application after detecting that the test application is loaded successfully, wherein the project test instruction carries a target test item and is used for instructing the test application to perform a working condition simulation operation according to the target test item; A system resource occupancy data receiving module, used for receiving the system resource occupancy data obtained after the working condition simulation operation is performed and sent by the test application; A resource occupancy test result generation module is used to determine the maximum resource occupancy data from each of the system resource occupancy data, and compare the maximum resource occupancy data with a preset resource occupancy threshold to generate a corresponding resource occupancy test result; wherein the resource occupancy test result includes reasonable resource occupancy and unreasonable resource occupancy; when the maximum resource occupancy data exceeds the preset resource occupancy threshold, the resource occupancy test result obtained is unreasonable resource occupancy, and when the maximum resource occupancy data does not exceed the preset resource occupancy threshold, the resource occupancy test result obtained is reasonable resource occupancy.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
