CN117421242A - Application detection method, apparatus, computer device and computer readable storage medium - Google Patents

Application detection method, apparatus, computer device and computer readable storage medium Download PDF

Info

Publication number
CN117421242A
CN117421242A CN202311506818.6A CN202311506818A CN117421242A CN 117421242 A CN117421242 A CN 117421242A CN 202311506818 A CN202311506818 A CN 202311506818A CN 117421242 A CN117421242 A CN 117421242A
Authority
CN
China
Prior art keywords
period
signal
vertical synchronization
target frame
synchronization signal
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.)
Pending
Application number
CN202311506818.6A
Other languages
Chinese (zh)
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.)
Xian Wingtech Information Technology Co Ltd
Original Assignee
Xian Wingtech Information Technology 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 Xian Wingtech Information Technology Co Ltd filed Critical Xian Wingtech Information Technology Co Ltd
Priority to CN202311506818.6A priority Critical patent/CN117421242A/en
Publication of CN117421242A publication Critical patent/CN117421242A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3632Software debugging of specific synchronisation aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods

Abstract

The application relates to the technical field of computers, and provides an application detection method, an application detection device, computer equipment and a computer readable storage medium. The method comprises the following steps: for the recorded data of each frame generated by the Perfecto tool in the process of testing the target application, extracting a first vertical synchronous signal and a second vertical synchronous signal of each frame from the recorded data, wherein the first vertical synchronous signal is a VSync-app signal, and the second vertical synchronous signal is a VSync-sf signal; determining a timeout thread in a thread of the target frame based on a magnitude relation between a duration of a thread in the target frame and a signal period of the first vertical synchronization signal or a signal period of the second vertical synchronization signal under the condition that the first vertical synchronization signal and the second vertical synchronization signal of the target frame are normal signals; based on the determined timeout thread, a cause of the stuck of the target application is analyzed. The method can improve the detection efficiency of the application.

Description

Application detection method, apparatus, computer device and computer readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an application detection method, an application detection apparatus, a computer device, and a computer readable storage medium.
Background
With the development of computer technology, mobile terminals are increasingly used for various operations. The mobile terminal runs an operating system (such as an Android operating system) and is provided with different applications, so that people can realize different functions by using the applications. However, when the hardware resources of the mobile terminal are not reasonably used or are excessively consumed, a problem of jamming easily occurs, resulting in poor user experience, which requires an engineer to test the application to find out the reason of jamming.
In the prior art, when an application is detected, a tracking tool is used to capture information generated in the running process of the application, and analyze the information to find out the cause of the jam. However, the application generates a lot of information during the operation, and a large part of the information is useless, which requires engineers to manually screen useful information from the lot of information, resulting in low detection efficiency of the application.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an application detection method, apparatus, computer device, and computer-readable storage medium that can improve the application detection efficiency.
The embodiment of the application provides an application detection method applied to an electronic device provided with a Perfetto tool, comprising the following steps:
for recorded data of each frame generated by a Perfetto tool in the process of testing target application, extracting a first vertical synchronous signal and a second vertical synchronous signal of each frame from the recorded data, wherein the first vertical synchronous signal is a VSync-app signal in an android system, and the second vertical synchronous signal is a VSync-sf signal in the android system;
for any one of the target frames, determining a timeout thread in the threads of the target frame based on a magnitude relation between a duration of the thread in the target frame and a signal period of the first vertical synchronization signal or a signal period of the second vertical synchronization signal when the first vertical synchronization signal and the second vertical synchronization signal of the target frame are normal signals;
and analyzing the blocking reason of the target application based on the determined timeout thread.
In one embodiment, the determining the timeout thread in the thread of the target frame based on the magnitude relation between the duration of the thread in the target frame and the signal period of the first vertical synchronization signal or the signal period of the second vertical synchronization signal includes:
Judging whether the sum of a first time length and a second time length of the target frame is larger than the signal period of the first vertical synchronous signal, wherein the first time length is the time length of a main thread of the target frame, and the second time length is the time length of a rendering thread of the target frame;
if yes, determining the main thread and the rendering thread of the target frame as timeout threads;
judging whether a third time length of the target frame is longer than a signal period of the second vertical synchronous signal, wherein the third time length is the time length of a drawing synthesis thread of the target frame;
if yes, determining the drawing synthesis thread of the target frame as a timeout thread.
In one embodiment, after analyzing the cause of the click of the target application based on the determined timeout thread, the method further comprises:
and displaying the starting time point, the ending time point and the duration of the overtime thread and the name of the target application corresponding to the overtime thread in the interface of the Perfetto tool.
In one embodiment, after the extracting the first vertical synchronization signal and the second vertical synchronization signal of each frame from the recording data, the method further includes:
For any one target frame in the frames, judging whether the first vertical synchronous signal and the second vertical synchronous signal of the target frame are abnormal signals or not.
In one embodiment, the determining whether the first vertical synchronization signal and the second vertical synchronization signal of the target frame are abnormal signals includes:
comparing a first period and a second period of the target frame with a standard signal period respectively, wherein the first period is a period of the first vertical synchronization signal, and the second period is a period of the second vertical synchronization signal;
if the first period is the same as the standard signal period, comparing the first period of the target frame with a third period and a fourth period respectively, and judging whether the first vertical synchronization signal of the target frame is an abnormal signal or not based on a comparison result, wherein the third period is a period of the first vertical synchronization signal of a frame before the target frame, and the fourth period is a period of the first vertical synchronization signal of a frame after the target frame;
and if the second period is the same as the standard signal period, comparing the second period of the target frame with a fifth period and a sixth period respectively, and judging whether the second vertical synchronization signal of the target frame is an abnormal signal or not based on a comparison result, wherein the fifth period is a period of the second vertical synchronization signal of a frame before the target frame, and the sixth period is a period of the second vertical synchronization signal of a frame after the target frame.
In one embodiment, the determining whether the first vertical synchronization signal of the target frame is an abnormal signal based on the comparison result includes:
if the first period of the target frame is different from the third period or the fourth period, the first vertical synchronization signal of the target frame is an abnormal signal;
the determining whether the second vertical synchronization signal of the target frame is an abnormal signal based on the comparison result includes:
if the second period of the target frame is different from the fifth period or the sixth period, the second vertical synchronization signal of the target frame is an abnormal signal.
In one embodiment, the analyzing the cause of the jam of the target application based on the determined timeout thread includes:
analyzing the type of the cartoon reason according to the name, the starting time point, the ending time point and the duration of the overtime thread, wherein the type at least comprises: operating system platform performance type, application itself type, and memory resource occupancy type.
The embodiment of the application provides an application detection device, which comprises:
the signal extraction module is used for extracting a first vertical synchronization signal and a second vertical synchronization signal of each frame from recorded data of each frame generated by a Perfecto tool in the process of testing target application, wherein the first vertical synchronization signal is a VSync-app signal in an android system, and the second vertical synchronization signal is a VSync-sf signal in the android system;
A timeout thread determining module, configured to determine, for any one of the target frames, a timeout thread in a thread of the target frame based on a magnitude relation between a duration of the thread in the target frame and a signal period of the first vertical synchronization signal or a signal period of the second vertical synchronization signal when the first vertical synchronization signal and the second vertical synchronization signal of the target frame are normal signals;
and the stuck cause analysis module is used for analyzing the stuck cause of the target application based on the determined timeout thread.
The embodiment of the application provides a computer device, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the application detection method provided by any embodiment of the application when executing the computer program.
Embodiments of the present application provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the application detection method provided by any embodiment of the present application.
According to the application detection method, the device, the computer equipment and the computer readable storage medium, the first vertical synchronous signal and the second vertical synchronous signal of each target frame are extracted from the frame record data instead of manually extracting massive record data, so that valuable information for analyzing the cause of the jamming does not need to be manually screened out, and the extraction efficiency of the valuable information is greatly improved; in addition, according to the embodiment of the application, the overtime thread in the thread of the target frame is determined based on the magnitude relation between the duration of the thread in the target frame and the signal period of the first vertical synchronous signal or the signal period of the second vertical synchronous signal, so that the cause of the stuck of the target application is analyzed based on the overtime thread instead of manually analyzing massive recorded data, and the analysis efficiency of the cause of the stuck is greatly improved. In summary, when detecting an application, the method of the embodiment of the application can improve the detection efficiency of the application.
Drawings
FIG. 1 is a flow chart of an application detection method in one embodiment;
FIG. 2 is a schematic diagram of the record data of a certain frame generated by the Perfecto tool in one embodiment;
FIG. 3 is a flow diagram illustrating steps for determining a timeout thread in one embodiment;
FIG. 4 is a schematic diagram of another embodiment for analyzing the cause of jamming;
FIG. 5 is a block diagram of an apparatus for applying a detection method in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Some terms referred to in this application will be briefly described as follows:
android: android is a Linux kernel-based operating system with free and open source code. The method is mainly used for mobile equipment, such as smart phones and tablet computers, and is led and developed by Google corporation and the open cell phone alliance in America.
Perfetto: perfetto is a brand new next generation platform-level tracking tool introduced in Android 10, and provides a universal performance detection and tracking analysis tool set for platforms such as Android, linux. The core is to introduce a brand new user space to user space tracking protocol, which fills the captured data into a shared memory buffer area and can be used for acquiring built-in data sources (such as locators) in the platform. Perfetto allows flexible dynamic configuration of data source crawling through an extensible configuration file and can record very long trace data streams into a file system.
Sufaceflinge: abbreviated as SF. Sufaceflinge accepts graphic display data from multiple sources, synthesizes them and sends them to a display device.
FPS: i.e. Frames Per Second, is a definition in the field of images, referring to the number of frames per second of transmission of the picture. The FPS measures the amount of information used to save and display the dynamic video. The more frames per second, the smoother the displayed motion.
Android Trace: android Trace is a set of APIs (Application Programming Interface ) and tools for application performance tracking. It can help developers perform simple, lightweight, efficient performance analysis and debugging in applications.
HWC: namely, a hardware synthesizer (Hardware Composer) is a component of the Android system and is responsible for synthesizing each interface element (such as graphics, text, video and the like) drawn in the application program into a complete screen image, and then outputting the complete screen image to a display.
Buffer: the content of the buffer, i.e. frame buffer, corresponds to the interface display content on the screen.
In one embodiment, as shown in fig. 1, an application detection method is provided, where this embodiment is applied to a terminal to illustrate the application, and it is understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, as shown in fig. 1, the method includes the following steps:
Step 101, for each frame of recording data generated by the Perfetto tool during the test target application, extracting the first vertical synchronization signal and the second vertical synchronization signal of each frame from the recording data.
When the target application is tested, for example, the smoothness of the running of the target application is tested, the Perfecto tool can record the generation process of each frame in the running of the application, and corresponding record data is generated. And, the Perfecto tool can visually present the recorded data.
The display process of the android system can be briefly summarized as: the android application program (namely application) caches the measured, laid out and drawn surface data, renders the cached data to a display screen through a Sufaceflinger, and refreshes the data through a refreshing mechanism of an android system.
Fig. 2 is a schematic diagram of recording data of a certain frame generated by the Perfetto tool, and as can be seen from fig. 2, in the current android system, a generating process of one frame corresponds to two vertical synchronization signals, namely a first vertical synchronization signal and a second vertical synchronization signal, namely a VSync-app signal and a VSync-sf signal, in the embodiment of the present application. Therefore, the embodiment of the application can extract the two vertical synchronous signals from each frame and analyze the two vertical synchronous signals. The embodiment of the application can test one target application, and can also test a plurality of target applications at the same time.
For any one of the target frames, in the case where the first vertical synchronization signal and the second vertical synchronization signal of the target frame are normal signals:
step 102, determining a timeout thread in the threads of the target frame based on a magnitude relation between the duration of the threads in the target frame and the signal period of the first vertical synchronization signal or the signal period of the second vertical synchronization signal.
For frames that need to be analyzed among the respective frames, these frames may be regarded as target frames. It will be appreciated that for each frame, the first and second vertical synchronization signals have respective signal periods, typically the inverse of the FPS. For example, 60FPS corresponds to a period of 16.6ms and 90FPS corresponds to a period of 11.1ms. In addition, the generation process of the target frame may correspond to the execution process of a plurality of threads, for example, the execution process of a main thread, the execution process of a rendering composition thread, and the like. Of course, these threads take time to execute. Based on this, the embodiment of the present application may determine the timeout thread in the thread of the target frame based on the magnitude relation between the duration of the thread in the target frame and the signal period of the first vertical synchronization signal, or based on the magnitude relation between the duration of the thread in the target frame and the signal period of the second vertical synchronization signal, that is, by comparing the duration spent by the thread executing process with the duration of the vertical synchronization signal.
And step 103, analyzing the blocking reason of the target application based on the determined timeout thread.
After determining the timeout thread, the cause of the jam of the target application can be analyzed by analyzing the timeout thread, for example, analyzing the contents of the thread name, the thread execution duration and the like. For example, due to which thread in which frame is executing too long resulting in a stuck.
Since a large number of frames are generated when detecting an application, each frame corresponds to a large amount of data including application data and system data. In view of this, according to the application detection method provided by the embodiment of the application, the first vertical synchronization signal and the second vertical synchronization signal of each target frame are extracted from the frame record data, instead of manually extracting massive record data, so that valuable information for analyzing the katon cause does not need to be manually screened out, and the extraction efficiency of the valuable information is greatly improved; in addition, according to the embodiment of the application, the overtime thread in the thread of the target frame is determined based on the magnitude relation between the duration of the thread in the target frame and the signal period of the first vertical synchronous signal or the signal period of the second vertical synchronous signal, so that the cause of the stuck of the target application is analyzed based on the overtime thread instead of manually analyzing massive recorded data, and the analysis efficiency of the cause of the stuck is greatly improved. In summary, when detecting an application, the method of the embodiment of the application can improve the detection efficiency of the application.
In one embodiment, as shown in fig. 3, step S102 specifically includes:
in step 1021, it is determined whether the sum of the first duration and the second duration of the target frame is greater than the signal period of the first vertical synchronization signal.
In the embodiment of the application, the first duration is the duration of the main thread of the target frame, and the second duration is the duration of the rendering thread of the target frame. For any one target frame generation process, the method comprises a main thread and a rendering thread. The main thread refers to an Application (APP) main thread, and the main thread is used for starting to execute drawing of one frame; rendering threads refer to APP rendering threads that function to apply buffers, process rendering commands, and the like. In the process of generating a frame, under normal conditions, when the first vertical synchronization signal arrives, the system sequentially starts the main thread and the rendering thread under the control of the first vertical synchronization signal, and executes the main thread and the rendering thread before the first vertical synchronization signal ends. However, after the first vertical synchronization signal ends, the main thread and the rendering thread may not be executed, which may cause that the frame cannot be rendered within a predetermined time, and further cause that the screen is stuck.
If yes, determining the main thread and the rendering thread of the target frame as timeout threads in step 1022.
For the above reasons, the embodiment of the present application may determine the timeout thread by determining a magnitude relation between a sum of the first duration and the second duration of the target frame and the signal period of the first vertical synchronization signal.
Step 1023, determining whether the third duration of the target frame is greater than the signal period of the second vertical synchronization signal. In this embodiment of the present application, the third duration is a duration of a rendering composition thread of the target frame. For the generation process of any target frame, the method further comprises a drawing synthesis thread, namely a thread for synthesizing the partial picture rendered by the rendering thread into a finished picture by using a Sufaceflinger. In the process of generating a frame, under normal conditions, when the second vertical synchronization signal arrives, the system starts the drawing synthesis thread under the control of the second vertical synchronization signal, and the drawing synthesis thread is executed before the second vertical synchronization signal ends. However, when the second vertical synchronization signal is over, the rendering and compositing thread is not yet executed, and this frame cannot be composited within a predetermined time, and thus the screen is blocked.
And step 1024, if yes, determining the drawing synthesis thread of the target frame as a timeout thread.
For the above reasons, the embodiment of the present application may determine the timeout thread by determining the magnitude relation between the third duration of the target frame and the signal period of the second vertical synchronization signal.
According to the method and the device for detecting the overtime thread, through judging the size relation between the sum of the first time length and the second time length of the target frame and the signal period of the first vertical synchronizing signal and the size relation between the third time length of the target frame and the signal period of the second vertical synchronizing signal, the overtime thread is not required to be manually analyzed from massive recorded data, automatic determination of the overtime thread is achieved, and therefore detection efficiency of application is improved.
In an embodiment, the application detection method of the embodiment of the application may further include:
and displaying the starting time point, the ending time point and the duration of the overtime thread and the name of the target application corresponding to the overtime thread in the interface of the Perfetto tool.
This step may be located after step 103. After determining the overtime thread, the embodiment of the application can extract the information such as the starting time point, the ending time point, the thread duration, the name of the target application corresponding to the overtime thread and the like of the overtime thread, and display the information in the interface of the Perfetto tool, so that an application developer can more intuitively know the information of the overtime thread, and the application developer can conveniently determine the cause of application blocking as soon as possible.
In an embodiment, the application detection method of the embodiment of the application may further include:
for any one of the target frames, it is determined whether the first vertical synchronization signal and the second vertical synchronization signal of the target frame are abnormal signals.
This step may be located after step 101. As described above, the signal period of the vertical synchronization signal is normally fixed, such as 11.1ms or 16.6ms. Sometimes, however, the signal period of the vertical synchronization signal may fluctuate for some unexpected reasons. For example, the period of the vertical synchronization signal of the previous frame is 16.6ms, and the period of the vertical synchronization signal of the next frame is 11.1ms, which may also cause the application to get stuck. Based on this, the embodiment of the present application may determine whether the first vertical synchronization signal and the second vertical synchronization signal of the target frame are abnormal signals, and if they are normal signals, execute step 102; if the abnormal signal is the abnormal signal, marking the abnormal signal and the time point of the abnormal signal, and displaying the abnormal signal and the time point of the abnormal signal in the interface of the Perfetto tool. By the method, on one hand, the reason for causing the application jamming can be obtained from the vertical signal dimension analysis, the comprehensiveness of the application jamming reason analysis is improved, and on the other hand, the method is beneficial to research and development personnel to quickly position the application jamming problem point based on the display content and improves the application detection efficiency.
In one embodiment, the step of determining whether the first vertical synchronization signal and the second vertical synchronization signal of the target frame are abnormal signals includes:
and step A, comparing the first period and the second period of the target frame with the standard signal period respectively.
In this embodiment of the present application, the first period is a period of the first vertical synchronization signal, and the second period is a period of the second vertical synchronization signal. The standard signal period of the embodiment of the present application may be a preset signal period, for example, 11.1ms, or 16.6ms.
And B, if the first period is the same as the standard signal period, comparing the first period of the target frame with the third period and the fourth period respectively, and judging whether the first vertical synchronous signal of the target frame is an abnormal signal or not based on a comparison result.
In this embodiment of the present application, the third period is a period of the first vertical synchronization signal of a frame preceding the target frame, and the fourth period is a period of the first vertical synchronization signal of a frame following the target frame.
Illustratively, the target frame is b frame, the previous frame of the target frame is a frame, the next frame of the target frame is c frame, and the third period refers to the period of the first vertical synchronization signal of the a frame, and is denoted as period a; the fourth period refers to the period of the first vertical synchronization signal of the c frame, denoted as period c. The period of the first vertical synchronization signal of the target frame is denoted as period b. If the period b is 11.1ms and is the same as the standard signal period, comparing the period b with the period a and the period c respectively, and judging whether the first vertical synchronous signal of the b frame is an abnormal signal or not based on the comparison result.
And C, if the second period is the same as the standard signal period, comparing the second period of the target frame with the fifth period and the sixth period respectively, and judging whether the second vertical synchronous signal of the target frame is an abnormal signal or not based on a comparison result.
In this embodiment of the present application, the fifth period is a period of the second vertical synchronization signal of a frame preceding the target frame, and the sixth period is a period of the second vertical synchronization signal of a frame following the target frame.
Still, a frame, b frame, c frame are described as examples. Illustratively, the fifth period refers to the period of the second vertical synchronization signal of the a frame, denoted as period a'; the sixth period is a period of the second vertical synchronization signal of the c frame, and is denoted as a period c'. The period of the second vertical synchronization signal of the target frame is denoted as period b'. If the period b 'is 11.1ms and is the same as the standard signal period, the period b' is compared with the period a 'and the period c' respectively, and whether the second vertical synchronization signal of the b frame is an abnormal signal is judged based on the comparison result.
According to the embodiment of the application, the abnormal vertical synchronous signal in the target frame can be determined, the reason for the application jamming is obtained through the vertical signal dimension analysis, and the comprehensiveness of the application jamming reason analysis is improved.
In one embodiment, the step B specifically includes:
if the first period of the target frame is different from the third period or the fourth period, the first vertical synchronization signal of the target frame is an abnormal signal.
Still, a frame, b frame, c frame are described as examples. Illustratively, if period b is different from period a, or period b is different from period c, indicating that a fluctuation occurs in the b frame, the first vertical synchronization signal of the b frame is an abnormal signal.
The step C specifically comprises the following steps:
if the second period of the target frame is different from the fifth period or the sixth period, the second vertical synchronization signal of the target frame is an abnormal signal.
Illustratively, if period b 'is different from period a', or period b 'is different from period c', also indicating that a fluctuation occurs in the b frame, the second vertical synchronization signal of the b frame is an abnormal signal.
According to the embodiment of the application, the abnormal vertical synchronous signals in the target frame can be determined based on the comparison between the target frame and the front frame and the rear frame of the target frame, and the reasons for causing application jamming are obtained through the vertical signal dimension analysis, so that the comprehensiveness of analysis of the application jamming reasons is improved.
In one embodiment, step 103 specifically includes:
analyzing the type of the katon reason according to the name, the starting time point, the ending time point and the duration of the timeout thread, wherein the type at least comprises: operating system platform performance type, application itself type, and memory resource occupancy type.
The cause of the application to get stuck may be caused by the performance of the android system, may be caused by the application itself, or may be caused by the performance of the memory. After determining information such as the name, the starting time point, the ending time point, the duration and the like of the timeout thread, the embodiment of the application can analyze the cause of the blocking based on the information. Referring to fig. 4, if the name of the timeout thread is the main thread, for example, the cause of the click can be classified as the application itself in fig. 4; if the timeout thread is named a rendering thread, the cause of the stuck may be categorized as the operating system platform performance of FIG. 4.
According to the embodiment of the application, the type of the jamming reason can be effectively analyzed, automatic determination of the type of the jamming reason is achieved, and therefore detection efficiency of application is improved.
In an embodiment, the application detection method of the embodiment of the application further includes:
extracting a target buffer for a target application from a plurality of buffers (buffers) for displaying screen contents;
the target buffer is shown along with an exception signal in the interface of the Perfetto tool.
Sometimes, the cause of the application to get stuck may be related to the buffers, e.g. the number of buffers is insufficient. According to the embodiment of the application, the buffer of the target application is extracted, and the target buffer and the abnormal signal are displayed in the interface of the Perfetto tool, so that an application developer can more intuitively see whether the abnormal signal is related to the buffer or not, and the application developer can conveniently determine the cause of application jamming as soon as possible.
In an embodiment, the application detection method of the embodiment of the application further includes:
and screening out the synthetic action of a frame which is completed by the HWC and the Sufacefling together from the recorded data, and displaying the synthetic action in the interface of the Perfetto tool. By the embodiment of the application, an application developer can more intuitively see the synthesis action of one frame, and the application developer can conveniently determine the cause of application blocking as soon as possible.
It should be understood that, although the steps in the flowcharts of fig. 1 and 3 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps of fig. 1, 3 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
In one embodiment, as shown in fig. 5, there is provided an application detection apparatus 500, the apparatus 500 comprising: a signal extraction module 501, a timeout thread determination module 502, and a katon cause analysis module 503, wherein:
the signal extraction module is used for extracting a first vertical synchronization signal and a second vertical synchronization signal of each frame from recorded data aiming at the recorded data of each frame generated by the Perfecto tool in the process of testing target application, wherein the first vertical synchronization signal is a VSync-app signal in an android system, and the second vertical synchronization signal is a VSync-sf signal in the android system;
the overtime thread determining module is used for determining an overtime thread in the threads of the target frames based on the size relation between the duration of the threads in the target frames and the signal period of the first vertical synchronizing signal or the signal period of the second vertical synchronizing signal under the condition that the first vertical synchronizing signal and the second vertical synchronizing signal of the target frames are normal signals for any one of the target frames;
and the stuck cause analysis module is used for analyzing the stuck cause of the target application based on the determined overtime thread.
In one embodiment, the timeout thread determination module is specifically configured to:
Judging whether the sum of the first time length and the second time length of the target frame is larger than the signal period of the first vertical synchronous signal, wherein the first time length is the time length of the main thread of the target frame, and the second time length is the time length of the rendering thread of the target frame;
if yes, determining a main thread and a rendering thread of the target frame as timeout threads;
judging whether a third time length of the target frame is longer than a signal period of the second vertical synchronous signal, wherein the third time length is the time length of a drawing synthesis thread of the target frame;
if yes, determining the drawing synthesis thread of the target frame as a timeout thread.
In one embodiment, the application detection apparatus of the embodiment of the present application further includes:
the display module is used for displaying the starting time point, the ending time point and the duration of the overtime thread and the name of the target application corresponding to the overtime thread in the interface of the Perfetto tool.
In one embodiment, the application detection apparatus of the embodiment of the present application further includes:
the abnormal signal judging module is used for judging whether the first vertical synchronous signal and the second vertical synchronous signal of each target frame are abnormal signals or not according to any one target frame in each frame.
In one embodiment, the abnormal signal judging module is specifically configured to:
Comparing the first period and the second period of the target frame with the standard signal period respectively, wherein the first period is the period of the first vertical synchronous signal, and the second period is the period of the second vertical synchronous signal;
if the first period is the same as the standard signal period, comparing the first period of the target frame with a third period and a fourth period respectively, and judging whether the first vertical synchronous signal of the target frame is an abnormal signal or not based on a comparison result, wherein the third period is the period of the first vertical synchronous signal of the previous frame of the target frame, and the fourth period is the period of the first vertical synchronous signal of the next frame of the target frame;
if the second period is the same as the standard signal period, comparing the second period of the target frame with a fifth period and a sixth period respectively, and judging whether the second vertical synchronization signal of the target frame is an abnormal signal or not based on a comparison result, wherein the fifth period is a period of the second vertical synchronization signal of a frame before the target frame, and the sixth period is a period of the second vertical synchronization signal of a frame after the target frame.
In one embodiment, the abnormal signal judging module is specifically configured to:
if the first period of the target frame is different from the third period or the fourth period, the first vertical synchronous signal of the target frame is an abnormal signal;
Judging whether the second vertical synchronization signal of the target frame is an abnormal signal based on the comparison result, comprising:
if the second period of the target frame is different from the fifth period or the sixth period, the second vertical synchronization signal of the target frame is an abnormal signal.
In one embodiment, the katon cause analysis module is specifically configured to:
according to the name, the starting time point, the ending time point and the duration of the overtime thread, analyzing the type of the katon reason, wherein the type at least comprises: operating system platform performance type, application itself type, and memory resource occupancy type.
In one embodiment, the application detection apparatus of the embodiment of the present application further includes:
and the extraction module is used for extracting a target buffer aiming at the target application from a plurality of buffers (buffers) for displaying screen contents.
The display module is specifically configured to: the target buffer is shown along with an exception signal in the interface of the Perfetto tool.
According to the application detection device provided by the embodiment of the application, the signal extraction module extracts the first vertical synchronous signal and the second vertical synchronous signal of each target frame from the frame record data instead of manually extracting massive record data, so that valuable information for analyzing the katon reasons does not need to be manually screened out, and the extraction efficiency of the valuable information is greatly improved; and, the overtime thread determining module determines the overtime thread in the thread of the target frame based on the size relation between the duration of the thread in the target frame and the signal period of the first vertical synchronous signal or the signal period of the second vertical synchronous signal, and the stuck cause analyzing module analyzes the stuck cause of the target application based on the overtime thread instead of manually analyzing massive recorded data, so that the analysis efficiency of the stuck cause is greatly improved. In summary, when the application is detected by the blocking method, the detection efficiency of the application can be improved.
For specific limitations of the application detection device, reference may be made to the above limitations of the application detection method, and no further description is given here. The respective modules in the above-described application detection apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store the recorded data of the individual frames generated by the Perfetto tool. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an application detection method.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the application detection apparatus provided herein may be implemented in the form of a computer program that is executable on a computer device as shown in fig. 6. The memory of the computer device may store various program modules constituting the application detection apparatus, such as the signal extraction module, the timeout thread determination module, and the stuck cause analysis module shown in fig. 5. The computer program constituted by the respective program modules causes the processor to execute the steps in the application detection method of the respective embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 6 may perform step 101 through a signal extraction module in the application detection apparatus as shown in fig. 5. The computer device may execute step 102 by a timeout thread determination module. The computer device may execute step 103 through the katon cause analysis module.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static random access memory (Static Random Access Memory, SRAM), dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. An application detection method, wherein the method is applied to an electronic device mounted with a Perfetto tool, the method comprising:
for recorded data of each frame generated by a Perfetto tool in the process of testing target application, extracting a first vertical synchronous signal and a second vertical synchronous signal of each frame from the recorded data, wherein the first vertical synchronous signal is a VSync-app signal in an android system, and the second vertical synchronous signal is a VSync-sf signal in the android system;
For any one of the target frames, determining a timeout thread in the threads of the target frame based on a magnitude relation between a duration of the thread in the target frame and a signal period of the first vertical synchronization signal or a signal period of the second vertical synchronization signal when the first vertical synchronization signal and the second vertical synchronization signal of the target frame are normal signals;
and analyzing the blocking reason of the target application based on the determined timeout thread.
2. The method of claim 1, wherein the determining a timeout thread of the threads of the target frame based on a magnitude relationship between a duration of the thread of the target frame and a signal period of the first vertical synchronization signal or a signal period of the second vertical synchronization signal comprises:
judging whether the sum of a first time length and a second time length of the target frame is larger than the signal period of the first vertical synchronous signal, wherein the first time length is the time length of a main thread of the target frame, and the second time length is the time length of a rendering thread of the target frame;
if yes, determining the main thread and the rendering thread of the target frame as timeout threads;
Judging whether a third time length of the target frame is longer than a signal period of the second vertical synchronous signal, wherein the third time length is the time length of a drawing synthesis thread of the target frame;
if yes, determining the drawing synthesis thread of the target frame as a timeout thread.
3. The method of claim 1, wherein after analyzing the cause of the click of the target application based on the determined timeout thread, the method further comprises:
and displaying the starting time point, the ending time point and the duration of the overtime thread and the name of the target application corresponding to the overtime thread in the interface of the Perfetto tool.
4. The method of claim 1, wherein after the extracting the first vertical synchronization signal and the second vertical synchronization signal of each frame from the recording data, the method further comprises:
for any one target frame in the frames, judging whether the first vertical synchronous signal and the second vertical synchronous signal of the target frame are abnormal signals or not.
5. The method of claim 4, wherein determining whether the first vertical synchronization signal and the second vertical synchronization signal of the target frame are abnormal signals comprises:
Comparing a first period and a second period of the target frame with a standard signal period respectively, wherein the first period is a period of the first vertical synchronization signal, and the second period is a period of the second vertical synchronization signal;
if the first period is the same as the standard signal period, comparing the first period of the target frame with a third period and a fourth period respectively, and judging whether the first vertical synchronization signal of the target frame is an abnormal signal or not based on a comparison result, wherein the third period is a period of the first vertical synchronization signal of a frame before the target frame, and the fourth period is a period of the first vertical synchronization signal of a frame after the target frame;
and if the second period is the same as the standard signal period, comparing the second period of the target frame with a fifth period and a sixth period respectively, and judging whether the second vertical synchronization signal of the target frame is an abnormal signal or not based on a comparison result, wherein the fifth period is a period of the second vertical synchronization signal of a frame before the target frame, and the sixth period is a period of the second vertical synchronization signal of a frame after the target frame.
6. The method of claim 5, wherein determining whether the first vertical synchronization signal of the target frame is an abnormal signal based on the comparison result comprises:
if the first period of the target frame is different from the third period or the fourth period, the first vertical synchronization signal of the target frame is an abnormal signal;
the determining whether the second vertical synchronization signal of the target frame is an abnormal signal based on the comparison result includes:
if the second period of the target frame is different from the fifth period or the sixth period, the second vertical synchronization signal of the target frame is an abnormal signal.
7. The method of claim 1, wherein the analyzing the cause of the click of the target application based on the determined timeout thread comprises:
analyzing the type of the cartoon reason according to the name, the starting time point, the ending time point and the duration of the overtime thread, wherein the type at least comprises: operating system platform performance type, application itself type, and memory resource occupancy type.
8. An application detection apparatus, the apparatus comprising:
The signal extraction module is used for extracting a first vertical synchronization signal and a second vertical synchronization signal of each frame from recorded data of each frame generated by a Perfecto tool in the process of testing target application, wherein the first vertical synchronization signal is a VSync-app signal in an android system, and the second vertical synchronization signal is a VSync-sf signal in the android system;
a timeout thread determining module, configured to determine, for any one of the target frames, a timeout thread in a thread of the target frame based on a magnitude relation between a duration of the thread in the target frame and a signal period of the first vertical synchronization signal or a signal period of the second vertical synchronization signal when the first vertical synchronization signal and the second vertical synchronization signal of the target frame are normal signals;
and the stuck cause analysis module is used for analyzing the stuck cause of the target application based on the determined timeout thread.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202311506818.6A 2023-11-13 2023-11-13 Application detection method, apparatus, computer device and computer readable storage medium Pending CN117421242A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311506818.6A CN117421242A (en) 2023-11-13 2023-11-13 Application detection method, apparatus, computer device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311506818.6A CN117421242A (en) 2023-11-13 2023-11-13 Application detection method, apparatus, computer device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN117421242A true CN117421242A (en) 2024-01-19

Family

ID=89522908

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311506818.6A Pending CN117421242A (en) 2023-11-13 2023-11-13 Application detection method, apparatus, computer device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117421242A (en)

Similar Documents

Publication Publication Date Title
EP2763034B1 (en) Method and device for image-capturing application screen for use in mobile terminal
US8418149B2 (en) Differential comparison system and method
US20110227925A1 (en) Displaying a visualization of event instances and common event sequences
US9355003B2 (en) Capturing trace information using annotated trace output
CN115145778B (en) Method and device for analyzing rendering result of display card and storage medium
US20130063452A1 (en) Capturing screen displays in video memory and detecting render artifacts
CN107045475B (en) Test method and device
CN109446025B (en) Operation behavior playback method and device, electronic equipment and readable medium
CN110795311B (en) Event playback method and device
US7432941B2 (en) Determining display subsystem compliance
CN116185743B (en) Dual graphics card contrast debugging method, device and medium of OpenGL interface
CN110990842A (en) Recurrence method and device of small probability event, storage medium and electronic equipment
CN112732576A (en) Automatic testing method, device and equipment based on user interface
CN110688245B (en) Information acquisition method, device, storage medium and equipment
CN109766275B (en) Automated testing method, system, storage medium and device for mobile application
US20180336122A1 (en) Generating application flow entities
CN110582016A (en) video information display method, device, server and storage medium
CN113824987A (en) Method, medium, device and computing equipment for determining time consumption of first frame of live broadcast room
US20140282426A1 (en) Divide and conquer approach to scenario timeline activity attribution
CN117421242A (en) Application detection method, apparatus, computer device and computer readable storage medium
CN113806183B (en) Application clamping and processing method, device, equipment, storage medium and program product
CN111045926A (en) Application program jamming detection method, device, medium and electronic equipment
US20210064685A1 (en) Identifying a script that originates synchronous and asynchronous actions
CN110618881B (en) Method and system for simulating message queue
CN115248772A (en) Interface testing method and device for software middleware

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication