CN109933537B - Stuck detection method, related device, equipment and computer readable medium - Google Patents

Stuck detection method, related device, equipment and computer readable medium Download PDF

Info

Publication number
CN109933537B
CN109933537B CN201910259036.4A CN201910259036A CN109933537B CN 109933537 B CN109933537 B CN 109933537B CN 201910259036 A CN201910259036 A CN 201910259036A CN 109933537 B CN109933537 B CN 109933537B
Authority
CN
China
Prior art keywords
segment
display sub
stuck
display
segments
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910259036.4A
Other languages
Chinese (zh)
Other versions
CN109933537A (en
Inventor
吴志栩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910259036.4A priority Critical patent/CN109933537B/en
Publication of CN109933537A publication Critical patent/CN109933537A/en
Application granted granted Critical
Publication of CN109933537B publication Critical patent/CN109933537B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the application discloses a stuck detection method, a related device, equipment and a computer readable medium, wherein the method comprises the following steps: dividing a display segment into N display sub-segments, wherein the display segment is a multi-frame picture displayed by a device in a first time period from the time when the device detects a first operation to the time when the device responds to the first operation; n is an integer greater than 1; measuring the frame rate of each display sub-segment, and determining the display sub-segment with the measured frame rate smaller than a preset threshold value as the display sub-segment with the pause; calculating a stuck result according to the display sub-segment with stuck in the N display sub-segments; wherein the stuck result is used to characterize the stuck severity. By implementing the method and the device, the extra performance overhead in the prior art when the application program is measured during the pause can be avoided, and the detection efficiency is improved.

Description

Stuck detection method, related device, equipment and computer readable medium
Technical Field
The present application relates to the field of computer application technologies, and in particular, to a stuck detection method, a related apparatus, a device, and a computer-readable medium.
Background
With the high-speed development of network technologies, application programs installed on intelligent terminals, such as mobile phones, tablet computers and wearable devices, show diversified development trends in both functional design and visual design, and aim to meet the basic requirements of users and improve better user experience for the users. An Application Not Responding (ANR) phenomenon of an Application refers to a phenomenon that a display page of a smart terminal is delayed and a frame loss occurs when a specific function is executed. Specifically, the phenomenon that the application is stuck means that the execution time of the application in response to the user operation exceeds a preset threshold of the smart terminal. The preset threshold value of the intelligent terminal refers to the preset time for processing a single event by the intelligent terminal. In most cases, the application program can restore itself to normal after a while. If the application continues to maintain the stuck phenomenon after a moment of time, this will cause a higher level of warning, resulting in the user's operation not being performed successfully.
In the prior art, an implementation procedure of a stuck detection method for an application program may include: firstly, measuring the time interval of drawing every two adjacent display interfaces; then, the time interval between every two adjacent display interface renderings is compared with a preset time interval (for example, the preset time interval is 16ms, which represents a standard frame rate of 60 frames/second), and when the time interval is greater than the preset time interval, it is determined that the application program has a stuck phenomenon. It can be understood that if the generation time between frames and frame pictures is much longer than 16ms, a continuous frame loss phenomenon occurs, and in this case, the display interface of the application program is severely jammed. As shown in fig. 1, accidental loss of one or two frames does not bring a pause feeling; as shown in (c), when the frame rate (FPS) is lower than 30 Frames/sec, a noticeable click feeling is generated. In practical application, the method needs to measure the generation time of each frame of picture, determine the time interval between every two adjacent display interface drawings based on the generation time of each frame of picture, and compare the time interval with a preset time interval one by one to determine whether the jam occurs, and the whole implementation process not only involves complicated measurement, calculation and analysis processes, but also includes too frequent data recording, which is easy to bring extra performance overhead to an application program.
Disclosure of Invention
The embodiment of the application provides a stuck detection method, a related device, equipment and a computer readable medium, which can avoid the extra performance overhead in the prior art when an application program is stuck, and improve the detection efficiency.
In a first aspect, an embodiment of the present application provides a stuck detection method, where the method includes:
dividing a display segment into N display sub-segments, wherein the display segment is a multi-frame picture displayed by a device in a first time period from the time when the device detects a first operation to the time when the device responds to the first operation; n is an integer greater than 1;
measuring the frame rate of each display sub-segment, and determining the display sub-segment with the measured frame rate smaller than a preset threshold value as the display sub-segment with the pause;
calculating a stuck result according to the display sub-segment with stuck in the N display sub-segments; wherein the stuck result is used to characterize the stuck severity.
According to the embodiment of the application, after the display segments displayed on the screen of the device are segmented, the frame rate of each display sub-segment in the N display sub-segments is measured, the display sub-segment with the frame rate smaller than the preset threshold value is determined as the display sub-segment with the pause, and then the pause result is calculated according to the display sub-segment with the pause.
In one possible implementation manner, the measuring the frame rate of each display sub-segment includes:
obtaining the rendering times of each display sub-fragment;
and determining the frame rate according to the rendering times of each display sub-segment and the duration of each display sub-segment.
In one possible implementation manner, the calculating a stuck result according to a display sub-segment in which stuck occurs in the N display sub-segments includes:
calculating the total pause time length according to the display sub-segments with pause in the N display sub-segments;
and determining a stuck result according to the duration of the display segment and the total stuck duration.
In one possible implementation manner, the determining a stuck result according to the duration of the display segment and the total stuck duration includes:
upon determining the stuck result, calculating according to the following formula:
Figure BDA0002012097020000031
wherein b represents the stuck result, TbRepresents the total duration of the stuck time, TtIndicating the duration of the display segment.
In one possible implementation manner, the calculating a stuck result according to a display sub-segment in which stuck occurs in the N display sub-segments further includes:
calculating the total number M of display sub-segments with blockage according to the display sub-segments with blockage in the N display sub-segments; wherein M is a positive integer less than or equal to N;
and determining the stuck result according to the N display sub-segments and the total number M of the display sub-segments with stuck.
In one possible implementation manner, the duration of any one of the N display sub-segments is not more than 250 ms.
In one possible implementation manner, the display segment is a multi-frame picture displayed in the first time period when the device runs the first application; before determining the display sub-segment with the frame rate of measurement being less than the preset threshold as the display sub-segment with the stuck occurrence, the method further includes:
and determining a preset threshold corresponding to the first application according to the corresponding relation between the preset application on the equipment and the threshold.
In a second aspect, an embodiment of the present application provides a stuck detection apparatus, which includes means for performing the method of the first aspect. Specifically, the apparatus may include:
the device comprises a dividing unit, a display unit and a display unit, wherein the dividing unit is used for dividing a display segment into N display sub-segments, the display segment is a multi-frame picture displayed by a device in a first time period, and the first time period is from the time when the device detects a first operation to the time when the device responds to the first operation; n is an integer greater than 1;
a measuring unit for measuring a frame rate of each display sub-segment;
the determining unit is used for determining the display sub-segment with the measurement frame rate smaller than the preset threshold value as the display sub-segment with the pause;
the calculating unit is used for calculating a stuck result according to the display sub-segment with stuck in the N display sub-segments; wherein the stuck result is used to characterize the stuck severity.
In one possible implementation manner, the measurement unit includes:
an obtaining unit, configured to obtain the rendering times of each display sub-segment;
a first determining unit, configured to determine the frame rate according to the rendering times of each display sub-segment and the duration of each display sub-segment.
In one possible implementation manner, the calculation unit includes:
the first calculating unit is used for calculating the total pause time length according to the display sub-segment with pause in the N display sub-segments;
the second determining unit is used for determining a pause result according to the duration of the display segment and the total pause duration;
in one possible implementation manner, the second determining unit is specifically configured to:
upon determining the stuck result, calculating according to the following formula:
Figure BDA0002012097020000041
wherein b represents the stuck result, TbRepresents the total duration of the stuck time, TtIndicating the duration of the display segment.
In one possible implementation manner, the computing unit further includes:
the second calculating unit is used for calculating the total number M of display sub-segments with blockage according to the display sub-segments with blockage in the N display sub-segments; wherein M is a positive integer less than or equal to N;
and the third determining unit is used for determining the stuck result according to the N display sub-segments and the total number M of the display sub-segments with stuck.
In one possible implementation manner, the duration of any one of the N display sub-segments is not more than 250 ms.
In one possible implementation manner, the display segment is a multi-frame picture displayed in the first time period when the device runs the first application; before the determining unit determines the display sub-segment with the frame rate less than the preset threshold as the display sub-segment with the stuck occurrence, the apparatus further includes:
and the fourth determining unit is used for determining a preset threshold corresponding to the first application according to the corresponding relation between the preset application on the equipment and the threshold.
In a third aspect, an embodiment of the present application provides a stuck detection apparatus, including a processor, an input apparatus, an output apparatus, and a memory, where the processor, the input apparatus, the output apparatus, and the memory are connected to each other, where the memory is used to store a computer program that supports the apparatus to execute the above method, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method of the first aspect.
In a fifth aspect, embodiments of the present application further provide a computer program, where the computer program includes program instructions, and the program instructions, when executed by a processor, cause the processor to execute the method of the first aspect.
According to the embodiment of the application, after the display segments displayed on the screen of the device are segmented, the frame rate of each display sub-segment in the N display sub-segments is measured, the display sub-segment with the measured frame rate smaller than the preset threshold is determined as the display sub-segment with the pause, and then the pause result is calculated according to the display sub-segment with the pause, for example, the pause result can be calculated according to the duration of the display segment and the total pause duration of the display sub-segment with the pause; for another example, the stuck result may be determined according to a ratio of the total number of display sub-segments in which stuck occurs to N display sub-segments, and in the whole implementation process, since the stuck result is determined within a small granularity time range, instead of determining whether stuck occurs according to the drawing time of every two frames of pictures, the additional performance overhead in measuring the application program stuck in the prior art may be avoided, and the detection efficiency may be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings used in the description of the embodiments will be briefly introduced below.
FIG. 1 is a schematic diagram of a stuck detection provided by an embodiment of the present application;
fig. 2 is an operation diagram illustrating a first interface of a virus checking and killing application program jumping to a second interface according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a stuck detection method according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating a display segment according to an embodiment of the present disclosure;
FIG. 5 is a diagram illustrating the number of frames included in a sub-segment according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a stuck detection apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a stuck detection apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
In a specific implementation, the device described in the embodiment of the present invention may be a terminal or a server. In particular, a device may include, but is not limited to, devices such as a desktop computer, a laptop computer, a tablet computer, a smart terminal, and the like.
In order to better understand the stuck detection method, the related device, and the apparatus provided in the embodiment of the present application, an application scenario in which the embodiment of the present application can be applied is explained first, as shown in fig. 2, a virus scanning application is run on an apparatus (e.g., an intelligent terminal), a display screen of the intelligent terminal shows a first interface 10 of the virus scanning application, a garbage clearing button 101 is displayed on the first interface, specifically, the garbage clearing button 101 is used to scan useless garbage occupying a memory on the intelligent terminal, and after the garbage scanning is completed, the second interface 20 is skipped. For example, as shown in the second interface 20, an immediate clean button 102 is included in the interface, which functions to implement garbage cleaning. Normally, after the user performs one touch operation (here, the touch operation includes but is not limited to clicking, pressing, etc.) on the garbage disposal button 101, the virus checking and killing application program jumps from the first display interface 10 to the second display interface 20 within 1 second (specifically, the 1 second referred to herein refers to the jump time for the first interface to jump to the second interface set by the smart terminal). However, in practical applications, it usually happens that when the first interface 10 of the virus checking and killing application jumps to the second interface, the jump time is longer than 1 second, and in this case, it can be determined that the stuck phenomenon occurs. Specifically, the karton phenomenon referred to herein means that the execution time of the application program in response to the user operation exceeds a preset threshold of the smart terminal. The blockage detection method described in the application can be used for detecting the blockage severity degree in the process of jumping from the first interface to the second interface, and the method has the characteristic of light weight.
Based on the application scenario, the following may specifically describe how to implement the detection of the stuck phenomenon in the application scenario with reference to a flowchart of a stuck detection method provided in the embodiment of the present application shown in fig. 3, and include, but are not limited to, the following steps:
step S301, dividing a display segment into N display sub-segments, wherein the display segment is a multi-frame picture displayed by a device in a first time period, and the first time period is from the time when the device detects a first operation to the time when the device responds to the first operation; n is an integer greater than 1.
In conjunction with the application scenario diagram shown in fig. 2, the display segment is a multi-frame during the process of the virus antivirus program jumping from the first interface 10 to the second interface in the first time period. Specifically, the first time period is from the time when the device detects that the user performs the touch operation on the trash button 101 to the time when the device displays the second interface.
In one possible implementation, a schematic diagram of dividing the display segment into N display sub-segments may be as shown in fig. 4, where when the display segment is divided in the first time period, the time length of each of the N display sub-segments is T.
In practical applications, the number of frames included in the time length T may be Q frame pictures, Q +1 frame pictures, or Q +2 frame pictures, and the embodiment of the present application is not particularly limited. For example, the display segment has a length of 4Q frame pictures, and the device divides the display segment into 4 display sub-segments, wherein the display sub-segment 1 has a length of Q frame pictures, the display sub-segment 2 has a length of Q frame pictures, the display sub-segment 3 has a length of Q frame pictures, and the display sub-segment 4 has a length of Q frame pictures. For another example, the display segment has a length of 4Q +1 frame pictures, and the device divides the display segment into 4 display sub-segments, wherein the display sub-segment 1 has a length of Q frame pictures, the display sub-segment 2 has a length of Q frame pictures, the display sub-segment 3 has a length of Q frame pictures, and the display sub-segment 4 has a length of Q +1 frame pictures. For another example, the display segment has a length of 4Q +2 frames, and the device divides the display segment into 4 display sub-segments, wherein the display sub-segment 1 has a length of Q frames, the display sub-segment 2 has a length of Q frames, the display sub-segment 3 has a length of Q frames, and the display sub-segment 4 has a length of Q +2 frames.
In one possible implementation manner, when the display segment is divided in the first time period, the time length of each of the N display sub-segments may be distributed as follows: t, T. Here, S is not greater than a certain set threshold value, for example, 20 msec. For example, the device divides the display segment into 3 display sub-segments, and the temporal length of each of the 3 display sub-segments may be distributed as: t, T, T + S.
In a specific implementation, the duration of any one of the N display sub-segments is not greater than 250 ms. For example, the duration of displaying the sub-segment may be 250ms, for example, the duration of displaying the sub-segment may be 200ms, for example, the duration of displaying the sub-segment may be 180ms, and the like, and the embodiments of the present application are not particularly limited.
For example, the display segment is divided into 6 display sub-segments, and a specific situation that the device renders the 6 display sub-segments in the first time can be as shown in fig. 5, where the display sub-segment 1 includes 8 frames of pictures (1 st frame of picture-8 th frame of picture), and a corresponding time duration is 160 ms; the display segment 2 includes 6 frames of pictures, and the corresponding duration of the pictures is 160 ms. It will be appreciated that each frame of the display sub-segment is associated with a respective timestamp at which the frame of the display sub-segment was rendered.
It should be noted that the frame number of the picture included in each display sub-segment described herein is the actual drawing frame number, and is indicated by a solid line; further, the dotted line indicates the number of frames that should be drawn in an ideal state, however, since the karton phenomenon occurs, in an actual case, the number of frames of a picture that should be drawn in an ideal state is not drawn, but a frame drop occurs. For example, the number of dropped frames in the display sub-segment 2 is 2 frames.
Step S302, measuring the frame rate of each display sub-segment, and determining the display sub-segment with the measured frame rate smaller than a preset threshold value as the display sub-segment with the display pause.
In a specific implementation, measuring the frame rate of each display sub-segment may include:
obtaining the rendering times of each display sub-fragment;
and determining the frame rate according to the rendering times of each display sub-segment and the duration of each display sub-segment.
Specifically, after the device receives a drawing rendering notification of the image rendering layer for the application program interface, the device performs a rendering operation. Specifically, the device performing the rendering operation refers to the device drawing an application program interface on a display screen, and then, when measuring the frame rate of each display sub-segment, the rendering times of each display sub-segment may be obtained first, and then, the frame rate is determined according to the rendering times of each display sub-segment and the duration of each display sub-segment.
For example, the frame rate of each display sub-segment may be determined according to the following formula:
Figure BDA0002012097020000081
wherein, FPS (FPS, Frames Per Second), that is, frame rate; p represents the number of rendering times of each display sub-segment; t represents the time duration of each display sub-segment in nanoseconds. Take the standard frame rate of 60 frames/second as an example, which means that 60 frames of pictures are displayed within 1 second.
It is understood that, in the embodiment of the present application, the frame rate refers to an average frame rate of each display sub-segment, rather than a frame rate of each two adjacent frames of pictures. As shown in fig. 1, in the conventional implementation, it can be determined that slight katton occurs between the 22 nd frame picture and the 23 rd frame picture. It should be further noted that the pause phenomenon between the 22 nd frame picture and the 23 rd frame picture is very small, which is an accidental pause phenomenon, and cannot represent that a problem occurs in a function call relationship in a program source code of an application program. Then, when analyzing the function call relation of the program source code of the application program, it is possible for the application program developer to ignore the stuck phenomenon. In addition, from the user's perspective, the user does not perceive the sporadic stuck phenomenon because it belongs to the phenomenon. In the embodiment of the application, the problem can be avoided by adopting the average frame rate, and meanwhile, the implementation mode can better accord with the actual sensing of the stuck state.
For example, the frame rate of the display sub-segment 1 shown in fig. 5 is determined to be 50 frames/second according to the above formula, the frame rate of the display sub-segment 2 shown in fig. 5 is determined to be 37.5 frames/second according to the above formula.
After determining the frame rate of each display sub-segment, the device compares the frame rate of each display sub-segment with a preset threshold to determine whether a stuck occurs.
In the embodiment of the present application, different application scenarios correspond to different frame rate setting values.
In one possible implementation, the preset threshold is a lowest frame rate threshold at which a stuck phenomenon is perceived to occur in the application scenario. Further, the preset threshold may be dynamically obtained from a background configuration.
In one possible implementation manner, the device stores a corresponding relationship between the application and the threshold in advance, and then, when determining the preset threshold in the current application scenario, the device may determine the preset threshold corresponding to the first application according to the corresponding relationship between the application preset on the device and the threshold.
For example, the correspondence between the application and the threshold may include, but is not limited to, those shown in table 1:
table 1 application and threshold value correspondence table
Application type Threshold value
Instant messaging application 40 frames/second
Audio-like application 50 frames/second
Game-like application program 60 frames/second
Virus checking and killing application program 35 frames/second
Taking a virus checking and killing application program as an example, when the device obtains a preset threshold of the frame rate of the virus checking and killing application program, the device determines that the preset threshold of the frame rate of the virus checking and killing application program is 35 frames/second according to the preset corresponding relation table 1, and then performs a comparison operation of the measured frame rate and the preset threshold to determine whether a stuck phenomenon occurs.
As described above, the apparatus determines that the frame rate of display sub-segment 1 is 50 frames/second, the frame rate of display sub-segment 2 is 37.5 frames/second, the frame rate of display sub-segment 3 is 45 frames/second, the frame rate of display sub-segment 4 is 32 frames/second, the frame rate of display sub-segment 5 is 30 frames/second, and the frame rate of display sub-segment 6 is 27.8 frames/second. Then, the device determines a display sub-segment (e.g., display sub-segment 4, display sub-segment 5, display sub-segment 6) that is less than a preset threshold as the display sub-segment in which stuck occurs.
Step S304, calculating a stuck result according to the display sub-segment with stuck in the N display sub-segments; wherein the stuck result is used to characterize the stuck severity.
In one possible implementation manner, the calculating a stuck result according to a display sub-segment in which stuck occurs in the N display sub-segments includes:
calculating the total pause time length according to the display sub-segments with pause in the N display sub-segments;
and determining a stuck result according to the duration of the display segment and the total stuck duration.
In a specific implementation, the determining a stuck result according to the duration of the display segment and the total stuck duration includes:
upon determining the stuck result, calculating according to the following formula:
Figure BDA0002012097020000101
wherein b represents the stuck result, TbRepresents the total duration of the stuck time, TtIndicating the duration of the display segment.
In one of the possible implementations, here, the stuck result may include a stuck coefficient. In the present embodiment, the katon coefficient may be expressed in percentage.
As described above, the device determines that the display sub-segment 4, the display sub-segment 5, and the display sub-segment 6 are display sub-segments in which stuck occurs, where the time length for displaying the sub-segment 4 is 160ms, the time length for displaying the sub-segment 5 is 160ms, and the time length for displaying the sub-segment 6 is 180ms, and the stuck coefficient calculated by the device according to the above formula is:
Figure BDA0002012097020000102
here, the higher the stuck coefficient, the more serious the stuck degree. In practical application, after acquiring the stuck coefficient of the test application, an application program research and development worker can fundamentally solve the stuck problem by analyzing the function call relation in the program source code of the application program. When the stuck coefficient is greater than a certain threshold (e.g., 80%), the device may issue an alert. In this case, the alert is used to prompt the application developer that analysis and optimization of the application is necessary.
In practical applications, the device may mark the display sub-segment where the stuck phenomenon occurs. Therefore, the device can output the marked display sub-segments, so that application program research personnel can know the running condition of the application program in time, and whether the program source code of the application program needs to be further analyzed, optimized and the like at the current stage is determined in a targeted manner.
In one possible implementation manner, the calculating a stuck result according to a display sub-segment in which stuck occurs in the N display sub-segments further includes:
calculating the total number M of display sub-segments with blockage according to the display sub-segments with blockage in the N display sub-segments; wherein M is a positive integer less than or equal to N;
and determining the stuck result according to the N display sub-segments and the total number M of the display sub-segments with stuck.
In a specific implementation, determining the stuck result according to the N display sub-segments and the total number M of the display sub-segments in which the stuck occurs includes:
when the stuck result is determined, calculating according to the following ratio formula:
Figure BDA0002012097020000111
wherein b represents the stuck result, M represents the total number of display sub-segments in which stuck occurs, and N represents the total number of the display sub-segments.
In the embodiment of the present application, the katon coefficient may also be expressed by a ratio. Specifically, the ratio is used for representing the ratio of the number of display sub-segments in which the stuck occurs to the number of all display sub-segments.
As described above, the device determines that the display sub-segments 4, 5, and 6 are display sub-segments that exhibit katon, that is, the device determines that the total number M of display sub-segments that exhibit katon phenomenon in the 6 display sub-segments is 3, and then the device calculates the katon coefficient according to the above ratio formula as follows:
Figure BDA0002012097020000112
it will be appreciated that a larger ratio indicates a more severe degree of stuck. Similarly, the device may issue a warning when the stuck coefficient is greater than a certain threshold (e.g., 80%).
In the embodiment of the application, because the stuck coefficient is determined in a small-granularity time range, only the number of frames needs to be accumulated, the display sub-segment with stuck is determined, the time data generated by each frame of picture does not need to be acquired, the data does not need to be calculated frequently, and the light-weight characteristic is achieved. In addition, from the user experience perspective, when the card pause condition of the application program is evaluated by the card pause coefficient, the actual card pause perception can be better met.
According to the embodiment of the application, after the display segments displayed on the screen of the device are segmented, the frame rate of each display sub-segment in the N display sub-segments is measured, the display sub-segment with the measured frame rate smaller than the preset threshold is determined as the display sub-segment with the pause, and then the pause result is calculated according to the display sub-segment with the pause, for example, the pause result can be calculated according to the duration of the display segment and the total pause duration of the display sub-segment with the pause; for another example, the stuck result may be determined according to a ratio of the total number of display sub-segments in which stuck occurs to N display sub-segments, and in the whole implementation process, since the stuck result is determined within a small granularity time range, instead of determining whether stuck occurs according to the drawing time of every two frames of pictures, the additional performance overhead in measuring the application program stuck in the prior art may be avoided, and the detection efficiency may be improved.
While the method of the embodiments of the present application has been described in detail, in order to better implement the above-described aspects of the embodiments of the present application, the following provides a corresponding apparatus for implementing the above-described aspects in a coordinated manner.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a stuck detection apparatus according to an embodiment of the present application, where the apparatus 60 at least includes: a dividing unit 600, a measuring unit 602, a determining unit 604, and a calculating unit 606; wherein the content of the first and second substances,
a dividing unit 600, configured to divide a display segment into N display sub-segments, where the display segment is a multi-frame picture displayed by a device in a first time period, and the first time period is from a time when the device detects a first operation to a time when the device responds to the first operation; n is an integer greater than 1;
a measuring unit 602, configured to measure a frame rate of each display sub-segment;
a determining unit 604, configured to determine a display sub-segment with a frame rate less than a preset threshold as a display sub-segment with a stuck frame;
a calculating unit 606, configured to calculate a stuck result according to a display sub-segment in which stuck occurs in the N display sub-segments; wherein the stuck result is used to characterize the stuck severity.
In one possible implementation manner, the measurement unit 602 may include:
an obtaining unit 6021, configured to obtain the rendering times of each display sub-segment;
a first determining unit 6022, configured to determine the frame rate according to the rendering number of each display sub-segment and the duration of each display sub-segment.
In one possible implementation manner, the calculating unit 606 includes:
a first calculating unit 6061, configured to calculate a total pause time length according to a display sub-segment in which a pause occurs in the N display sub-segments;
a second determination unit 6062 configured to determine a stuck result according to the time length of the display section and the total stuck time length;
in one possible implementation manner, the second determining unit 6062 is specifically configured to:
upon determining the stuck result, calculating according to the following formula:
Figure BDA0002012097020000121
wherein b represents the stuck result, TbRepresents the total duration of the stuck time, TtIndicating the duration of the display segment.
In one possible implementation manner, the calculating unit 606 further includes:
a second calculating unit 6063, configured to calculate, according to a display sub-segment in which a stuck occurs in the N display sub-segments, a total number M of the display sub-segments in which the stuck occurs; wherein M is a positive integer less than or equal to N;
a third determining unit 6064, configured to determine the stuck result according to the N display sub-segments and the total number M of the display sub-segments in which stuck occurs.
In one possible implementation manner, the duration of any one of the N display sub-segments is not more than 250 ms.
In one possible implementation manner, the display segment is a multi-frame picture displayed in the first time period when the device runs the first application; before the determining unit 604 determines the display sub-segment with the frame rate less than the preset threshold as the display sub-segment with the occurrence of stuck, the apparatus further includes:
a fourth determining unit 608, configured to determine a preset threshold corresponding to the first application according to a correspondence between an application preset on the device and the threshold.
According to the embodiment of the application, after the display segments displayed on the screen of the device are segmented, the frame rate of each display sub-segment in the N display sub-segments is measured, the display sub-segment with the measured frame rate smaller than the preset threshold is determined as the display sub-segment with the pause, and then the pause result is calculated according to the display sub-segment with the pause, for example, the pause result can be calculated according to the duration of the display segment and the total pause duration of the display sub-segment with the pause; for another example, the stuck result may be determined according to a ratio of the total number of display sub-segments in which stuck occurs to N display sub-segments, and in the whole implementation process, since the stuck result is determined within a small granularity time range, instead of determining whether stuck occurs according to the drawing time of every two frames of pictures, the additional performance overhead in measuring the application program stuck in the prior art may be avoided, and the detection efficiency may be improved.
In order to better implement the above scheme of the embodiment of the present invention, the present invention further provides a stuck detection apparatus, which is described in detail below with reference to the accompanying drawings:
as shown in fig. 7, which is a schematic structural diagram of a card-ton device provided in the embodiment of the present invention, the device 70 may include a processor 701, a memory 704, and a communication module 705, and the processor 701, the memory 704, and the communication module 705 may be connected to each other through a bus 706. The Memory 704 may be a Random Access Memory (RAM) Memory or a non-volatile Memory (e.g., at least one disk Memory). The memory 704 may alternatively be at least one memory system located remotely from the processor 701. The memory 704 is used for storing application program codes and can comprise an operating system, a network communication module, a user interface module and a stuck detection program, and the communication module 705 is used for information interaction with external equipment; the processor 701 is configured to call the program code, and perform the following steps:
dividing a display segment into N display sub-segments, wherein the display segment is a multi-frame picture displayed by a device in a first time period from the time when the device detects a first operation to the time when the device responds to the first operation; n is an integer greater than 1;
measuring the frame rate of each display sub-segment, and determining the display sub-segment with the measured frame rate smaller than a preset threshold value as the display sub-segment with the pause;
calculating a stuck result according to the display sub-segment with stuck in the N display sub-segments; wherein the stuck result is used to characterize the stuck severity.
The measuring, by the processor 701, the frame rate of each display sub-segment may include:
obtaining the rendering times of each display sub-fragment;
and determining the frame rate according to the rendering times of each display sub-segment and the duration of each display sub-segment.
The calculating, by the processor 701, a stuck result according to a display sub-segment in which stuck occurs in the N display sub-segments may include:
calculating the total pause time length according to the display sub-segments with pause in the N display sub-segments;
and determining a stuck result according to the duration of the display segment and the total stuck duration.
The determining, by the processor 701, a stuck result according to the duration of the display segment and the total stuck duration may include:
upon determining the stuck result, calculating according to the following formula:
Figure BDA0002012097020000141
wherein b represents the stuck result, TbRepresents the total duration of the stuck time, TtIndicating the duration of the display segment.
The calculating, by the processor 701, a stuck result according to a display sub-segment in which stuck occurs in the N display sub-segments may further include:
calculating the total number M of display sub-segments with blockage according to the display sub-segments with blockage in the N display sub-segments; wherein M is a positive integer less than or equal to N;
and determining the stuck result according to the N display sub-segments and the total number M of the display sub-segments with stuck.
Wherein the time length of any one of the N display sub-segments is not more than 250 ms.
The display segment is a multi-frame picture displayed in the first time period when the equipment runs the first application; before the processor 701 determines the display sub-segment with the frame rate less than the preset threshold as the display sub-segment with the stuck occurrence, the processor 701 may further be configured to:
and determining a preset threshold corresponding to the first application according to the corresponding relation between the preset application on the equipment and the threshold.
It should be noted that, for the execution steps of the processor in the device 70 in the embodiment of the present invention, reference may be made to the specific implementation manner of the device operation in the embodiment of fig. 3 in each method embodiment described above, and details are not described here again.
In a specific implementation, the morton Device 70 may include various devices that can be used by a user, such as a Mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and the like, and the embodiment of the present invention is not limited in particular.
It should be understood that the application scenario to which the method provided in the embodiment of the present application may be applied is only an example, and is not limited to this in practical application.
It should also be understood that the reference to first, second, third and various numerical designations in this application are merely for convenience of description and do not limit the scope of this application.
It should be understood that the term "and/or" in this application is only one type of association relationship that describes the associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in this application generally indicates that the former and latter related objects are in an "or" relationship.
In addition, in each embodiment of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules and units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, and may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
In addition, functional units related to the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of software functional unit, which is not limited in this application.
Embodiments of the present invention also provide a computer storage medium having stored therein instructions, which when executed on a computer or processor, cause the computer or processor to perform one or more steps of a method according to any of the above embodiments. Based on the understanding that the constituent modules of the above-mentioned apparatus, if implemented in the form of software functional units and sold or used as independent products, may be stored in the computer-readable storage medium, and based on this understanding, the technical solutions of the present application, in essence, or a part contributing to the prior art, or all or part of the technical solutions, may be embodied in the form of software products, and the computer products are stored in the computer-readable storage medium.
The computer readable storage medium may be an internal storage unit of the device according to the foregoing embodiment, such as a hard disk or a memory. The computer readable storage medium may be an external storage device of the above-described apparatus, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the computer-readable storage medium may include both an internal storage unit and an external storage device of the device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the apparatus. The above-described computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the above embodiments of the methods when the computer program is executed. And the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device can be merged, divided and deleted according to actual needs.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A stuck detection method, comprising:
dividing a display segment into N display sub-segments, wherein the display segment is a multi-frame picture displayed in the process that a device jumps from a first interface to a second interface within a first time period, and the first time period is from the time when the device detects a first operation to the time when the device responds to the first operation and displays the second interface; n is an integer greater than 1; the frame pictures included in each display sub-segment are continuous in the display segment;
measuring the frame rate of each display sub-segment, and determining the display sub-segment with the measured frame rate smaller than a preset threshold value as the display sub-segment with the pause;
calculating a stuck result according to the display sub-segment with stuck in the N display sub-segments; wherein the stuck result is used to characterize the stuck severity.
2. The method of claim 1, wherein measuring the frame rate of each display sub-segment comprises:
obtaining the rendering times of each display sub-fragment;
and determining the frame rate according to the rendering times of each display sub-segment and the duration of each display sub-segment.
3. The method of claim 1, wherein said calculating a stuck result based on a display sub-segment of said N display sub-segments in which stuck occurs comprises:
calculating the total pause time length according to the display sub-segments with pause in the N display sub-segments;
and determining a stuck result according to the duration of the display segment and the total stuck duration.
4. The method of claim 3, wherein determining the stuck result based on the duration of the display segment and the total stuck duration comprises:
upon determining the stuck result, calculating according to the following formula:
Figure FDA0003071090500000011
wherein b represents the stuck result, TbRepresents the total duration of the stuck time, TtIndicating the duration of the display segment.
5. The method of claim 3, wherein calculating the stuck result based on the display sub-segment that stuck in the N display sub-segments further comprises:
calculating the total number M of display sub-segments with blockage according to the display sub-segments with blockage in the N display sub-segments; wherein M is a positive integer less than or equal to N;
and determining the stuck result according to the N display sub-segments and the total number M of the display sub-segments with stuck.
6. The method according to any one of claims 1-5, wherein any one of the N display sub-segments has a display sub-segment duration of no more than 250 ms.
7. The method according to any one of claims 1 to 5, wherein the display segment is a multi-frame picture displayed in the first time period when the device runs the first application; before determining the display sub-segment with the frame rate of measurement being less than the preset threshold as the display sub-segment with the stuck occurrence, the method further includes:
and determining a preset threshold corresponding to the first application according to the corresponding relation between the preset application on the equipment and the threshold.
8. A stuck detection device, comprising:
the device comprises a dividing unit, a display unit and a display unit, wherein the dividing unit is used for dividing a display segment into N display sub-segments, the display segment is a multi-frame picture displayed in the process that the device jumps from a first interface to a second interface within a first time period, and the first time period is from the time when the device detects a first operation to the time when the device responds to the first operation to display the second interface; n is an integer greater than 1; the frame pictures included in each display sub-segment are continuous in the display segment;
a measuring unit for measuring a frame rate of each display sub-segment;
the determining unit is used for determining the display sub-segment with the measurement frame rate smaller than the preset threshold value as the display sub-segment with the pause;
the calculating unit is used for calculating a stuck result according to the display sub-segment with stuck in the N display sub-segments; wherein the stuck result is used to characterize the stuck severity.
9. A stuck detection device comprising a processor, an input device, an output device, and a memory, the processor, the input device, the output device, and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to carry out the method according to any one of claims 1-7.
CN201910259036.4A 2019-03-29 2019-03-29 Stuck detection method, related device, equipment and computer readable medium Active CN109933537B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910259036.4A CN109933537B (en) 2019-03-29 2019-03-29 Stuck detection method, related device, equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910259036.4A CN109933537B (en) 2019-03-29 2019-03-29 Stuck detection method, related device, equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN109933537A CN109933537A (en) 2019-06-25
CN109933537B true CN109933537B (en) 2021-07-27

Family

ID=66988891

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910259036.4A Active CN109933537B (en) 2019-03-29 2019-03-29 Stuck detection method, related device, equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN109933537B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991034A (en) * 2017-04-01 2017-07-28 奇酷互联网络科技(深圳)有限公司 A kind of method and apparatus and mobile terminal for monitoring interim card
CN107678934A (en) * 2017-10-13 2018-02-09 北京小米移动软件有限公司 Interim card index selection method and device
CN108076386A (en) * 2017-12-22 2018-05-25 广州酷狗计算机科技有限公司 Video cardton detection method and device, storage medium
CN108721898A (en) * 2018-06-01 2018-11-02 深圳市腾讯网络信息技术有限公司 The determination method and apparatus of frame per second, storage medium, electronic device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8712945B2 (en) * 2012-01-31 2014-04-29 International Business Machines Corporation System and method for optimizing teams

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991034A (en) * 2017-04-01 2017-07-28 奇酷互联网络科技(深圳)有限公司 A kind of method and apparatus and mobile terminal for monitoring interim card
CN107678934A (en) * 2017-10-13 2018-02-09 北京小米移动软件有限公司 Interim card index selection method and device
CN108076386A (en) * 2017-12-22 2018-05-25 广州酷狗计算机科技有限公司 Video cardton detection method and device, storage medium
CN108721898A (en) * 2018-06-01 2018-11-02 深圳市腾讯网络信息技术有限公司 The determination method and apparatus of frame per second, storage medium, electronic device

Also Published As

Publication number Publication date
CN109933537A (en) 2019-06-25

Similar Documents

Publication Publication Date Title
CN107193515B (en) Method, device and equipment for monitoring animation display fluency
US9860139B2 (en) Passive monitoring of live virtual desktop infrastructure (VDI) deployments
CN110300327B (en) Game client performance analysis method, device, terminal and storage medium
CN107450900B (en) Screenshot method and device
CN109388317B (en) Picture loading method, terminal device and storage medium
US20130036235A1 (en) Method of transmission of visual content
EP3408752B1 (en) Object management and visualization using a computing device
CN112135140A (en) Video definition recognition method, electronic device and storage medium
CN110069194B (en) Page blockage determining method and device, electronic equipment and readable storage medium
CN114996103A (en) Page abnormity detection method and device, electronic equipment and storage medium
CN113765873A (en) Method and apparatus for detecting abnormal access traffic
CN106850692B (en) Method and device for determining streaming media playing mode
CN111818393A (en) Video progress adjusting method and device and electronic equipment
CN110781427A (en) Method, device, equipment and storage medium for calculating first screen time
US10152214B2 (en) Method and mobile terminal for displaying visual prompt
CN106445698B (en) Method and device for acquiring step counting data
US11800975B2 (en) Eye fatigue prediction based on calculated blood vessel density score
CN109933537B (en) Stuck detection method, related device, equipment and computer readable medium
CN107038053B (en) Statistical method and device for loading webpage pictures and mobile terminal
CN112905935A (en) Page recording method, page recording animation generation method, equipment and storage medium
CN107862010B (en) Method and device for acquiring information of application system of Internet of things and mobile terminal
CN115955557A (en) Kadun analysis method and device thereof
CN106708605B (en) Method and device for detecting resource leakage
CN112527539B (en) Interface detection method and related device
CN113535993A (en) Work cover display method, device, medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant