CN109426603B - Method and device for analyzing application program blockage - Google Patents

Method and device for analyzing application program blockage Download PDF

Info

Publication number
CN109426603B
CN109426603B CN201710718184.9A CN201710718184A CN109426603B CN 109426603 B CN109426603 B CN 109426603B CN 201710718184 A CN201710718184 A CN 201710718184A CN 109426603 B CN109426603 B CN 109426603B
Authority
CN
China
Prior art keywords
frame
time
task
data
frame structure
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
CN201710718184.9A
Other languages
Chinese (zh)
Other versions
CN109426603A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710718184.9A priority Critical patent/CN109426603B/en
Publication of CN109426603A publication Critical patent/CN109426603A/en
Application granted granted Critical
Publication of CN109426603B publication Critical patent/CN109426603B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/3668Software testing

Abstract

The invention discloses a method and a device for analyzing application program blockage, and relates to the technical field of computers. One embodiment of the method comprises: constructing a frame structure according to a task name in stream file data recorded with an application program running process and a start mark and an end mark corresponding to the task name; acquiring a time stamp corresponding to the task name from the stream file data; generating frame data according to the frame structure and the time stamp; and searching for a timeout frame according to the frame data, and determining a cause of the seizure according to the state of the timeout frame. The embodiment can automatically analyze the cause of the application program blockage, thereby improving the analysis efficiency and reducing the labor cost.

Description

Method and device for analyzing application program blockage
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for analyzing application program blockage.
Background
Generally, during the running of an application program, the demand for hardware computing power is constantly changing, and if the duration of processing a certain frame to display required resources exceeds a preset standard duration (for example, a standard frame rate is 60 frames per second, and the preset standard duration of each frame is 16 milliseconds), a stuck problem occurs. Therefore, in the process of developing the application program, the display performance of the application program interface needs to be analyzed, and the interface operation is ensured to be maintained above a certain frame rate standard, so that smooth use experience is provided for a user.
In the prior art, the reason for the application interface pause is analyzed manually, some tracking programs are usually adopted to track and record the manual operation of the application program within a period of time, and the recording result is manually analyzed to find the timeout frame and further determine the reason for the occurrence of the timeout frame.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: the tracing program can only record the method executed in the running process of the application program in the form of a stream file, the recorded result is difficult to identify, and a method with problems needs to be checked one by one, so that the efficiency is low, and a large amount of human resources are consumed. Especially for application programs with frequent version updating, manual analysis needs to be performed on each interface before each version release, and the workload is too large.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for analyzing applications stuck, which can automatically analyze the cause of applications stuck, thereby improving the efficiency of the analysis system and reducing the labor cost.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method for analyzing application morton, including:
constructing a frame structure according to a task name in stream file data recorded with an application program running process and a start mark and an end mark corresponding to the task name;
acquiring a time stamp corresponding to the task name from the stream file data;
generating frame data according to the frame structure and the time stamp;
and searching for a timeout frame according to the frame data, and determining a cause of the seizure according to the state of the timeout frame.
Optionally, the step of generating frame data according to the frame structure and the timestamp includes:
determining the starting time and the ending time of each task in a frame structure according to the starting time stamp and the ending time stamp corresponding to each task name;
taking the starting time of the main task in the frame structure as the starting time of the frame;
judging whether the frame structure contains a display task or not;
if not, taking the termination time of the main task of the frame structure as the termination time of the frame; if yes, taking the termination time of the display task as the termination time of the frame;
and generating frame data comprising the frame structure of the frame, the starting time and the ending time of the frame and the starting time and the ending time of each task in the frame.
Optionally, the method further includes:
before the step of constructing a frame structure based on the task name and the start mark and the end mark corresponding to the task name in the stream file data recorded with the application program running process,
and simulating the application program running process by using the automation script, and recording the application program running process as the stream file data.
Optionally, the step of determining the cause of the stuck event according to the state of the timeout frame includes:
presetting an association relation between a timeout frame state and a cause of the stuck frame;
and determining a pause reason corresponding to the overtime frame in the frame data according to the association relation.
Optionally, the stream file data is an HTML file recorded by using a sysstrace tool.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided an apparatus for analyzing stuck of an application, including:
the frame structure module is used for constructing a frame structure according to a task name in stream file data recorded with an application program running process and a start mark and an end mark corresponding to the task name;
the time stamp module is used for acquiring a time stamp corresponding to the task name from the stream file data;
the frame data module is used for generating frame data according to the frame structure and the time stamp;
and the stuck analysis module is used for searching the super-time frame according to the frame data and determining a stuck reason according to the state of the super-time frame.
Optionally, the frame data module is further configured to:
determining the starting time and the ending time of each task in a frame structure according to the starting time stamp and the ending time stamp corresponding to each task name;
taking the starting time of the main task in the frame structure as the starting time of the frame;
judging whether the frame structure contains a display task or not;
if not, taking the termination time of the main task of the frame structure as the termination time of the frame; if yes, taking the termination time of the display task as the termination time of the frame;
and generating frame data comprising the frame structure of the frame, the starting time and the ending time of the frame and the starting time and the ending time of each task in the frame.
Optionally, the apparatus further comprises:
and the stream file recording module is used for simulating the running process of the application program by using the automation script and recording the running process of the application program into stream file data.
Optionally, the morton analysis module is further configured to:
presetting an association relation between a timeout frame state and a cause of the stuck; and determining the cause of the pause corresponding to the overtime frame in the frame data according to the incidence relation.
Optionally, the stream file data is an HTML file recorded by using a sysstrace tool.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided an electronic device for analyzing stuck applications, including:
one or more processors;
a storage device to store one or more programs,
when executed by the one or more processors, cause the one or more processors to perform at least the following:
generating frame data according to the stream file data recorded with the application program running process;
and searching for a timeout frame in the frame data, and determining a cause of the seizure according to the state of the timeout frame.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable medium on which a computer program is stored, the program, when executed by a processor, at least realizing:
generating frame data according to the stream file data recorded with the application program running process;
and searching for a timeout frame in the frame data, and determining a cause of the seizure according to the state of the timeout frame.
One embodiment of the above invention has the following advantages or benefits: because the technical means of recovering the stream file data recorded with the application program running process into the frame data, searching the time-out frame according to the frame data and determining the cause of the blockage according to the state of the time-out frame are adopted, and the analysis of the application program running process is realized in an automatic process, the technical problems of time and labor consumption of manual analysis in the prior art are solved, and the technical effects of improving the blockage analysis efficiency and saving the labor cost are further achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a method of analyzing application jams, according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the main steps of a method for analyzing application morton according to another embodiment of the present invention;
FIG. 3 is a diagram illustrating a frame structure in a method for analyzing applications stuck according to another embodiment of the invention;
FIG. 4 is a schematic diagram of the main modules of an apparatus for analyzing application jams, according to an embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of the main steps of a method for analyzing applications stuck according to an embodiment of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a method for analyzing application morton, including:
and S10, constructing a frame structure according to the task name recorded in the stream file data of the application program running process and the start mark and the end mark corresponding to the task name. By using some tools, the running process of the application program can be recorded as stream file data; although the task executed by the system in each frame can be identified according to the stream file data, the stream file data has no logical structure, and is very difficult to process because the stream file data has no logical structure.
In the stream file data, the tasks can be threads or methods, and each task is attached with a task name, a starting mark, a starting timestamp, an ending mark and an ending timestamp; due to the adoption of the streaming storage form, the start and the end of the task in the streaming file data are recorded sequentially, so that the task structure cannot be clearly shown. For a task containing a sub-task, the task is nested with the start tag, the end tag, etc. of its sub-task, which makes it more difficult to recognize. In the step, the task name, the starting mark and the ending mark in the stream file data are identified, and the frame structure is reconstructed to restore the corresponding relation between the frame and the task.
And S11, acquiring a time stamp corresponding to the task name from the stream file data. Each task in the stream file data includes two time stamps, i.e., a start time stamp and an end time stamp, which are used to mark the start time and the end time of the task, respectively.
And S12, generating frame data according to the frame structure and the time stamp. The frame structure obtained in step S10 realizes reconstruction of hierarchical relationships among tasks in the frame, and in this step, the tasks are further arranged based on the same time axis according to the frame structure and the timestamp obtained in step S11, so that frame data including both hierarchical relationships of the tasks and temporal logics is obtained. After the step S12 is completed, the stream file data is converted into the structured frame data, so that on one hand, the subsequent processing speed can be increased, on the other hand, when the user needs to check a specific frame, the frame data corresponding to the frame can be directly accessed, and the readability of the data is also improved.
S13, searching for a timeout frame according to the frame data, and determining a cause of the seizure according to the state of the timeout frame. The state of each frame can be obtained according to the frame data, the processing time consumption of each frame and the processing time consumption of each task executed in each frame are included, the overtime task in the overtime frame can be found through analysis of the processing time consumption, and therefore the cause of the occurrence of the jamming can be confirmed according to the task.
As can be seen from the foregoing, according to the method for analyzing the application program stuck, provided by this embodiment, because the technical means that the stream file data recorded with the application program running process is restored to the frame data, the timeout frame is searched according to the frame data, and the stuck cause is determined according to the state of the timeout frame is adopted, the analysis of the application program running process is realized in an automated process, so that the technical problem that manual analysis in the prior art is time-consuming and labor-consuming is solved, and the technical effects of improving the stuck analysis efficiency and saving the labor cost are further achieved.
In some optional embodiments, S12, the step of generating frame data according to the frame structure and the timestamp includes:
and determining the starting time and the ending time of each task in the frame structure according to the starting time stamp and the ending time stamp corresponding to each task name.
Taking the starting time of the main task in the frame structure as the starting time of the frame; judging whether the frame structure contains a display task or not; if not, taking the termination time of the main task of the frame structure as the termination time of the frame; and if so, taking the ending time of the display task as the ending time of the frame. The main task refers to a main task in the frame structure, and is usually the first started task in the frame structure; the display task is a task for interactively realizing a final image display function with a display device of hardware, when the display task exists in a frame structure, the main task transfers processed related data to the display task after executing to a certain stage, and the display task finally realizes the display function, so that the termination time of the display task lags behind the termination time of the main task, and the termination time of the display task is taken as the termination time of the whole frame.
And generating frame data comprising the frame structure of the frame, the starting time and the ending time of the frame and the starting time and the ending time of each task in the frame. A preferred time pattern of the frame data is based on the same time axis, and the tasks are arranged according to their hierarchical relationship and start and end times, so that the developer can clearly understand the execution sequence of the tasks in a frame.
It should be noted that the time marked by the timestamp in the stream file data is the operating system time, and in order to more intuitively represent the time node of each task in a single stuck analysis, the timestamp may be preprocessed, that is, the start timestamp of the first task is set to 0 time, and the values of other timestamps are converted under the premise of maintaining the time difference, so that all tasks are distributed on a millisecond-level time axis with 0 time as the start time. In some optional embodiments, the time consumption of each task may also be calculated according to the start time stamp and the end time stamp of the task, so as to perform the search of the timeout frame in the subsequent step.
As can be seen from the above, the method of this embodiment can restore the sequentially recorded stream file data to the structured frame data, which not only facilitates searching for the timeout frame, but also improves the readability of the data.
Optionally, the method further includes:
before the step of S10, constructing a frame structure according to the task name in the stream file data recorded with the application program running process and the start mark and the end mark corresponding to the task name,
and simulating the application program running process by using the automation script, and recording the application program running process as the stream file data. The automation script is a script file which is configured in advance, contains an operation instruction and can run automatically, and the automation script can automatically execute the operation instruction according to a certain sequence, so that the manual operation on the application program is simulated. Optionally, the operation instructions included in the automation script should be instructions directly acting on the input and output devices on the hardware device on which the application program runs, rather than instructions directly acting on the application program, so as to improve the reality degree of the simulation running process. For example, for an application program running on the mobile terminal, the operation instruction should be a touch signal of an analog touch screen; for an application program running on a desktop computer, the operation instruction should be, for example, an input signal simulating a keyboard or a click signal of a mouse.
In some optional embodiments, in S20, the step of determining the cause of the stuck according to the state of the timeout frame includes:
and presetting an association relation between the state of the timeout frame and the cause of the stuck in the frame data, and determining the cause of the stuck in the frame data corresponding to the timeout frame according to the association relation.
According to the state of the timeout frame and the technical experience, the relation between the state of the timeout frame and the cause of the pause can be realized; the relevance relationship between the states and the corresponding blockage reason is stored, and the blockage reason can be automatically determined. The timeout frame state includes multiple aspects, for example, multiple frames are continuously timed out, and the same timeout task occurs in each frame; as another example, a specific timeout task occurs in the timeout frame, etc.
In order to make the technical solution of the present invention clearer, the technical solution of the present invention is further described below by a specific example.
FIG. 2 is a schematic diagram of the main steps of a method for analyzing application morton according to another embodiment of the present invention; fig. 3 is a diagram illustrating a frame structure in a method for analyzing applications stuck according to another embodiment of the present invention.
As shown in fig. 2, this embodiment provides a morton test method for an intelligent device based on an Android system according to the method provided by the present invention, which mainly includes the following steps:
and S20, simulating the running process of the App interface to be tested by using the automatic script, and recording the running process of the application program as an HTML file. In this embodiment, the application program is specifically an App running on the basis of an android system, and the running process of the application program is specifically a running process of an interface to be tested of the App. The program is most intuitively embodied in the process of interface switching or changing, for example, the program is stuck to render new display contents when a list in the interface is slid, or the program is stuck after a special effect is triggered to be displayed when a certain plug-in the interface is clicked, and the like. The embodiment simulates the running process of an App interface to be tested by using an automatic script, for example, for an App used in a mobile device with a touch screen, the automatic script is used for sending a touch signal to a processor to simulate artificial touch behavior.
The HTML file is a streaming file generated by using a Systrace tool, wherein data recorded in the operation process of all App interfaces are recorded in < script class = 'trace-data' type = 'application/text' > \8230; \8230ina file body, and the data comprise the following data:
(1)taskname-25917(25917)[000]...1 699252.417026:tracing_mark_write:B|25917|Choreographer#doFrame
(2)taskname-25917(25917)[000]...1 699252.417046:tracing_mark_write:B|25917|input
(3)taskname-25917(25917)[000]...1 699252.417094:tracing_mark_write:E
(4)taskname-25917(25917)[000]...1 699252.417108:tracing_mark_write:E
taking the data in (1) above as an example, "taskname" refers to the name of the test, and if the test is the main thread of the application, the package name of the application is used; other threads of the application are also possible, such as RenderThread;
"25917" outside the first parenthesis indicates the ID of the thread; the second "(25917)" in parentheses indicates the ID of the process to which the thread belongs, and if the process is the main thread of the process, the process ID is the same as the thread ID; the third "25917" is the ID of the process, as the second; for example, if a process has a child thread of RenderThread, then the record may be: renderThread-26308 (25917) [001]. 1 699250.872633;
1 "denotes the number of the CPU, starting with 0, and if it is an 8-core CPU, taking 0 to 7;
"chord graph # doFrame" is a keyword, that is, the task name called in the previous embodiment, and mainly represents a method used in App;
"B" is a start flag indicating that this record is the start time record of the method, and "E" in (3) and (4) is an end flag indicating that this record is the end time record of the method;
"699252.417026" is a time stamp, directly records system time, and converts the system time into relative time starting from 0 moment in the current detection in subsequent steps; the timestamp behind the 'B' is a starting timestamp, and the timestamp behind the 'E' is an ending timestamp;
as can be seen from (1) - (4), the HTML file sequentially records the start and end of each method, and a nested structure exists, so that it is difficult to directly read. Taking (1) - (4) as an example, two methods are included, and the "input" method is subordinate to the "Choroegraph # doFrame" method.
And S21, analyzing the original record to obtain the information of the frame data. The information of the frame data comprises information such as task name thread ID, time stamp and the like; in the case of a record of frame data, the information of the frame data further includes start and end markers (B, E) of the frame, a process ID, a method, and the like. In the HTML file, besides the record related to the frame data, other types of data are also included, and this step selects the record related to the frame data from the HTML file so as to reconstruct the frame data, and excludes the data unrelated to the katton so as to facilitate reading.
And S22, reconstructing the frame data according to the information of the frame data. The frame data corresponding to the interface to be tested starts with a keyword of Choroegraph # doFrame or performTravversals, and a large number of method operations are nested in the middle. On some models, the frame data may start with data for keys such as "DeliverInputEvent", "obainView", "setupListItem", etc. If RenderThread is present, the data start tag for the Renderthread is "DrawFrame". If the frame data has a beginning marker B but no ending marker E, the frame data is considered to be an incomplete frame and does not participate in the analysis of the subsequent timeout frames.
And S23, combining the frame data of the target App and the RenderThread frame data (if existing) into complete frame data according to the time correlation. After the merging is complete, a start timestamp and an end timestamp are also optionally added for each frame, each method. A most complex complete frame is generally structured as shown in fig. 3, where the schematic content in fig. 3 is a method or a thread name, which represents the span executed by the method, for example, a main thread draws a frame and completes the frame in a chord. The obtainView and the setupListItem are used for acquiring and setting list information; animation is used to process animations; the travelsal comprises measurement, layout and display. A frame data structure diagram such as that shown in fig. 3 may be drawn based on the enlightenment and expiration time stamps for the frames and methods, and the time sequence of the methods is graphically identified for ease of reading.
With continued reference to FIG. 3, during the processing of a frame, which may include multiple parallel threads, after the APP main thread has processed to the draw phase, the result is handed to the render thread party, which then participates in interacting with the display module of the system. When the RenderThread processing is completed, it indicates that the frame data is finished, so the frame start timestamp is the start timestamp of the App main thread, and the frame end timestamp is the end timestamp of the RenderThread (when the frame does not contain the RenderThread, the frame end timestamp is the end timestamp of the App main thread), and the complete frame length can be calculated according to the frame start time in the App main thread and the end time of the RenderThread.
And S24, performing the Cartton analysis according to the frame data. According to the Android interface design requirement, the standard of interface fluency is that the frame rate reaches 60 frames, and the duration of each frame cannot exceed 16ms according to calculation. In the katton analysis, the requirements can be relaxed properly, the App main thread duration is greater than 20ms, the render thread duration is greater than 20ms, or the length of the whole complete frame is greater than 30ms, then the super-time frame is considered.
After the timeout frame data is found, the reason for the timeout frame generation needs to be analyzed. Methods contained in the overrun frame need to be searched, the occupied duration of the methods is analyzed, and the generation reason is judged. After the relation between the state of the timeout frame data and the cause of the stuck-in state is determined, the relation between the state of the timeout frame data and the cause of the stuck-in state can be established, and an automatic method is adopted for matching so as to realize automatic stuck-in analysis. According to experience, the general katon situation in the Android interface and the corresponding reasons are as follows:
(1) The method comprises the ultralong obtainView/setup ListItem (> 8 ms), which indicates that the createView/measure consumes time and needs to be optimized when the ListView acquires new data;
(2) Each frame performTraversals contains a measure operation and the super-long frames appear continuously, indicating that code causing the refresh is added to the code of the onsrol during the sliding operation;
(3) The drawdisplayList method in the target App or renderThread data times out (> 12 ms), indicating that there is an operation in the layout that causes OpenGL rendering to time out, e.g., setAlpha;
(4) When large frame data occurs, a GC-related field is found in the overtime method, which indicates frequent memory allocation release, and results in interface pause caused by GC in the operation process, and the allocation of local variables needs to be optimized.
The following describes a specific use of the method of the present embodiment by way of an example, for part of data in the following HTML file:
app.package.name-25917(25917)[003]...1 699253.574979:tracing_mark_write:B|25917|animation
app.package.name-25917(25917)[003]...1 699253.576824:tracing_mark_write:B|25917|obtainView
app.package.name-25917(25917)[004]...1 699253.586487:tracing_mark_write:E
app.package.name-25917(25917)[004]...1 699253.587492:tracing_mark_write:B|25917|setupListItem
app.package.name-25917(25917)[003]...1 699253.591303:tracing_mark_write:E
app.package.name-25917(25917)[003]...1 699253.591366:tracing_mark_write:E
after an App is subjected to morton analysis according to the method of the embodiment, the output result is as follows:
detecting a timeout frame: start time 3278.179ms, frame length 30.762ms,
wherein the process animation method takes 16.387ms,
the animation sub-method, the obtainView, takes 9.663ms,
the submethod setupListItem of animation takes 3.811ms,
if the obtainView is too long, please check if there is a time consuming operation in the onCreateView method of the ListView class.
FIG. 4 is a schematic diagram of the main modules of an apparatus for analyzing application jams, according to an embodiment of the present invention.
As shown, according to another aspect of the embodiment of the present invention, there is provided an apparatus 400 for analyzing application stuck, including:
a frame structure module 401, configured to construct a frame structure according to a task name in stream file data recorded with an application program running process, and a start tag and an end tag corresponding to the task name;
a timestamp module 402, configured to obtain a timestamp corresponding to the task name from the stream file data;
a frame data module 403, configured to generate frame data according to the frame structure and the timestamp;
and the stuck analysis module 404 is configured to search for a timeout frame according to the frame data, and determine a stuck reason according to a state of the timeout frame.
In some optional embodiments, the frame data module 403 is further configured to:
determining the starting time and the ending time of each task in a frame structure according to the starting time stamp and the ending time stamp corresponding to each task name;
taking the starting time of the main task in the frame structure as the starting time of the frame;
judging whether the frame structure contains a display task or not;
if not, taking the termination time of the main task of the frame structure as the termination time of the frame; if yes, taking the termination time of the display task as the termination time of the frame;
and generating frame data comprising the frame structure of the frame, the starting time and the ending time of the frame and the starting time and the ending time of each task in the frame.
In some optional embodiments, the apparatus 400 further comprises:
and a stream file recording module 405 for simulating the application program running process by using the automation script and recording the application program running process as stream file data.
In some optional embodiments, the katon analysis module 404 is further configured to:
presetting an association relation between a timeout frame state and a cause of the stuck; and determining the cause of the pause corresponding to the overtime frame in the frame data according to the incidence relation.
In some optional embodiments, the stream file data is an HTML file recorded using the sysstrace tool.
As can be seen from the foregoing, according to the apparatus for analyzing the stuck state of the application program provided in this embodiment, because the technical means of recovering the stream file data recorded with the running process of the application program into the frame data, searching the timeout frame according to the frame data, and determining the cause of the stuck state according to the state of the timeout frame are adopted, the analysis of the running process of the application program is realized in an automated process, so that the technical problems of time and labor consumption in manual analysis in the prior art are solved, and the technical effects of improving the stuck analysis efficiency and saving the labor cost are achieved.
Fig. 5 illustrates an exemplary system architecture 500 of a method of analyzing application jams or a device for analyzing application jams to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is the medium used to provide communication links between terminal devices 501, 502, 503 and the server 505. Network 504 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have various applications to be tested installed thereon, such as a shopping application, a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as an arithmetic server that records and analyzes the operation process of the application to be tested that is executed by the user using the terminal devices 501, 502, 503. The operation server may perform processing such as reconstruction and analysis on the received record data, and output a processing result.
It should be noted that the method for analyzing the application program stuck provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the apparatus for analyzing the application program stuck is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The invention also provides an electronic device and a readable storage medium according to the embodiment of the invention.
Fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Referring now to FIG. 6, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing embodiments of the present invention. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. A driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, the processes described above in the schematic representation of the main steps may be implemented as computer software programs according to embodiments of the present invention. For example, an embodiment of the invention comprises a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for performing the method illustrated in the schematic diagram of the main steps. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a frame structure module, a timestamp module, a frame data module, and a stuck analysis module. The names of these modules do not constitute a limitation to the modules themselves in some cases, for example, the frame structure module may also be described as "a module for constructing a frame structure from a task name in stream file data recorded with an application running process and a start flag and an end flag corresponding to the task name".
As another aspect, the present invention also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not assembled into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
constructing a frame structure according to a task name in stream file data recorded with an application program running process and a start mark and an end mark corresponding to the task name;
acquiring a time stamp corresponding to the task name from the stream file data;
generating frame data according to the frame structure and the time stamp;
and searching for a timeout frame according to the frame data, and determining a cause of the seizure according to the state of the timeout frame.
According to the technical scheme of the embodiment of the invention, the analysis of the running process of the application program is realized in an automatic process by adopting the technical means of recovering the stream file data recorded with the running process of the application program into the frame data, searching the time-exceeding frame according to the frame data and determining the cause of the stuck according to the state of the time-exceeding frame, so that the technical problems of time and labor consumption of manual analysis in the prior art are solved, and the technical effects of improving the efficiency of the stuck analysis and saving the labor cost are further achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method for analyzing applications stuck, comprising:
constructing a frame structure according to a task name in stream file data recorded with an application program running process and a start mark and an end mark corresponding to the task name;
acquiring a time stamp corresponding to the task name from the stream file data;
generating frame data according to the frame structure and the time stamp;
and searching for a timeout frame according to the frame data, and determining a cause of the seizure according to the state of the timeout frame.
2. The method of claim 1, wherein generating frame data based on the frame structure and the timestamp comprises:
determining the starting time and the ending time of each task in a frame structure according to the starting time stamp and the ending time stamp corresponding to each task name;
taking the starting time of the main task in the frame structure as the starting time of the frame;
judging whether the frame structure contains a display task or not;
if not, taking the termination time of the main task of the frame structure as the termination time of the frame; if yes, taking the termination time of the display task as the termination time of the frame;
and generating frame data comprising the frame structure of the frame, the starting time and the ending time of the frame and the starting time and the ending time of each task in the frame.
3. The method of claim 1, further comprising:
before the step of constructing a frame structure based on the task name and the start mark and the end mark corresponding to the task name in the stream file data recorded with the application program running process,
and simulating the application program running process by using the automation script, and recording the application program running process as the stream file data.
4. The method of claim 1, wherein determining the cause of the stuck in time based on the state of the timeframe comprises:
presetting an association relation between a timeout frame state and a cause of the stuck;
and determining a pause reason corresponding to the overtime frame in the frame data according to the association relation.
5. The method of any of claims 1-4, wherein the stream file data is an HTML file recorded using a Systrace tool.
6. An apparatus for analyzing applications stuck, comprising:
the frame structure module is used for constructing a frame structure according to a task name in stream file data recorded with an application program running process and a start mark and an end mark corresponding to the task name;
the time stamp module is used for acquiring a time stamp corresponding to the task name from the stream file data;
the frame data module is used for generating frame data according to the frame structure and the time stamp;
and the seizure analysis module is used for searching for the super-time frame according to the frame data and determining the seizure reason according to the state of the super-time frame.
7. The apparatus of claim 6, wherein the frame data module is further configured to:
determining the starting time and the ending time of each task in a frame structure according to the starting time stamp and the ending time stamp corresponding to each task name;
taking the starting time of the main task in the frame structure as the starting time of the frame;
judging whether the frame structure contains a display task or not;
if not, taking the termination time of the main task of the frame structure as the termination time of the frame; if yes, taking the termination time of the display task as the termination time of the frame;
and generating frame data comprising the frame structure of the frame, the starting time and the ending time of the frame and the starting time and the ending time of each task in the frame.
8. The apparatus of claim 6, further comprising:
and the stream file recording module is used for simulating the running process of the application program by using the automation script and recording the running process of the application program as stream file data.
9. The apparatus of claim 6, wherein the Cartton analysis module is further configured to:
presetting an association relation between a timeout frame state and a cause of the stuck frame; and determining the cause of the pause corresponding to the overtime frame in the frame data according to the incidence relation.
10. The apparatus of any of claims 6-9, wherein the stream file data is an HTML file recorded using the sysstrace tool.
11. An electronic device for analyzing applications stuck, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201710718184.9A 2017-08-21 2017-08-21 Method and device for analyzing application program blockage Active CN109426603B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710718184.9A CN109426603B (en) 2017-08-21 2017-08-21 Method and device for analyzing application program blockage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710718184.9A CN109426603B (en) 2017-08-21 2017-08-21 Method and device for analyzing application program blockage

Publications (2)

Publication Number Publication Date
CN109426603A CN109426603A (en) 2019-03-05
CN109426603B true CN109426603B (en) 2022-11-08

Family

ID=65499021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710718184.9A Active CN109426603B (en) 2017-08-21 2017-08-21 Method and device for analyzing application program blockage

Country Status (1)

Country Link
CN (1) CN109426603B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110489165B (en) * 2019-08-02 2021-10-15 北京字节跳动网络技术有限公司 Method, device, medium and equipment for acquiring call stack frame instruction offset
CN110489318B (en) * 2019-08-20 2023-04-28 Oppo(重庆)智能科技有限公司 Systrace information grabbing method and device, storage medium and terminal
CN110750346B (en) * 2019-10-17 2022-11-15 Oppo(重庆)智能科技有限公司 Task operation optimization method, device, terminal and storage medium
CN112069079B (en) * 2020-09-22 2024-03-22 腾讯科技(成都)有限公司 Performance test method, related device and storage medium
CN112559231B (en) * 2020-12-15 2023-10-03 北京百度网讯科技有限公司 Application detection method, device, equipment and storage medium
CN115942131B (en) * 2023-02-09 2023-09-01 蔚来汽车科技(安徽)有限公司 Method for guaranteeing vehicle looking-around function, cabin system, vehicle and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1980390A (en) * 2005-12-07 2007-06-13 联合信源数字音视频技术(北京)有限公司 Audio-video frequency media data organization realizing method of supporting precision positioning
CN105589783A (en) * 2014-11-18 2016-05-18 广州市动景计算机科技有限公司 Application program lag problem data obtaining method and device
CN105653407A (en) * 2015-12-08 2016-06-08 网易(杭州)网络有限公司 Terminal, jam measuring method, device, game jam measuring method and apparatus

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239168B (en) * 2013-06-09 2018-03-23 腾讯科技(深圳)有限公司 Interim card detection method and equipment
CN105979332A (en) * 2015-12-04 2016-09-28 乐视致新电子科技(天津)有限公司 Video data detection method and device
CN106681913A (en) * 2016-12-08 2017-05-17 武汉斗鱼网络科技有限公司 Application not responding positioning system and method
CN107038107B (en) * 2017-03-09 2020-03-17 武汉斗鱼网络科技有限公司 Method and device for acquiring application blocking information

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1980390A (en) * 2005-12-07 2007-06-13 联合信源数字音视频技术(北京)有限公司 Audio-video frequency media data organization realizing method of supporting precision positioning
CN105589783A (en) * 2014-11-18 2016-05-18 广州市动景计算机科技有限公司 Application program lag problem data obtaining method and device
CN105653407A (en) * 2015-12-08 2016-06-08 网易(杭州)网络有限公司 Terminal, jam measuring method, device, game jam measuring method and apparatus

Also Published As

Publication number Publication date
CN109426603A (en) 2019-03-05

Similar Documents

Publication Publication Date Title
CN109426603B (en) Method and device for analyzing application program blockage
CN109460513B (en) Method and apparatus for generating click rate prediction model
US20190196672A1 (en) Visual effects system for &#34;big data&#34; analysis workflow editors, distribution platforms, execution engines, and management systems comprising same
US20160313874A1 (en) Visual effects system for &#34;big data&#34; analysis workflow editors, distribution platforms, execution engines, and management systems comprising same
CN109558323B (en) System, method and apparatus for debugging pages
US11201806B2 (en) Automated analysis and recommendations for highly performant single page web applications
US10528456B2 (en) Determining idle testing periods
CN109002282B (en) Method and device for realizing animation effect in web page development
CN114218052B (en) Service interaction diagram generation method, device, equipment and storage medium
US11095957B2 (en) Method and apparatus for publishing information, and method and apparatus for processing information
CN110673886B (en) Method and device for generating thermodynamic diagrams
CN112954056B (en) Method and device for processing monitoring data, electronic equipment and storage medium
CN111200639B (en) Information pushing method and device based on user operation behavior and electronic equipment
CN109582580B (en) System, method and apparatus for debugging pages
CN113282444A (en) Visualization method and device for business process debugging
CN115994971A (en) Image rendering time calculation method and device, storage medium and electronic equipment
CN115509913A (en) Software automation test method, device, machine readable medium and equipment
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN113849758A (en) Webpage index generation method and device, electronic equipment and storage medium
CN111131354B (en) Method and apparatus for generating information
CN108960433B (en) Method and system for running machine learning modeling process
CN113378346A (en) Method and device for model simulation
CN111767486A (en) Method, device, electronic equipment and computer readable medium for displaying page
EP4250142A1 (en) Session replay with multiple tabs
CN110825438B (en) Method and device for simulating data processing of artificial intelligence chip

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