Terminal power consumption test method, platform, terminal, computer equipment and storage medium
By monitoring and testing the power consumption under different power conditions in the terminal power consumption test, the problem of ignoring the impact of terminal power in the existing technology is solved, and a more accurate power consumption assessment is achieved.
Patent Information
- Application Number
- CN202210960740.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-11
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-08-11
AI Technical Summary
The terminal power consumption test in the prior art fails to fully consider the impact of the remaining power of the terminal on the power consumption value, resulting in inaccurate test results.
By generating a test plan, sending power monitoring and test execution instructions, monitoring the remaining power of the terminal and testing power consumption under different power conditions, the final power consumption value of the terminal is calculated.
Accurately measure the power consumption impact of the terminal when processing different services under different remaining power conditions, improving the accuracy of power consumption testing.
Smart Images

Figure CN115327216B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power consumption testing, and in particular to a terminal power consumption testing method, a testing platform, a tested terminal, a computer device, and a computer-readable storage medium. Background Art
[0002] To ensure that performance meets requirements, terminals generally undergo a series of tests before leaving the factory, such as power consumption tests, which are mainly used to test the power consumption of various hardware and software in the terminal during operation, so that the terminal can be improved based on the test results.
[0003] Currently, the most commonly used power consumption testing method primarily measures the power consumption of the terminal under test in different service scenarios at different locations and under different network conditions, thereby determining the terminal's power consumption. However, many factors affect terminal power consumption. When testing terminal power consumption, only considering the service scenario and network conditions while ignoring the impact of the terminal's remaining battery on power consumption will inevitably lead to inaccurate test results. Summary of the Invention
[0004] The present invention is completed in order to at least partially solve the technical problem in the prior art that terminal power consumption testing only considers business scenarios and network conditions while ignoring the impact of terminal power on power consumption values, resulting in inaccurate test results.
[0005] According to one aspect of the present invention, a terminal power consumption testing method is provided, which is applied to a test platform. The method includes:
[0006] Generate a test plan for testing the power consumption of the terminal under test;
[0007] generating a plurality of power monitoring instructions and a plurality of test execution instructions according to the test plan, wherein each power monitoring instruction corresponds to a test execution instruction;
[0008] sending a plurality of power monitoring instructions and a plurality of test execution instructions to the terminal under test, so that the terminal under test monitors its own remaining power based on the plurality of power monitoring instructions, and in response to its own remaining power value meeting the requirements of each power monitoring instruction, tests its own power consumption according to each corresponding test execution instruction and feeds back the test results to the test platform; and
[0009] Receive all test results sent by the terminal under test, and calculate the final power consumption value of the terminal under test based on all test results.
[0010] Optionally, the test plan includes test requirements corresponding to a plurality of preset remaining power values, and the test requirement corresponding to each preset remaining power value includes a requirement for testing power consumption values of the tested terminal running a plurality of preset services.
[0011] Optionally, the final power consumption value of the terminal under test is calculated based on all test results, and is implemented using the following formula:
[0012]
[0013] Where P represents the final power consumption value of the terminal under test, m represents the total number of preset remaining power values corresponding to the test requirements included in the test plan, n represents the total number of preset services that need to be run when the terminal under test performs power consumption testing in the test requirements corresponding to each preset remaining power value, and A 1i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the first preset service, B1 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the first preset service, A 2i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the second preset service, B2 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the second preset service, A ni Indicates the power consumption value of the tested terminal when running the nth preset service when its remaining power value reaches the i-th preset remaining power value, B n It indicates the power consumption ratio of the tested terminal when running the nth preset service when its remaining power value reaches each preset remaining power value, and B1+B2+…+B n =100%.
[0014] Optionally, sending a plurality of power monitoring instructions and a plurality of test execution instructions to the terminal under test includes:
[0015] Sending a plurality of power monitoring instructions to the terminal under test, so that the terminal under test monitors its own remaining power based on the plurality of power monitoring instructions, and in response to its own remaining power value meeting the requirements of each power monitoring instruction, sequentially feeding back a power monitoring response message to the test platform; and
[0016] Receive the power monitoring response message sent by the terminal under test, and send a test execution instruction to the terminal under test every time a power monitoring response message is received, so that the terminal under test tests its own power consumption based on the test execution instruction and feeds back the test results to the test platform.
[0017] Optionally, after sending the plurality of power monitoring instructions and the plurality of test execution instructions to the terminal under test, the method further includes:
[0018] The number of power monitoring instructions and the number of test execution instructions are also sent to the terminal under test;
[0019] receiving a power monitoring execution completion message sent by the terminal under test after executing all power monitoring instructions based on the number of power monitoring instructions;
[0020] generating a test end instruction based on the power monitoring execution completion message and sending the instruction to the terminal under test, so that the terminal under test feeds back a power consumption test execution completion message to the test platform after executing all test execution instructions based on the test end instruction and the number of test execution instructions; and
[0021] Receive a power consumption test completion message sent by the terminal under test;
[0022] The final power consumption value of the terminal under test is calculated based on all test results, specifically:
[0023] After receiving the power consumption test execution completion message sent by the tested terminal, the final power consumption value of the tested terminal is calculated based on all test results.
[0024] According to another aspect of the present invention, a terminal power consumption testing method is provided, which is applied to a terminal under test, and the method includes:
[0025] receiving a plurality of power monitoring instructions and a plurality of test execution instructions sent by a test platform, wherein the test platform pre-generates a test plan for testing the power consumption of the terminal under test, generates a plurality of power monitoring instructions and a plurality of test execution instructions according to the test plan, and sends the plurality of power monitoring instructions and the plurality of test execution instructions to the terminal under test, wherein each power monitoring instruction corresponds to a test execution instruction;
[0026] Monitor the remaining power of the battery based on the plurality of power monitoring instructions; and
[0027] In response to its own remaining power value meeting the requirements of each power monitoring instruction, it tests its own power consumption according to the corresponding test execution instructions and feeds back the test results to the test platform, so that the test platform receives all test results sent by the terminal under test and calculates the final power consumption value of the terminal under test based on all test results.
[0028] Optionally, after monitoring that the remaining power value of the device meets the requirements of each power monitoring instruction, the method further includes:
[0029] The power monitoring response messages are fed back to the test platform in sequence, so that the test platform receives the power monitoring response messages sent by the terminal under test, and sends a test execution instruction to the terminal under test every time a power monitoring response message is received.
[0030] Optionally, after receiving several power monitoring instructions and several test execution instructions sent by the test platform, the method further includes:
[0031] Receive the number of power monitoring instructions and test execution instructions sent by the test platform;
[0032] After all power monitoring instructions are executed based on the number of power monitoring instructions, a power monitoring execution completion message is sent to the test platform, so that the test platform generates a test end instruction based on the power monitoring execution completion message and sends it to the terminal under test; and
[0033] Receive the test end instruction sent by the test platform, and after executing all test execution instructions based on the test end instruction and the number of test execution instructions, feedback the power consumption test execution completion message to the test platform, so that after the test platform receives the power consumption test execution completion message sent by the tested terminal, it can calculate the final power consumption value of the tested terminal based on all test results.
[0034] According to another aspect of the present invention, a test platform is provided, comprising:
[0035] a plan generating module configured to generate a test plan for testing the power consumption of a terminal under test;
[0036] an instruction generation module configured to generate a plurality of power monitoring instructions and a plurality of test execution instructions according to the test plan, wherein each power monitoring instruction corresponds to a test execution instruction;
[0037] a sending module configured to send a plurality of power monitoring instructions and a plurality of test execution instructions to the terminal under test, so that the terminal under test monitors its own remaining power based on the plurality of power monitoring instructions, and in response to its own remaining power value meeting the requirements of each power monitoring instruction, tests its own power consumption according to each corresponding test execution instruction and feeds back the test results to the test platform;
[0038] a receiving module configured to receive all test results sent by the terminal under test; and
[0039] The power consumption calculation module is configured to calculate a final power consumption value of the terminal under test based on all test results received by the receiving module.
[0040] According to another aspect of the present invention, there is provided a terminal under test, comprising:
[0041] A power monitoring module, configured to receive a plurality of power monitoring instructions sent by the test platform, and monitor the remaining power of the terminal under test based on the plurality of power monitoring instructions; and
[0042] a test execution module configured to receive a plurality of test execution instructions sent by the test platform, and when the power monitoring module detects that the remaining power of the terminal under test meets the requirements of each power monitoring instruction, test the power consumption of the terminal under test according to each corresponding test execution instruction and feed back the test results to the test platform, so that the test platform receives all test results sent by the terminal under test and calculates a final power consumption value of the terminal under test based on all test results;
[0043] The test platform pre-generates a test plan for testing the power consumption of the terminal under test, generates several power monitoring instructions and several test execution instructions according to the test plan and sends them to the terminal under test, and each power monitoring instruction corresponds to a test execution instruction.
[0044] According to another aspect of the present invention, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the aforementioned terminal power consumption test method.
[0045] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the aforementioned terminal power consumption test method.
[0046] The technical solution provided by the present invention can have the following beneficial effects:
[0047] The terminal power consumption testing method provided by the present invention measures the power consumption values of the tested terminal when running different services under different remaining power conditions. It can effectively test the impact of the terminal power consumption when the terminal processes different service types under different remaining power conditions, and fully considers the impact of the terminal's remaining power on its power consumption value, thereby more accurately measuring the terminal's power consumption performance.
[0048] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation to the technical solution of the present invention.
[0050] Figure 1 A schematic diagram of a process flow of a terminal power consumption testing method provided by an embodiment of the present invention;
[0051] Figure 2 A flowchart of another terminal power consumption testing method provided by an embodiment of the present invention;
[0052] Figure 3 A schematic diagram of the structure of a test platform provided in an embodiment of the present invention;
[0053] Figure 4 A schematic diagram of the structure of a terminal under test provided in an embodiment of the present invention;
[0054] Figure 5 A schematic diagram of the structure of a terminal power consumption test system provided in an embodiment of the present invention;
[0055] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the following detailed description of the specific embodiments of the present invention is given in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present invention and are not intended to limit the present invention.
[0057] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence; and, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be arbitrarily combined with each other.
[0058] In the subsequent description, suffixes such as "module," "component," or "unit" used to represent elements are only used to facilitate the description of the present invention and have no specific meaning. Therefore, "module," "component," or "unit" can be used interchangeably.
[0059] Figure 1 The present invention provides a flow chart of a method for testing terminal power consumption. The method is applied to a test platform, such as Figure 1 As shown, the method includes the following steps S101 to S104.
[0060] S101. Generate a test plan for testing the power consumption of a terminal under test.
[0061] In this step, the test plan is related to the power consumption of the terminal under test at different remaining power levels.
[0062] S102. Generate a plurality of power monitoring instructions and a plurality of test execution instructions according to the test plan, wherein each power monitoring instruction corresponds to a test execution instruction.
[0063] In this step, in order to implement the test plan, it is necessary to generate corresponding power monitoring instructions and test execution instructions, where the power monitoring instructions are used to trigger the terminal under test to monitor its own remaining power, and the test execution instructions are used to trigger the terminal under test to test its own power consumption.
[0064] S103. Send several power monitoring instructions and several test execution instructions to the terminal under test, so that the terminal under test monitors its own remaining power based on the several power monitoring instructions, responds to its own remaining power value meeting the requirements of each power monitoring instruction, tests its own power consumption according to the corresponding test execution instructions, and feeds back the test results to the test platform.
[0065] In this step, after receiving several power monitoring instructions and several test execution instructions sent by the test platform, the terminal under test first monitors its own remaining power based on the several power monitoring instructions, and when its own remaining power value meets the requirements of each power monitoring instruction, it then tests its own power consumption based on the corresponding test execution instructions to obtain test results, and then feeds back the test results to the test platform.
[0066] S104. Receive all test results sent by the terminal under test, and calculate the final power consumption value of the terminal under test based on all test results.
[0067] In this step, the test platform saves each test result received from the terminal under test until all test results are received and saved, and then calculates the final power consumption value of the terminal under test based on all saved test results.
[0068] In this embodiment, the test platform generates a test plan for testing the power consumption of the terminal under test, and then generates a number of power monitoring instructions and a number of test execution instructions according to the test plan and sends them to the terminal under test. The terminal under test monitors its own remaining power based on the several power monitoring instructions sent by the test platform, and when its own remaining power value meets the requirements of each power monitoring instruction, it tests its own power consumption according to the corresponding test execution instructions and feeds back the test results to the test platform. The test platform can then calculate the final power consumption value of the terminal under test based on the test results fed back by the terminal under test.
[0069] In a specific embodiment, the test plan includes test requirements corresponding to several preset remaining power values, and the test requirement corresponding to each preset remaining power value includes a requirement for testing power consumption values of the tested terminal running several preset services.
[0070] In this embodiment, the number and specific values of the preset remaining power values can be set and adjusted by those skilled in the art according to actual needs, for example, the remaining power value is set at intervals of 5% (5%, 10%, 15%, ...), or the remaining power value is set at intervals of 10% (10%, 20%, 30%, ...); the preset services refer to the services included in the test plan that require testing the power consumption of the terminal, which can generally include commonly used calls, instant messaging, games, videos, audio, social services, etc. For example, for the social Douyin service, after the Douyin service is turned on, it can be refreshed every 15 seconds to test the power consumption value when running the Douyin service.
[0071] In a specific implementation, step S104 calculates the final power consumption value of the tested terminal based on all test results, which is implemented using the following formula:
[0072]
[0073] Where P represents the final power consumption value of the terminal under test; m represents the total number of preset remaining power values corresponding to the test requirements included in the test plan; n represents the total number of preset services that need to be run when the terminal under test performs power consumption testing in the test requirements corresponding to each preset remaining power value, and both m and n are positive integers; A 1i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the first preset service, B1 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the first preset service, A 2i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the second preset service, B2 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the second preset service, A ni Indicates the power consumption value of the tested terminal when running the nth preset service when its remaining power value reaches the i-th preset remaining power value, B n It indicates the power consumption ratio of the tested terminal when running the nth preset service when its remaining power value reaches each preset remaining power value, and B1+B2+…+B n =100%.
[0074] It should be noted that, when the remaining power value of the tested terminal reaches different preset remaining power values, the power consumption ratio of running the same preset service is the same.
[0075] In this embodiment, the final power consumption value of the terminal under test is calculated based on the power consumption values of the terminal under test when processing different services under different remaining power conditions and the power consumption proportions of the terminal under test when running different services under different remaining power values.
[0076] In a specific implementation, step S103 includes the following steps S103a and S103b.
[0077] S103a sends several power monitoring instructions to the terminal under test, so that the terminal under test monitors its own remaining power based on the several power monitoring instructions, in response to its own remaining power value respectively reaches the requirements of each power monitoring instruction in turn to the test platform feedback power monitoring response message;
[0078] S103b. Receive the power monitoring response message sent by the terminal under test, and send a test execution instruction to the terminal under test for each power monitoring response message received, so that the terminal under test tests its own power consumption based on the test execution instruction and feeds back the test results to the test platform.
[0079] In this embodiment, after generating a test plan, the test platform first generates a power monitoring instruction according to the test plan and sends it to the terminal under test, and receives the power monitoring response message that the terminal under test monitors its own remaining power based on the monitoring requirements of each power monitoring instruction for the terminal power, and sequentially feeds back when its own remaining power value meets the requirements of each power monitoring instruction; then, a test execution instruction is generated according to the test plan and the power monitoring response message and sent to the terminal under test, and the test results fed back sequentially when the terminal under test tests its own power consumption based on each test execution instruction are received.
[0080] It should be noted that the power monitoring instruction is one or more instructions, and one or more power monitoring instructions correspond to one or more monitoring requirements of the remaining power values, that is, each power monitoring instruction corresponds to a monitoring requirement of the remaining power value. The terminal under test monitors its own remaining power in real time according to the monitoring requirements of one or more power monitoring instructions. When its remaining power value meets the monitoring requirements of a certain power monitoring instruction, it feeds back a power monitoring response message to the test platform. Therefore, the power monitoring response message is also one or more, corresponding to one or more power monitoring instructions.
[0081] Each time the test platform receives a power monitoring response message from the terminal under test, it generates a test execution instruction based on the test requirements contained in the test plan and sends it to the terminal under test. Each time the terminal under test receives a test execution instruction, it tests its own power consumption according to the test execution instruction and feeds back the test results to the test platform. Therefore, there are one or more test execution instructions, each corresponding to one or more power monitoring instructions. Each test execution instruction includes testing the power consumption value of the terminal under test running one or more preset services. Accordingly, each test result fed back by the terminal under test to the test platform may include one or more power consumption values depending on the test execution instruction. That is, when the test execution instruction includes testing the power consumption value of the terminal under test running a preset service, a test result only includes one power consumption value. When the test execution instruction includes testing the power consumption value of the terminal under test running multiple preset services, a test result needs to include multiple power consumption values.
[0082] In a specific implementation, after step S103, the following steps S105 to S108 are further included.
[0083] S105. The number of power monitoring instructions and the number of test execution instructions are also sent to the terminal under test;
[0084] S106. Receiving a power monitoring execution completion message sent by the terminal under test after executing all power monitoring instructions based on the number of power monitoring instructions;
[0085] S107. Generate a test end instruction based on the power monitoring execution completion message and send it to the terminal under test, so that the terminal under test will feedback the power consumption test execution completion message to the test platform after executing all test execution instructions based on the test end instruction and the number of test execution instructions;
[0086] S108. Receive a power consumption test completion message sent by the terminal under test.
[0087] Accordingly, in step S104, the final power consumption value of the terminal under test is calculated based on all test results, specifically:
[0088] After receiving the power consumption test execution completion message sent by the tested terminal, the final power consumption value of the tested terminal is calculated based on all test results.
[0089] In this embodiment, for several power monitoring instructions sent by the test platform, after the terminal under test executes all the power monitoring instructions, it sends a power monitoring execution completion message to the test platform to inform the test platform that the terminal under test has completed all power monitoring work; after receiving the power monitoring execution completion message sent by the terminal under test, the test platform generates a test end instruction and sends it to the terminal under test. After receiving the test end instruction, the terminal under test will complete all test execution instructions received so far, and then feedback a power consumption test execution completion message to the test platform to inform the test platform that the terminal under test has completed all power consumption testing work; after receiving the power consumption test execution completion message, the test platform calls out all the test results it has saved, and calculates the final power consumption value of the terminal under test based on the power consumption ratio of the terminal under test running different services at different remaining power values.
[0090] It should be noted that the order of the above steps is only a specific example proposed to illustrate the embodiments of the present invention. The present invention does not limit the order of the above steps, and those skilled in the art can adjust them as needed in actual applications; and the size of the sequence numbers of the above steps does not limit their execution order.
[0091] Figure 2 A flow chart of another terminal power consumption test method provided by an embodiment of the present invention. The method is applied to the terminal under test, such as Figure 2 As shown, the method includes the following steps S201 to S203.
[0092] S201. Receive several power monitoring instructions and several test execution instructions sent by the test platform, wherein the test platform pre-generates a test plan for testing the power consumption of the terminal under test, generates several power monitoring instructions and several test execution instructions according to the test plan and sends them to the terminal under test, each power monitoring instruction corresponds to a test execution instruction;
[0093] S202. Monitor the remaining power of the battery based on the number of power monitoring instructions;
[0094] S203. In response to its own remaining power value reaching the requirements of each power monitoring instruction, its own power consumption is tested according to the corresponding test execution instructions and the test results are fed back to the test platform, so that the test platform receives all test results sent by the terminal under test and calculates the final power consumption value of the terminal under test based on all test results.
[0095] The test plan includes test requirements corresponding to a number of preset remaining power values, and the test requirements corresponding to each preset remaining power value include a requirement for testing power consumption values of the tested terminal running a number of preset services.
[0096] The test platform calculates the final power consumption value of the terminal under test based on all test results using the following formula:
[0097]
[0098] Where P represents the final power consumption value of the terminal under test; m represents the total number of preset remaining power values corresponding to the test requirements included in the test plan; n represents the total number of preset services that need to be run when the terminal under test performs power consumption testing in the test requirements corresponding to each preset remaining power value, and both m and n are positive integers; A 1i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the first preset service, B1 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the first preset service, A 2i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the second preset service, B2 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the second preset service, A ni Indicates the power consumption value of the tested terminal when running the nth preset service when its remaining power value reaches the i-th preset remaining power value, B n It indicates the power consumption ratio of the tested terminal when running the nth preset service when its remaining power value reaches each preset remaining power value, and B1+B2+…+B n =100%. It should be noted that, when the remaining power value of the tested terminal reaches different preset remaining power values, the power consumption ratio of running the same preset service is the same.
[0099] In this embodiment, after the terminal under test receives several power monitoring instructions and several test execution instructions generated by the test platform based on the test plan pre-generated by the test platform for testing the power consumption of the terminal under test, the terminal under test first monitors its own remaining power based on the several power monitoring instructions, and when its own remaining power value meets the requirements of each power monitoring instruction, it tests its own power consumption according to the corresponding test execution instructions and feeds back the test results to the test platform. The test platform can then calculate the final power consumption value of the terminal under test based on the test results fed back by the terminal under test.
[0100] In a specific implementation, after the remaining power value of the battery is monitored to meet the requirements of each power monitoring instruction in step S202, the following step S204 is also included.
[0101] S204. Feedback the power monitoring response messages to the test platform in sequence, so that the test platform receives the power monitoring response messages sent by the terminal under test, and sends a test execution instruction to the terminal under test every time a power monitoring response message is received.
[0102] In this embodiment, after the terminal under test receives the power monitoring instruction sent by the test platform, it monitors its own remaining power based on each power monitoring instruction, and when its own remaining power value meets the requirements of each power monitoring instruction, it sequentially feeds back a power monitoring response message to the test platform, and then receives the test execution instruction generated by the test platform according to the test plan and the power monitoring response message, tests its own power consumption based on each test execution instruction and sends the test results to the test platform.
[0103] In a specific implementation, after step S201, the following steps S205 to S207 are further included.
[0104] S205. Receive the number of power monitoring instructions and test execution instructions sent by the test platform;
[0105] S206. After executing all power monitoring instructions based on the number of power monitoring instructions, a power monitoring execution completion message is sent to the test platform, so that the test platform generates a test end instruction based on the power monitoring execution completion message and sends it to the terminal under test;
[0106] S207. Receive the test end instruction sent by the test platform, and after executing all the test execution instructions based on the test end instruction and the number of test execution instructions, feedback the power consumption test execution completion message to the test platform, so that after receiving the power consumption test execution completion message sent by the terminal under test, the test platform calculates the final power consumption value of the terminal under test based on all test results.
[0107] In this embodiment, for several power monitoring instructions sent by the test platform, after the terminal under test executes all the power monitoring instructions, it sends a power monitoring execution completion message to the test platform to inform the test platform that the terminal under test has completed all power monitoring work; after receiving the power monitoring execution completion message sent by the terminal under test, the test platform generates a test end instruction and sends it to the terminal under test; after receiving the test end instruction sent by the test platform, the terminal under test will complete all test execution instructions received so far, and then feedback a power consumption test execution completion message to the test platform to inform the test platform that the terminal under test has completed all power consumption testing work; after receiving the power consumption test execution completion message, the test platform calls out all the test results it has saved, and calculates the final power consumption value of the terminal under test based on the power consumption ratio of running different services at different remaining power values.
[0108] It should be noted that the order of the above steps is only a specific example proposed to illustrate the embodiments of the present invention. The present invention does not limit the order of the above steps, and those skilled in the art can adjust them as needed in actual applications; and the size of the sequence numbers of the above steps does not limit their execution order.
[0109] The terminal power consumption testing method provided in an embodiment of the present invention obtains the power consumption values of the terminal under test when processing different services under different remaining power conditions, and calculates the final power consumption value of the terminal under test based on the power consumption ratio of the terminal under test when running different services at different remaining power values. It fully considers the impact of the remaining power of the terminal on its power consumption value, thereby more accurately measuring the power consumption performance of the terminal.
[0110] Figure 3 This is a schematic diagram of the structure of the test platform provided by the embodiment of the present invention. Figure 3 As shown, the test platform includes: a plan generation module 301, an instruction generation module 302, a sending module 303, a receiving module 304 and a power consumption calculation module 305.
[0111] Among them, the plan generation module 301 is configured to generate a test plan for testing the power consumption of the terminal under test; the instruction generation module 302 is configured to generate a number of power monitoring instructions and a number of test execution instructions according to the test plan, wherein each power monitoring instruction corresponds to a test execution instruction; the sending module 303 is configured to send a number of power monitoring instructions and a number of test execution instructions to the terminal under test, so that the terminal under test monitors its own remaining power based on the number of power monitoring instructions, and in response to its own remaining power value meeting the requirements of each power monitoring instruction, tests its own power consumption according to the corresponding test execution instructions and feeds back the test results to the test platform; the receiving module 304 is configured to receive all test results sent by the terminal under test; the power consumption calculation module 305 is configured to calculate the final power consumption value of the terminal under test based on all test results received by the receiving module 304.
[0112] In a specific embodiment, the test plan includes test requirements corresponding to several preset remaining power values, and the test requirement corresponding to each preset remaining power value includes a requirement for testing power consumption values of the tested terminal running several preset services.
[0113] In a specific implementation, the power consumption calculation module 305 calculates the final power consumption value of the terminal under test using the following formula:
[0114]
[0115] Where P represents the final power consumption value of the terminal under test, m represents the total number of preset remaining power values corresponding to the test requirements included in the test plan, n represents the total number of preset services that need to be run when the terminal under test performs power consumption testing in the test requirements corresponding to each preset remaining power value, and A 1i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the first preset service, B1 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the first preset service, A 2i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the second preset service, B2 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the second preset service, A ni Indicates the power consumption value of the tested terminal when running the nth preset service when its remaining power value reaches the i-th preset remaining power value, B n It indicates the power consumption ratio of the tested terminal when running the nth preset service when its remaining power value reaches each preset remaining power value, and B1+B2+…+B n =100%.
[0116] In a specific implementation, the sending module 303 includes: a sending unit and a receiving unit.
[0117] Among them, the sending unit is configured to send a number of power monitoring instructions to the terminal under test, so that the terminal under test monitors its own remaining power based on the said number of power monitoring instructions, and in response to its own remaining power value reaching the requirements of each power monitoring instruction, it sequentially feeds back a power monitoring response message to the test platform; the receiving unit is configured to receive the power monitoring response message sent by the terminal under test; the sending unit is also configured to send a test execution instruction to the terminal under test every time the receiving unit receives a power monitoring response message, so that the terminal under test tests its own power consumption based on the test execution instruction and feeds back the test results to the test platform.
[0118] In a specific embodiment, the sending module 303 is also configured to send the number of power monitoring instructions and the number of test execution instructions to the terminal under test; the receiving module 304 is also configured to receive the power monitoring execution completion message sent by the terminal under test after executing all power monitoring instructions based on the number of power monitoring instructions; the instruction generation module 302 is also configured to generate a test end instruction based on the power monitoring execution completion message received by the receiving module 304; the sending module 303 is also configured to send the test end instruction generated by the instruction generation module 302 to the terminal under test, so that the terminal under test can feedback the power consumption test execution completion message to the test platform after executing all test execution instructions based on the test end instruction and the number of test execution instructions; the receiving module 304 is also configured to receive the power consumption test execution completion message sent by the terminal under test.
[0119] Accordingly, the power consumption calculation module 305 is specifically configured to calculate the final power consumption value of the terminal under test based on all test results after the receiving module 304 receives the power consumption test execution completion message sent by the terminal under test.
[0120] The test platform provided by the embodiment of the present invention obtains the power consumption values of the terminal under test when processing different services under different remaining power conditions, and calculates the final power consumption value of the terminal under test based on the power consumption ratio of the terminal under test when running different services at different remaining power values. It fully considers the impact of the terminal's remaining power on its power consumption value, thereby more accurately measuring the power consumption performance of the terminal.
[0121] Figure 4 This is a schematic diagram of the structure of the terminal under test provided by an embodiment of the present invention. Figure 4 As shown, the terminal under test includes: a power monitoring module 401 and a test execution module 402. The power monitoring module 401 and the test execution module 402 are integrated or installed on the terminal under test.
[0122] Among them, the power monitoring module 401 is configured to receive several power monitoring instructions sent by the test platform, and monitor the remaining power of the terminal under test based on the several power monitoring instructions; the test execution module 402 is configured to receive several test execution instructions sent by the test platform, and when the power monitoring module 401 detects that the remaining power of the terminal under test meets the requirements of each power monitoring instruction, the power consumption of the terminal under test is tested according to the corresponding test execution instructions and the test results are fed back to the test platform, so that the test platform receives all test results sent by the terminal under test and calculates the final power consumption value of the terminal under test based on all test results. The test platform pre-generates a test plan for testing the power consumption of the terminal under test, generates several power monitoring instructions and several test execution instructions according to the test plan, and sends them to the terminal under test, and each power monitoring instruction corresponds to a test execution instruction.
[0123] In a specific embodiment, the power monitoring module 401 is also configured to feedback power monitoring response messages to the test platform in sequence after monitoring that the remaining power value of the terminal under test meets the requirements of each power monitoring instruction, so that the test platform receives the power monitoring response message sent by the terminal under test, and sends a test execution instruction to the terminal under test each time a power monitoring response message is received.
[0124] In a specific embodiment, the power monitoring module 401 is also configured to receive the number of power monitoring instructions sent by the test platform, and send a power monitoring execution completion message to the test platform after executing all power monitoring instructions based on the number of power monitoring instructions, so that the test platform generates a test end instruction based on the power monitoring execution completion message and sends it to the terminal under test; the test execution module 402 is also configured to receive the number of test execution instructions sent by the test platform and the test end instruction sent by the test platform, and after executing all test execution instructions based on the test end instruction and the number of test execution instructions, it feeds back a power consumption test execution completion message to the test platform, so that after receiving the power consumption test execution completion message sent by the terminal under test, the test platform calculates the final power consumption value of the terminal under test based on all test results.
[0125] The terminal under test provided in an embodiment of the present invention obtains its own power consumption values when processing different services under different remaining power conditions and sends them to the test platform. The test platform calculates the final power consumption value of the terminal under test based on the power consumption ratio of the terminal under test when running different services at different remaining power values, fully considering the impact of the terminal's remaining power on its power consumption value, thereby more accurately measuring the terminal's power consumption performance.
[0126] Based on the same technical concept, the embodiment of the present invention also provides a terminal power consumption test system. Figure 5 As shown, the system includes: a test platform 51 and a terminal under test 52.
[0127] The specific structures of the test platform 51 and the terminal under test 52 can refer to the above embodiments and will not be described again here.
[0128] Based on the same technical concept, the embodiment of the present invention also provides a computer device, such as Figure 6 As shown, the computer device includes a memory 61 and a processor 62. The memory 61 stores a computer program. When the processor 62 runs the computer program stored in the memory 61, the processor 62 executes the aforementioned terminal power consumption test method.
[0129] Based on the same technical concept, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the processor executes the aforementioned terminal power consumption test method.
[0130] To sum up, the terminal power consumption testing method, system, testing platform, tested terminal, computer equipment and storage medium provided by the embodiments of the present invention are mainly used in the terminal power consumption testing process. By obtaining the power consumption values of the tested terminal when processing different services under different remaining power conditions, and calculating the final power consumption value of the tested terminal according to the power consumption ratio of the tested terminal when running different services at different remaining power values, the problem in the prior art that only business scenarios and network conditions are considered when testing terminal power consumption, while ignoring the impact of the terminal's remaining power on the power consumption value, resulting in inaccurate test results and inability to accurately determine the actual power consumption value of the terminal, is solved.
[0131] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A terminal power consumption test method, characterized in that: Applied to a test platform, the method includes: Generating a test plan for testing the power consumption of the terminal under test, the test plan including test requirements corresponding to a plurality of preset remaining power values, wherein the test requirement corresponding to each preset remaining power value includes a requirement for testing the power consumption values of the terminal under test when running a plurality of preset services; generating a plurality of power monitoring instructions and a plurality of test execution instructions according to the test plan, wherein each power monitoring instruction corresponds to a test execution instruction; sending a plurality of power monitoring instructions and a plurality of test execution instructions to the terminal under test, so that the terminal under test monitors its own remaining power based on the plurality of power monitoring instructions, and in response to its own remaining power value meeting the requirements of each power monitoring instruction, tests its own power consumption according to each corresponding test execution instruction and feeds back the test results to the test platform; and Receive all test results sent by the terminal under test, and calculate the final power consumption value of the terminal under test based on all test results; The final power consumption value of the terminal under test is calculated based on all test results using the following formula: Where P represents the final power consumption value of the terminal under test, m represents the total number of preset remaining power values corresponding to the test requirements included in the test plan, n represents the total number of preset services that need to be run when the terminal under test performs power consumption testing in the test requirements corresponding to each preset remaining power value, and A 1i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the first preset service, B1 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the first preset service, A 2i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the second preset service, B2 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the second preset service, A ni Indicates the power consumption value of the tested terminal when running the nth preset service when its remaining power value reaches the i-th preset remaining power value, B n It indicates the power consumption ratio of the tested terminal when running the nth preset service when its remaining power value reaches each preset remaining power value. The power consumption ratio of the tested terminal when running the same preset service when its remaining power value reaches different preset remaining power values is the same, and B1+B2+…+B n =100%.
2. The method according to claim 1, characterized in that The sending of the plurality of power monitoring instructions and the plurality of test execution instructions to the terminal under test includes: Sending a plurality of power monitoring instructions to the terminal under test, so that the terminal under test monitors its own remaining power based on the plurality of power monitoring instructions, and in response to its own remaining power value meeting the requirements of each power monitoring instruction, sequentially feeding back a power monitoring response message to the test platform; and Receive the power monitoring response message sent by the terminal under test, and send a test execution instruction to the terminal under test every time a power monitoring response message is received, so that the terminal under test tests its own power consumption based on the test execution instruction and feeds back the test results to the test platform.
3. The method according to claim 1 or 2, characterized in that After sending a plurality of power monitoring instructions and a plurality of test execution instructions to the terminal under test, the method further includes: The number of power monitoring instructions and the number of test execution instructions are also sent to the terminal under test; receiving a power monitoring execution completion message sent by the terminal under test after executing all power monitoring instructions based on the number of power monitoring instructions; generating a test end instruction based on the power monitoring execution completion message and sending the instruction to the terminal under test, so that the terminal under test feeds back a power consumption test execution completion message to the test platform after executing all test execution instructions based on the test end instruction and the number of test execution instructions; and Receive a power consumption test completion message sent by the terminal under test; The final power consumption value of the terminal under test is calculated based on all test results, specifically: After receiving the power consumption test execution completion message sent by the tested terminal, the final power consumption value of the tested terminal is calculated based on all test results.
4. A terminal power consumption test method, characterized in that: Applied to the terminal under test, the method includes: receiving a plurality of power monitoring instructions and a plurality of test execution instructions sent by a test platform, wherein the test platform pre-generates a test plan for testing the power consumption of a terminal under test, generates a plurality of power monitoring instructions and a plurality of test execution instructions according to the test plan, and sends the plurality of power monitoring instructions and the plurality of test execution instructions to the terminal under test, wherein each power monitoring instruction corresponds to a test execution instruction, the test plan includes test requirements corresponding to a plurality of preset remaining power values, and the test requirements corresponding to each preset remaining power value include a requirement for testing power consumption values of the terminal under test when running a plurality of preset services; Monitor the remaining power of the battery based on the plurality of power monitoring instructions; and In response to the remaining power value of the terminal meeting the requirements of each power monitoring instruction, the terminal tests its own power consumption according to the corresponding test execution instructions and feeds back the test results to the test platform, so that the test platform receives all test results sent by the terminal under test and calculates the final power consumption value of the terminal under test based on all test results; The final power consumption value of the terminal under test is calculated based on all test results using the following formula: Where P represents the final power consumption value of the terminal under test, m represents the total number of preset remaining power values corresponding to the test requirements included in the test plan, n represents the total number of preset services that need to be run when the terminal under test performs power consumption testing in the test requirements corresponding to each preset remaining power value, and A 1i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the first preset service, B1 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the first preset service, A 2i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the second preset service, B2 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the second preset service, A ni Indicates the power consumption value of the tested terminal when running the nth preset service when its remaining power value reaches the i-th preset remaining power value, B n It indicates the power consumption ratio of the tested terminal when running the nth preset service when its remaining power value reaches each preset remaining power value. The power consumption ratio of the tested terminal when running the same preset service when its remaining power value reaches different preset remaining power values is the same, and B1+B2+…+B n =100%.
5. The method according to claim 4, characterized in that After the remaining power value of the battery is monitored to meet the requirements of each power monitoring instruction, the following is also included: The power monitoring response messages are fed back to the test platform in sequence, so that the test platform receives the power monitoring response messages sent by the terminal under test, and sends a test execution instruction to the terminal under test every time a power monitoring response message is received.
6. The method according to claim 4 or 5, characterized in that After receiving several power monitoring instructions and several test execution instructions sent by the test platform, it also includes: Receive the number of power monitoring instructions and test execution instructions sent by the test platform; After all power monitoring instructions are executed based on the number of power monitoring instructions, a power monitoring execution completion message is sent to the test platform, so that the test platform generates a test end instruction based on the power monitoring execution completion message and sends it to the terminal under test; and Receive the test end instruction sent by the test platform, and after executing all test execution instructions based on the test end instruction and the number of test execution instructions, feedback the power consumption test execution completion message to the test platform, so that after the test platform receives the power consumption test execution completion message sent by the tested terminal, it can calculate the final power consumption value of the tested terminal based on all test results.
7. A test platform, characterized in that: include: a plan generation module configured to generate a test plan for testing the power consumption of a terminal under test, the test plan including test requirements corresponding to a plurality of preset remaining power values, wherein the test requirement corresponding to each preset remaining power value includes a requirement for testing the power consumption values of the terminal under test when running a plurality of preset services; an instruction generation module configured to generate a plurality of power monitoring instructions and a plurality of test execution instructions according to the test plan, wherein each power monitoring instruction corresponds to a test execution instruction; a sending module configured to send a plurality of power monitoring instructions and a plurality of test execution instructions to the terminal under test, so that the terminal under test monitors its own remaining power based on the plurality of power monitoring instructions, and in response to its own remaining power value meeting the requirements of each power monitoring instruction, tests its own power consumption according to each corresponding test execution instruction and feeds back the test results to the test platform; A receiving module configured to receive all test results sent by the terminal under test; as well as, a power consumption calculation module, configured to calculate a final power consumption value of the terminal under test based on all test results received by the receiving module; The final power consumption value of the terminal under test is calculated based on all test results using the following formula: Where P represents the final power consumption value of the terminal under test, m represents the total number of preset remaining power values corresponding to the test requirements included in the test plan, n represents the total number of preset services that need to be run when the terminal under test performs power consumption testing in the test requirements corresponding to each preset remaining power value, and A 1i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the first preset service, B1 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the first preset service, A 2i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the second preset service, B2 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the second preset service, A ni Indicates the power consumption value of the tested terminal when running the nth preset service when its remaining power value reaches the i-th preset remaining power value, B n It indicates the power consumption ratio of the tested terminal when running the nth preset service when its remaining power value reaches each preset remaining power value. The power consumption ratio of the tested terminal when running the same preset service when its remaining power value reaches different preset remaining power values is the same, and B1+B2+…+B n =100%.
8. A terminal under test, characterized in that: include: A power monitoring module, configured to receive a plurality of power monitoring instructions sent by the test platform, and monitor the remaining power of the terminal under test based on the plurality of power monitoring instructions; and a test execution module configured to receive a plurality of test execution instructions sent by the test platform, and when the power monitoring module detects that the remaining power of the terminal under test meets the requirements of each power monitoring instruction, test the power consumption of the terminal under test according to each corresponding test execution instruction and feed back the test results to the test platform, so that the test platform receives all test results sent by the terminal under test and calculates a final power consumption value of the terminal under test based on all test results; The test platform pre-generates a test plan for testing the power consumption of the terminal under test, generates a plurality of power monitoring instructions and a plurality of test execution instructions according to the test plan, and sends the instructions to the terminal under test, wherein each power monitoring instruction corresponds to a test execution instruction, and the test plan includes test requirements corresponding to a plurality of preset remaining power values, and the test requirements corresponding to each preset remaining power value include requirements for testing the power consumption values of the terminal under test when running a plurality of preset services; The final power consumption value of the terminal under test is calculated based on all test results using the following formula: Where P represents the final power consumption value of the terminal under test, m represents the total number of preset remaining power values corresponding to the test requirements included in the test plan, n represents the total number of preset services that need to be run when the terminal under test performs power consumption testing in the test requirements corresponding to each preset remaining power value, and A 1i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the first preset service, B1 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the first preset service, A 2i represents the power consumption value of the tested terminal when the remaining power value reaches the i-th preset remaining power value to run the second preset service, B2 represents the power consumption ratio of the tested terminal when the remaining power value reaches each preset remaining power value to run the second preset service, A ni Indicates the power consumption value of the tested terminal when running the nth preset service when its remaining power value reaches the i-th preset remaining power value, B n It indicates the power consumption ratio of the tested terminal when running the nth preset service when its remaining power value reaches each preset remaining power value. The power consumption ratio of the tested terminal when running the same preset service when its remaining power value reaches different preset remaining power values is the same, and B1+B2+…+B n =100%.
9. A computer device, characterized in that: It includes a memory and a processor, wherein a computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes the terminal power consumption testing method according to any one of claims 1 to 3, or the terminal power consumption testing method according to any one of claims 4 to 6.
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 processor executes the terminal power consumption testing method according to any one of claims 1 to 3, or the terminal power consumption testing method according to any one of claims 4 to 6.