Application monitoring method and device, computer equipment and storage medium

By monitoring the exit signal and stuttering events in the target application, the problem of inaccurate ANR detection in the prior art is solved, and fast and accurate monitoring of the application's unresponsiveness problem is achieved.

CN119829381APending Publication Date: 2025-04-15SHENZHEN YISHIHUOLALA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411984646.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-28
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing monitoring scheme for application non-response (ANR) problems cannot be accurately detected in some specific scenarios, resulting in inaccurate monitoring results.

Method used

By obtaining the Android version of the target application, if the version is larger than the preset version, the signal processor and message looper are called to listen for exit signals and stuttering events. Based on the monitored signals and events, an unresponsive analysis is performed to generate analysis results.

Benefits of technology

It realizes the rapid and accurate detection of application unresponsive problems in complex multithreaded application scenarios, and improves the accuracy and reliability of monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829381A_ABST
    Figure CN119829381A_ABST
Patent Text Reader

Abstract

The invention provides an application monitoring method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining an Android system version corresponding to a target application in a running process of the target application; judging whether the version of the Android system is greater than a preset version or not; if yes, calling a preset signal processor and a message circulator; whether an exit signal exists or not is monitored based on the signal processor, and whether a jamming event exists in the message circulator or not is monitored; if an exit signal is monitored on the basis of the signal processor, performing application non-response analysis on the target application on the basis of a preset first analysis strategy to obtain a corresponding first analysis result; and if it is firstly monitored that the message circulator has the lagging event, performing application non-response analysis on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result. According to the method and the device, whether the target application has the application non-response problem or not can be quickly and accurately monitored and processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to an application monitoring method, device, computer equipment and storage medium. Background Art

[0002] With the rapid development of information technology, mobile applications (APP) have become an indispensable part of people's daily life and work. However, as APP functions become increasingly rich and complex, their stability and performance issues are becoming increasingly prominent, among which the phenomenon of Application Not Responding (ANR) is particularly prominent. The ANR problem not only seriously affects the user experience, but may also lead to serious consequences such as data loss and system crash. Therefore, it is particularly important to effectively monitor and solve the ANR problem.

[0003] At present, many monitoring tools for ANR problems have emerged on the market. These tools use different technical means to achieve real-time monitoring of the running status of the APP. Once the ANR phenomenon is detected, an alarm will be immediately issued to the developer or operation and maintenance personnel so that timely measures can be taken to intervene. These monitoring tools have improved the stability and user experience of the APP to a certain extent, but there are still some shortcomings. Specifically, the current mainstream monitoring solutions are often unable to accurately detect ANR problems in some specific scenarios. For example, in some complex multi-threaded application scenarios, due to synchronization and communication problems between threads, the APP may experience a brief freeze or unresponsiveness at certain moments, but this phenomenon may not be enough to trigger the alarm mechanism of the existing monitoring tools and thus be missed. Therefore, the existing monitoring solutions for ANR problems have the problem of inaccurate monitoring results. Summary of the invention

[0004] The main purpose of the present invention is to provide an application monitoring method, device, computer equipment and storage medium, aiming to solve the technical problem that the existing monitoring solutions for ANR problems have inaccurate monitoring results.

[0005] To achieve the above object, the present invention provides an application monitoring method, the method comprising: During the running process of the target application, obtaining the Android system version corresponding to the target application; Determine whether the Android system version is greater than a preset version; If so, call the preset signal handler and message looper; Based on the signal processor, monitor whether there is an exit signal, and monitor whether there is a freeze event in the message circulator; If the signal processor first monitors the exit signal, then performing application unresponsiveness analysis on the target application based on a preset first analysis strategy to obtain a corresponding first analysis result; If a jam event of the message circulator is first monitored, an application unresponsiveness analysis is performed on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result.

[0006] Optionally, if the signal processor first monitors the exit signal, performing application unresponsiveness analysis on the target application based on a preset first analysis strategy to obtain a corresponding first analysis result includes: If the signal processor first listens to the exit signal, detecting the application process of the target application to determine whether the application process is marked as unresponsive; If the application process is marked as unresponsive, generating a first analysis result indicating that the target application has an application unresponsive problem; If the application process is not marked as unresponsive, determining whether a freeze event of the message circulator is detected; If so, obtain a first processing duration corresponding to the freeze event, and determine whether the first processing duration is greater than a preset first duration threshold; If so, a first analysis result is generated indicating that the target application has an application non-response problem; otherwise, a first analysis result is generated indicating that the target application does not have an application non-response problem.

[0007] Optionally, if a jam event of the message circulator is first monitored, an application unresponsiveness analysis is performed on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result, including: If a jam event is detected in the message circulator, determine whether the second processing duration corresponding to the jam event is greater than a preset second duration threshold; If so, obtaining a system log corresponding to the target application; Determine whether there is a target keyword related to the application not responding in the system log; If so, a second analysis result is generated indicating that the target application has an application non-response problem; otherwise, a second analysis result is generated indicating that the target application does not have an application non-response problem.

[0008] Optionally, after determining whether the Android system version is greater than a preset version, the method further includes: If the Android system version is smaller than the preset version, calling the preset file monitoring instance; Perform event monitoring on a preset target directory based on the file monitoring instance; If the specified file is generated in the target directory through the file monitoring instance, a third analysis result is generated indicating that the target application has an application non-response problem; otherwise, a third analysis result is generated indicating that the target application does not have an application non-response problem.

[0009] Optionally, if the message circulator is first monitored for a freeze event, then an application unresponsiveness analysis is performed on the target application based on a preset second analysis strategy, and after obtaining a corresponding second analysis result, the method further includes: Determine whether the content of the analysis result is that the target application has an application non-response problem; wherein the analysis result includes the first analysis result or the second analysis result; If yes, obtaining relevant information corresponding to the analysis result based on a preset information type; Get the preset information reporting strategy; Based on the information reporting strategy, the relevant information is sent to a preset monitoring system.

[0010] Optionally, after acquiring relevant information corresponding to the analysis result based on a preset information type, the method further includes: Acquire a storage method corresponding to the relevant information; Call the preset specified storage medium; Based on the storage method, the relevant information is stored in the designated storage medium.

[0011] Optionally, before calling the preset signal processor and message circulator, the method further includes: Get the preset registration method; Registering and obtaining the signal processor based on the registration method; The signal processor is stored.

[0012] In addition, to achieve the above object, the present invention further provides an application monitoring device, the application monitoring device comprising: A first acquisition module is used to acquire the Android system version corresponding to the target application during the running process of the target application; A first judging module, used to judge whether the Android system version is greater than a preset version; A first calling module, for calling a preset signal processor and message circulator if yes; A monitoring module, used for monitoring whether there is an exit signal based on the signal processor, and monitoring whether there is a freeze event in the message circulator; A first processing module is used for performing application unresponsiveness analysis on the target application based on a preset first analysis strategy to obtain a corresponding first analysis result if the signal processor first monitors the exit signal; The second processing module is used to perform application unresponsiveness analysis on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result if a freeze event of the message circulator is first monitored.

[0013] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution: The computer device includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of any one of the application monitoring methods proposed in the embodiments of the present application are implemented.

[0014] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the application monitoring method described in any one of the embodiments of the present application are implemented.

[0015] Compared with the prior art, the embodiments of the present application have the following beneficial effects: The present invention provides an application monitoring method, device, computer equipment and storage medium, the method comprising: during the operation of a target application, first obtaining an Android system version corresponding to the target application; then determining whether the Android system version is greater than a preset version; if so, calling a preset signal processor and message circulator; subsequently monitoring whether there is an exit signal based on the signal processor, and monitoring whether there is a freeze event in the message circulator; if the exit signal is first monitored by the signal processor, performing an application unresponsiveness analysis on the target application based on a preset first analysis strategy to obtain a corresponding first analysis result; and if a freeze event is first monitored in the message circulator, performing an application unresponsiveness analysis on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result. During the operation of the target application, the present application obtains the Android system version corresponding to the target application. If it is detected that the Android system version is greater than the preset version, the preset signal processor and message circulator will be called, and the signal processor will be used to monitor whether there is an exit signal and whether there is a freeze event in the message circulator. If the signal processor first monitors the exit signal, the target application is analyzed for application non-response based on the preset first analysis strategy to obtain a corresponding first analysis result. If the message circulator is first monitored for a freeze event, the target application is analyzed for application non-response based on the preset second analysis strategy to obtain a corresponding second analysis result. This achieves the goal of combining multiple means such as exit signal monitoring based on the signal processor and freeze event monitoring based on the message circulator to quickly and accurately complete the monitoring and processing of whether the target application has an application non-response problem, thereby ensuring the accuracy of the obtained analysis results and improving the accuracy and reliability of application monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 is an exemplary system architecture diagram to which the present application may be applied; Figure 2 is a flow chart of an application monitoring method provided by an embodiment of the present invention; Figure 3 is a structural schematic diagram of an embodiment of an application monitoring device according to the present application; Figure 4 This is a basic structural block diagram of the computer device in this embodiment. DETAILED DESCRIPTION

[0018] The application monitoring method provided by the embodiment of the present invention is applied to the application monitoring device. Unless otherwise defined, all technical and scientific terms used in this document have the same meaning as those generally understood by technicians in the technical field of this application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned drawings and any variations thereof are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0019] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0020] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0021] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0022] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social online platform software, etc.

[0023] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV), laptop computers, desktop computers, etc.

[0024] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0025] It should be noted that the application monitoring method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the application monitoring device is generally set in the server / terminal device.

[0026] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0027] With the rapid development of information technology, mobile applications (APP) have become an indispensable part of people's daily life and work. However, as APP functions become increasingly rich and complex, their stability and performance issues are becoming increasingly prominent, among which the phenomenon of Application Not Responding (ANR) is particularly prominent. The ANR problem not only seriously affects the user experience, but may also lead to serious consequences such as data loss and system crash. Therefore, it is particularly important to effectively monitor and solve the ANR problem.

[0028] At present, many monitoring tools for ANR problems have emerged on the market. These tools use different technical means to achieve real-time monitoring of the running status of the APP. Once the ANR phenomenon is detected, an alarm will be immediately issued to the developer or operation and maintenance personnel so that timely measures can be taken to intervene. These monitoring tools have improved the stability and user experience of the APP to a certain extent, but there are still some shortcomings. Specifically, the current mainstream monitoring solutions are often unable to accurately detect ANR problems in some specific scenarios. For example, in some complex multi-threaded application scenarios, due to synchronization and communication problems between threads, the APP may experience a brief freeze or unresponsiveness at certain moments, but this phenomenon may not be enough to trigger the alarm mechanism of the existing monitoring tools and thus be missed. Therefore, the existing monitoring solutions for ANR problems have the problem of inaccurate monitoring results.

[0029] Continue to refer Figure 2 , shows a flow chart of an embodiment of the application monitoring method proposed in the present application. The embodiment of the present application can acquire and process relevant data based on artificial intelligence technology.

[0030] The application monitoring method provided by the embodiment of the present invention comprises the following steps: S210, during the running process of the target application, obtaining an Android system version corresponding to the target application.

[0031] In this step, the execution subject of the present invention may be a mobile terminal installed with the target application. The corresponding Android system version may be obtained by querying the Android system version of the mobile terminal corresponding to the target application.

[0032] S220, determining whether the Android system version is greater than a preset version.

[0033] In this step, the preset version may specifically be Android 5.0 version.

[0034] S230: If yes, call the preset signal processor and message circulator.

[0035] In this step, the signal processor can be a signal processor constructed based on a preset registration method. The specific construction process will be further described in detail in the subsequent specific embodiments of the present invention, and will not be elaborated on here. The message circulator is Looper, which is a class for managing message queues and distributing messages. Each thread can have a Looper object, which is responsible for taking messages from the message queue and distributing them to the corresponding processing function.

[0036] S240, based on the signal processor monitoring whether there is an exit signal, and monitoring whether there is a freeze event in the message circulator.

[0037] In this step, the exit signal refers to the SIGQUIT signal. The exit signal is a signal in UNIX and UNIX-like systems, which is used to request the process to generate a core dump file. The presence of the exit signal can be monitored by using the above signal processor. The above jam event refers to the event corresponding to the jam of the current page of the target application, that is, the time spent by the Looper in processing the message exceeds the preset threshold, resulting in page jam.

[0038] S250: If the signal processor first monitors the exit signal, perform application unresponsiveness analysis on the target application based on a preset first analysis strategy to obtain a corresponding first analysis result.

[0039] In this step, ANR (Application Not Responding): Application is not responding, which is a term in the Android system, indicating that the application cannot respond to the user's input or the system's request within the specified time. Among them, if the signal processor first listens to the exit signal, the target application is analyzed for application non-response based on the preset first analysis strategy to obtain the specific implementation process of the corresponding first analysis result. The present invention will further describe this in detail in the subsequent specific embodiments, and will not be elaborated on here.

[0040] S260: If a freeze event of the message circulator is detected first, an application unresponsiveness analysis is performed on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result.

[0041] In this step, if the message circulator is first monitored to have a freeze event, the target application is subjected to an application unresponsiveness analysis based on a preset second analysis strategy to obtain a specific implementation process corresponding to the second analysis result. The present invention will provide further detailed descriptions of this in subsequent specific embodiments, which will not be elaborated in detail here.

[0042] In an embodiment of the present invention, during the operation of a target application, an Android system version corresponding to the target application is first obtained; then a determination is made as to whether the Android system version is greater than a preset version; if so, a preset signal processor and message circulator are called; subsequently, based on the signal processor, monitoring is performed to determine whether there is an exit signal, and based on the message circulator, monitoring is performed to determine whether there is a freeze event; if the signal processor first monitors an exit signal, an application unresponsiveness analysis is performed on the target application based on a preset first analysis strategy to obtain a corresponding first analysis result; and if a freeze event is first monitored in the message circulator, an application unresponsiveness analysis is performed on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result. During the operation of the target application, the present application obtains the Android system version corresponding to the target application. If it is detected that the Android system version is greater than the preset version, the preset signal processor and message circulator will be called, and the signal processor will be used to monitor whether there is an exit signal and whether there is a freeze event in the message circulator. If the signal processor first monitors the exit signal, the target application is analyzed for application non-response based on the preset first analysis strategy to obtain a corresponding first analysis result. If the message circulator is first monitored for a freeze event, the target application is analyzed for application non-response based on the preset second analysis strategy to obtain a corresponding second analysis result. This achieves the goal of combining multiple means such as exit signal monitoring based on the signal processor and freeze event monitoring based on the message circulator to quickly and accurately complete the monitoring and processing of whether the target application has an application non-response problem, thereby ensuring the accuracy of the obtained analysis results and improving the accuracy and reliability of application monitoring.

[0043] Optionally, if the signal processor first monitors the exit signal, performing application unresponsiveness analysis on the target application based on a preset first analysis strategy to obtain a corresponding first analysis result includes: If the signal processor first monitors the exit signal, the application process of the target application is detected to determine whether the application process is marked as unresponsive.

[0044] In this step, the exit signal refers to the SIGQUIT signal. If the signal processor first listens to the exit signal, the system process status can be checked to see whether the application process of the current target application is marked as NotResponding, that is, not responding.

[0045] If the application process is marked as unresponsive, a first analysis result is generated indicating that the target application has an application unresponsiveness problem.

[0046] In this step, if the above application process is marked as unresponsive, it is directly determined that the target application has an ANR problem, and a first analysis result indicating that the target application has an application unresponsive problem is generated.

[0047] If the application process is not marked as unresponsive, it is determined whether a freeze event of the message circulator is monitored.

[0048] In this step, if the application process is not marked as unresponsive, the message circulator is continuously monitored for a freeze event. The message circulator is Looper. A freeze event is when the current page of the target application freezes.

[0049] If so, obtain a first processing duration corresponding to the freeze event, and determine whether the first processing duration is greater than a preset first duration threshold.

[0050] In this step, the first processing duration refers to the duration of the current page of the target application being stuck. There is no specific limitation on the value of the first duration threshold, which can be set according to the actual business scenario. For example, the duration threshold for the foreground application can be set to 5s, and the duration threshold for the background application can be set to 15s.

[0051] If so, a first analysis result is generated indicating that the target application has an application non-response problem; otherwise, a first analysis result is generated indicating that the target application does not have an application non-response problem.

[0052] In this step, if it is detected that the first processing duration corresponding to the jam event is greater than the first duration threshold, it is determined that the target application has an ANR problem, and a first analysis result that the target application has an application non-response problem is generated. If it is detected that the first processing duration corresponding to the jam event is not greater than the first duration threshold, it is not determined that the target application has an ANR problem, and a first analysis result that the target application does not have an application non-response problem is generated.

[0053] In this embodiment, if the signal processor first listens to the exit signal, the application process of the target application is detected to determine whether the application process is marked as unresponsive; if the application process is marked as unresponsive, a first analysis result is generated that the target application has an application unresponsive problem; if the application process is not marked as unresponsive, it is determined whether a jamming event is detected in the message circulator; if so, a first processing duration corresponding to the jamming event is obtained, and it is determined whether the first processing duration is greater than a preset first duration threshold; if so, a first analysis result is generated that the target application has an application unresponsive problem, otherwise a first analysis result is generated that the target application does not have an application unresponsive problem. In the present invention, if the signal processor first listens to the exit signal, the application process of the target application is detected, and if it is detected that the application process is marked as unresponsive, a first analysis result is generated that the target application has an application unresponsive problem. If the application process is not marked as unresponsive and a jam event is detected in the message circulator, the first processing duration corresponding to the jam event will be intelligently obtained, and a determination will be made as to whether the first processing duration is greater than a preset first duration threshold. If the first processing duration is greater than the first duration threshold, a first analysis result is generated indicating that the target application has an application unresponsiveness problem; otherwise, a first analysis result is generated indicating that the target application does not have an application unresponsiveness problem. Thus, by combining a variety of means such as signal processor-based exit signal monitoring and message circulator-based jam event monitoring, rapid and accurate monitoring of whether the target application has an application unresponsiveness problem is achieved, thereby ensuring the accuracy of the first analysis result and improving the accuracy and reliability of application monitoring.

[0054] Optionally, if a jam event of the message circulator is first monitored, an application unresponsiveness analysis is performed on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result, including: If a jam event of the message circulator is first monitored, it is determined whether a second processing duration corresponding to the jam event is greater than a preset second duration threshold.

[0055] In this step, the second processing duration refers to the duration of the current page of the target application being stuck. There is no specific limitation on the value of the second duration threshold, which can be set according to the actual business scenario. For example, the duration threshold for the foreground application can be set to 5s, and the duration threshold for the background application can be set to 15s.

[0056] If so, obtain the system log corresponding to the target application.

[0057] In this step, when it is detected that the second processing time corresponding to the freeze event is greater than the second time threshold, the system log can be captured by executing the logcat command.

[0058] It is determined whether there is a target keyword related to the application not responding in the system log.

[0059] In this step, the target keywords are keywords related to ANR (such as "skipping Anr", which needs to be compatible with systems of different manufacturers).

[0060] If so, a second analysis result is generated indicating that the target application has an application non-response problem; otherwise, a second analysis result is generated indicating that the target application does not have an application non-response problem.

[0061] In this step, if it is detected that there are target keywords related to application non-response in the above-mentioned system log, it is determined that the target application has an ANR problem, and a second analysis result indicating that the target application has an application non-response problem is generated. If it is detected that there are no target keywords related to application non-response in the above-mentioned system log, it is determined that the target application does not have an ANR problem, and a second analysis result indicating that the target application does not have an application non-response problem is generated.

[0062] In this embodiment, if a jamming event is first monitored in the message circulator, it is determined whether the second processing duration corresponding to the jamming event is greater than a preset second duration threshold; if so, the system log corresponding to the target application is obtained; subsequently, it is determined whether there is a target keyword related to application non-response in the system log; if so, a second analysis result is generated that the target application has an application non-response problem, otherwise a second analysis result is generated that the target application does not have an application non-response problem. When the present invention first monitors the existence of a freeze event in the message circulator, if it is detected that the second processing time corresponding to the freeze event is greater than a preset second time threshold, the system log corresponding to the target application will be intelligently obtained, and then it will be determined whether there is a target keyword related to the application non-response in the system log. If it is detected that there is a target keyword related to the application non-response in the system log, a second analysis result indicating that the target application has an application non-response problem will be generated, otherwise a second analysis result indicating that the target application does not have an application non-response problem will be generated. In this way, by combining multiple means such as exit signal monitoring based on a signal processor, freeze event monitoring based on a message circulator, and system log analysis, it is possible to quickly and accurately complete the monitoring process of whether the target application has an application non-response problem, thereby ensuring the accuracy of the second analysis result obtained and improving the accuracy and reliability of application monitoring.

[0063] Optionally, after determining whether the Android system version is greater than a preset version, the method further includes: If the Android system version is smaller than the preset version, the preset file monitoring instance is called.

[0064] In this step, the preset version specifically refers to Android 5.0. The file monitoring instance specifically refers to the pre-created FileObserver instance. In Android, FileObserver is a class used to monitor file system changes. It can monitor changes in specified directories or files, such as file creation, deletion, modification, etc., and trigger corresponding callback methods.

[0065] Event monitoring is performed on a preset target directory based on the file monitoring instance.

[0066] In this step, the target directory is specifically the / data / anr / directory. You can use a file monitoring instance, that is, a FileObserver instance, to monitor file changes in the / data / anr / directory, specifically monitoring file creation events (CREATE). CREATE: Create event. In FileObserver, this is an event type that indicates that a file or directory has been created.

[0067] If the specified file is generated in the target directory through the file monitoring instance, a third analysis result is generated indicating that the target application has an application non-response problem; otherwise, a third analysis result is generated indicating that the target application does not have an application non-response problem.

[0068] In this step, the specified file refers to the trace file. If a new file is detected in the target directory through the file monitoring instance, that is, when the trace file is generated, it will be determined that the target application has an ANR problem, and a third analysis result is generated that the target application has an application non-response problem. If the trace file is not detected in the target directory through the file monitoring instance, it will be determined that the target application does not have an ANR problem, and a third analysis result is generated that the target application does not have an application non-response problem.

[0069] In this embodiment, if the Android system version is less than the preset version, a preset file monitoring instance is called; subsequently, event monitoring is performed on the preset target directory based on the file monitoring instance; if the specified file is generated in the target directory through the file monitoring instance, a third analysis result is generated that the target application has an application non-response problem, otherwise a third analysis result is generated that the target application does not have an application non-response problem. When the present invention detects that the Android system version corresponding to the target application is less than the preset version, the preset file monitoring instance will be automatically and intelligently called to perform event monitoring on the preset target directory. If the specified file is generated in the target directory through the file monitoring instance, a third analysis result is generated that the target application has an application non-response problem, otherwise a third analysis result is generated that the target application does not have an application non-response problem, thereby quickly and accurately completing the monitoring process of whether the target application has an application non-response problem based on the obtained event monitoring results, ensuring the accuracy of the obtained analysis results, and improving the accuracy and reliability of application monitoring.

[0070] Optionally, if the message circulator is first monitored for a freeze event, then an application unresponsiveness analysis is performed on the target application based on a preset second analysis strategy, and after obtaining a corresponding second analysis result, the method further includes: Determine whether the content of the analysis result is that the target application has an application non-response problem; wherein the analysis result includes the first analysis result or the second analysis result.

[0071] In this step, the content of the analysis result can be identified to determine whether the content of the analysis result indicates that the target application has an application unresponsiveness problem. The content of the analysis result includes: the target application has an application unresponsiveness problem, or the target application does not have an application unresponsiveness problem.

[0072] If so, relevant information corresponding to the analysis result is obtained based on a preset information type.

[0073] In this step, the above-mentioned relevant information may refer to ANR (Application Not Responding) information, and the above-mentioned information types may at least include Looper time consumption, occurrence time, occurrence scenario, system status when ANR occurs, stack information and other information types.

[0074] Get the preset information reporting strategy.

[0075] In this step, an information reporting strategy is pre-set to ensure that ANR information can be reported to the monitoring system in a timely and accurate manner. The information reporting strategy includes: considering the use of asynchronous reporting methods to avoid reporting operations affecting application performance. And implementing a retry mechanism to ensure that ANR information can be successfully reported in abnormal situations such as network failures.

[0076] Based on the information reporting strategy, the relevant information is sent to a preset monitoring system.

[0077] In this step, the relevant information can be reported to the preset monitoring system according to the policy content of the above information reporting policy. Among them, the monitoring system is set with alarm rules, and when ANR information is received, an alarm will be issued in time. A feedback mechanism will be established to feed back the ANR information to the development team so as to locate and solve the problem in time.

[0078] In this embodiment, it is determined whether the content of the analysis result indicates that the target application has an application non-response problem; wherein the analysis result includes the first analysis result or the second analysis result; if so, relevant information corresponding to the analysis result is obtained based on a preset information type; then a preset information reporting strategy is obtained; subsequently, based on the information reporting strategy, the relevant information is sent to a preset monitoring system. When the present invention detects whether the content of the analysis result indicates that the target application has an application non-response problem, it intelligently obtains relevant information corresponding to the analysis result based on a preset information type, and then sends the relevant information to a preset monitoring system based on the use of an information reporting strategy, so that the subsequent monitoring system can locate and solve the problem in a timely manner based on the received relevant information, thereby ensuring the operational stability of the target application.

[0079] Optionally, after acquiring relevant information corresponding to the analysis result based on a preset information type, the method further includes: Obtain a storage method corresponding to the relevant information.

[0080] In this step, there is no specific limitation on the selection of the above storage method, which can be set according to actual business needs, for example, the JSON format can be used.

[0081] Recall the preset specified storage medium.

[0082] In this step, there is no specific limitation on the selection of the above-mentioned designated storage medium, which can be determined according to actual business needs. For example, any one of the storage media such as local database, cloud server, disk, blockchain, etc. can be used.

[0083] Based on the storage method, the relevant information is stored in the designated storage medium.

[0084] In this step, the above-mentioned storage method can be used to store the relevant information in the corresponding position in the above-mentioned designated storage medium.

[0085] In this embodiment, the storage method corresponding to the relevant information is obtained; then the preset designated storage medium is called; and subsequently, based on the storage method, the relevant information is stored in the designated storage medium. The present invention obtains the storage method corresponding to the relevant information, calls the preset designated storage medium, and then stores the relevant information in the designated storage medium based on the use of the storage method, which effectively improves the storage intelligence and storage standardization of the relevant information and ensures the security of the relevant information.

[0086] Optionally, before calling the preset signal processor and message circulator, the method further includes: Gets the preset registration method.

[0087] In this step, the above registration method is specifically the Signal.handle(Signal.SIGQUIT, handler) method.

[0088] The signal processor is registered based on the registration method.

[0089] In this step, a custom signal handler can be registered by using the above registration method, that is, the Signal.handle(Signal.SIGQUIT, handler) method.

[0090] The signal processor is stored.

[0091] In this step, the generated signal processor is responsible for monitoring the SIGQUIT signal, i.e., the exit signal, and executing a part of the preset ANR decision logic when the exit signal arrives. The registered signal processor is stored for subsequent calling.

[0092] In this embodiment, a preset registration method is obtained; then the signal processor is registered based on the registration method; and the signal processor is subsequently stored. The present invention can efficiently and intelligently register the required signal processor based on the use of the registration method, thereby improving the generation intelligence of the signal processor. In addition, by storing the signal processor, it is convenient to directly call the signal processor later to accurately complete the monitoring process of the exit signal, thereby improving the processing efficiency of the monitoring process of the exit signal.

[0093] Further references Figure 3 , as a response to the above Figure 2In order to realize the method shown in the figure, the present application provides an embodiment of an application monitoring device 300, and the embodiment of the device is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0094] An embodiment of the present invention provides an application monitoring device 300, and the application monitoring device 300 includes: A first acquisition module 310 is used to acquire an Android system version corresponding to the target application during the running process of the target application; A first determination module 320 is used to determine whether the Android system version is greater than a preset version; A first calling module 330, for calling a preset signal processor and message circulator if yes; A monitoring module 340 is used to monitor whether there is an exit signal based on the signal processor, and monitor whether there is a freeze event in the message circulator; A first processing module 350 is configured to perform application unresponsiveness analysis on the target application based on a preset first analysis strategy to obtain a corresponding first analysis result if the signal processor first monitors the exit signal; The second processing module 360 ​​is used to perform application unresponsiveness analysis on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result if a freeze event of the message circulator is first monitored.

[0095] Optionally, the first processing module 350 includes: A first judgment submodule is used to detect the application process of the target application and determine whether the application process is marked as unresponsive if the signal processor first monitors the exit signal; A first generating submodule, configured to generate a first analysis result indicating that the target application has an application non-response problem if the application process is marked as non-response; A second judgment submodule is used to judge whether a freeze event of the message circulator is monitored if the application process is not marked as unresponsive; A third judgment submodule is used to obtain a first processing duration corresponding to the freeze event, and determine whether the first processing duration is greater than a preset first duration threshold; The second generating submodule is used to generate a first analysis result of the target application having an application non-response problem if yes, and otherwise generate a first analysis result of the target application not having an application non-response problem.

[0096] Optionally, the second processing module 360 ​​includes: A third judgment submodule is used to judge whether a second processing duration corresponding to the jam event is greater than a preset second duration threshold if a jam event of the message circulator is first monitored; an acquisition submodule, for acquiring a system log corresponding to the target application; A fourth judgment submodule is used to judge whether there is a target keyword related to the application not responding in the system log; The third generating submodule is used to generate a second analysis result of the target application having an application non-response problem if yes, and otherwise generate a second analysis result of the target application not having an application non-response problem.

[0097] Optionally, the application monitoring device 300 further includes: A second calling module, configured to call a preset file monitoring instance if the Android system version is smaller than the preset version; An event monitoring module, used for monitoring events of a preset target directory based on the file monitoring instance; The generation module is used to generate a third analysis result indicating that the target application has an application non-response problem if the specified file is generated in the target directory through the file monitoring instance, otherwise generate a third analysis result indicating that the target application does not have an application non-response problem.

[0098] Optionally, the application monitoring device 300 further includes: A second judgment module is used to judge whether the content of the analysis result is that the target application has an application non-response problem; wherein the analysis result includes the first analysis result or the second analysis result; A second acquisition module, configured to acquire relevant information corresponding to the analysis result based on a preset information type; The third acquisition module is used to obtain a preset information reporting strategy; The sending module is used to send the relevant information to a preset monitoring system based on the information reporting strategy.

[0099] Optionally, the application monitoring device 300 further includes: A fourth acquisition module, used to acquire a storage method corresponding to the relevant information; A third calling module is used to call a preset designated storage medium; The first storage module is used to store the relevant information in the designated storage medium based on the storage method.

[0100] Optionally, the application monitoring device 300 further includes: A fifth acquisition module, used to acquire a preset registration method; A registration module, used for registering and obtaining the signal processor based on the registration method; The second storage module is used to store the signal processor.

[0101] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment. The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0102] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0103] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as the program code of the application monitoring method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0104] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the program code stored in the memory 41 or process data, such as running the program code of the application monitoring method.

[0105] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0106] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores the application crash processing program, and the application crash processing program can be executed by at least one processor to enable the at least one processor to perform the steps of the application monitoring method as described above.

[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware online platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0108] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0109] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. An application monitoring method, characterized in that: include: During the running process of the target application, obtaining the Android system version corresponding to the target application; Determine whether the Android system version is greater than a preset version; If so, call the preset signal handler and message looper; Based on the signal processor, monitor whether there is an exit signal, and monitor whether there is a freeze event in the message circulator; If the signal processor first monitors the exit signal, then performing application unresponsiveness analysis on the target application based on a preset first analysis strategy to obtain a corresponding first analysis result; If a jam event of the message circulator is monitored first, an application unresponsiveness analysis is performed on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result.

2. The method according to claim 1, characterized in that If the signal processor first monitors the exit signal, then based on the preset first analysis strategy, the target application is subjected to application unresponsiveness analysis to obtain a corresponding first analysis result, including: If the signal processor first listens to the exit signal, detecting the application process of the target application to determine whether the application process is marked as unresponsive; If the application process is marked as unresponsive, generating a first analysis result indicating that the target application has an application unresponsive problem; If the application process is not marked as unresponsive, determining whether a freeze event of the message circulator is detected; If yes, obtain a first processing duration corresponding to the freeze event, and determine whether the first processing duration is greater than a preset first duration threshold; If so, a first analysis result is generated indicating that the target application has an application non-response problem; otherwise, a first analysis result is generated indicating that the target application does not have an application non-response problem.

3. The method according to claim 1, characterized in that If the message circulator is first monitored to have a jam event, an application unresponsiveness analysis is performed on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result, including: If a jam event is detected in the message circulator, determine whether the second processing duration corresponding to the jam event is greater than a preset second duration threshold; If so, obtaining a system log corresponding to the target application; Determine whether there is a target keyword related to the application not responding in the system log; If so, a second analysis result is generated indicating that the target application has an application non-response problem; otherwise, a second analysis result is generated indicating that the target application does not have an application non-response problem.

4. The method according to claim 1, characterized in that: After determining whether the Android system version is greater than a preset version, the method further includes: If the Android system version is smaller than the preset version, calling the preset file monitoring instance; Perform event monitoring on a preset target directory based on the file monitoring instance; If the specified file is generated in the target directory through the file monitoring instance, a third analysis result is generated indicating that the target application has an application non-response problem; otherwise, a third analysis result is generated indicating that the target application does not have an application non-response problem.

5. The method according to claim 4, characterized in that If the message circulator is first monitored to have a jam event, then the target application is subjected to application unresponsiveness analysis based on a preset second analysis strategy, and after obtaining a corresponding second analysis result, the method further includes: Determine whether the content of the analysis result is that the target application has an application non-response problem; wherein the analysis result includes the first analysis result or the second analysis result; If yes, obtaining relevant information corresponding to the analysis result based on a preset information type; Get the preset information reporting strategy; Based on the information reporting strategy, the relevant information is sent to a preset monitoring system.

6. The method according to claim 5, characterized in that After acquiring relevant information corresponding to the analysis result based on the preset information type, the method further includes: Acquire a storage method corresponding to the relevant information; Call the preset specified storage medium; Based on the storage method, the relevant information is stored in the designated storage medium.

7. The method according to claim 1, characterized in that Before calling the preset signal processor and message circulator, the method further includes: Get the preset registration method; Registering and obtaining the signal processor based on the registration method; The signal processor is stored.

8. An application monitoring device, characterized in that: include: A first acquisition module is used to acquire the Android system version corresponding to the target application during the running process of the target application; A first judging module, used to judge whether the Android system version is greater than a preset version; A first calling module, for calling a preset signal processor and message circulator if yes; A monitoring module, used for monitoring whether there is an exit signal based on the signal processor, and monitoring whether there is a freeze event in the message circulator; A first processing module is used for performing application unresponsiveness analysis on the target application based on a preset first analysis strategy to obtain a corresponding first analysis result if the signal processor first monitors the exit signal; The second processing module is used to perform application unresponsiveness analysis on the target application based on a preset second analysis strategy to obtain a corresponding second analysis result if a freeze event of the message circulator is first monitored.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the application monitoring method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the application monitoring method according to any one of claims 1 to 7 are implemented.