Application performance testing methods, apparatus and equipment
By automatically simulating the functionality of other applications through data collection and mapping, the problem of low accuracy in testing live streaming applications and other applications on the same device is solved, reducing labor costs and improving test accuracy and user experience.
Patent Information
- Application Number
- CN202110467930.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-28
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2041-04-28
AI Technical Summary
In existing technologies, when live streaming applications run on the same electronic device as other applications, performance testing relies on manual operation, which leads to human error, resulting in low testing accuracy and high costs. It is also difficult to reproduce the functionality of other applications, affecting the user experience during the live streaming process.
By collecting performance parameter values through testing applications and based on the mapping relationship between the number of task blocks and performance parameter values, the functionality of other applications can be automatically simulated. Real-world scenarios can be reproduced using task blocks to detect the performance parameters of electronic devices, reducing the cost of manual intervention and improving testing accuracy.
It enables automated testing when live streaming applications are broadcasting other applications, reducing manual costs, improving the accuracy and reliability of testing, and enhancing the user experience.
Smart Images

Figure CN115248770B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of live streaming technology, and in particular to a method, apparatus, and device for testing the performance of an application. Background Technology
[0002] With the continuous development of internet technology, users often use live streaming apps to broadcast the functions of other apps, such as playing games on live streaming apps or playing music on live streaming apps. This makes it convenient to share content through live streaming, which helps enrich users' entertainment life.
[0003] During the live stream, although the live streaming application and other applications run independently, they also influence each other because they operate on the same electronic device. For example, performance parameters such as the central processing unit (CPU) and memory can compete for and interfere with each other. Therefore, testing the performance parameters of the electronic device while other applications are performing their functions is crucial to analyzing their impact on the live streaming application and ensuring the smooth execution of the live stream.
[0004] Currently, testing the performance parameters of electronic devices when live streaming applications broadcast other applications to complete their functions requires testers to reproduce the functions of other applications during the live streaming of the live streaming application, and to recreate the live streaming scenario of the functions of other applications. For example, testers repeatedly play games during the live streaming, and the parameters such as the route, operation, and screen of the game played by the testers each time need to be consistent.
[0005] However, the above testing methods rely on manual operation, which is prone to human differences, such as advanced players and non-advanced players. They also waste a lot of manpower and time. Furthermore, it is difficult to keep the functionality of other applications constant during the live broadcast, making it difficult to reproduce the functionality of other applications during the live broadcast. This reduces the accuracy of the test, affects the live broadcast process of the application, and is not conducive to the user experience. Summary of the Invention
[0006] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a method, apparatus, and device for testing the performance of an application.
[0007] In one aspect, this disclosure provides a method for testing the performance of an application, applied to an electronic device, which has a test application, a live streaming application, and other applications installed thereon;
[0008] The method includes:
[0009] The test application responds to the test command and collects multiple performance parameter values generated by the live streaming application running a test scenario with other applications.
[0010] The test application determines the number of task blocks required to simulate a test scenario based on the mapping relationship between the number of task blocks and the performance parameter values of electronic devices, and the number of task blocks corresponding to the multiple performance parameter values.
[0011] The test application starts the task blocks corresponding to the number of task blocks in sequence according to the collection order of multiple performance parameter values, and obtains the simulation test results of the test scenario.
[0012] Using the method provided in the first aspect, after receiving a test instruction, the test application can collect multiple performance parameter values generated by a real live streaming application running another application in a test scenario. Based on the mapping relationship between the number of task blocks on the electronic device and the performance parameter values, the test application determines the number of task blocks corresponding to each performance parameter value. Since a test scenario can be simulated based on the number of task blocks, the test application can sequentially start the task blocks corresponding to each of the multiple task block numbers according to the collection order of the multiple performance parameter values to obtain a simulated test result of the test scenario. Therefore, the test application can automate the testing of other applications' functional implementation during live streaming. By reproducing the functional implementation of other applications during the live streaming process through task blocks, and detecting the performance parameters of the electronic device when testing other applications' functional implementation, the test application can not only control and reduce the impact of other applications on the live streaming application, improving the user experience of using the live streaming application to stream other applications, but also reduce the cost of manual intervention and improve the accuracy and reliability of the test.
[0013] In one possible design, the method further includes: the test application responding to a self-test command to determine the mapping relationship.
[0014] In one possible design, the test application determines the mapping relationship, including:
[0015] The test application launches j task blocks in the electronic device, where j is a positive integer;
[0016] After the test application starts the first preset duration of j task blocks, the performance parameter values corresponding to j and j task blocks are bound and recorded.
[0017] The test application updates j to j+1 until the performance parameter value is greater than or equal to the preset threshold. The mapping relationship is determined based on the performance parameter values corresponding to all j and j task blocks in the bound record.
[0018] In one possible design, the mathematical calculations are the same in each task block.
[0019] In one possible design, the mathematical calculations include at least one of: sine and cosine calculations, Fourier transforms, or logarithmic calculations.
[0020] In one possible design, the method further includes: the test application acquiring the current temperature of the electronic device; and the test application determining the mapping relationship corresponding to the current temperature.
[0021] In one possible design, the test application sequentially launches task blocks corresponding to the number of task blocks, according to the collection order of multiple performance parameter values, to obtain a simulated test result of the test scenario, including:
[0022] The test application determines at the initial moment of the (i+1)th test period whether the number of first task blocks corresponding to the (i+1)th test period is greater than the number of second task blocks corresponding to the ith test period. i is a positive integer, and the initial value of i is 1. The number of first task blocks and the number of second task blocks are adjacent and different according to the collection order of multiple performance parameter values.
[0023] If so, the test application will increase the number of task blocks corresponding to the difference between the number of first task blocks and the number of second task blocks, so that the task blocks corresponding to the number of first task blocks will be started.
[0024] If not, the test application stops starting the task blocks corresponding to the difference between the number of second task blocks and the number of first task blocks, so that the task blocks corresponding to the number of first task blocks can be started.
[0025] After the test application starts the second preset duration of the task block corresponding to the first task block quantity value, update i to i+1 until the total duration of all test periods is greater than or equal to the duration required to simulate one test scenario.
[0026] In one possible design, the method further includes: the test application responding to the replay instruction repeatedly executing the step N times of sequentially starting task blocks corresponding to the number values of multiple task blocks according to the acquisition order of multiple performance parameter values, and obtaining N simulation test results of the test scenario, where N is a positive integer.
[0027] Secondly, this disclosure provides an application performance testing device for electronic devices, which have live streaming applications and other applications installed in them;
[0028] The application performance testing apparatus includes:
[0029] The acquisition module is used to respond to test commands and acquire multiple performance parameter values generated by the live streaming application during a test scenario where other applications are running live.
[0030] The determination module is used to determine the number of task blocks required to simulate a test scenario based on the mapping relationship between the number of task blocks and performance parameter values of electronic devices, and to determine the number of task blocks corresponding to multiple performance parameter values respectively.
[0031] The processing module is used to sequentially start the task blocks corresponding to the number of task blocks respectively, according to the collection order of multiple performance parameter values, so as to obtain the simulation test result of the test scenario.
[0032] In one possible design, the determination module is also used to determine the mapping relationship in response to a self-test command.
[0033] In one possible design, a module is defined, specifically used to start j task blocks in the electronic device, where j is a positive integer; after the j task blocks have started for a first preset duration, the performance parameter values corresponding to j and the j task blocks are bound and recorded; j is updated to j+1 until the performance parameter values are greater than or equal to a preset threshold, and the mapping relationship is determined based on all the bound records of the performance parameter values corresponding to j and the j task blocks.
[0034] In one possible design, the mathematical calculations are the same in each task block.
[0035] In one possible design, the mathematical calculations include at least one of: sine and cosine calculations, Fourier transforms, or logarithmic calculations.
[0036] In one possible design, the acquisition module is also used to acquire the current temperature of the electronic device; the determination module is also used to determine the mapping relationship corresponding to the current temperature.
[0037] In one possible design, the processing module is specifically used at the initial moment of the (i+1)th test period to determine whether the number of first task blocks corresponding to the (i+1)th test period is greater than the number of second task blocks corresponding to the i-th test period, where i is a positive integer and its initial value is 1. The number of first and second task blocks are adjacent and different according to the collection order of multiple performance parameter values. When the number of first task blocks is greater than the number of second task blocks, the module adds a task block corresponding to the difference between the number of first and second task blocks to start, so that the task block corresponding to the number of first task blocks is started. When the number of first task blocks is less than the number of second task blocks, the module stops starting the task block corresponding to the difference between the number of second and first task blocks to start, so that the task block corresponding to the number of first task blocks is started. After starting the task block corresponding to the number of first task blocks for a second preset duration, i is updated to i+1, until the total duration of all test periods is greater than or equal to the duration required to simulate one test scenario.
[0038] In one possible design, the processing module is also used to respond to the replay instruction by repeatedly executing the steps of starting the task blocks corresponding to the number of task blocks respectively N times according to the acquisition order of multiple performance parameter values, so as to obtain the N simulation test results of the test scenario, where N is a positive integer.
[0039] The beneficial effects of the application performance testing apparatus provided in the second aspect and the various possible designs of the second aspect can be found in the first aspect and the various possible implementations of the first aspect, and will not be repeated here.
[0040] Thirdly, this disclosure provides an electronic device, including: a memory and a processor; the memory is used to store program instructions; the processor is used to invoke the program instructions in the memory to cause the electronic device to execute the performance testing method of the application program in the first aspect and any possible design of the first aspect.
[0041] Fourthly, this disclosure provides a computer storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform a performance testing method for an application program in the first aspect and any possible design of the first aspect.
[0042] Fifthly, this disclosure provides a computer program product that, when run on a computer, causes the computer to execute the performance testing method of the application program in the first aspect and any possible design of the first aspect.
[0043] In a sixth aspect, this disclosure provides a chip system comprising: a processor; and, when the processor executes computer instructions stored in a memory, an electronic device performs a performance testing method for the application program in any possible design of the first aspect. Attached Figure Description
[0044] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0045] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 A flowchart illustrating the performance testing method for an application provided in this embodiment of the disclosure;
[0047] Figure 2 A schematic diagram illustrating the working principle of the test application for collecting multiple performance parameter values provided in this embodiment of the disclosure;
[0048] Figure 3 A schematic diagram of time curves for multiple performance parameter values provided in the embodiments of this disclosure;
[0049] Figure 4A schematic diagram of the performance parameter values after the task block is started, provided in an embodiment of this disclosure;
[0050] Figure 5 A flowchart illustrating the performance testing method for an application provided in this embodiment of the disclosure;
[0051] Figure 6 A schematic diagram illustrating the working principle of determining mapping relationships for test applications provided in this embodiment of the disclosure;
[0052] Figure 7 A flowchart illustrating the performance testing method for an application provided in this embodiment of the disclosure;
[0053] Figure 8 This is a schematic diagram illustrating the working principle of the application performance testing method provided in this embodiment of the disclosure;
[0054] Figures 9A-9C A schematic diagram of the time curves of N simulation test results provided in this embodiment of the disclosure;
[0055] Figure 10 This is a schematic diagram of the structure of the application performance testing device provided in the embodiments of this disclosure. Detailed Implementation
[0056] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0057] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0058] For example, this disclosure provides a method, apparatus, device, computer storage medium, and computer program product for testing the performance of an application. By using task blocks to automatically simulate the live streaming application's implementation of other applications' functions, the functionality of other applications can be reproduced during the live streaming process. This allows for the detection of the performance parameters (such as CPU or memory) of the electronic device when other applications complete their functionality, thereby controlling the performance consumption of other applications in the electronic device. This helps reduce the interaction between the live streaming application and other applications, ensures the accuracy and reliability of the test, reduces the cost of manual intervention, and improves the efficiency of the test.
[0059] The performance testing method for the application disclosed herein is executed by a test application in an electronic device. Furthermore, the electronic device also has a live streaming application and other applications installed. This disclosure does not limit the specific implementation of the live streaming application and other applications.
[0060] The test application provides acquisition, input, and replay functions to reproduce the functionality of other applications during a live stream. The acquisition function collects performance parameters when another application performs a function once during the live stream. The input function inputs the mapping relationship between task blocks in the electronic device and performance parameters. The replay function reproduces the functionality of other applications during the live stream using task blocks.
[0061] This disclosure does not limit the specific implementation of each task block. In some embodiments, the mathematical calculations in each task block are the same. These mathematical calculations may include, but are not limited to, at least one of: sine and cosine calculations, Fourier transforms, or logarithmic calculations.
[0062] The electronic devices can be tablets, mobile phones, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart TVs, smart screens, high-definition TVs, 4K TVs, smart speakers, smart projectors, etc. This disclosure does not impose any restrictions on the specific types of electronic devices.
[0063] This disclosure does not limit the type of operating system used in electronic devices. Examples include Android, Linux, Windows, and iOS.
[0064] First, some of the terms used in the disclosure will be explained below to facilitate understanding by those skilled in the art.
[0065] 1. CPU: One of the main components of a computer, its main function is to interpret computer instructions and process data in computer software.
[0066] 2. RAM: This is the internal storage that directly exchanges data with the CPU. RAM can be read and written at any time and is very fast. It is usually used as a temporary data storage medium for the operating system or other running applications.
[0067] 3. Performance Parameters (i.e., performance consumption parameters): The operating system can dynamically adjust CPU and memory, but CPU and memory resources are not unlimited. Within limited resources, other applications compete with the live streaming application. When resources are insufficient, the use of other applications can affect the live streaming process, such as causing stuttering.
[0068] Based on the foregoing description, this disclosure will use an example of a test application, combined with the accompanying drawings and application scenarios, to elaborate in detail on the performance testing method of the application provided in this disclosure.
[0069] See also Figure 1 , Figure 1 This is a flowchart illustrating the performance testing method for an application provided in an embodiment of this disclosure. Figure 1 As shown, the application performance testing methods provided in this disclosure may include:
[0070] S101. The test application responds to the test command and collects multiple performance parameter values generated by the live application running a test scenario once.
[0071] When a live streaming application starts broadcasting a test scenario run by another application, the test application can receive test instructions. These test instructions can be sent by the tester to the test application, such as when the tester triggers a test button in the test application's user interface; they can also be obtained by the test application from monitoring the live streaming application; or they can be sent by the live streaming application to the test application. This disclosure does not limit the scope of these instructions.
[0072] Upon receiving a test command, the test application can collect multiple performance parameter values generated by the live streaming application broadcasting another application running a test scenario. These performance parameter values represent the numerical magnitudes of the performance parameters, and these multiple values reflect the actual performance of the other application during a single test scenario run in the live stream.
[0073] The test scenario refers to another application performing a real-world functionality test, such as a game application playing a real game or a music application playing a real song. Furthermore, multiple performance parameter values can be recorded using tables, formulas, or matrices.
[0074] This disclosure does not limit the method by which the test application collects multiple performance parameter values.
[0075] Below, in conjunction with Figure 2 and Figure 3 This section details the specific implementation process of collecting multiple performance parameter values in the test application.
[0076] See also Figure 2 , Figure 2This is a schematic diagram illustrating the working principle of the test application for collecting multiple performance parameter values provided in this embodiment of the disclosure. Figure 3 A time curve diagram of multiple performance parameter values provided in the embodiments of this disclosure. Figure 2 and Figure 3 In the test scenario, a game application was used to play a game, the performance parameters were set to the game's CPU utilization, and the duration of a game was set to 600 seconds.
[0077] like Figure 2 As shown, when the live streaming application starts streaming a game application running once, the test application can start timing and collect the game's CPU usage every 10 seconds, and mark the data. Figure 3 The curve in the image. The test application determines whether the total collection time is greater than or equal to 600 seconds. If the total collection time is less than 600 seconds, the test application can continue to collect the game's CPU utilization. If the total collection time is greater than or equal to 600 seconds, the test application can stop collecting the game's CPU utilization and end the collection process of multiple performance parameter values.
[0078] In summary, the test application uses Table 1 and Figure 3 It can display multiple performance parameter values.
[0079] Table 1 Values of Multiple Performance Parameters
[0080] Time (unit: seconds) Game CPU usage 0 47% 0-10 35% 10-20 16% 20-30 44% 30-40 29% 40-50 22% 50-60 42% 60-70 22% 70-80 44% 80-90 50% 90-100 8%
[0081] S102. Test the mapping relationship between the number of task blocks and performance parameter values of electronic devices, and determine the number of task blocks required to simulate a test scenario, corresponding to the multiple performance parameter values respectively.
[0082] Since the test application stores the mapping relationship between the number of task blocks and the performance parameter values of electronic devices, the test application can determine the number of task blocks corresponding to each of the multiple performance parameter values based on this mapping relationship and the collected multiple performance parameter values, that is, simulate the number of tasks corresponding to each of the multiple performance parameter values required for a test scenario.
[0083] The mapping relationship described above refers to the correspondence between task blocks and performance parameters. After an electronic device initiates a task block, it can consume performance parameters. Generally, the larger the number of task blocks, the greater the performance parameter consumption of the electronic device. Furthermore, this mapping relationship can be represented in the form of tables, formulas, or matrices.
[0084] S103. The test application starts the task blocks corresponding to the number of task blocks respectively according to the collection order of multiple performance parameter values, and obtains the simulation test result of the test scenario.
[0085] Since the multiple task block quantity values correspond to multiple performance parameter values respectively, the test application can determine that the collection order of the multiple performance parameter values is the same as the usage order of the multiple task block quantity values.
[0086] Therefore, after determining the number of tasks required to simulate a test scenario, the test application can sequentially start the task blocks corresponding to the number of task blocks based on the order in which they are used, until all the determined number of task blocks has been used.
[0087] In summary, after each task block corresponding to a CNC value is started, the test application can collect a corresponding simulated performance parameter value, and multiple simulated performance parameter values can be used as a simulation test result of the test scenario.
[0088] The application performance testing method disclosed herein allows the test application to collect multiple performance parameter values generated by a real live streaming application running another application during a test scenario after receiving a test instruction. Based on the mapping relationship between the number of task blocks on the electronic device and the performance parameter values, the test application determines the number of task blocks corresponding to each performance parameter value. Since a test scenario can be simulated based on the number of task blocks, the test application can sequentially start the task blocks corresponding to each of the multiple task block numbers according to the collection order of the multiple performance parameter values to obtain a simulated test result of the test scenario. Therefore, the test application can automate the testing of other applications' functional implementation during a live streaming application's broadcast. By reproducing the functional implementation of other applications during the live streaming process through task blocks, and detecting the performance parameters of the electronic device when testing other applications' functional implementation, the impact of other applications on the live streaming application can be reduced, improving the user experience of using the live streaming application to broadcast other applications. Furthermore, it helps reduce the cost of manual intervention and improves the accuracy and reliability of the test.
[0089] In this disclosure, the performance parameter values collected by multiple task blocks after starting the stack are not equal to the product of the performance parameters collected by starting a single task block and the number of task blocks. Therefore, this disclosure can view a task block as a mathematical computation task consisting of a thread and a loop. Figure 4 As shown, assuming the performance parameter is set to CPU, after one task block starts, the CPU usage of a thread + loop mathematical calculation task is 1%. After two task blocks start, the CPU usage of a thread + loop mathematical calculation task is 1.5%, not 2%. After three task blocks start, the CPU usage of a thread + loop mathematical calculation task is 1.8%, not 3%.
[0090] Furthermore, different electronic devices will consume different performance parameters after the same number of task blocks are started. Therefore, the number of task blocks depends on the performance of the electronic device.
[0091] In summary, Figure 1 Before step S102, the test application needs to redetermine the above mapping relationship in order to prepare to determine the number of multiple task blocks corresponding to the electronic device.
[0092] In some embodiments, the test application may receive self-test instructions from the tester, such as when the tester triggers a self-test button in the test application's user interface to generate a self-test instruction, or when it is necessary to determine the number of multiple task blocks; this disclosure does not limit this. Thus, upon receiving the self-test instruction, the test application can determine the aforementioned mapping relationship.
[0093] This disclosure does not limit the specific implementation method for determining the above mapping relationship.
[0094] Below, in conjunction with Figure 5 This section details the specific implementation process by which the test application determines the above mapping relationship.
[0095] See also Figure 5 , Figure 5 This is a flowchart illustrating the performance testing method for an application provided in an embodiment of this disclosure. Figure 5 As shown, the application performance testing methods provided in this disclosure may include:
[0096] S201. Test the application to start j task blocks in the electronic device, where j is a positive integer.
[0097] The test device can initiate j task blocks in the electronic device. When the test device initiates j task blocks in the electronic device for the first time, it can initiate an initial number of j task blocks in the electronic device.
[0098] In this disclosure, the initial value of j is not limited. In some embodiments, when the initial value of j is 1, the test application may start one task block in the electronic device for the first time.
[0099] S202. After the test application starts the first preset duration of j task blocks, bind and record the performance parameter values corresponding to j and j task blocks.
[0100] After the j task blocks have started for the first preset duration, the test application can record the performance parameter values corresponding to j and j task blocks, as well as the binding relationship between j and the performance parameter values corresponding to j task blocks, so as to realize the binding record of the performance parameter values corresponding to j task blocks.
[0101] This disclosure does not specify a particular value for the first preset duration. Furthermore, the test application can use methods such as tables, matrices, or formulas for recording.
[0102] S203. Test whether the performance parameter value is greater than or equal to the preset threshold.
[0103] Since performance parameter values in real-world electronic device scenarios will not exceed preset thresholds, testing applications do not need to test scenarios where performance parameter values exceed preset thresholds.
[0104] The preset threshold refers to the allowable or maximum value that the performance parameter can achieve in the electronic device. This disclosure does not specify the exact value of the preset threshold. For example, when the performance parameter is CPU, the preset threshold can be 100%. When the performance parameter is memory, the preset threshold can be the maximum storage capacity of the memory in the electronic device.
[0105] In summary, the test application can determine whether the performance parameter value is greater than or equal to the preset threshold.
[0106] If the performance parameter value is less than the preset threshold, the test application proceeds to step S204. If the performance parameter value is greater than or equal to the preset threshold, the test application proceeds to step S205.
[0107] S204, Test application updates j to j+1.
[0108] When the performance parameter value is less than the preset threshold, the test application can update j to j+1, so that the test application can continue to execute step S201 to start more task blocks.
[0109] S205. The test application determines the mapping relationship based on the performance parameter values corresponding to all j and j task blocks of the binding record.
[0110] When the performance parameter value is greater than or equal to a preset threshold, the test application can stop launching any more task blocks. Therefore, based on the performance parameter values corresponding to all j and j task blocks bound to the record, the test application can determine the aforementioned mapping relationship.
[0111] The mapping relationships described above can be recorded using tables, formulas, or matrices. For example, a test application can directly use the performance parameter values corresponding to all j and j task blocks in the bound records as the mapping relationship. Alternatively, the test application can directly determine the correspondence between j and the performance parameter values corresponding to the j task blocks based on the performance parameter values corresponding to all j and j task blocks in the bound records. The test application can then define this correspondence as the mapping relationship described above.
[0112] Below, in conjunction with Figure 6 This section details the specific implementation process of determining the mapping relationship in the test application.
[0113] See also Figure 6 , Figure 6 A schematic diagram illustrating the working principle of determining mapping relationships for test applications provided in this embodiment of the disclosure. Figure 6 In the settings, the performance parameter is set to CPU utilization, with a preset threshold of 100%.
[0114] like Figure 6 As shown, the test application can create a task block every 10 seconds. After each task block starts, the test application obtains the CPU utilization rate, binds and records the number of task blocks and the CPU utilization rate, and determines whether the CPU utilization rate is greater than or equal to a preset threshold, that is, whether the CPU utilization rate is full.
[0115] When CPU utilization is less than the CPU usage threshold, the test application creates a new task block and executes the above process. When CPU utilization is greater than or equal to the CPU usage threshold, the test application stops creating new task blocks.
[0116] In summary, Table 2 shows the number of task blocks and CPU utilization in the bound records. Therefore, based on the task block count and CPU utilization in Table 2, the test application can determine the aforementioned mapping relationship.
[0117] Table 2 shows the mapping relationships above.
[0118] Task block count value CPU utilization 1 0.3% 2 0.8% 3 1.1% 4 1.8% … … 500 99.3% … … 553 100%
[0119] In summary, after completing its self-test, the test application can determine the aforementioned mapping relationship. Therefore, the test application can identify the performance parameter value with the smallest difference from a collected performance parameter value from Table 2, and then determine the number of task blocks corresponding to that performance parameter value. Thus, based on the above method, the test application can determine the number of task blocks corresponding to each of the collected performance parameter values.
[0120] Furthermore, since the performance parameters of electronic devices differ at different temperatures, based on the description of the above embodiments, the test application can store a mapping relationship corresponding to each temperature within a temperature range.
[0121] The aforementioned temperature range includes all temperatures that the electronic device can reach. The mapping relationship between each temperature within the aforementioned temperature range and the actual temperature can be established using... Figure 5 The embodiments described herein are not limited thereto.
[0122] In summary, the testing application can collect multiple performance parameter values as well as the current temperature of the electronic device. Therefore, based on the current temperature, the testing application can determine a mapping relationship corresponding to that temperature.
[0123] Based on the description of the above embodiments, the test application can be implemented in various ways. Figure 1 Step S103 is shown.
[0124] Below, in conjunction with Figure 7 The document details the implementation process of the test application sequentially starting task blocks corresponding to the number of task blocks, according to the collection order of multiple performance parameter values.
[0125] See also Figure 7 , Figure 7 This is a flowchart illustrating the performance testing method for an application provided in an embodiment of this disclosure. Figure 7 As shown, the application performance testing methods provided in this disclosure may include:
[0126] S301. At the initial moment of the (i+1)th test period, the test application determines whether the number of first task blocks corresponding to the (i+1)th test period is greater than the number of second task blocks corresponding to the ith test period. Here, i is a positive integer, initially set to 1, and the number of first and second task blocks are adjacent and different according to the collection order of multiple performance parameter values.
[0127] The testing equipment can sequentially activate task blocks corresponding to multiple task block quantity values, starting from the first test period. The duration of each test period is a second preset duration, meaning that a task block corresponding to one task block quantity can be activated for the second preset duration. This second preset duration is related to the acquisition frequency of multiple performance parameter values. The acquisition frequency of multiple performance parameter values refers to the frequency of acquiring performance parameter values during a live broadcast of a real-world functional implementation, such as acquiring performance parameter values every 10 seconds, so that, according to the usage order of the task block quantity values, the task block corresponding to one task block quantity value is activated every 10 seconds.
[0128] In addition, the maximum total duration of all test periods can be set to the total duration of a single actual function implementation, i.e., the total duration of collecting performance parameter values, such as 600s.
[0129] Therefore, after the task block corresponding to the second task block quantity value of the i-th test period starts for the second preset duration, the test device can determine at the beginning of the i+1 test period whether the first task block quantity value of the i+1 test period is greater than the second task block quantity value of the i-th test period, so as to determine whether task blocks need to be added or deleted.
[0130] Specifically, the first task block quantity value and the second task block quantity value are adjacent and different according to the acquisition order of multiple performance parameter values, and the second task block quantity value is used before the first task block quantity value. That is, according to the acquisition order of multiple performance parameter values, the first task block quantity value used after the second task block quantity value can be determined, and correspondingly, the second task block quantity value used before the first task block quantity value can also be determined.
[0131] If the number of first task blocks is greater than the number of second task blocks, the test application can execute step S302; if the number of first task blocks is less than the number of second task blocks, the test application can execute step S303.
[0132] S302. The test application adds a task block corresponding to the difference between the number of first task blocks and the number of second task blocks, so that the task block corresponding to the number of first task blocks is started.
[0133] When the number of first task blocks is greater than the number of second task blocks, the test application can determine that new task blocks need to be added. Therefore, the test application can increase the number of task blocks launched by the difference between the number of first and second task blocks, while maintaining the launch of task blocks corresponding to the number of second task blocks, thus enabling the test application to launch task blocks corresponding to the number of first task blocks.
[0134] S303. The test application stops starting the task block corresponding to the difference between the number of second task blocks and the number of first task blocks, so that the task block corresponding to the number of first task blocks can be started.
[0135] When the number of first task blocks is less than the number of second task blocks, the test application can determine that it needs to stop the already started task blocks. Therefore, the test application can stop starting task blocks corresponding to the difference between the number of second and first task blocks, allowing the test application to start task blocks corresponding to the number of first task blocks.
[0136] It should be noted that when the number of the first task block is equal to the number of the second task block, the test application does not need to add new task blocks or stop the already started task blocks; it only needs to keep the already started task blocks running.
[0137] S304. After the test application starts the second preset duration of the task block corresponding to the first task block quantity value, determine whether the total duration of all test periods is greater than or equal to the duration required to simulate a test scenario.
[0138] After starting the second preset duration of the task block corresponding to the first task block quantity value, the test application can determine whether the total duration of all test periods is greater than or equal to the duration required to simulate a test scenario, and then determine whether to continue to start a new test period.
[0139] If the total duration of all test periods is less than the duration required to simulate one test scenario, the test application can execute step S305; if the total duration of all test periods is greater than or equal to the duration required to simulate one test scenario, the test application can execute step S306.
[0140] S305, Test application updates i to i+1.
[0141] If the total duration of all test periods is less than the duration required to simulate one test scenario, the test application can update i to i+1, so that the test application can continue to execute step S301 to start the task blocks corresponding to other task block values.
[0142] S306, Test application stops testing.
[0143] When the total duration of all test periods is greater than or equal to the duration required to simulate one test scenario, the test application can stop testing, and one test scenario can be simulated.
[0144] In summary, by following the collection order of multiple performance parameter values, the test application can sequentially start the task blocks corresponding to the number of task blocks, thus obtaining a simulation test result of the test scenario.
[0145] Below, in conjunction with Figure 8 This section details the specific implementation process of simulating a test scenario using a test application.
[0146] See also Figure 8 , Figure 8 This is a schematic diagram illustrating the working principle of the application performance testing method provided in the embodiments of this disclosure. Figure 8 In the test scenario, a game application was set to play a game once, with a second preset duration of 10 seconds and a total predicted duration of 600 seconds.
[0147] like Figure 8 As shown, the test application can collect multiple performance parameter values from a live streaming game application during a single game session, i.e., read game data. The test application can also read the mapping relationship between the number of task blocks and performance parameter values of the electronic device, i.e., read the lookup table. Therefore, based on the game data and the lookup table, the test application can determine appropriate values for the number of task blocks. The test application can determine if the number of task blocks in the current time period is less than the number of task blocks in the next time period. If so, the test application starts the task blocks corresponding to the difference. If not, the test application reclaims the task blocks corresponding to the difference. After 10 task blocks corresponding to the number of task blocks in the next time period are started, the test application can determine if the total duration of all time periods reaches 600 seconds. If not, the test application continues to acquire the number of task blocks for the next time period. If so, the test application ends the test process, thus simulating a test scenario.
[0148] It should be noted that the test application can also determine a suitable number of task blocks by collecting multiple performance parameter values in the order they are collected, rather than the total number of task blocks.
[0149] Based on the description of the above embodiments, the test application can also re-enact the process of simulating multiple test scenarios. In some embodiments, the test application can receive a re-enactment instruction from the tester, such as when the tester triggers a re-enactment button in the test application's user interface, or it can be automatically generated after completing a simulation of a test scenario; this disclosure does not limit this. Thus, after receiving the re-enactment instruction, the test application can repeatedly execute the process based on... Figure 1 In step S103, the task blocks corresponding to the number of task blocks are initiated N times in the order of collecting multiple performance parameter values, where N is a positive integer. Thus, the test application can obtain N simulation test results for the test scenario.
[0150] The simulated performance parameter values from the N simulation test results can be found in [reference needed]. Figures 9A-9C A time curve diagram. Figures 9A-9C In the test scenario, a game application was used to play a game, and the performance parameter was set to the game's CPU utilization.
[0151] In conclusion, Figures 9A-9C The three curves in the example and Figure 3 The curve trends are largely the same. Therefore, the test application achieves stable reenactment of a simulated test scenario, reducing manpower consumption.
[0152] For example, this disclosure provides an application performance testing apparatus.
[0153] See also Figure 10 , Figure 10 This is a schematic diagram of the application performance testing device provided in this embodiment of the disclosure. The application performance testing device of this disclosure can be installed in an electronic device, and the electronic device has live streaming applications and other applications installed, thus enabling the above-mentioned... Figures 1-9C The application performance testing method in this embodiment corresponds to the operation of a test application in an electronic device.
[0154] like Figure 10 As shown, the application performance testing device 100 provided in this disclosure may include: a data acquisition module 101, a determination module 102, and a processing module 103.
[0155] The acquisition module 101 is used to collect multiple performance parameter values generated by the live application running a test scenario once in response to the test command.
[0156] The determination module 102 is used to determine the number of task blocks required to simulate a test scenario based on the mapping relationship between the number of task blocks and the performance parameter values of the electronic device;
[0157] The processing module 103 is used to sequentially start the task blocks corresponding to the number of task blocks respectively according to the collection order of multiple performance parameter values, so as to obtain a simulation test result of the test scenario.
[0158] In some embodiments, the determining module 102 is further configured to determine the mapping relationship in response to a self-test command.
[0159] In some embodiments, the determining module 102 is specifically used to start j task blocks in the electronic device, where j is a positive integer; after the j task blocks have been started for a first preset duration, the performance parameter values corresponding to j and the j task blocks are bound and recorded; j is updated to j+1 until the performance parameter value is greater than or equal to a preset threshold, and the mapping relationship is determined based on all the bound records of the performance parameter values corresponding to j and the j task blocks.
[0160] In some embodiments, the mathematical calculations are the same in each task block.
[0161] In some embodiments, mathematical calculations include at least one of sine and cosine calculations, Fourier transforms, or logarithmic calculations.
[0162] In some embodiments, the acquisition module 101 is further configured to acquire the current temperature of the electronic device; the determination module 102 is further configured to determine the mapping relationship corresponding to the current temperature.
[0163] In some embodiments, the processing module 103 is specifically used to determine, at the initial moment of the (i+1)th test period, whether the number of first task blocks corresponding to the (i+1)th test period is greater than the number of second task blocks corresponding to the i-th test period, where i is a positive integer and its initial value is 1. The number of first task blocks and the number of second task blocks are adjacent and different according to the collection order of multiple performance parameter values. When the number of first task blocks is greater than the number of second task blocks, the processing module 103 increases the number of task blocks corresponding to the difference between the number of first and second task blocks to start the task blocks corresponding to the number of first task blocks. When the number of first task blocks is less than the number of second task blocks, the processing module 103 stops the processing module 103 from starting the task blocks corresponding to the difference between the number of second and first task blocks to start the task blocks corresponding to the number of first task blocks. After starting the task blocks corresponding to the number of first task blocks for a second preset duration, the processing module 103 updates i to i+1 until the total duration of all test periods is greater than or equal to the duration required to simulate one test scenario.
[0164] In some embodiments, the processing module 103 is further configured to, in response to a replay instruction, repeatedly execute step N times of sequentially starting task blocks corresponding to the number values of multiple task blocks according to the acquisition order of multiple performance parameter values, and obtain N simulation test results of the test scenario, where N is a positive integer.
[0165] The application performance testing device provided in this disclosure can execute the above method embodiments. Its specific implementation principle and technical effect can be found in the above method embodiments, and will not be repeated here.
[0166] For example, this disclosure provides an electronic device including: one or more processors; a memory; and one or more computer programs; wherein the one or more computer programs are stored in the memory; and when the one or more processors execute the one or more computer programs, the electronic device causes the electronic device to implement the performance testing method of the application described in the preceding embodiments.
[0167] For example, this disclosure provides a chip system applied to an electronic device including memory and sensors; the chip system includes: a processor; and a performance testing method for the application executed by the processor in the preceding embodiments.
[0168] For example, this disclosure provides a computer-readable storage medium having a computer program stored thereon, the computer program being processed by a processor to cause an electronic device to execute a performance testing method for the application described in the preceding embodiments.
[0169] For example, this disclosure provides a computer program product that, when run on a computer, causes the computer to execute the application of the preceding embodiments for performance testing.
[0170] In the above embodiments, all or part of the functionality can be implemented by software, hardware, or a combination of software and hardware. When implemented using software, it can be implemented wholly or partially in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this disclosure is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0171] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0172] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A performance testing method for an application, characterized in that, Applied to electronic devices, which have installed testing applications, live streaming applications, and other applications; The method includes: The test application responds to the test command and collects multiple performance parameter values generated by the live streaming application broadcasting the other application running a test scenario once. The test application determines the number of task blocks required to simulate the test scenario once, based on the mapping relationship between the number of task blocks and the performance parameter values of the electronic device; wherein, the task blocks are used to automatically simulate the function implementation of the live streaming application to broadcast other applications. The test application sequentially starts the task blocks corresponding to the number of task blocks respectively, according to the collection order of the multiple performance parameter values, to obtain a simulation test result of the test scenario; wherein, the test application is used to determine whether the number of task blocks in the current time period is less than the number of task blocks in the next time period. If so, the test application starts the task block corresponding to the difference between the two. If not, the test application reclaims the task block corresponding to the difference between the two, until the total duration of all test periods is greater than or equal to the duration required to simulate the test scenario once. The number of task blocks in the current time period is different from the number of task blocks in the next time period.
2. The method according to claim 1, characterized in that, The method further includes: The test application responds to a self-test command and determines the mapping relationship.
3. The method according to claim 2, characterized in that, The test application determines the mapping relationship, including: The test application initiates j task blocks in the electronic device, where j is a positive integer; The test application binds and records the performance parameter values corresponding to j and the j task blocks after the j task blocks have been started for a first preset time. The test application updates j to j+1 until the performance parameter value is greater than or equal to a preset threshold, and determines the mapping relationship based on all j in the bound records and the performance parameter values corresponding to the j task blocks.
4. The method according to claim 3, characterized in that, The mathematical calculations are the same in each task block.
5. The method according to claim 4, characterized in that, The mathematical calculations include at least one of sine and cosine calculations, Fourier transforms, or logarithmic calculations.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: The test application collects the current temperature of the electronic device; The test application determines the mapping relationship corresponding to the current temperature.
7. The method according to any one of claims 1-5, characterized in that, The test application sequentially starts the task blocks corresponding to the number of task blocks, according to the collection order of the multiple performance parameter values, to obtain a simulation test result of the test scenario, including: The test application determines at the initial moment of the (i+1)th test period whether the number of first task blocks corresponding to the (i+1)th test period is greater than the number of second task blocks corresponding to the ith test period, where i is a positive integer and the initial value of i is 1. The number of first task blocks and the number of second task blocks are adjacent and different according to the collection order of the multiple performance parameter values. If so, the test application will increase the number of task blocks to be started by the difference between the number of the first task blocks and the number of the second task blocks, so that the task blocks corresponding to the number of the first task blocks will be started. If not, the test application stops starting the task blocks corresponding to the difference between the second task block quantity value and the first task block quantity value, so that the task blocks corresponding to the first task block quantity value can be started. After the test application starts the second preset duration of the task block corresponding to the first task block quantity value, it updates i to i+1 until the total duration of all test periods is greater than or equal to the duration required to simulate the test scenario once.
8. The method according to any one of claims 1-5, characterized in that, The method further includes: The test application responds to the replay command by repeatedly executing the step N times, which involves sequentially starting the task blocks corresponding to the number of task blocks, according to the acquisition order of the multiple performance parameter values, and obtaining N simulation test results for the test scenario, where N is a positive integer.
9. A performance testing device for an application, characterized in that, Applied to electronic devices, which have installed testing applications, live streaming applications, and other applications; The device includes: The acquisition module is used to collect multiple performance parameter values generated by the live streaming application running the test scenario once. The determining module is used to determine, based on the mapping relationship between the number of task blocks and performance parameter values of the electronic device, the number of task blocks required to simulate the test scenario once, corresponding to the multiple performance parameter values respectively; wherein, the task blocks are used to automatically simulate the function implementation of the live streaming application to broadcast other applications; The processing module is used to sequentially start task blocks corresponding to the number of task blocks respectively according to the collection order of the multiple performance parameter values, so as to obtain a simulation test result of the test scenario; wherein, the test application is used to determine whether the number of task blocks in the current time period is less than the number of task blocks in the next time period. If so, the test application starts the task block corresponding to the difference between the two. If not, the test application reclaims the task block corresponding to the difference between the two, until the total duration of all test periods is greater than or equal to the duration required to simulate the test scenario once. The number of task blocks in the current time period is different from the number of task blocks in the next time period.
10. An electronic device, comprising: One or more processors; Memory; And one or more computer programs; wherein the one or more computer programs are stored in the memory; characterized in that, when the one or more processors execute the one or more computer programs, the electronic device causes the electronic device to implement the performance testing method of the application as described in any one of claims 1-8.
11. A computer storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the performance testing method for the application as described in any one of claims 1-8.
12. A computer program product, characterized in that, When the computer program product is run on a computer, the computer performs the performance testing method for the application as described in any one of claims 1-8.
Citation Information
Patent Citations
Test method and system
CN108073502A