Method, apparatus, device, and storage medium for determining interactive time of application program

By acquiring and analyzing the frame time consumption and degree of discreteness measurements of the application, determining the end time point of the interactive time, solving the problems of high error, delay and inaccuracy in the prior art, achieving higher measurement accuracy and sensitivity.

CN113986696BActive Publication Date: 2025-06-10BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111127486.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-26
Publication Date
2025-06-10
Estimated Expiration
2041-09-26

AI Technical Summary

Technical Problem

In the prior art, there are problems such as high error, delay, low sensitivity and inaccuracy of interaction time (TTI).

Method used

By obtaining the time consumed time of each frame of the continuous set frame application screen from the start time point of the interactive time during the operation of the application to be tested, the discrete degree measure of the time consumed by all frames of the continuous set frame application screen is determined, and the end time point of the interaction time is determined when the time consumed and discrete degree measure values ​​of each frame meet the preset conditions.

Benefits of technology

Reduces errors in interactive time, reduces delays, and improves measurement sensitivity and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113986696B_ABST
    Figure CN113986696B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, apparatus, electronic device, and storage medium for determining the interactive time of an application program. The method includes: during the running of the application program to be tested, obtaining the time consumption of each frame of a continuously set number of frames of the application program screen starting from the start time point of the interactive time; determining a measure of the dispersion of the time consumption of all frames of the continuously set number of frames of the application program screen; if the time consumption of each frame and the measure of dispersion do not meet the preset conditions, obtaining the time consumption of each frame of a continuously set number of frames of the application program screen again starting from a preset frame of the continuously set number of frames of the application program screen, and determining the measure of dispersion until the time consumption of each frame and the measure of dispersion meet the preset conditions, and determining the time point corresponding to the first frame of the continuously set number of frames of the application program screen as the end time point of the interactive time; determining the interactive time according to the start time point and the end time point. The present disclosure reduces the error of the interactive time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of testing technologies, and in particular, to a method, apparatus, electronic device, and storage medium for determining the interactive time of an application program. Background Art

[0002] The Time to Interactive (TTI) belongs to the field of iOS and Android performance monitoring and is an important performance metric. Specifically, it starts timing from the first frame after the splash screen appears on the interface until the time when the user can operate smoothly. For video applications, the interactive time can be the duration from the first frame after startup to the user enters the selected page with smooth up and down scrolling without lag.

[0003] In related technologies, when determining the interactive time, starting from the first frame (the start point of TTI), the frame rate for consecutive 5 seconds is taken. If the frame rate is greater than 50 within 5 seconds and the average value is greater than 55, then the end time point of the first second is the end time point of the interactive time, and thus the interactive time is obtained. The perfDog performance monitoring tool can also be used for auxiliary testing. Through the perfDog performance monitoring tool, it is possible to directly view that from the opening of the application to the FPS (Frames Per Second) stabilizing as a straight line, and then the first point of this straight line is the end time point of the interactive time. The advantage of perfDog is that it is simple and easy to use. As long as the mobile phone is connected to the computer via USB, the performance data can be monitored.

[0004] FPS is calculated in seconds, so it inherently has an error of one second. In the field of performance optimization, measured by a common optimization benefit of 100 milliseconds, the error reaches about 1000 milliseconds. Secondly, when using perfDog for auxiliary testing, it is also found that this tool has problems such as latency, low sensitivity, and inaccuracy. Summary of the Invention

[0005] The present disclosure provides a method, apparatus, electronic device, and storage medium for determining the interactive time of an application program to at least solve the problems of high TTI error, latency, low sensitivity, and inaccuracy in related technologies. The technical solution of the present disclosure is as follows:

[0006] According to the first aspect of the embodiments of the present disclosure, a method for determining the interactive time of an application program is provided, including:

[0007] During the running of the application program to be tested, obtain the time consumption of each frame of consecutive set number of frames of the application program screen starting from the start time point of the interactive time;

[0008] Determine the measure of the degree of dispersion of the time consumption of all frames of the continuously set number of frames of the application screen;

[0009] If the time consumption of each frame and the measure of the degree of dispersion satisfy a preset condition, then determine the time point corresponding to the first frame of the application screen of the continuously set number of frames of the application screen as the end time point of the interactive time;

[0010] If the time consumption of each frame and the measure of the degree of dispersion do not satisfy the preset condition, then start from the preset frame of the continuously set number of frames of the application screen to obtain the time consumption of each frame of the continuously set number of frames of the application screen again, and determine the measure of the degree of dispersion until the time consumption of each frame and the measure of the degree of dispersion satisfy the preset condition, and determine the time point corresponding to the first frame of the application screen of the continuously set number of frames of the application screen obtained again as the end time point of the interactive time;

[0011] Determine the interactive time according to the start time point and the end time point.

[0012] Optionally, it further includes:

[0013] Determine the average value of the time consumption of all frames of the continuously set number of frames of the application screen;

[0014] If the time consumption of each frame and the measure of the degree of dispersion satisfy a preset condition, then determining the time point corresponding to the first frame of the application screen of the continuously set number of frames of the application screen as the end time point of the interactive time includes:

[0015] If the time consumption of each frame, the measure of the degree of dispersion, and the average value satisfy the preset condition, then determine the time point corresponding to the first frame of the application screen of the continuously set number of frames of the application screen as the end time point of the interactive time;

[0016] If the time consumption of each frame and the measure of the degree of dispersion do not satisfy the preset condition, then starting from the preset frame of the continuously set number of frames of the application screen to obtain the time consumption of each frame of the continuously set number of frames of the application screen again, and determining the measure of the degree of dispersion until the time consumption of each frame and the measure of the degree of dispersion satisfy the preset condition, and determining the time point corresponding to the first frame of the application screen of the continuously set number of frames of the application screen obtained again as the end time point of the interactive time includes:

[0017] If the time consumption of each frame, the dispersion metric value, and the average value do not meet the preset conditions, then starting from the preset frame application screen of the continuous set number of frames, obtain the time consumption of each frame of the continuous set number of frames of the application screen again, and determine the dispersion metric value and the average value until the time consumption of each frame, the dispersion metric value, and the average value meet the preset conditions, and determine the time point corresponding to the first frame application screen of the continuously obtained continuous set number of frames of the application screen as the end time point of the interactive time.

[0018] Optionally, the preset conditions are that the time consumption of each frame is less than or equal to the time consumption threshold, the dispersion metric value is less than or equal to the metric value threshold, and the average value is less than or equal to the average value threshold.

[0019] Optionally, the preset frame is the next frame after the last frame with a frame time consumption greater than the time consumption threshold in the continuous set number of frames of the application screen.

[0020] Optionally, after obtaining the time consumption of each frame of the continuous set number of frames of the application screen starting from the start time point of the interactive time, it further includes:

[0021] Display the time consumption of each frame of the continuous set number of frames of the application screen through a frame time consumption floating window.

[0022] Optionally, before obtaining the time consumption of each frame of the continuous set number of frames of the application screen starting from the start time point of the interactive time during the running of the application under test, it further includes:

[0023] Encapsulate the function code for determining the interactive time into a dynamic library, inject the dynamic library into the application under test, and re-sign the dynamic library and the application under test.

[0024] Optionally, obtaining the time consumption of each frame of the continuous set number of frames of the application screen starting from the start time point of the interactive time includes:

[0025] Start listening for the time points when the application under test calls the refresh function starting from the start time point of the interactive time;

[0026] Determine the time consumption of the corresponding frame application screen according to the time points of two adjacent calls to the refresh function;

[0027] Determine the time consumption of each frame of the continuous set number of frames of the application screen according to the above-mentioned determination method of the frame time consumption.

[0028] According to the second aspect of the embodiments of the present disclosure, there is provided a device for determining the interactive time of an application, including:

[0029] A frame time-consuming acquisition module, configured to obtain the time-consuming of each frame of a continuously set number of application screens starting from the start time point of the interactive time during the running of the application under test;

[0030] A metric value determination module, configured to determine a metric value of the dispersion degree of the time-consuming of all frames of the continuously set number of application screens;

[0031] An end point determination module, configured to, if the time-consuming of each frame and the dispersion degree metric value meet a preset condition, determine the time point corresponding to the first frame of the continuously set number of application screens as the end time point of the interactive time; if the time-consuming of each frame and the dispersion degree metric value do not meet the preset condition, start obtaining the time-consuming of each frame of a continuously set number of application screens again from a preset frame of the continuously set number of application screens, and determine the dispersion degree metric value until the time-consuming of each frame and the dispersion degree metric value meet the preset condition, and determine the time point corresponding to the first frame of the continuously set number of application screens obtained again as the end time point of the interactive time;

[0032] An interactive time determination module, configured to determine the interactive time according to the start time point and the end time point.

[0033] Optionally, the device further includes:

[0034] An average value determination module, configured to determine the average value of the time-consuming of all frames of the continuously set number of application screens;

[0035] The end point determination module is configured to perform:

[0036] If the time-consuming of each frame, the dispersion degree metric value, and the average value meet the preset condition, determine the time point corresponding to the first frame of the continuously set number of application screens as the end time point of the interactive time;

[0037] If the time-consuming of each frame, the dispersion degree metric value, and the average value do not meet the preset condition, start obtaining the time-consuming of each frame of a continuously set number of application screens again from a preset frame of the continuously set number of application screens, and determine the dispersion degree metric value and the average value until the time-consuming of each frame, the dispersion degree metric value, and the average value meet the preset condition, and determine the time point corresponding to the first frame of the continuously set number of application screens obtained again as the end time point of the interactive time.

[0038] Optionally, the preset conditions are that the time consumption of each frame is less than or equal to a time consumption threshold value, the dispersion measurement value is less than or equal to a measurement value threshold value, and the average value is less than or equal to an average value threshold value.

[0039] Optionally, the preset frame is the next frame of the last frame in the continuously set number of frames of the application screen whose frame time consumption is greater than the time consumption threshold value.

[0040] Optionally, the device further includes:

[0041] A frame time consumption display module, configured to execute and display the time consumption of each frame of the continuously set number of frames of the application screen through a frame time consumption floating window.

[0042] Optionally, the device further includes:

[0043] A dynamic library injection module, configured to execute encapsulating the function code for determining the interactive time into a dynamic library, injecting the dynamic library into the application under test, and re-signing the dynamic library and the application under test.

[0044] Optionally, the frame time consumption acquisition module includes:

[0045] A refresh function call monitoring unit, configured to execute and monitor the time point when the application under test calls the refresh function starting from the start time point of the interactive time;

[0046] A single-frame time consumption determination unit, configured to execute and determine the frame time consumption of the corresponding frame of the application screen according to the time points of two adjacent calls to the refresh function;

[0047] A continuous-frame time consumption determination unit, configured to execute and determine the time consumption of each frame of the continuously set number of frames of the application screen according to the above-mentioned method for determining the single-frame time consumption.

[0048] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including:

[0049] A processor;

[0050] A memory for storing executable instructions of the processor;

[0051] Wherein, the processor is configured to execute the instructions to implement the method for determining the interactive time of the application as described in the first aspect.

[0052] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the method for determining the interactive time of the application as described in the first aspect.

[0053] According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program or computer instructions, which when executed by a processor implement the method for determining the interactive time of an application program described in the first aspect.

[0054] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:

[0055] In the embodiments of the present disclosure, during the running of the application program to be tested, starting from the start time point of the interactive time, the time consumption of each frame of a continuously set number of frames of the application program screen is obtained, the measure value of the dispersion degree of the time consumption of all frames of the continuously set number of frames of the application program screen is determined, and when the time consumption of each frame and the measure value of the dispersion degree meet the preset conditions, the time point corresponding to the first frame of the continuously set number of frames of the application program screen is determined as the end time point of the interactive time, so as to determine the interactive time according to the start time point and the end time point. Since when the time consumption of each frame and the measure value of the dispersion degree do not meet the preset conditions, the time consumption of each frame of a continuously set number of frames is obtained again starting from a preset frame of the continuously set number of frames of the application program screen, the error is the time consumption required for the preset frame of the application program screen, which is much less than 1 second, so the error of the interactive time is reduced, and the delay is reduced, solving the problems of low sensitivity and inaccuracy.

[0056] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an improper limitation to the present disclosure.

[0058] Figure 1 is a flowchart of a method for determining the interactive time of an application program shown according to an exemplary embodiment;

[0059] Figure 2 is an example diagram of a floating window of frame time consumption in the embodiments of the present disclosure;

[0060] Figures 3a - 3d is an example diagram showing the calculation process of the interactive time through the floating window of frame time consumption in the embodiments of the present disclosure;

[0061] Figure 4 is an example diagram of the test data of the application program to be tested in an iPhone 6 mobile phone using PerfDog in the related art;

[0062] Figure 5It is a data example diagram of testing an application to be tested in an iPhone XS mobile phone using PerfDog in related technologies;

[0063] Figure 6 It is a block diagram of a device for determining the interactive time of an application shown according to an exemplary embodiment;

[0064] Figure 7 It is a block diagram of an electronic device shown according to an exemplary embodiment. Detailed implementation manners

[0065] To enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0066] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0067] Figure 1 It is a flowchart of a method for determining the interactive time of an application shown according to an exemplary embodiment. As Figure 1 shown, the method for determining the interactive time of the application can be used in electronic devices such as mobile phones and tablet computers, and includes the following steps.

[0068] In step S11, during the running of the application to be tested, starting from the start time point of the interactive time, the time consumption of each frame of the application screen for a continuously set number of frames is obtained.

[0069] Among them, the start time point can be a certain time point that needs to be tested. For example, for a short video application, it can be the time point corresponding to the first frame of the video played after the application is started. Of course, it can also be other pre-set time points. The continuously set number of frames can be the number of frames that can be refreshed in about 5 seconds. For example, it can be 300, 400, 500, etc.

[0070] During the running of the application to be tested, when reaching the start time point of the interactive time, start to obtain the time consumption of each frame of the application screen in a continuously set number of frames of the application screen, and obtain the time consumption of each frame of the continuously set number of frames.

[0071] In an exemplary embodiment, obtaining the time consumption of each frame of a continuous set number of frames of the application screen starting from the start time point of the interactive time includes: starting from the start time point of the interactive time, listening for the time points when the application under test calls the refresh function; determining the frame time consumption of the corresponding frame of the application screen according to the time points of two adjacent calls to the refresh function; and determining the time consumption of each frame of the continuous set number of frames of the application screen in the above manner of determining the frame time consumption.

[0072] When obtaining the frame time consumption, it is possible to listen for the time points when the application under test calls the refresh function, subtract the time points of two adjacent calls to the refresh function to obtain the frame time consumption of the corresponding frame of the application screen for the previous call to the refresh function in the two adjacent calls to the refresh function, and use this way of determining the frame time consumption to determine the time consumption of each frame of the continuous set number of frames of the application screen. Of course, when obtaining the time consumption of each frame of the continuous set number of frames of the application screen, it is possible that the time consumption of each frame and the measure of dispersion value do not meet the preset conditions. Therefore, it is possible to keep obtaining the frame time consumption until it is determined that the time consumption of each frame and the measure of dispersion value meet the preset conditions, and then stop listening for the calls to the refresh function of the application under test.

[0073] By listening for the calls to the refresh function of the application under test, it is possible to obtain the time points of each call to the refresh function of the application under test, and thus obtain a relatively accurate frame time consumption.

[0074] In step S12, determine the measure of dispersion value of the time consumption of all frames of the continuous set number of frames of the application screen.

[0075] Among them, the measure of dispersion value can be variance or standard deviation.

[0076] Perform statistics on the time consumption of all frames of the continuous set number of frames of the application screen, determine the average value of the time consumption of all frames of the continuous set number of frames of the application screen, and based on the time consumption of each frame of the continuous set number of frames and the average value, determine the variance or standard deviation of the time consumption of all frames of the continuous set number of frames of the application screen, so as to obtain the measure of dispersion value of the time consumption of all frames of the continuous set number of frames of the application screen.

[0077] In step S13, determine whether the time consumption of each frame and the measure of dispersion value meet the preset conditions. If not, execute step S14; if so, execute step S15.

[0078] Among them, the preset condition may be that the time consumption of each frame is less than or equal to the time consumption threshold and the dispersion measurement value is less than or equal to the measurement value threshold. The time consumption threshold can be determined according to the single-frame time consumption of movie frames. The movie frame rate is 18 - 24, generally 24 frames, so the single-frame time consumption of movie frames is: 1000ms / 24 ≈ 41.67ms. The movie frame rate is a critical point. Below the movie frame rate, the human eye can basically feel the discontinuity of the picture, that is, feel the lag. The GPU generally has 3 buffers. The current frame already occupies one buffer, that is, there are 2 remaining buffers. The human eye can generally tolerate a 2-frame delay. The time consumption of two movie frames is 41.67ms * 2 ≈ 83.33ms. Therefore, the time consumption threshold can be 84ms.

[0079] In step S14, starting from the preset frame application program screen of the continuous set number of frames, obtain the time consumption of each frame of the application program screen of the continuous set number of frames again, and determine the dispersion measurement value, and then loop to execute step S13 and step S14.

[0080] When the time consumption of each frame and the dispersion measurement value do not meet the preset conditions, starting from the preset frame application program screen of the continuous set number of frames obtained last time, obtain the time consumption of each frame of the application program screen of the continuous set number of frames again, and determine the dispersion measurement value of the time consumption of all frames of the application program screen of the continuous set number of frames obtained this time, and then loop to execute step S13 and step S14 until the time consumption of each frame and the dispersion measurement value meet the preset conditions. Among them, the preset frame can be a preset frame in the application program screen of the continuous set number of frames, or it can also be a calculated frame. For example, the preset frame can be the next frame of the last frame in the application program screen of the continuous set number of frames whose frame time consumption is greater than the time consumption threshold. The error of the interactive time is only the frame time consumption of one frame of the application program screen. When the application program to be tested runs stably and can respond to user operations in time, the frame time consumption is about 16.67ms, so the error is only 16.67ms.

[0081] In step S15, determine the time point corresponding to the first frame of the application program screen of the continuous set number of frames as the end time point of the interactive time.

[0082] When the time consumption of each frame and the dispersion measurement value meet the preset conditions, it means that within a period of time corresponding to the application program screen of the continuous set number of frames, the time consumption of each frame is less than or equal to the time consumption threshold, and the time consumption of each frame also fluctuates relatively little. At this time, the time point corresponding to the first frame of the application program screen of the continuous set number of frames can be determined as the end time point of the interactive time. Among them, the time point corresponding to the first frame of the application program screen can be the start time point or the end time point corresponding to the first frame of the application program screen.

[0083] In step S16, according to the start time point and the end time point, the interactive time is determined.

[0084] Subtract the start time point from the end time point to obtain the interactive time. The interactive time is an important performance metric for performance testing. Based on the interactive time, the performance of the application under test can be understood.

[0085] The method for determining the interactive time of an application provided by this exemplary embodiment obtains the time consumption of each frame of a continuously set number of frames of the application screen starting from the start time point of the interactive time during the running of the application under test, determines the measure of the dispersion of the time consumption of all frames of the continuously set number of frames of the application screen, and when the time consumption of each frame and the measure of dispersion meet the preset conditions, determines the time point corresponding to the first frame of the continuously set number of frames of the application screen as the end time point of the interactive time, so as to determine the interactive time according to the start time point and the end time point. Since when the time consumption of each frame and the measure of dispersion do not meet the preset conditions, the time consumption of each frame of a continuously set number of frames is obtained again starting from a preset frame of the continuously set number of frames of the application screen, the error, which is the time consumption required for the preset frame of the application screen, is much less than 1 second, so the error of the interactive time is reduced and the delay is reduced, solving the problems of low sensitivity and inaccuracy.

[0086] Based on the above technical solution, the method further includes: determining the average value of the time consumption of all frames of the continuously set number of frames of the application screen;

[0087] If the time consumption of each frame and the measure of dispersion meet the preset conditions, determining the time point corresponding to the first frame of the continuously set number of frames of the application screen as the end time point of the interactive time includes:

[0088] If the time consumption of each frame, the measure of dispersion, and the average value meet the preset conditions, determining the time point corresponding to the first frame of the continuously set number of frames of the application screen as the end time point of the interactive time;

[0089] If the time taken for each frame and the measure of dispersion do not meet the preset conditions, then starting from the preset frame of the application screen with the continuously set number of frames, obtain the time taken for each frame of the application screen with the continuously set number of frames again, and determine the measure of dispersion, until the time taken for each frame and the measure of dispersion meet the preset conditions. Determine the time point corresponding to the first frame of the application screen of the application screen with the continuously set number of frames obtained again as the end time point of the interactive time, including: If the time taken for each frame, the measure of dispersion, and the average value do not meet the preset conditions, then starting from the preset frame of the application screen with the continuously set number of frames, obtain the time taken for each frame of the application screen with the continuously set number of frames again, and determine the measure of dispersion and the average value, until the time taken for each frame, the measure of dispersion, and the average value meet the preset conditions. Determine the time point corresponding to the first frame of the application screen of the application screen with the continuously set number of frames obtained again as the end time point of the interactive time.

[0090] Among them, the preset conditions are that the time taken for each frame is less than or equal to the time threshold, the measure of dispersion is less than or equal to the measure threshold, and the average value is less than or equal to the average threshold. The time threshold is determined according to the time taken for a single frame of 2 movie frames, the average threshold is determined according to the time taken for a single frame of the movie frame. The time threshold can be, for example, 84 ms, the average threshold can be 42 ms, the measure of dispersion can be variance, and the measure threshold can be 10. Each threshold can be dynamically adjusted according to requirements. The preset frame is the next frame after the last frame in the application screen with the continuously set number of frames whose frame time is greater than the time threshold.

[0091] When determining the end time point of the interactive time, the average value of the time taken for all frames of the application screen with the continuously set number of frames can also be calculated simultaneously, and it is simultaneously determined whether the time taken for each frame, the measure of dispersion, and the average value meet the preset conditions. When the time taken for each frame, the measure of dispersion, and the average value simultaneously meet the preset conditions, determine the time point corresponding to the first frame of the application screen of the application screen with the continuously set number of frames as the end time point of the interactive time. If the time taken for each frame, the measure of dispersion, and the average value of the application screen with the continuously set number of frames cannot simultaneously meet the preset conditions, then the application screen with the continuously set number of frames can be obtained again starting from the preset frame of the application screen with the continuously set number of frames. Since the preset frame is the next frame after the last frame in the application screen with the continuously set number of frames whose frame time is greater than the time threshold, obtaining the application screen with the continuously set number of frames again starting from the next frame can more quickly and accurately determine the end time point of the interactive time. By simultaneously judging the average value on the basis of the time taken for each frame and the measure of dispersion, the accuracy of the determined interactive time can be further improved.

[0092] On the basis of the above technical solution, after obtaining the time consumption of each frame of the continuously set number of frames of the application screen starting from the start time point of the interactive time, the following is further included: displaying the time consumption of each frame of the continuously set number of frames of the application screen through a frame time consumption floating window.

[0093] Wherein, the frame time consumption floating window is a window suspended on the application screen for visually displaying the time consumption of each frame. For example, it can be a top-level window suspended on the application screen.

[0094] After obtaining the time consumption of each frame of the application screen, the time consumption of this frame is promptly displayed in the frame time consumption floating window. The window display area of the frame time consumption floating window can display the time consumption of each frame of the continuously set number of frames. In the frame time consumption floating window, the time consumption threshold corresponding to the time consumption can also be displayed.

[0095] Figure 2 It is an example diagram of the frame time consumption floating window in an embodiment of the present disclosure. As Figure 2 shown, in the frame time consumption floating window, the time consumption of each frame of the continuously set number of frames of the application screen, the threshold line corresponding to the time consumption threshold, the total number of milliseconds from the start (i.e., the start time point) to the current time, the total number of frames from the start (i.e., the start time point) to the current time, the current maximum frame time consumption, and the current frame time consumption can be displayed. Figure 2 In the example, the time consumption threshold is 84 ms, the continuously set number of frames is 300 consecutive frames, the width of the frame time consumption floating window is 300 frames. If there is no frame time consumption higher than the threshold line within the entire floating window, then the first frame is the end time point of the interactive time.

[0096] Figures 3a - 3d It is an example diagram of the calculation process of the interactive time displayed through the frame time consumption floating window in an embodiment of the present disclosure. As Figure 3a shown, when the TTI time consumption is 5151 ms, there are still frames with a time consumption greater than 84 ms in the floating window, and there may be more in the future. At this time, the end time point of the TTI cannot be determined. As Figure 3b shown, when the TTI time consumption is 7961 ms, there are still frames with a time consumption greater than 84 ms in the floating window, and there may be more in the future. At this time, the end time point of the TTI cannot be determined. As Figure 3cAs shown, at a TTI duration of 12484 ms, the last frame with a duration greater than 84 ms (this frame is called the last frame) appears in the floating window. After that, there are no more frames with a duration greater than 84 ms. Therefore, the calculation of 300 consecutive frames that meet the condition must start from the frame immediately following this last frame (which can be called the head frame). If 300 frames including the head frame can meet the condition, then the head frame is the end frame of the TTI, and the TTI duration is approximately the current 12484 ms. However, the final TTI duration will be less than 12484 ms because, as can be seen from the figure, more than two frames have appeared after the time point of the screenshot and after the last frame. As Figure 3d shown, there are no more single frames above the threshold line after the last frame. The final calculated result is 12417 ms, which is very close to the above analysis result. Among them, the last frame refers to the last single frame with a duration greater than the duration threshold. After it, there are no more single frames with a duration greater than the duration threshold. It is also possible that there is no last frame. If the application under test is very smooth from the beginning and there are no single frames with a duration greater than the duration threshold in 300 consecutive frames (about 5 s), then there is no last frame at this time.

[0097] And Figures 3a - 3d correspondingly, the test tool PerfDog in the related technology is used to test the application under test in the same time period. The test mobile phone is iPhone6, and PerfDog also records some data during the entire TTI stage. However, it is impossible to distinguish from the curve where the start time point of the TTI is and where the end time point of the TTI is. Therefore, it is necessary to artificially create a start point. The solution adopted here is to suspend the process for 3 s after the end of the first frame rendering and then resume it. Therefore, on the CPU curve, it can be clearly seen that there is a horizon of about 3 s. As Figure 4 shown, then the start time point of the TTI starts from the end point of this horizon (shown in box 1). However, the end time point of the TTI cannot be determined from the figure. We can first roughly calculate 20 s, which is the range shown in box 2 in the figure. Within this range, there are no obvious fluctuations in the frame duration (Frame Time) and FPS of PerfDog. In other words, PerfDog believes that there is no obvious stuttering in the picture within these 20 s. However, this is inconsistent with the conclusion of the screen recording during the test. It can be clearly felt from the screen recording that there is stuttering. It can be seen that PerfDog has problems with low sensitivity and inaccuracy. Similarly, the corresponding test was also carried out using the mobile phone iPhoneXS. As Figure 5 shown, the data shows that the CPU horizon is less than 3 s, indicating that PerfDog has a delay in obtaining data and is inaccurate.

[0098] By displaying the duration of each frame of the application screen with a continuous set number of frames through the floating window of frame duration, the dynamic display of frame duration is realized during the process of determining the interactive time.

[0099] Based on the above technical solution, before obtaining the time consumption of each frame of the application screen with a continuous set number of frames starting from the start time point of the interactive time during the operation of the application under test, it further includes: encapsulating the function code for determining the interactive time into a dynamic library, injecting the dynamic library into the application under test, and re-signing the dynamic library and the application under test.

[0100] The function code for determining the interactive time can be encapsulated into a dynamic library, and the dynamic library can be injected into the package of the application under test using a specific dynamic library injection command to obtain a new package. At this time, since the content of the package has been changed, the signature also needs to be updated. A signature identifier is regenerated according to the content of the new package, and the original signature identifier of the application under test is replaced with the newly generated signature identifier to achieve re-signing of the dynamic library and the application under test. After re-signing, it can run on any terminal such as a mobile phone.

[0101] By encapsulating the function code for determining the interactive time into a dynamic library and injecting the dynamic library into the application under test using the dynamic library injection method for re-signing, any application under test can be tested in this way, and without modifying the source code of the application under test, the fairness and justice of the test can also be ensured.

[0102] Figure 6 It is a block diagram of a device for determining the interactive time of an application according to an exemplary embodiment. Refer to Figure 6 As shown in the figure, the device includes a frame time consumption acquisition module 61, a metric value determination module 62, an end point determination module 63, and an interactive time determination module 64.

[0103] The frame time consumption acquisition module 61 is configured to execute obtaining the time consumption of each frame of the application screen with a continuous set number of frames starting from the start time point of the interactive time during the operation of the application under test;

[0104] The metric value determination module 62 is configured to execute determining the dispersion metric value of the time consumption of all frames of the application screen with the continuous set number of frames;

[0105] The end point determination module 63 is configured to execute: if the time consumption per frame and the dispersion metric value satisfy a preset condition, determine the time point corresponding to the first application screen of the continuous set number of frames of application screens as the end time point of the interactive time; if the time consumption per frame and the dispersion metric value do not satisfy the preset condition, obtain the time consumption per frame of the continuous set number of frames of application screens again starting from a preset frame of the continuous set number of frames of application screens, and determine the dispersion metric value until the time consumption per frame and the dispersion metric value satisfy the preset condition, and determine the time point corresponding to the first application screen of the continuously obtained continuous set number of frames of application screens as the end time point of the interactive time;

[0106] The interactive time determination module 64 is configured to execute: determine the interactive time according to the start time point and the end time point.

[0107] Optionally, the device further includes:

[0108] An average value determination module, configured to execute: determine the average value of the time consumption of all frames of the continuous set number of frames of application screens;

[0109] The end point determination module is configured to execute:

[0110] If the time consumption per frame, the dispersion metric value, and the average value satisfy the preset condition, determine the time point corresponding to the first application screen of the continuous set number of frames of application screens as the end time point of the interactive time;

[0111] If the time consumption per frame, the dispersion metric value, and the average value do not satisfy the preset condition, obtain the time consumption per frame of the continuous set number of frames of application screens again starting from a preset frame of the continuous set number of frames of application screens, and determine the dispersion metric value and the average value until the time consumption per frame, the dispersion metric value, and the average value satisfy the preset condition, and determine the time point corresponding to the first application screen of the continuously obtained continuous set number of frames of application screens as the end time point of the interactive time.

[0112] Optionally, the preset condition is that the time consumption per frame is less than or equal to a time consumption threshold, the dispersion metric value is less than or equal to a metric value threshold, and the average value is less than or equal to an average value threshold.

[0113] Optionally, the preset frame is the next frame after the last frame with a frame time consumption greater than the time consumption threshold in the continuous set number of frames of application screens.

[0114] Optionally, the device further includes:

[0115] The single-frame time-consuming display module is configured to execute the display of the time-consuming of each frame of the application screen of the continuously set number of frames through a floating window of frame time-consuming.

[0116] Optionally, the device further includes:

[0117] The dynamic library injection module is configured to execute encapsulating the function code for determining the interactive time into a dynamic library, injecting the dynamic library into the application under test, and re-signing the dynamic library and the application under test.

[0118] Optionally, the frame time-consuming acquisition module includes:

[0119] The refresh function call monitoring unit is configured to execute monitoring the time point when the application under test calls the refresh function starting from the start time point of the interactive time;

[0120] The single-frame time-consuming determination unit is configured to execute determining the time-consuming of the corresponding frame of the application screen according to the time points of two adjacent calls to the refresh function;

[0121] The continuous-frame time-consuming determination unit is configured to execute determining the time-consuming of each frame of the application screen of the continuously set number of frames in accordance with the above-mentioned method for determining the frame time-consuming.

[0122] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0123] Figure 7 It is a block diagram of an electronic device shown according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0124] Referring to Figure 7 , the electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input / output (I / O) interface 712, a sensor component 714, and a communication component 716.

[0125] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above - mentioned methods. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.

[0126] The memory 704 is configured to store various types of data to support the operation of the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non - volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read - only memory (EEPROM), erasable programmable read - only memory (EPROM), programmable read - only memory (PROM), read - only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0127] The power component 706 provides power to various components of the electronic device 700. The power component 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 700.

[0128] The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of the touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 708 includes a front - facing camera and / or a rear - facing camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front - facing camera and / or the rear - facing camera can receive external multimedia data. Each front - facing camera and rear - facing camera can be a fixed optical lens system or have focal length and optical zoom capabilities.

[0129] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 700 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 704 or transmitted via the communication component 716. In some embodiments, the audio component 710 further includes a speaker for outputting audio signals.

[0130] The I / O interface 712 provides an interface between the processing component 702 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a power button, and a lock button.

[0131] The sensor component 714 includes one or more sensors for providing status assessments of various aspects of the electronic device 700. For example, the sensor component 714 can detect the on / off state of the electronic device 700, the relative positioning of components, such as the display and keypad of the electronic device 700. The sensor component 714 can also detect a change in the position of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and the temperature change of the electronic device 700. The sensor component 714 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 714 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 714 can further include an acceleration sensor, a gyro sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0132] The communication component 716 is configured to facilitate communication between the electronic device 700 and other devices in a wired or wireless manner. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0133] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components for performing the method for determining the interactive time of the above application program.

[0134] In an exemplary embodiment, there is also provided a computer-readable storage medium including instructions, such as a memory 704 including instructions, and the above instructions can be executed by a processor 720 of the electronic device 700 to complete the method for determining the interactive time of the above application program. Optionally, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0135] In an exemplary embodiment, there is also provided a computer program product including a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, the method for determining the interactive time of the above application program is implemented.

[0136] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed herein. The specification and embodiments are only to be considered exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0137] It should be understood that the present invention is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.

Claims

1. A method for determining the interactive time of an application program, characterized in that, it includes: During the running of the application program to be tested, obtain the time consumption of each frame of a continuous set number of frames of the application program screen starting from the start time point of the interactive time; Determine the measure of the degree of dispersion of the time consumption of all frames of the continuous set number of frames of the application program screen; If the time consumption of each frame and the measure of the degree of dispersion meet the preset conditions, determine the time point corresponding to the first frame of the application program screen of the continuous set number of frames of the application program screen as the end time point of the interactive time; If the time consumption of each frame and the measure of the degree of dispersion do not meet the preset conditions, start obtaining the time consumption of each frame of a continuous set number of frames of the application program screen again from the preset frame of the continuous set number of frames of the application program screen, and determine the measure of the degree of dispersion until the time consumption of each frame and the measure of the degree of dispersion meet the preset conditions, and determine the time point corresponding to the first frame of the application program screen of the continuously obtained continuous set number of frames of the application program screen as the end time point of the interactive time; Determine the interactive time according to the start time point and the end time point.

2. The method according to claim 1, characterized in that, it further includes: Determine the average value of the time consumption of all frames of the continuous set number of frames of the application program screen; If the time consumption of each frame and the measure of the degree of dispersion meet the preset conditions, determining the time point corresponding to the first frame of the application program screen of the continuous set number of frames of the application program screen as the end time point of the interactive time includes: If the time consumption of each frame, the measure of the degree of dispersion, and the average value meet the preset conditions, determine the time point corresponding to the first frame of the application program screen of the continuous set number of frames of the application program screen as the end time point of the interactive time; If the time consumption of each frame and the measure of the degree of dispersion do not meet the preset conditions, start obtaining the time consumption of each frame of a continuous set number of frames of the application program screen again from the preset frame of the continuous set number of frames of the application program screen, and determine the measure of the degree of dispersion until the time consumption of each frame and the measure of the degree of dispersion meet the preset conditions, and determining the time point corresponding to the first frame of the application program screen of the continuously obtained continuous set number of frames of the application program screen as the end time point of the interactive time includes: If the time consumption of each frame, the measure of the degree of dispersion, and the average value do not meet the preset conditions, start obtaining the time consumption of each frame of a continuous set number of frames of the application program screen again from the preset frame of the continuous set number of frames of the application program screen, and determine the measure of the degree of dispersion and the average value until the time consumption of each frame, the measure of the degree of dispersion, and the average value meet the preset conditions, and determine the time point corresponding to the first frame of the application program screen of the continuously obtained continuous set number of frames of the application program screen as the end time point of the interactive time.

3. The method according to claim 2, characterized in that, The preset conditions are that the time consumption of each frame is less than or equal to a time consumption threshold value, the dispersion measurement value is less than or equal to a measurement value threshold value, and the average value is less than or equal to an average value threshold value.

4. The method according to claim 3, wherein, the preset frame is the next frame of the last frame in the continuously set number of frames of the application program screen whose frame time consumption is greater than the time consumption threshold value.

5. The method according to claim 1, wherein, after obtaining the time consumption of each frame of the continuously set number of frames of the application program screen starting from the start time point of the interactive time, it further includes: displaying the time consumption of each frame of the continuously set number of frames of the application program screen through a frame time consumption floating window.

6. The method according to claim 1, wherein, before obtaining the time consumption of each frame of the continuously set number of frames of the application program screen starting from the start time point of the interactive time during the running of the application program to be tested, it further includes: encapsulating the function code for determining the interactive time into a dynamic library, injecting the dynamic library into the application program to be tested, and re-signing the dynamic library and the application program to be tested.

7. The method according to claim 1, wherein, obtaining the time consumption of each frame of the continuously set number of frames of the application program screen starting from the start time point of the interactive time includes: starting from the start time point of the interactive time, listening for the time points when the application program to be tested calls the refresh function; determining the frame time consumption of the corresponding frame of the application program screen according to the time points of two adjacent calls to the refresh function; determining the time consumption of each frame of the continuously set number of frames of the application program screen according to the above-mentioned method for determining the frame time consumption.

8. An apparatus for determining the interactive time of an application program, wherein, it includes: a frame time consumption obtaining module configured to execute obtaining the time consumption of each frame of the continuously set number of frames of the application program screen starting from the start time point of the interactive time during the running of the application program to be tested; a measurement value determining module configured to execute determining the dispersion measurement value of the time consumption of all frames of the continuously set number of frames of the application program screen; an end point determining module configured to execute if the time consumption of each frame and the dispersion measurement value meet the preset conditions, then determining the time point corresponding to the first frame of the application program screen of the continuously set number of frames as the end time point of the interactive time; if the time consumption of each frame and the dispersion measurement value do not meet the preset conditions, then starting from the preset frame of the continuously set number of frames of the application program screen, obtaining the time consumption of each frame of the continuously set number of frames of the application program screen again, and determining the dispersion measurement value until the time consumption of each frame and the dispersion measurement value meet the preset conditions, and determining the time point corresponding to the first frame of the application program screen obtained again as the end time point of the interactive time; an interactive time determining module configured to execute determining the interactive time according to the start time point and the end time point.

9. The apparatus according to claim 8, wherein, the apparatus further includes: An average value determination module, configured to determine the average value of the time taken for all frames of the continuous set number of frames of the application screen; The end point determination module is configured to perform: If the time taken for each frame, the measure of dispersion, and the average value satisfy the preset condition, then determine the time point corresponding to the first frame of the continuous set number of frames of the application screen as the end time point of the interactive time; If the time taken for each frame, the measure of dispersion, and the average value do not satisfy the preset condition, then start obtaining the time taken for each frame of the continuous set number of frames of the application screen again from the preset frame of the continuous set number of frames of the application screen, and determine the measure of dispersion and the average value until the time taken for each frame, the measure of dispersion, and the average value satisfy the preset condition, and determine the time point corresponding to the first frame of the continuous set number of frames of the application screen obtained again as the end time point of the interactive time.

10. The device according to claim 9, wherein, The preset condition is that the time taken for each frame is less than or equal to the time threshold, the measure of dispersion is less than or equal to the measure threshold, and the average value is less than or equal to the average threshold.

11. The device according to claim 10, wherein, The preset frame is the next frame after the last frame in the continuous set number of frames of the application screen whose frame time is greater than the time threshold.

12. The device according to claim 8, wherein, The device further includes: A frame time display module, configured to perform displaying the time taken for each frame of the continuous set number of frames of the application screen through a frame time floating window.

13. The device according to claim 8, wherein, The device further includes: A dynamic library injection module, configured to perform encapsulating the function code for determining the interactive time into a dynamic library, injecting the dynamic library into the application under test, and re-signing the dynamic library and the application under test.

14. The device according to claim 8, wherein, The frame time acquisition module includes: A refresh function call monitoring unit, configured to perform monitoring the time points when the application under test calls the refresh function starting from the start time point of the interactive time; A single-frame time determination unit, configured to perform determining the time taken for the corresponding frame of the application screen according to the time points of two adjacent calls to the refresh function; A continuous-frame time determination unit, configured to perform determining the time taken for each frame of the continuous set number of frames of the application screen according to the above-mentioned method for determining the frame time.

15. An electronic device, wherein, includes: A processor; A memory for storing instructions executable by the processor; wherein, the processor is configured to execute the instructions to implement the method for determining the interactive time of the application as described in any one of claims 1 to 7.

16. A computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the method for determining the interactive time of an application program according to any one of claims 1 to 7.

17. A computer program product, comprising a computer program or computer instructions, characterized in that when the computer program or computer instructions are executed by a processor, the method for determining the interactive time of an application program according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Interaction method, terminal and storage medium

    CN113094237A

  • Terminal fluency determination method and device, electronic equipment and storage medium

    CN113176909A