CN108345524B - Application program monitoring method and application program monitoring device - Google Patents

Application program monitoring method and application program monitoring device Download PDF

Info

Publication number
CN108345524B
CN108345524B CN201710054388.7A CN201710054388A CN108345524B CN 108345524 B CN108345524 B CN 108345524B CN 201710054388 A CN201710054388 A CN 201710054388A CN 108345524 B CN108345524 B CN 108345524B
Authority
CN
China
Prior art keywords
application program
monitoring
running
main thread
time
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
CN201710054388.7A
Other languages
Chinese (zh)
Other versions
CN108345524A (en
Inventor
吴海涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710054388.7A priority Critical patent/CN108345524B/en
Publication of CN108345524A publication Critical patent/CN108345524A/en
Application granted granted Critical
Publication of CN108345524B publication Critical patent/CN108345524B/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/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

An application program monitoring method and device, the method of one embodiment includes: monitoring the operation parameters of the application program; judging whether the application program is blocked or not according to the monitored running parameters; and when the application program is judged to generate the stuck phenomenon, recording the running state of the current process of the application program and stack information of each thread. The scheme of this embodiment can keep the on-the-spot circumstances of card pause to monitor application program's card pause phenomenon, improves the accuracy of monitoring and analyzing application program card pause phenomenon in view of the above.

Description

Application program monitoring method and application program monitoring device
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to an application monitoring method and an application monitoring apparatus.
Background
With the increasing popularization of intelligent terminal devices such as smart phones and tablet computers, the processing capacity of the intelligent terminal devices is stronger and stronger, and the number of application programs which can be installed and run is larger. In the running process of the application program, a stuck phenomenon may occur, and the stuck phenomenon of the application program is collected, so that the stuck problem of the application program is conveniently analyzed, the performance of the application program is conveniently analyzed, and the application program is further conveniently improved, which is an important content in the application program. Currently, for monitoring the application program stuck problem, usually when the application program is stuck, a log of the application program is recorded, and a reproduction is attempted based on the log record, so as to perform analysis. However, since the log record cannot be completely reflected in the morton site, and the user using environment is not only the same, the morton cannot be completely reproduced based on the log record, thereby easily causing inaccuracy in analyzing the morton phenomenon.
Disclosure of Invention
Accordingly, an object of the present invention is to provide an application monitoring method and an application monitoring apparatus, which can monitor the stuck phenomenon of an application while maintaining the stuck site, thereby improving the accuracy of monitoring and analyzing the stuck phenomenon of the application.
In order to achieve the above purpose, the following technical solutions are adopted in this embodiment:
an application monitoring method, comprising the steps of:
monitoring the operation parameters of the application program;
judging whether the application program is blocked or not according to the monitored running parameters;
and when the application program is judged to generate the stuck phenomenon, recording the running state of the current process of the application program and stack information of each thread.
An application program monitoring method device comprises the following steps:
the monitoring module is used for monitoring the operating parameters of the application program;
the judging module is used for judging whether the application program is blocked or not according to the operation parameters monitored by the monitoring module;
and the recording module is used for recording the running state of the current process of the application program and the stack information of each thread when the judging module judges that the application program generates the pause phenomenon.
According to the scheme of the embodiment, the operation parameters of the application program are monitored, and when the application program is judged to be blocked according to the monitored operation parameters, the operation state of the current process of the application program and the stack information of each thread are recorded, and the operation state of the current process of the application program and the stack information of each thread well reflect a blocking site, so that the blocking phenomenon of the application program can be monitored under the condition that the blocking site is reserved, and the accuracy of monitoring and analyzing the blocking phenomenon of the application program is improved.
Drawings
FIG. 1 is a schematic diagram of an application environment of a scheme in one embodiment;
fig. 2 is a schematic diagram of a composition structure of a terminal in one embodiment;
FIG. 3 is a flow diagram that illustrates a method for application monitoring, in one embodiment;
FIG. 4 is a schematic diagram of the monitoring principle of the embodiment in a specific example;
FIG. 5 is a schematic illustration of an upload interface in one particular example;
FIG. 6 is a schematic diagram of a backend server in one particular example;
FIG. 7 is a schematic diagram of an interface for analyzing the Canton phenomenon in one particular example;
FIG. 8 is a block diagram of an application monitoring device of an embodiment;
FIG. 9 is a schematic diagram of a snoop module in one particular example;
fig. 10 is a schematic structural diagram of a recording module in a specific example.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the detailed description and specific examples, while indicating the scope of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
Fig. 1 is a schematic diagram illustrating an operating environment in an embodiment of the present invention, as shown in fig. 1, the operating environment relates to a terminal 101 and a backend server 102, and the terminal 101 and the backend server 102 can communicate via a network. Various application programs run on the terminal 101, the terminal 101 monitors the running application programs, when the fact that the application programs are blocked is monitored, the terminal 101 records relevant parameters of the blocked site, the relevant parameters are sent to the background server 102, and the background server 102 analyzes the blocking phenomenon of the application programs according to the received relevant parameters. The embodiment of the invention relates to a scheme for monitoring the pause phenomenon of an application program by a terminal 101.
A schematic diagram of the structure of the terminal 101 in one embodiment is shown in fig. 2. The terminal 101 includes a processor, a storage medium, a communication interface, a power interface, and a memory connected by a system bus. The storage medium of the terminal 101 stores an application monitoring apparatus, which is used to implement an application monitoring method. The communication interface of the terminal 101 is used for connecting and communicating with the background server 102, the power interface of the terminal 101 is used for connecting with an external power supply, and the external power supply supplies power to the terminal 101 through the power interface. The terminal 101 may be any device capable of realizing intelligent input and output, for example, a mobile terminal, such as a mobile phone, a tablet computer, etc.; a personal computer, etc., or other devices having the above-described structure.
Fig. 3 is a flowchart illustrating an application monitoring method in an embodiment, where as shown in fig. 3, the application monitoring method of the embodiment includes:
step S301: monitoring the operation parameters of the application program;
step S302: judging whether the application program is blocked according to the monitored running parameters, and entering the step S303 when the application program is judged to be blocked;
step S303: and recording the running state of the current process of the application program and the stack information of each thread.
According to the scheme of the embodiment, the operation parameters of the application program are monitored, and when the application program is judged to be blocked according to the monitored operation parameters, the operation state of the current process of the application program and the stack information of each thread are recorded, and the operation state of the current process of the application program and the stack information of each thread well reflect a blocking site, so that the blocking phenomenon of the application program can be monitored under the condition that the blocking site is reserved, and the accuracy of monitoring and analyzing the blocking phenomenon of the application program is improved.
In step S301, when monitoring the operating parameters of the application program, any possible method may be adopted, and the following description is given by way of example in combination with some of the methods.
In a specific example, the manner of monitoring the operating parameters of the application program may include: and monitoring the starting running time of the main thread of the application program, wherein the running parameters comprise the starting running time. In a specific technical application, the start runtime of the main thread of an application program can be monitored by creating a new monitoring sub-thread.
At this time, when the step S302 determines whether the application program is stuck according to the monitored operation parameters, it may be determined that the application program is stuck when the operation state of the current process of the application program is in operation and a difference between the current time and the start operation time is greater than or equal to a predetermined time threshold.
In a specific technical application, the start running time of each main thread and the end running time of each main thread can be recorded, so that the start running time of the main thread with the latest time can be used as the start running time of the main thread of an application program. The recorded start run time and end run time of each sub-primary thread can be used for performing other related analysis. On the other hand, it is also acceptable to record only the start operation time of the main thread of the application program, and to read the recorded start operation time directly when the determination is made in step S302 by clearing the recorded start operation time after the main thread finishes operating.
In listening for the start runtime of the main thread of the application program, in an application example, the start runtime of the main thread of the application program may be monitored by embedding an observer function in the main thread of the application program and by embedding the observer function in the main thread. In another application example, a rendering frame start time of the application program may be listened to by a screen refresh timer associated with the application program, and the rendering frame start time may be taken as the start runtime. The screen refresh timer may be, for example, a CADisplayLinkUI, so that after the CADisplayLinkUI is embedded into the main thread, the rendering frame start time of the application program is monitored through a caddisplaylinkui object embedded in the main thread.
In another specific example, the manner of monitoring the operation parameters of the application program may include: and monitoring the running state of the main thread of the application program. At this time, the operation parameter includes an operation state of a main thread of the application program.
In this case, when determining whether the application program is stuck according to the monitored operation parameters in step S302, it may be determined that the application program is stuck when the operation state of the main thread of the application program is in the event waiting phase.
In another specific example, the manner of monitoring the operation parameters of the application program may include: and monitoring the CPU utilization rate of the application program. At this time, the operation parameter includes a CPU utilization of the application program.
In this case, when determining whether the application program is stuck according to the monitored operation parameters in step S302, it may be determined that the application program is stuck when the CPU utilization of the application program is greater than or equal to a utilization threshold.
In another specific example, the manner of monitoring the operation parameters of the application program may include: and monitoring frame rendering information of the application program. At this time, the operation parameter includes frame rendering information of the application program.
In this case, when determining whether the application program is stuck according to the monitored operation parameters in step S302, it may be determined that the application program is stuck when the frame rendering information of the application program determines that the application program is dropped.
In a specific application example, when the operation parameters of the application program are monitored in step S301, the monitoring may be performed once at certain intervals, so that the monitoring of the operation parameters is continuously implemented. The time period can be set according to the actual technical application requirements. Accordingly, when it is determined in the step S302 that the application program is not stuck, after a preset time period, the step of determining whether the application program is stuck according to the monitored operation parameters may be returned, and whether the application program is stuck may be determined again. The preset time period may be set according to actual needs, may be the same as the time period for monitoring the operation parameters, and may also be a time period greater than the time period for monitoring the operation parameters.
When the running state of the current process of the application program and the stack information of each thread are recorded in the step S303, a specific example may include: and recording the running state of the current process of the application program and the stack information of each thread to a dump file. Therefore, the running state of the current process of the application program and the stack information of each thread can be recorded in a file mode, and the running state and the stack information are convenient to store and upload to a background server for subsequent analysis.
When the dump file is recorded, a specific example may be as follows:
judging whether a dump file corresponding to the stuck phenomenon exists or not; when the specific judgment is made, whether the call stack of the current main thread of the application program is the same as the call stack of the current main thread recorded in the dump file of the last pause phenomenon can be judged; if the same, it can be determined that there is a dump file corresponding to the stuck phenomenon; if not, it can be determined that there is no dump file corresponding to the stuck phenomenon.
If yes, the dump file corresponding to the stuck phenomenon is judged, the stuck phenomenon is ignored, and the corresponding dump file is not required to be repeatedly generated.
If not, namely judging that no dump file corresponding to the stuck phenomenon exists, generating the dump file of the stuck phenomenon, and recording the running state of the current process of the application program and the stack information of each thread to the generated dump file.
In a specific example, after the running state of the current process of the application program and the stack information of each thread are recorded in step S303, the recorded information may be sent to a background server, so that the background server may perform analysis. Therefore, the method of this embodiment may further include the steps of:
and sending the pause recording information to a background server, wherein the pause recording information comprises the recorded running state of the current process of the application program and the stack information of each thread, and the background server performs data analysis according to the pause recording information.
In step S303, if the running state of the application program and the stack information of each thread are recorded as a dump file, the dump file may be uploaded to the background server. Uploading the dump file to the background server may be timed uploading or uploading based on an instruction of an end user.
In the case of uploading an instruction based on a terminal user, at this time, the method for monitoring an application program in this embodiment may further include the steps of:
receiving an uploading instruction, wherein the uploading instruction comprises a time range;
acquiring dump files in the time range;
and sending the dump files in the time range to a background server, and carrying out data analysis by the background server according to the dump files.
Under the condition of uploading at regular time, at this time, the application monitoring method in this embodiment may further include the steps of:
when the scheduled reporting time point is reached, acquiring a dump file between the last scheduled reporting time point and the current scheduled reporting time point;
and sending the acquired dump files to a background server, and carrying out data analysis by the background server according to the dump files.
Based on the Application monitoring method in the above embodiment, when an Application (for example, APP (Application) of a terminal) of the terminal is stuck during the running process in the process of using the terminal by a terminal user, the solution of the embodiment may record the stuck site, that is, the running state of the current process of the Application and the stack information of each thread, and then upload the running state and the stack information to a background server for analysis. Of course, as described above, when generating the dump file, the dump file may also be actively uploaded to a background server by the end user for analysis by the developer.
Accordingly, fig. 4 shows a schematic diagram of a monitoring principle of the embodiment in a specific example, in the embodiment, an independent monitoring sub-thread may be created to monitor a series of operation indexes of the application program of the terminal, where the operation indexes are related to whether the application program is blocked or not in the process of using the application program by the terminal. In addition, corresponding threshold values can be set for each operation index, when the monitored operation index exceeds the corresponding threshold value, the application program can be regarded as being stuck, and meanwhile, relevant parameters of the application program are recorded acutely, so that the stuck site is captured.
When the application program is stuck, the interface operation is mainly reflected as no reaction, and on the code level of the application program, the main thread is mainly reflected as busy, the main thread enters a waiting event stage or the CPU utilization rate is too high, so that the main thread does not respond to the events such as clicking or sliding of a user.
Accordingly, in one application example, as shown in fig. 4, the main thread of the application program may be monitored for runtime each time the main thread runs. For example, the main thread runloop may be monitored, the running time of each main thread runloop is monitored, and if the running time is too long, the main thread runloop is considered to be stuck. In a specific technical application, an observer function may be added to a main thread runloop, so that a time point when each main thread runloop starts to run, that is, a start running time, may be known through the observer function, after a sub-thread is opened as a monitoring thread, the monitoring thread may periodically check the start running time of each main thread runloop through the observer, and if the sub-main thread runloop has not been executed for a certain time, that is, if a difference between a current time and the start running time of the sub-main thread runloop is greater than or equal to a predetermined time threshold, it is determined that the main thread is stuck.
After the application is monitored to be stuck, a stuck site needs to be reserved, and in order to have more useful information, in this embodiment, when the application is monitored to be stuck, call stacks of all threads in a process of the application are recorded, including an operating state of a current process of the application and stack information of each thread, as information when a cause of the stuck is analyzed.
After the application program is monitored to generate the stuck phenomenon, it may be determined whether the current stuck phenomenon has been recently recorded as the dump file according to the call stack of the current main thread of the application program, for example, whether the call stack of the current main thread of the application program is the same as the call stack of the current main thread recorded in the dump file of the last stuck phenomenon, if so, the call stack of the current main thread of the application program is already recorded as the dump file, and if not, the call stack of the current main thread of the application program is not recorded as the dump file.
If the file is already recorded as a dump file, the phenomenon of blocking is ignored in order to avoid the consumption of the local storage space of the terminal due to the repeated recording of the dump file, and the file is not recorded temporarily, and if the file is not recorded as a dump file, the file is recorded as a dump file and saved. When the file is recorded as a dump file, part of log information of the application program can be written into the dump file at the same time. Wherein each stuck phenomenon can generate a corresponding dump file.
After generating the dump file, the terminal can upload the dump file to the background server based on a set strategy, and the background server stores the received dump file and performs analysis processing to obtain a final analysis result for a developer to use.
When uploading the dump files to the background server, the terminal may automatically upload the dump files generated after uploading once or a certain number of dump files to the background server every certain time, or manually report the dump files. Fig. 5 is a schematic diagram illustrating an upload interface in a specific example, and as shown in fig. 5, all dump files or which time period (e.g., a certain day) of the dump files may be selected to be reported. The terminal may upload the dump file to the backend server based on any possible network communication protocol.
The background server may be an independent server or a server cluster. Taking a background server as an example of a server cluster, fig. 6 shows a schematic diagram of a background server in a specific example, after receiving a dump file uploaded by a terminal, the background server stores the received dump file in a storage server, and then an analysis server pulls data from the storage server at regular time for analysis, and a result after the data analysis can be displayed on the terminal used by a developer for the developer to check, so that the application program can be improved and the like. In performing the data analysis, it may be performed in any possible manner. Since the dump file records the running state of the current process of the application program and the stack information of each thread, during analysis, analysis may be performed in a clustering manner, and a specific clustering analysis manner is not limited in this embodiment, and an analysis interface after analyzing the stuck phenomenon in a specific example is shown in fig. 7.
The method in the above embodiments may be integrated in an application program, or may be integrated in a component for being called by another application program.
Based on the same idea as the method in the above embodiment, an application program monitoring apparatus is also provided.
Fig. 8 is a schematic structural diagram of an application monitoring apparatus in an embodiment, where the application monitoring apparatus includes:
a monitoring module 801, configured to monitor an operation parameter of an application;
a determining module 802, configured to determine whether the application program is stuck according to the operating parameter monitored by the monitoring module;
the recording module 803 is configured to record the running state of the current process of the application program and stack information of each thread when the determining module determines that the application program is stuck.
According to the scheme of the embodiment, the operation parameters of the application program are monitored, and when the application program is judged to be blocked according to the monitored operation parameters, the operation state of the current process of the application program and the stack information of each thread are recorded, and the operation state of the current process of the application program and the stack information of each thread well reflect a blocking site, so that the blocking phenomenon of the application program can be monitored under the condition that the blocking site is reserved, and the accuracy of monitoring and analyzing the blocking phenomenon of the application program is improved.
The monitoring module 801 may monitor the operation parameters of the application program in any possible manner. Fig. 9 shows a schematic structural diagram of a listening module in a specific example.
As shown in fig. 9, in a specific example, the listening module 801 may include:
the runtime monitoring module 8011 is configured to monitor a start runtime of a main thread of the application program, where the running parameter includes the start runtime. In a specific technical application, the start runtime of the main thread of an application program can be monitored by creating a new monitoring sub-thread.
At this time, the determining module 802 may determine that the application is stuck when the running state of the current process of the application is running and a difference between the current time and the starting running time is greater than or equal to a predetermined time threshold.
In a specific technical application, the start running time of each main thread and the end running time of each main thread can be recorded, so that the start running time of the main thread with the latest time can be used as the start running time of the main thread of an application program. The recorded start run time and end run time of each sub-primary thread can be used for performing other related analysis. On the other hand, it is also acceptable that only the start operation time of the main thread of the application program is recorded, and the recorded start operation time is cleared after the main thread finishes operating, so that the judgment module 802 directly reads the recorded start operation time when performing the judgment.
In one specific example, the runtime listening module 8011 may listen to the start runtime of the main thread of the application via an observer function embedded in the main thread. In another example, the runtime listening module 8011 may listen to a rendering frame start time of the application via a screen refresh timer associated with the application, and use the rendering frame start time as the start runtime. Here, the screen refresh timer may be, for example, a CADisplayLinkUI (a timer capable of drawing content on a screen at the same frequency as a screen refresh rate), so that the caddisplaylinkui can be embedded in the main thread and then the rendering frame start time of the application program is monitored through a caddisplaylinkui object embedded in the main thread.
In another specific example, as shown in fig. 9, the listening module 801 may include:
an operation status monitoring module 8012 is configured to monitor an operation status of a main thread of the application program. At this time, the operation parameter includes an operation state of a main thread of the application program.
In this case, the determining module 802 may determine that the application is stuck when the running state of the main thread of the application is the waiting event phase.
In another specific example, as shown in fig. 9, the listening module 801 may include:
a utilization monitoring module 8013 configured to monitor the CPU utilization of the application. At this time, the operation parameter includes a CPU utilization of the application program.
In this case, the determining module 802 may determine that the application program is stuck when the CPU utilization of the application program is greater than or equal to the utilization threshold.
In another specific example, as shown in fig. 9, the listening module 801 may include:
a rendering information monitoring module 8014, configured to monitor frame rendering information of the application. At this time, the operation parameter includes frame rendering information of the application program.
In this case, the determining module 802 may determine that the application is stuck when the frame rendering information of the application determines that the application is dropped.
In a specific application example, the determining module 802 may monitor the operation parameters of the application program once every certain time period, so as to continuously monitor the operation parameters. The time period can be set according to the actual technical application requirements.
Accordingly, in a specific example, the determining module 802 is further configured to determine whether the application program is stuck again according to the operation parameters monitored by the monitoring module after a preset time period elapses when it is determined that the application program is stuck. The preset time period may be set according to actual needs, may be the same as the time period for monitoring the operation parameters, and may also be a time period greater than the time period for monitoring the operation parameters.
When the recording module 803 records the running state of the current process of the application program and the stack information of each thread, a specific example may include: and recording the running state of the current process of the application program and the stack information of each thread to a dump file. Therefore, the running state of the current process of the application program and the stack information of each thread can be recorded in a file mode, and the running state and the stack information are convenient to store and upload to a background server for subsequent analysis.
Fig. 10 shows a schematic structural diagram of a recording module 803 in a specific example, where the recording module 803 includes:
the searching module 8031 is configured to determine whether a dump file corresponding to the stuck phenomenon exists; when the specific judgment is made, whether the call stack of the current main thread of the application program is the same as the call stack of the current main thread recorded in the dump file of the last pause phenomenon can be judged; if the same, it can be determined that there is a dump file corresponding to the stuck phenomenon; if not, judging that no dump file corresponding to the pause phenomenon exists;
the file generating module 8032 is configured to, if the determination result of the searching module 8031 is negative, generate a dump file of the karton phenomenon, and record the running state of the current process of the application program and the stack information of each thread to the generated dump file.
If the determination result of the searching module 8031 is yes, that is, if it is determined that the dump file corresponding to the stuck phenomenon exists, the file generating module 8032 ignores the stuck phenomenon, and does not need to repeatedly generate the corresponding dump file.
In a specific example, after the recording module 803 records the running state of the current process of the application program and the stack information of each thread, the recorded information may also be sent to a background server for analysis by the background server. Therefore, as shown in fig. 8, the apparatus of this embodiment may further include an upload module 804.
In a specific example, the uploading module 804 is configured to send morton record information to a background server, where the morton record information includes a recorded running state of the current process of the application program and stack information of each thread, and the background server performs data analysis according to the morton record information.
After the running state of the current process of the application program and the stack information of each thread are recorded in the dump file, the dump file can be uploaded to a background server.
When the dump file is uploaded to the background server, the dump file can be uploaded at regular time or based on instructions of an end user.
Under the condition of uploading an instruction based on a terminal user, at the moment, the uploading module 804 is used for receiving an uploading instruction, the uploading instruction comprises a time range, the dump files in the time range are obtained, the dump files in the time range are sent to a background server, and the background server performs data analysis according to the dump files. In this case, the morton record information may be embodied by the dump file, or the dump file may include the morton record information.
Under the condition of timed uploading, at this time, the uploading module 804 is configured to, when the scheduled reporting time point is reached, acquire a dump file between the last scheduled reporting time point and the current scheduled reporting time point, and send the acquired dump file to the background server, where the background server performs data analysis according to the dump file. In this case, the morton record information may be embodied by the dump file, or the dump file may include the morton record information.
It will be understood by those skilled in the art that all or part of the processes in the methods of the embodiments described above may be implemented by a computer program, which is stored in a non-volatile computer readable storage medium, and in the embodiments of the present invention, the program may be stored in the storage medium of a computer system and executed by at least one processor in the computer system to implement the processes of the embodiments including the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. An application monitoring method, comprising the steps of:
monitoring the operation parameters of the application program;
judging whether the application program is blocked or not according to the monitored running parameters;
when the application program is judged to be blocked, recording the running state of the current process of the application program and stack information of each thread;
the method for monitoring the operation parameters of the application program comprises the following steps: monitoring the starting running time of a runloop of a main thread of the application program every time by an observer function embedded in the runloop of the main thread in a timed mode through the created independent monitoring sub-thread, wherein the running parameters comprise the starting running time;
the method for judging whether the application program generates the stuck phenomenon according to the monitored operation parameters comprises the following steps: when the running state of the main thread of the application program is running and the difference value between the current time and the starting running time is greater than or equal to a preset time threshold, judging that the application program is in a stuck phenomenon;
the method for monitoring the operation parameters of the application program comprises the following steps: monitoring the running state of a main thread of the application program, wherein the running parameters comprise the running state of the main thread of the application program; the method for judging whether the application program generates the stuck phenomenon according to the monitored operation parameters comprises the following steps: when the running state of the main thread of the application program is in a waiting event stage, judging that the application program generates a stuck phenomenon;
when the application program is judged to be in the stuck phenomenon, the mode of recording the running state of the current process of the application program and the stack information of each thread comprises the following steps:
when the call stack of the current main thread of the application program is the same as the call stack of the current main thread recorded in the dump file of the last stuck phenomenon, the stuck phenomenon is ignored when the dump file corresponding to the stuck phenomenon is judged to exist;
when the call stack of the current main thread of the application program is different from the call stack of the current main thread recorded in the dump file of the last pause phenomenon, determining that no dump file corresponding to the pause phenomenon exists, generating the dump file of the pause phenomenon, and recording the running state of the current process of the application program, the stack information of each thread and partial log information of the application program to the generated dump file, wherein each pause phenomenon generates a corresponding dump file;
receiving an uploading instruction, wherein the uploading instruction comprises a time range;
acquiring dump files in the time range;
and sending the dump files in the time range to a background server, storing the received dump files in a storage server by the background server, regularly pulling data from the storage server by an analysis server for cluster analysis, and displaying the analyzed result on a terminal used by a developer.
2. The application monitoring method according to claim 1, characterized in that:
monitoring the rendering frame starting time of the application program through a screen refreshing timer associated with the application program, and taking the rendering frame starting time as the starting running time.
3. The application monitoring method according to claim 1, characterized in that:
the method for monitoring the operation parameters of the application program comprises the following steps: monitoring the CPU utilization rate of the application program, wherein the operation parameters comprise the CPU utilization rate of the application program; the method for judging whether the application program generates the stuck phenomenon according to the monitored operation parameters comprises the following steps: and when the CPU utilization rate of the application program is greater than or equal to a utilization rate threshold value, judging that the application program generates a stuck phenomenon.
4. The application monitoring method according to claim 1, characterized in that:
the method for monitoring the operation parameters of the application program comprises the following steps: monitoring frame rendering information of the application program, wherein the operation parameters comprise the frame rendering information of the application program; the method for judging whether the application program generates the stuck phenomenon according to the monitored operation parameters comprises the following steps: and when the frame rendering information of the application program judges that the frame of the application program is dropped, judging that the application program generates a pause phenomenon.
5. An application monitoring apparatus, comprising:
the monitoring module is used for monitoring the operating parameters of the application program;
the judging module is used for judging whether the application program is blocked or not according to the operation parameters monitored by the monitoring module;
the recording module is used for recording the running state of the current process of the application program and the stack information of each thread when the judging module judges that the application program is blocked;
the monitoring module comprises: the running time monitoring module is used for creating an independent monitoring sub-thread, regularly monitoring the running starting time of the main thread runloop of the application program every time through an observer function embedded in the main thread runloop through the monitoring sub-thread, and the running parameters comprise the running starting time;
the judging module judges that the application program is blocked when the running state of the main thread of the application program is running and the difference value between the current time and the starting running time is greater than or equal to a preset time threshold;
the monitoring module comprises a running state monitoring module used for monitoring the running state of the main thread of the application program, and the running parameters comprise the running state of the main thread of the application program;
the judging module judges that the application program is blocked when the running state of the main thread of the application program is in a waiting event stage;
the recording module includes:
the searching module is used for judging whether the call stack of the current main thread of the application program is the same as the call stack of the current main thread recorded in the dump file of the last jamming phenomenon, and if so, judging that the dump file corresponding to the jamming phenomenon exists;
the file generation module is used for generating a dump file of the stuck phenomenon when the judgment result of the search module is negative, and recording the running state of the current process of the application program, the stack information of each thread and partial log information of the application program to the generated dump file, wherein each stuck phenomenon generates a corresponding dump file;
the device further comprises: the uploading module is used for receiving an uploading instruction, and the uploading instruction comprises a time range; acquiring dump files in the time range; and sending the dump files in the time range to a background server, storing the received dump files in a storage server by the background server, regularly pulling data from the storage server by an analysis server for cluster analysis, and displaying the analyzed result on a terminal used by a developer.
6. The application monitoring device of claim 5, wherein:
and the runtime monitoring module monitors the rendering frame starting time of the application program through a screen refresh timer associated with the application program, and takes the rendering frame starting time as the starting runtime.
7. The application monitoring device of claim 5, wherein:
the monitoring module comprises a utilization rate monitoring module used for monitoring the CPU utilization rate of the application program, and the operation parameters comprise the CPU utilization rate of the application program; the judging module judges that the application program is blocked when the CPU utilization rate of the application program is greater than or equal to a utilization rate threshold value.
8. The application monitoring device of claim 5, wherein:
the monitoring module comprises a rendering information monitoring module used for monitoring the frame rendering information of the application program, and the operation parameters comprise the frame rendering information of the application program; and the judging module judges that the application program generates a pause phenomenon when the frame rendering information of the application program judges that the frame of the application program is dropped.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
CN201710054388.7A 2017-01-22 2017-01-22 Application program monitoring method and application program monitoring device Active CN108345524B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710054388.7A CN108345524B (en) 2017-01-22 2017-01-22 Application program monitoring method and application program monitoring device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710054388.7A CN108345524B (en) 2017-01-22 2017-01-22 Application program monitoring method and application program monitoring device

Publications (2)

Publication Number Publication Date
CN108345524A CN108345524A (en) 2018-07-31
CN108345524B true CN108345524B (en) 2021-12-14

Family

ID=62962878

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710054388.7A Active CN108345524B (en) 2017-01-22 2017-01-22 Application program monitoring method and application program monitoring device

Country Status (1)

Country Link
CN (1) CN108345524B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110874301B (en) * 2018-08-30 2022-09-13 腾讯科技(深圳)有限公司 Method and device for acquiring program pause information
CN109446039A (en) * 2018-09-21 2019-03-08 苏州蜗牛数字科技股份有限公司 A kind of method and system of detection device Caton
CN109218435B (en) * 2018-09-30 2021-07-23 湖北华联博远科技有限公司 Data uploading method and system
CN109542719B (en) * 2018-10-26 2022-05-13 金蝶软件(中国)有限公司 Thread state monitoring method and device, computer equipment and storage medium
CN109491907A (en) * 2018-11-05 2019-03-19 网易(杭州)网络有限公司 A kind of Caton detection method, device, electronic equipment and storage medium
CN111382026B (en) * 2018-12-28 2024-02-06 广州市百果园信息技术有限公司 Method, device, system, storage medium and computer equipment for monitoring card
CN109918222B (en) * 2019-03-14 2022-09-06 携程计算机技术(上海)有限公司 Dump analysis method and system for application program
CN110177300B (en) * 2019-05-23 2021-12-28 北京字节跳动网络技术有限公司 Program running state monitoring method and device, electronic equipment and storage medium
CN110188016B (en) * 2019-05-24 2022-11-01 山东多科科技有限公司 Method, terminal and storage medium for detecting application program no-response blocking
CN110618933B (en) * 2019-08-15 2021-05-11 华为技术有限公司 Performance analysis method and system, electronic device and storage medium
CN110908864B (en) * 2019-11-11 2024-05-10 腾讯科技(深圳)有限公司 Equipment jamming processing method, device, equipment and medium
CN110990243B (en) * 2019-11-29 2023-08-11 天津网之易创新科技有限公司 Method, device, storage medium and computing equipment for katon analysis
CN111274086B (en) * 2020-01-15 2023-06-13 湖北工程学院 Computer software fault monitoring system
CN113297052B (en) * 2020-02-21 2024-04-26 腾讯科技(深圳)有限公司 Method, device, storage medium and equipment for positioning stuck event of application program
CN113568801B (en) * 2020-04-29 2023-11-03 华为技术有限公司 Frozen screen detection method and device, terminal equipment and computer storage medium
CN111625456B (en) * 2020-05-26 2024-04-30 北京达佳互联信息技术有限公司 Clamping positioning method and device
CN112650647B (en) * 2020-12-29 2023-10-31 北京字节跳动网络技术有限公司 Information acquisition method, device, equipment and medium
CN113900910A (en) * 2021-12-08 2022-01-07 北京新唐思创教育科技有限公司 Application program monitoring method and device, storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117240A (en) * 2009-12-31 2011-07-06 腾讯科技(深圳)有限公司 Method and device for acquiring progress blocking information
CN104317649A (en) * 2014-09-30 2015-01-28 北京金山安全软件有限公司 Processing method and device of terminal application program APP and terminal
CN105389258A (en) * 2015-12-10 2016-03-09 腾讯科技(深圳)有限公司 Program detection method and apparatus
CN105589783A (en) * 2014-11-18 2016-05-18 广州市动景计算机科技有限公司 Application program lag problem data obtaining method and device
CN105677573A (en) * 2016-02-26 2016-06-15 厦门美图移动科技有限公司 Halt detection method and device and computing device
CN105786571A (en) * 2016-02-29 2016-07-20 珠海市魅族科技有限公司 Mobile terminal and control method thereof

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043712B (en) * 2009-10-19 2013-03-13 杭州华三通信技术有限公司 Error message output method and device
CN105740326B (en) * 2016-01-21 2021-01-15 腾讯科技(深圳)有限公司 Thread state monitoring method and device for browser
CN105893130B (en) * 2016-03-31 2019-06-07 维沃移动通信有限公司 A kind of processing method and mobile terminal of application program for mobile terminal
CN106155741B (en) * 2016-06-30 2019-10-08 努比亚技术有限公司 It is a kind of to avoid processing unit and method of the application program without response

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117240A (en) * 2009-12-31 2011-07-06 腾讯科技(深圳)有限公司 Method and device for acquiring progress blocking information
CN104317649A (en) * 2014-09-30 2015-01-28 北京金山安全软件有限公司 Processing method and device of terminal application program APP and terminal
CN105589783A (en) * 2014-11-18 2016-05-18 广州市动景计算机科技有限公司 Application program lag problem data obtaining method and device
CN105389258A (en) * 2015-12-10 2016-03-09 腾讯科技(深圳)有限公司 Program detection method and apparatus
CN105677573A (en) * 2016-02-26 2016-06-15 厦门美图移动科技有限公司 Halt detection method and device and computing device
CN105786571A (en) * 2016-02-29 2016-07-20 珠海市魅族科技有限公司 Mobile terminal and control method thereof

Also Published As

Publication number Publication date
CN108345524A (en) 2018-07-31

Similar Documents

Publication Publication Date Title
CN108345524B (en) Application program monitoring method and application program monitoring device
KR102214888B1 (en) Method and device for detecting an audio signal
KR101606102B1 (en) Terminal device
CN109002387B (en) User reminding method and device of application program, terminal equipment and storage medium
CN103347009A (en) Method and device filtering information
CN109656885B (en) Storage space monitoring method and device, electronic terminal and storage medium
CN110704283A (en) Method, device and medium for uniformly generating alarm information
CN112749013B (en) Thread load detection method and device, electronic equipment and storage medium
CN103473343A (en) File management method, device and terminal
CN111625456A (en) Stuck positioning method and device
CN110601872A (en) Transmission method and device and storage medium
CN106326065B (en) Terminal use duration management method and device
CN112135287A (en) Bluetooth data transmission rate test method, system, electronic device and storage medium
CN114647550A (en) Process control method, device, storage medium and electronic equipment
CN112764959B (en) Method, device, equipment and storage medium for monitoring application program locking problem
CN104424109B (en) Information processing method and electronic equipment
CN112566228A (en) Method and system for reducing equipment power consumption in network video conference
CN101320389B (en) File management method and apparatus
CN110347546B (en) Dynamic adjustment method, device, medium and electronic equipment for monitoring task
CN110442439B (en) Task process processing method and device and computer equipment
CN110781166B (en) Data management method and device in storage system
CN108989088B (en) Log uploading method and communication equipment
CN110719367A (en) Cloud mobile phone friend recommendation method, device, equipment and storage medium
CN113961427B (en) System memory analysis method and electronic equipment
CN116841815A (en) Operation monitoring method, device, electronic equipment and storage medium

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