Application startup anomaly detection method, medium, device and computing equipment

By detecting abnormal events and non-transparent page exposure during application startup, the problem of inaccurate startup abnormality judgment in the existing technology is solved, more efficient abnormality detection and optimization processing are achieved, and manual screening and maintenance costs are reduced.

CN113918422BActive Publication Date: 2025-09-26NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111181761.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-11
Publication Date
2025-09-26
Estimated Expiration
2041-10-11

AI Technical Summary

Technical Problem

The existing technology has inaccurate results in determining application startup anomalies, leading to misjudgments and increased manual screening costs, and is unable to accurately classify and attribute startup anomaly rates in the pre-reporting stage.

Method used

By detecting whether an abnormal event occurs in the target application and determining whether the target non-transparent page is exposed, if an abnormal event is detected and the non-transparent page is not exposed, a message indicating that the abnormal event is a startup abnormality is sent to the server, and the exposure notification code is inserted into the preset page using aspect-oriented programming (AOP) technology to improve detection accuracy.

Benefits of technology

It significantly improves the accuracy of startup anomaly detection, reduces false positives of non-startup anomalies, reduces maintenance costs, and improves user experience and development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113918422B_ABST
    Figure CN113918422B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide a method, medium, apparatus, and computing device for detecting application startup anomalies. The method includes: in response to a trigger operation for starting a target application, detecting whether an abnormal event occurs in the target application, and determining whether a target non-transparent page of the target application is exposed; if an abnormal event of the target application is detected, and it is determined that the target non-transparent page is not exposed, sending abnormal information to the server indicating that the abnormal event is a startup anomaly. This method detects startup anomalies by detecting abnormal events and whether the target non-transparent page is exposed, without the need to set a delay task through manual experience. It can significantly improve the accuracy of detecting startup anomalies, reduce the steps of manually screening startup anomalies, and reduce the maintenance cost of the target application. In addition, the embodiments of the present disclosure also provide a medium, an apparatus, and a computing device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the technical field of anomaly detection. More specifically, embodiments of the present disclosure relate to a method, medium, apparatus, and computing device for detecting application startup anomalies. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the present disclosure that are recited in the claims. No statement herein is admitted to be prior art by virtue of its inclusion in this section.

[0003] With the development of the Internet, various applications (APPs) have emerged. In order to meet the needs of users, APPs have more and more functions, which have brought great convenience to users' lives and work. At the same time, the stability requirements of APPs are getting higher and higher. When APPs have program failures such as startup exceptions, it will seriously affect the user experience.

[0004] In related technologies, a delay task can be set when an app is launched, thereby determining whether an app has a startup anomaly by judging the execution of the delay task. However, the delay duration of the delay task is set based on manual experience, which is not accurate, resulting in inaccurate judgment results on app startup anomalies. Summary of the Invention

[0005] The embodiments of the present disclosure provide a method, medium, apparatus, and computing device for detecting application startup anomalies, which are used to solve the technical problem of inaccurate judgment results of startup anomalies in current APPs.

[0006] In a first aspect of an embodiment of the present disclosure, a method for detecting an application startup anomaly is provided, which is applied to a terminal device on which a target application is installed. The detection method includes: in response to a trigger operation for starting the target application, detecting whether an abnormal event occurs in the target application, and determining whether a target non-transparent page of the target application is exposed; if an abnormal event of the target application is detected and it is determined that the target non-transparent page is not exposed, sending abnormal information to a server to indicate that the abnormal event is a startup abnormality.

[0007] In one embodiment of the present disclosure, detecting whether an abnormal event occurs in a target application includes: registering an abnormality receiver and executing an initialization process of the target application in response to a trigger operation for starting the target application; receiving abnormal events in the initialization process through the abnormality receiver; wherein the initialization process of the target application includes at least one of the following: a function initialization process, an initialization process of a third-party library, or a page drawing process.

[0008] In one possible implementation, determining whether a target non-transparent page of a target application is exposed includes: determining the number of executions of an exposure notification code for a preset page during a page drawing process of the target application; in response to the number of executions being greater than or equal to a preset number and the target page of the target application being a non-transparent page, determining that the target non-transparent page of the target application is exposed; wherein the exposure notification code is inserted into the preset page using aspect-oriented programming (AOP) technology, and if the exposure notification code is executed, it indicates that the corresponding preset page is exposed.

[0009] In a possible implementation, determining whether a target non-transparent page of a target application is exposed includes: reading flag information stored in Native; and determining that the target non-transparent page of the target application is exposed if a value of the flag information is determined to be a first preset value.

[0010] In one possible implementation, the value of the flag information is set as follows: determining the number of executions of the exposure notification code of the preset page in the page drawing process of the target application; in response to the number of executions being equal to the preset number and the target page of the target application being a non-transparent page, setting the value of the flag information to a first preset value; wherein, the exposure notification code is inserted into the preset page through AOP technology, and if the exposure notification code is executed, it indicates that the preset page is exposed.

[0011] In one possible implementation, determining whether the target page of the target application is a non-transparent page is performed as follows: obtaining the root view background color value of the target page; when the background color value is greater than the background color threshold, determining whether the exposed page is a non-transparent page based on the transparency of the target page.

[0012] In a possible implementation, after detecting an abnormal event of the target application, it also includes: obtaining log information and abnormal cause corresponding to the abnormal event according to the abnormal type of the abnormal event, where the log information is used to indicate the abnormal location that initiated the abnormality; and obtaining abnormal information in a preset format according to the abnormal type, log information and abnormal cause.

[0013] In a possible implementation, the log information includes stack logs and / or system environment snapshot information; the exception type includes at least one of the following: an uncaught exception, an out of memory exception (OMM exception), an unresponsive program (ANR exception), or a native crash.

[0014] In a possible implementation, the detection method further includes: if no abnormal event of the target application is detected and the target non-transparent page of the target application is exposed, sending first indication information to the server for indicating that the target application is started normally.

[0015] In a possible implementation, the detection method further includes: if an abnormal event is detected in the target application and it is determined that the target non-transparent page is exposed, sending second indication information to the server to indicate that the abnormal event is not a startup abnormality.

[0016] In a possible implementation, the third-party library includes a third-party software development kit (SDK), and the third-party SDK is used to insert the exposure notification code into a preset page of the target application through AOP technology.

[0017] In a second aspect of the embodiments of the present disclosure, a method for detecting application startup anomalies is provided, which is applied to a server. The detection method includes: receiving multiple exception information of a target application sent by at least one terminal device, the exception information being sent when each terminal device detects an abnormal event in the target application and determines that the target non-transparent page of the target application is not exposed, and the exception information is used to indicate that a startup anomaly has occurred in the target application; determining the startup anomaly rate of the target application based on the exception information; and outputting a warning message based on the startup anomaly rate, and the warning message is used to indicate that optimization processing of the target application should be performed.

[0018] In a possible implementation, the exception information includes the exception type, log information, and the exception cause, and the log information is used to indicate the abnormal location of the abnormal event;

[0019] Determine the startup exception rate of the target application based on the exception information, including at least one of the following: determining the startup exception rate corresponding to the exception event of each exception type; determining the startup exception rate corresponding to the exception event of each exception cause; determining the startup exception rate corresponding to the exception event of each exception location.

[0020] In a third aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the detection method of the first aspect and / or the second aspect is implemented.

[0021] In a fourth aspect of the embodiments of the present disclosure, a device for detecting application startup anomalies is provided, which is applied to a terminal device on which a target application is installed. The detection device includes: a detection module for detecting whether an abnormal event occurs in the target application in response to a trigger operation for starting the target application, and determining whether a target non-transparent page of the target application is exposed; a processing module for sending abnormal information to a server to indicate that the abnormal event is a startup abnormality when an abnormal event of the target application is detected and it is determined that the target non-transparent page is not exposed.

[0022] In one possible implementation, the detection module is specifically used to: in response to a trigger operation for starting a target application, register an exception receiver and execute an initialization process of the target application; receive abnormal events in the initialization process through the exception receiver; wherein the initialization process of the target application includes at least one of the following: a function initialization process, an initialization process of a third-party library, or a page drawing process.

[0023] In one possible implementation, the detection module is specifically used to: determine the number of times the exposure notification code of a preset page is executed during the page drawing process of the target application; in response to the number of executions being greater than or equal to the preset number and the target page of the target application being a non-transparent page, determine that the target non-transparent page of the target application is exposed; wherein, the exposure notification code is inserted into the preset page through aspect-oriented programming (AOP) technology, and if the exposure notification code is executed, it indicates that the corresponding preset page is exposed.

[0024] In a possible implementation, the detection module is specifically configured to: read flag information stored in the Native; and if it is determined that the value of the flag information is a first preset value, determine that the target non-transparent page of the target application is exposed.

[0025] In one possible embodiment, the detection device also includes: a determination module, used to determine the number of times the exposure notification code of a preset page is executed in the page drawing process of the target application; in response to the number of executions being equal to the preset number and the target page of the target application being a non-transparent page, setting the value of the flag information to a first preset value; wherein, the exposure notification code is inserted into the preset page through AOP technology, and if the exposure notification code is executed, it indicates that the preset page is exposed.

[0026] In a possible implementation, the detection module is specifically configured to: obtain a root view background color value of the target page; and when the background color value is greater than a background color threshold, determine whether the exposed page is a non-transparent page based on the transparency of the target page.

[0027] In a possible embodiment, the detection device also includes: an acquisition module, which is used to obtain log information and abnormal cause corresponding to the abnormal event according to the abnormal type of the abnormal event, and the log information is used to indicate the abnormal location that initiated the abnormality; according to the abnormal type, log information and abnormal cause, obtain abnormal information in a preset format.

[0028] In a possible implementation, the log information includes stack logs and / or system environment snapshot information; the exception type includes at least one of the following: an uncaught exception, an out of memory exception (OMM exception), an unresponsive program (ANR exception), or a native crash.

[0029] In a possible implementation, the detection device further includes: a first sending module configured to send first indication information indicating that the target application is started normally to the server if no abnormal event of the target application is detected and the target non-transparent page of the target application is exposed.

[0030] In a possible implementation, the detection device further includes: a second sending module configured to send second indication information to the server indicating that the abnormal event is not a startup abnormality if an abnormal event is detected in the target application and the target non-transparent page is determined to be exposed.

[0031] In a possible implementation, the third-party library includes a third-party software development kit (SDK), and the third-party SDK is used to insert the exposure notification code into a preset page of the target application through AOP technology.

[0032] In the fifth aspect of the embodiment of the present disclosure, a device for detecting application startup anomalies is provided, which is applied to a server. The detection device includes: a receiving module for receiving multiple exception information of a target application sent by at least one terminal device, the exception information being sent when each terminal device detects an abnormal event in the target application and determines that the target non-transparent page of the target application is not exposed, and the exception information is used to indicate that a startup anomaly has occurred in the target application; a determination module for determining the startup anomaly rate of the target application based on the exception information; and an output module for outputting warning information based on the startup anomaly rate, and the warning information is used to indicate that optimization processing of the target application should be performed.

[0033] In a possible implementation, the exception information includes the exception type, log information, and the exception cause, and the log information is used to indicate the abnormal location of the abnormal event;

[0034] The determination module is specifically used to perform at least one of the following: determining the startup abnormality rate corresponding to abnormal events of each abnormal type; determining the startup abnormality rate corresponding to abnormal events of each abnormal cause; determining the startup abnormality rate corresponding to abnormal events of each abnormal location.

[0035] In the sixth aspect of the embodiment of the present disclosure, a computing device is provided, comprising: at least one processor and a memory; the memory stores computer-executable instructions; at least one processor stores at least computer-executable instructions in the memory, so that the at least one processor executes the detection method provided in the first aspect and / or the second aspect.

[0036] In a seventh aspect of the embodiments of the present disclosure, a computer program product is provided, which includes a computer program; when the computer program is executed, the detection method of the first aspect and / or the second aspect is implemented.

[0037] The application startup anomaly detection method, medium, apparatus, and computing device provided by the embodiments of the present disclosure detect whether an abnormal event occurs in the target application and determines whether the target non-transparent page of the target application is exposed in response to a trigger operation for starting the target application. If an abnormal event of the target application is detected and it is determined that the target non-transparent page is not exposed, an abnormality message indicating that the abnormal event is a startup anomaly is sent to the server. In the scheme of the embodiments of the present disclosure, startup anomalies are detected by detecting abnormal events and whether the target non-transparent page is exposed, without the need to set a delay task through manual experience. This can significantly improve the accuracy of detecting startup anomalies, thereby avoiding non-startup anomalies from being reported, reducing the steps of manually screening startup anomalies, and reducing the maintenance cost of the target application. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings, in which several embodiments of the present disclosure are shown by way of example and not limitation, wherein:

[0039] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present disclosure;

[0040] Figure 2 Interactive schematic diagram of the detection method provided in the embodiment of the present disclosure Figure 1 ;

[0041] Figure 3 A schematic diagram of a flow chart of a detection method provided in an embodiment of the present disclosure;

[0042] Figure 4 Interactive schematic diagram of the detection method provided in the embodiment of the present disclosure Figure 2 ;

[0043] Figure 5 A schematic diagram of a program product provided by an embodiment of the present disclosure;

[0044] Figure 6 A schematic diagram of the structure of the detection device provided in the embodiment of the present disclosure Figure 1 ;

[0045] Figure 7 A schematic diagram of the structure of the detection device provided in the embodiment of the present disclosure Figure 2 ;

[0046] Figure 8 A schematic diagram of the structure of a computing device provided in an embodiment of the present disclosure.

[0047] In the drawings, the same or corresponding reference numerals denote the same or corresponding parts. DETAILED DESCRIPTION

[0048] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. Rather, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0049] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, apparatus, device, method, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software.

[0050] According to an embodiment of the present disclosure, a method, medium, apparatus, and computing device for detecting application startup anomalies are proposed.

[0051] In this article, it is important to understand that the terms used have the following meanings:

[0052] Uncaught Exception: An exception occurs during the execution of the programming language of the operating system platform where the application is running and is not caught by the developer, causing the application to crash. For Android, examples of uncaught exceptions are exceptions in Java / Kotlin; for iOS, examples are exceptions in Objective-C / Swift.

[0053] OutOfMemory (OOM): This refers to an application memory overflow event where the application process cannot allocate memory anymore, causing the application to crash. For the Android system, this is a virtual machine memory overflow.

[0054] Application Not Respond (ANR): An application not responding event occurs on both Android and iOS systems. This occurs when the main thread of the application is stuck, causing the user to see a frozen interface. When an ANR occurs, the application will be killed by the system.

[0055] Native crash: The native layer crashes and is killed by the system. For Android, the native layer is the C / C++ layer; for iOS, the native layer is the C layer. The difference between a native crash and an uncaught exception in the application is that the application programming language layer is the high-level programming language specified by the application operating system platform (such as Java / Kotlin for Android and Objective-C / Swift for iOS), while the native layer is at a lower level and directly faces the operating system kernel layer. Native layer crashes are generally caused by an execution error in the operating system kernel, which sends the operating system's predefined SIGXXX signal to the application process.

[0056] Startup exception: During the application startup phase, if one of the following exceptions occurs, such as "uncaught exception, OOM, ANR, or Native crash," the application may crash immediately before completing the startup process, preventing the user from accessing the application.

[0057] Among them, application startup is divided into cold start and hot start. Cold start requires re-creating the application process and will execute more initialization logic of third-party libraries in the application process creation. Hot start is when the application returns to the foreground from the background, and the application process does not need to be created. Therefore, the time for cold start is much longer than that for hot start. Most startup failures in production environments are cold start exceptions. The solution disclosed in this disclosure can cover cold start and hot start.

[0058] SDK: A code module or library that can independently complete a certain function. For Android, it is a jar package and aar package; for iOS, it is a static library, dynamic library, and pod reference.

[0059] Page: The system uses the program carrier to represent the user-visible interface on the mobile phone screen. For the Android system, the page is the Activity class, and for the iOS system, the page is the UIViewController class.

[0060] In addition, the number of any elements in the drawings is for illustration and not for limitation, and any names are for distinction only and do not have any limiting meaning. The principle and spirit of the present disclosure will be explained in detail with reference to several representative embodiments of the present disclosure. SUMMARY OF THE INVENTION

[0062] With the development of the Internet, various applications (APPs) have emerged. In order to meet the needs of users, APPs have more and more functions, which have brought great convenience to users' lives and work. At the same time, the stability requirements of APPs are getting higher and higher. When APPs have program failures such as startup exceptions, it will seriously affect the user experience.

[0063] Among them, startup exceptions are exceptions that occur during the application startup phase. Since large applications often introduce various third-party libraries, and the startup phase often includes the initialization of many third-party SDKs, the code in third-party SDKs is black box, and it is difficult to control the code quality. This is the main culprit of startup exceptions. In addition, other sub-phases of the application startup process may also cause startup exceptions.

[0064] Startup anomalies are the most serious program failures among all application anomalies. Users may directly uninstall the APP because they cannot open the APP, resulting in user loss. Therefore, how to detect startup anomalies is an urgent problem that needs to be solved today.

[0065] In the related art, a delayed task can be set at the same time as the APP is started, so as to determine whether the APP has a startup abnormality by judging the execution status of the delayed task. Specifically, when the application is started, a startup flag is set first, and a delayed task that resets the startup flag is delivered to the main thread. If the application starts normally, the delayed task will successfully reset the startup flag. If the application has a startup abnormality, the delayed task is not executed, and the flag is not reset. If the same application on the same terminal device is started multiple times in a row and the startup flag is not reset correctly, it is considered that a startup abnormality is detected, and the safe mode is entered and the startup abnormality is reported. However, the inventors found that the existing solution has the following deficiencies:

[0066] 1. In the above solution, a time delay duration is set based on experience. However, due to the message loop mechanism of the application's main thread, the actual execution time of the delayed task may not be the exact delay duration. During application startup, the main thread often inserts numerous system messages or asynchronous messages, making the execution time of the delayed task unpredictable. It may even be delayed several times the delay duration due to main thread blocking. If the delay duration is set too short, the flag may be reset before the application startup process is initialized, resulting in inaccurate monitoring of the entire application startup process. As a result, it is possible that due to the main thread being busy, the user may have already completed the application startup initialization and entered a deeper page path unrelated to the startup path before the delayed task is about to execute. If an exception is encountered on one of these deeper pages and the user exits, the flag may not be reset correctly. These are actually non-startup exceptions, but will be incorrectly counted as startup exceptions, resulting in inaccurate startup exception statistics.

[0067] 2. Because exceptions encountered by users on deeper pages unrelated to the startup path may also be monitored and identified as startup exceptions, it is necessary to set an empirical threshold to filter reports. That is, when the number of exceptions reaches the threshold parameter, a report is made. If the empirical threshold is inaccurate, too many non-startup exceptions will be reported.

[0068] 3. When a startup anomaly is detected, the exception log is typically reported, and developers then intervene to analyze and locate the issue, ultimately releasing a new version or hotfix. If existing detection methods are inaccurate, anomalies caused by users entering deeper page paths unrelated to the startup path may also be reported. This interferes with developers' analysis of the startup anomaly and requires an additional step of manual screening of valid startup anomaly logs, wasting manpower.

[0069] 4. The above-mentioned anomaly detection method can only generally report that a startup anomaly has occurred. Although it is possible to rely on manual post-processing to check and analyze logs one by one to infer the classification of startup anomalies, it is impossible to classify startup anomalies in the pre-reporting stage (that is, when the target application crashes, before the fault is reported). The classification statistics and attribution of startup anomaly rate indicators are also inaccurate and cannot be used as a macro-measurement standard for subsequent optimization effects.

[0070] In addition, when a startup anomaly is detected, the general approach is to skip the app initialization process and enter the app's safe mode to prevent users from being unable to open the app. If existing detection methods are inaccurate, meaning the user may accidentally enter a deeper page unrelated to the startup path and encounter an anomaly, causing the app to exit (for example, if the user clicks an ad multiple times on the startup splash screen to jump to the ad details page, an anomaly occurs. However, the crash that occurs when clicking an ad on the splash screen to the ad details page is not a core crash in the normal application usage scenario), the user will be mistakenly directed to safe mode, which is only intended to assist with user feedback and troubleshooting.

[0071] In view of this, embodiments of the present disclosure provide a method, medium, apparatus, and computing device for detecting application startup anomalies. These methods, in response to a trigger operation for starting a target application, detect whether an abnormal event has occurred in the target application and determine whether a target non-transparent page of the target application has been exposed. If an abnormal event is detected for the target application and it is determined that the target non-transparent page has not been exposed, an abnormality message indicating that the abnormal event is a startup anomaly is sent to a server. In this solution, startup anomalies are detected by detecting abnormal events and whether the target non-transparent page has been exposed, without the need to manually set a delay task. This significantly improves the accuracy of detecting startup anomalies, thereby preventing non-startup anomalies from being reported, reducing the steps of manually screening startup anomalies, and lowering the maintenance cost of the target application.

[0072] Among them, the method and the device are based on the same application concept. Since the principles of solving problems by the method and the device are similar, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.

[0073] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.

[0074] Application Scenario Overview

[0075] First reference Figure 1 , Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present disclosure. Figure 1 As shown, the devices involved in this application scenario include: a server 101 and a terminal device 102.

[0076] Among them, the target application is installed on the terminal device 102. During the startup process of the target application, the terminal device 101 is used to detect startup abnormalities during the startup process of the target application, and the abnormal information is sent to the server 101, so that the server 101 can optimize the target application according to the abnormal information.

[0077] The server 101 may be a single server, a server cluster, a distributed server, a centralized server, or a cloud server.

[0078] The terminal 102 may be a personal digital assistant (PDA) device, a handheld device with wireless communication capabilities (such as a smartphone or tablet), a computing device (such as a personal computer (PC)), a vehicle-mounted device, a wearable device (such as a smart watch or smart bracelet), a smart home device (such as a smart display device), etc.

[0079] Exemplary Methods

[0080] The following combination Figure 1 The application scenario shown, refer to Figures 2 to 5 The following describes a method for detecting application startup anomalies according to an exemplary embodiment of the present disclosure. It should be noted that the above application scenarios are merely provided to facilitate understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.

[0081] Among them, the execution device applicable to the embodiments of the present disclosure is a computing device, such as the above-mentioned terminal and server.

[0082] Figure 2Interactive schematic diagram of the detection method provided in the embodiment of the present disclosure Figure 1 Applied to terminal devices and servers, where the target application is installed on the terminal device, such as Figure 2 As shown, the detection method may include the following steps:

[0083] S201 : In response to a trigger operation for starting a target application, a terminal device detects whether an abnormal event occurs in the target application and determines whether a target non-transparent page of the target application is exposed.

[0084] S202: If an abnormal event of the target application is detected and it is determined that the target non-transparent page is not exposed, abnormal information indicating that the abnormal event is a startup abnormality is sent to the server.

[0085] The target non-transparent page is the first page that the user can see during the application startup process.

[0086] In actual applications, for Android and iOS systems, Android pages are typically Activity-based, while iOS pages are UIViewController-based. Although Activity and UIViewController provide a page lifecycle, they can also be fully transparent. In certain specific situations, when executing auxiliary code, their pages are not visible to the user. Therefore, the target non-transparent page is the first page that the user can see during the application startup process. It should be understood that other systems are similar, and this embodiment of the disclosure will not be described in detail.

[0087] It should be noted that during the target application's startup, the application process is created and initialized. When the target non-transparent page is exposed, the application startup operation is considered complete. This means that if no abnormal events occur when the first page seen by the user is exposed, the target application has successfully started. Conversely, if the first page seen by the user is not exposed and an abnormal event is detected, a startup abnormality has occurred. Furthermore, abnormal events that occur after the first page seen by the user is exposed do not constitute startup abnormalities.

[0088] In the embodiments of the present disclosure, there is no specific limitation on the type of triggering operation. For example, the triggering operation may include the following types:

[0089] 1) Click the icon of the target application on the terminal device interface;

[0090] 2) Long press the target app icon and open the tools in the target app through the pop-up shortcut menu;

[0091] 3) Click the push message of the target application in the notification bar;

[0092] 4) Open the link provided by the target application directly in the browser;

[0093] 5) Open the target application in other applications for which the application provides authorized login;

[0094] 6) Invoke certain services provided in the target application through other applications, etc.

[0095] In this step, when the terminal device detects any of the above triggering operations, the application starts to start. At this time, it starts to detect abnormal events in the startup process and simultaneously detects whether the first page seen by the user (ie, the target non-transparent page) is exposed.

[0096] In some embodiments, due to the different triggering methods described above, the paths for launching the target application are different, and the target non-transparent pages corresponding to different paths are also different. For example, when launching the target application by clicking the target application icon in the terminal device interface, the target non-transparent page is typically the target application's homepage; and when launching the target application by clicking a push message from the target application in the notification bar, the target non-transparent page is typically the target application's message display interface.

[0097] Therefore, when determining whether the target non-transparent page is exposed, it is possible to determine whether the target non-transparent page is exposed by burying points. Specifically, all startup paths used to start the target application are determined. Based on these startup paths, all the first pages that the user may see after the target application is started are determined, and these pages are marked and buried one by one.

[0098] When a trigger operation to start the target application is detected, the corresponding path of the current trigger operation can be determined through the execution of the tracking point, and then it can be determined whether the target non-transparent page corresponding to the path (the first one the user sees) is exposed.

[0099] Furthermore, if an abnormal event is detected during the startup process, and the first page visible to the user is not exposed (ie, the target non-transparent page is not exposed), it is indicated that the abnormal event is a startup abnormality.

[0100] In this solution, by marking all startup paths of the target application one by one, no matter what trigger operation is used to start the target application, it is possible to accurately determine whether the target non-transparent page of the target application is exposed, and then accurately determine whether the target application has a startup abnormality.

[0101] In one embodiment, the abnormal information of the startup abnormality may be sent to a server so that the target application can be optimized by the server.

[0102] The exception information may include at least one of the following: an exception type, log information, and an exception cause, etc., wherein the log information is used to indicate the abnormal location of the abnormal event.

[0103] The optimization process may include, for example, the server outputting a warning message to the developer based on the exception information to remind the developer to perform the optimization process, or the server performing online optimization process on the target application based on the exception information.

[0104] In other embodiments, while outputting warning information, the server can also provide corresponding solutions to developers based on the exception information, or directly apply corresponding emergency processing to the target based on the exception information. As for other methods, the embodiments of this disclosure will not go into details one by one.

[0105] Next, the solution for the server outputting warning information is described in detail with reference to steps S203 to S204:

[0106] S203: The server determines the startup exception rate of the target application based on the exception information.

[0107] Correspondingly, the server receives the abnormal information of the target application sent by multiple terminal devices, and determines the startup abnormality rate of the target application.

[0108] The embodiment of the present disclosure does not limit the type of the startup abnormality rate. For example, the startup abnormality rate may be at least one of the following:

[0109] 1) The startup abnormality rate corresponding to the abnormality type, that is, the ratio of the number of startup abnormalities corresponding to each abnormality type to the total number of startup abnormalities;

[0110] The total number of startup exceptions is the total number of all abnormal events of the target application received by the server. These abnormal events may be sent by the same terminal or by multiple terminals, which is not limited in this embodiment.

[0111] Exemplarily, taking the abnormality types including type 1, type 2 and type 3 as an example, in this step, the startup abnormality rates corresponding to the startup abnormality events of type 1, type 2 and type 3 may be calculated respectively.

[0112] For example, for type 1, first, the server determines the total number M of received startup exception events and the number m1 of startup exception events whose exception type is type 1.

[0113] Furthermore, the ratio of m1 to M is determined as the startup abnormality rate of type 1;

[0114] 2) The abnormal startup rate corresponding to the abnormal position, that is, the ratio of the number of abnormal startups corresponding to each abnormal position to the total number of abnormal startups;

[0115] 3) The abnormal startup rate corresponding to the abnormal reason, that is, the ratio of the number of abnormal startups corresponding to each abnormal reason to the total number of abnormal startups;

[0116] It should be noted that the calculation method and principle of the startup abnormality rate corresponding to each abnormal location and each abnormal cause are similar to the abnormality type and will not be repeated here.

[0117] 4) The total startup exception rate of the target application, that is, the ratio of the total number of startup exceptions of the target application to the number of startup starts.

[0118] Among them, the number of startup starts can be the total number of trigger operations used to start the target application. This total number can be the sum of the number of trigger operations for the target application on the same terminal, or the sum of the number of trigger operations for the target applications on multiple terminals. This embodiment does not limit this.

[0119] Specifically, each time the terminal receives a trigger operation for the target application, it sends an instruction to the server, so that the server counts the number of times the target application is started according to the instruction. S204: The server outputs a warning message based on the abnormal startup rate.

[0120] In some embodiments, after obtaining the abnormal startup rate, whether to issue an alarm can be determined based on the relationship between the abnormal startup rate and the startup rate threshold.

[0121] For example, taking the startup exception rate corresponding to the exception type as an example, if the startup exception rate corresponding to a certain type of exception is greater than or equal to the startup exception rate threshold, a warning message is output; otherwise, no warning message is output, and the startup exception rate of this type of exception continues to be counted.

[0122] The startup rate thresholds corresponding to the above startup anomalies may be the same or different, and are not specifically limited in the embodiments of the present disclosure.

[0123] In actual applications, since startup anomalies may only occur under certain specific conditions and on specific devices, it is impossible to find all vulnerabilities during the testing phase of the target application. Therefore, in this solution, the startup anomaly rate of each dimension is used to measure the startup anomaly of the target application. This can be used as an indicator to measure the effectiveness of subsequent optimization and provide a reference for subsequent optimization of the target application.

[0124] In the method for detecting application startup anomalies provided by the embodiments of the present disclosure, in response to a trigger operation for starting a target application, it is detected whether an abnormal event has occurred in the target application, and it is determined whether the target non-transparent page of the target application has been exposed; if an abnormal event of the target application is detected, and it is determined that the target non-transparent page has not been exposed, an abnormality message indicating that the abnormal event is a startup anomaly is sent to the server. By detecting the abnormal event and whether the target non-transparent page has been exposed, startup anomalies can be detected without the need to set a delay task through manual experience. This can significantly improve the accuracy of detecting startup anomalies, thereby preventing deep-level non-startup anomalies from being reported, reducing the steps of manually screening startup anomalies, and reducing the maintenance cost of the target application.

[0125] In addition, when the user enters a deeper page that is not related to the startup path, even if an abnormal event occurs, this solution can accurately identify whether the abnormal event is a startup abnormality, thereby avoiding mistakenly guiding the user to safe mode and further improving the user experience.

[0126] Figure 3 A flow chart of the detection method provided in the embodiment of the present disclosure. Figure 2 The solution executed by the terminal device is described in more detail based on the illustrated embodiment. Specifically, the detection method of this embodiment includes the following steps:

[0127] S301 : In response to a trigger operation for starting a target application, register an exception receiver and execute an initialization process of the target application.

[0128] The initialization process of the target application includes at least one of the following: a function initialization process, a third-party library initialization process, or a page drawing process.

[0129] Optionally, in response to a trigger operation for starting the target application, the terminal device can also report a startup start event to the server, thereby instructing the server to start the target application by reporting the startup start event, so that the server can optimize the target application based on subsequent exception information.

[0130] S302: Receive an abnormal event in the initialization process through an abnormal receiver, and determine whether a target non-transparent page of a target application is exposed.

[0131] It should be noted that in addition to the method provided in the above embodiment of determining whether a page is exposed by marking the startup path, in the disclosed embodiment, it is also possible to insert an exposure notification code into the page to determine whether the page is exposed based on the execution of the exposure notification code.

[0132] Specifically, the exposure notification code can be inserted at the end of the code of the preset page of the target application. If the exposure notification code is executed, it indicates that the corresponding preset page is exposed. Correspondingly, if the exposure notification code is not executed, it indicates that the preset page has not been exposed.

[0133] It should be understood that the method for inserting the exposure notification code into the preset page is not specifically limited in the present embodiment. On the one hand, during the development of the target application, the exposure notification code can be inserted at the end of the code corresponding to the preset page of the target application through aspect-oriented programming (AOP) technology.

[0134] On the other hand, the exposure notification code can be inserted into a preset page of the target application through a third-party library during the initialization process of the target application.

[0135] Specifically, the third-party library of the target application includes: a third-party software development kit SDK. During the initialization process of the third-party library, the third-party SDK will insert the exposure notification code into the preset page of the target application through the AOP technology.

[0136] The preset page may be all non-transparent pages of the target application, or the preset page may be the target non-transparent page corresponding to all startup paths of the target application, which is not limited in the embodiment of the present disclosure.

[0137] In this solution, the exposure notification code is inserted into the preset page of the target application through AOP technology, so that no matter what trigger operation is used to start the target application, it is possible to accurately determine whether the target non-transparent page of the target application is exposed, and then determine whether a startup abnormality has occurred.

[0138] Secondly, compared to the method of embedding points in pages, the difference of this embodiment is that: through AOP technology, the exposure notification code is inserted into the code of the preset page of the target application, and then the execution of the exposure notification code is used to determine whether the page has been exposed. This process is non-invasive to the engineering source code of the target application and has higher security. In addition, the method provided by this embodiment can be inserted into any page of any application without determining the startup path corresponding to each application. Therefore, it is not affected by changes in the startup path of the application. It has universality and scalability and can be quickly connected to any application, thereby improving application development efficiency.

[0139] In addition, by inserting the exposure notification code through a third-party SDK, there is no need to insert the exposure notification code page by page during the application development process, which can significantly improve application development efficiency and reduce costs.

[0140] In some embodiments, determining whether the target non-transparent page is exposed by the execution of the exposure notification code specifically includes the following two methods:

[0141] Method 1:

[0142] 1) Determine the number of times the exposure notification code of a preset page is executed during the page drawing process of the target application.

[0143] 2) In response to the execution number being greater than or equal to the preset number, and the target page of the target application being a non-transparent page, determining that the target non-transparent page of the target application is exposed.

[0144] Specifically, during the startup process of the target application, the target application will perform a page drawing process, that is, execute the page code. If the exposure notification code at the end of the page code is executed, it means that the page has been drawn successfully (that is, the page has been exposed), and the number of times the exposure notification code of the target application is executed represents the number of page exposures of the target application.

[0145] In this embodiment, during the startup process of the target application, the number of executions of the exposure notification code of the preset page is counted to obtain the number of currently exposed pages. If the current number of executions is greater than or equal to the preset number (for example, 1 time), it means that the target application currently has a page exposed.

[0146] Furthermore, it is determined whether the currently exposed page contains a non-transparent page. If the currently exposed page contains a non-transparent page, it means that the target non-transparent page of the target application must have been exposed. On the contrary, if the currently exposed page does not contain a non-transparent page, it means that the target non-transparent page of the target application has not been exposed, and the number of executions of the exposure notification code continues to be counted.

[0147] For example, if the current exposure notification code is executed twice, the first time the exposure notification code is executed, the corresponding exposure page is page 1, and the second time the exposure notification code is executed, the corresponding exposure page is page 2. If page 1 is a transparent page and page 2 is a non-transparent page, it means that the target non-transparent page of the target application is exposed (page 2 is the target non-transparent page of the target application). Correspondingly, if both page 1 and page 2 are transparent pages, the number of executions of the exposure notification code continues to be counted.

[0148] In some scenarios, when the exposure notification code is executed more than or equal to the execution count threshold, if there is still no non-transparent page among the exposed pages, it may be that the target non-transparent page cannot be displayed normally due to a startup exception. At this time, the exposure notification code is executed again. The number of times the exposure notification code is executed is set to 0, so that the exposure notification code can be recounted in subsequent startup operations of the target application.

[0149] The execution count threshold can be determined in the following two ways:

[0150] (1) In the process of determining the exposure of the target non-transparent page, the empirical value of the number of times the exposure notification code is executed is the execution number threshold.

[0151] For example, under normal circumstances, it is necessary to execute the exposure notification code at most n times to open a non-transparent page. In this solution, if no non-transparent page is exposed after executing the exposure notification code n times, it means that a startup exception may have occurred, and the count is reset.

[0152] (2) When determining that the target non-transparent page corresponding to the current startup path is exposed, the number of executions of the exposure notification code is the execution number threshold.

[0153] Each startup operation has a different startup path and a different corresponding target non-transparent page. For example, if the target non-transparent page corresponding to the current startup path is page A, during the exposure of page A, the pages that need to execute the exposure notification code are, in order: page A1, page A2, ..., page As, and page A. Pages A1, A2, ..., and As are transparent pages, and page A is a non-transparent page. Therefore, the number of executions of the exposure notification code for the target non-transparent page (page A) corresponding to the current startup path is s+1, and the execution count threshold for page A is s+1. That is, in this solution, if no non-transparent page is found after s+1 executions of the exposure notification code, it indicates that a startup exception may have occurred, and the count is reset.

[0154] In other scenarios, when the current execution count of the exposure notification code is greater than or equal to the preset count, and it is determined that the target non-transparent page of the target application is exposed, it means that the target application is successfully started. At this time, the execution count of the exposure notification code is set to 0, so that the exposure notification code can be recounted in subsequent startup operations of the target application.

[0155] In some embodiments, it is also possible to determine whether the target non-transparent page of the target application is exposed by setting a flag bit. This method is described in detail below:

[0156] Method 2:

[0157] 1) Determine the number of times the exposure notification code of a preset page is executed during the page drawing process of the target application.

[0158] 2) In response to the execution count being equal to the preset count and the target page of the target application being a non-transparent page, the value of the flag information stored in the Native is set to a first preset value.

[0159] The value of the preset number of times may be 1, and the target page of the target application is the page corresponding to the current exposure notification code.

[0160] Specifically, each time the exposure notification code is executed, it is determined whether the page corresponding to the current exposure notification code is a non-transparent page. If so, the value of the flag information stored in Native is set to the first preset value. If not, continue to execute according to steps 1) and 2) until the value of the flag information stored in Native is set to the first preset value.

[0161] 3) Read the flag information stored in Native.

[0162] 4) If it is determined that the value of the flag information is the first preset value, then the target non-transparent page of the target application is determined to be exposed.

[0163] Specifically, in step S302, the flag information stored in Native is read. If the value of the flag information is a first preset value, it indicates that the current target non-transparent page of the target application has been exposed; correspondingly, if the value of the flag information is an initial value, it indicates that the current target non-transparent page of the target application has not been exposed.

[0164] The first preset value is, for example, 1, and the initial value is, for example, 0.

[0165] In some embodiments, when it is determined that the target non-transparent page of the target application is exposed, it indicates that the target application is started normally. At this time, the flag information stored in the Native is reset to the initial value, so that in the subsequent startup process, in the subsequent startup operation of the target application, the flag information is reset according to the exposure of the target non-transparent page.

[0166] In the embodiment of the present disclosure, through the above two methods of determining whether the target non-transparent page of the target application is exposed, it is possible to accurately judge whether the target non-transparent page of the target application is exposed, thereby accurately inferring whether the abnormal event is a startup abnormality, and then performing corresponding optimization processing to improve the user experience.

[0167] S303: If an abnormal event of the target application is detected and it is determined that the target non-transparent page is exposed, first indication information indicating that the abnormal event is not a startup abnormality is sent to the server.

[0168] It should be understood that since the target non-transparent page has been exposed, it means that the target application has been started normally, and the abnormal event may not affect some functions of the target application. Therefore, after receiving the first indication information, the server can display the target non-transparent page in the terminal interface for the user to operate.

[0169] In some embodiments, the server may also output a warning message based on the first indication information to prompt the developer to perform corresponding optimization processing on the target application. At the same time, a prompt message may also be displayed on the terminal interface to prompt the user that the target application is currently abnormal.

[0170] S304: If an abnormal event of the target application is detected and it is determined that the target non-transparent page is not exposed, abnormal information indicating that the abnormal event is a startup abnormality is sent to the server.

[0171] It should be understood that the solution of step S304 is the same as Figure 2 The solutions of the illustrated embodiment are similar and will not be described again here.

[0172] S305: If no abnormal event of the target application is detected and the target non-transparent page of the target application is exposed, second indication information for indicating that the target application is started normally is sent to the server.

[0173] Correspondingly, after the server receives the second indication information, it indicates that the target application has been started normally and there are no other abnormal events, and the target non-transparent page can be displayed in the terminal interface.

[0174] In this embodiment, when an abnormal event is detected, if the target non-transparent page is exposed, a first indication message is sent to the server. If it is determined that the target non-transparent page is not exposed, an abnormality message is sent to the server. This solution allows the server to handle abnormal events accordingly based on different abnormal situations, ensuring a better user experience. In addition, by detecting different types of abnormal situations and sending different indication messages to the server in different abnormal situations, the server can analyze different types of abnormal events without interfering with each other, thus obtaining more accurate abnormality analysis results. This process also eliminates the need for additional steps to screen different types of abnormal events, reducing labor costs and improving the efficiency of abnormal problem analysis.

[0175] In some embodiments, in the above two methods, whether the target page of the target application is a non-transparent page can be determined by the following steps:

[0176] (1) Get the background color value of the root view of the target page;

[0177] In this embodiment, the background color value of the root view of the target page can be obtained through the page exposure callback.

[0178] It should be noted that the exposure callback method is different in different operating systems. As for the specific schemes for exposure callback in each system, they will not be described here one by one.

[0179] (2) When the background color value is greater than the background color threshold, it is determined whether the exposed page is a non-transparent page based on the transparency of the target page.

[0180] Specifically, if the background color value is greater than the background color threshold, it is determined whether the target page has a transparent theme enabled. If the target page has a transparent theme enabled, the target page is determined to be a transparent page. Correspondingly, if the target page does not have a transparent theme enabled, the target page is determined to be a non-transparent page.

[0181] Through this embodiment, it is possible to accurately determine whether the target page is a non-transparent page, and further accurately determine whether a startup abnormality has occurred.

[0182] Figure 4 Interactive schematic diagram of the detection method provided in the embodiment of the present disclosure Figure 2 This embodiment will be Figure 2 Based on the illustrated embodiment, the scheme executed by the terminal device and the server is described in more detail. Specifically, the detection method of this embodiment includes the following steps:

[0183] S401 : In response to a trigger operation for starting a target application, the terminal device detects whether an abnormal event occurs in the target application and determines whether a target non-transparent page of the target application is exposed.

[0184] S402: If the terminal device detects an abnormal event of the target application, the log information and abnormal cause corresponding to the abnormal event are obtained according to the abnormal type of the abnormal event.

[0185] Among them, the exception type includes at least one of the following: uncaught exception, OMM exception, ANR exception or Native crash; the log information is used to indicate the exception location of the startup exception, and the log information includes stack logs and / or system environment snapshot information.

[0186] Correspondingly, the exception causes corresponding to the above exception types are as follows:

[0187] Cause of uncaught exception: An exception occurred during the execution of the programming language and was not caught by the developer;

[0188] Causes of OMM exceptions: heap memory exhaustion, memory fragmentation, and inability to allocate continuously;

[0189] Abnormal causes of native crashes: CUP instruction execution errors, or the generation of any of the following signals: SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGSTKFLT, SIGPIPED, etc.

[0190] S403: The terminal device obtains exception information in a preset format according to the exception type, log information, and exception cause.

[0191] Among them, exception information includes the following: exception category, exception cause, exception details, programming language exception stack, native layer exception stack, memory and other system environment snapshot information corresponding to each exception event.

[0192] Optionally, since exception events of different exception categories may occur in different environments, such as programming language environment, native layer environment, signal processing program environment, etc., and the execution restrictions and conditions in different environments are different, they need to be uniformly dispatched to the native layer environment for the next step of processing.

[0193] S404: If the terminal device determines that the target non-transparent page is not exposed, it sends abnormal information indicating that the abnormal event is a startup abnormality to the server.

[0194] In this embodiment, when an exception occurs in a target application, the startup anomaly is statistically categorized and attributed. Based on this classification and attribution, the anomaly information is determined and reported to the server. Compared to server-based analysis to obtain anomaly information, this solution provides more accurate anomaly information, enabling the generation of an accurate startup anomaly rate metric. This provides a macrometric for subsequent optimization efforts and improves the user experience.

[0195] S405: The server receives multiple abnormal information of the target application sent by at least one terminal device. It should be noted that the above steps S404 to S405 are the same as Figure 3 The solutions in the illustrated embodiment are similar and will not be described again here.

[0196] S406: The server determines the startup exception rate of the target application based on the exception information.

[0197] Determining the startup exception rate of the target application based on the exception information includes at least one of the following:

[0198] The startup exception rate corresponding to abnormal events of each abnormal type, the startup exception rate corresponding to abnormal events of each abnormal cause, the startup exception rate corresponding to abnormal events of each abnormal location, and the total startup exception rate of the target application, etc.

[0199] It should be understood that the calculation method of the above startup abnormality rate is the same as Figure 2 This is shown in step S203 in the illustrated embodiment and will not be described in detail here.

[0200] In some embodiments, the total startup abnormality rate may be obtained by calculating the total startup abnormality rate corresponding to the abnormal events according to the following formula:

[0201]

[0202] Where P is the total startup abnormality rate, N1 is the number of startup completions, and N2 is the number of startup starts.

[0203] It should be noted that the number of startup completions N1 can be determined based on the first indication information sent by the terminal device to instruct the target application to start normally, and the number of startup starts N2 can be determined based on the startup start event reported by the terminal device.

[0204] S407: The server outputs a warning message based on the startup abnormality rate.

[0205] The warning information is used to instruct the target application to be optimized.

[0206] It should be noted that step S407 and Figure 2 Step S204 in the illustrated embodiment is similar and will not be described again here.

[0207] In this embodiment, when an abnormal event occurs, the startup abnormality is classified by the terminal device and then reported to the server in a unified manner, so that the server can classify, count and attribute abnormal events in multiple dimensions such as abnormal type, abnormal cause and abnormal location to obtain the startup abnormality rate. This process does not require manual intervention in classification, and can obtain more accurate results. The multi-dimensional data can provide a more accurate reference for the optimization process of the target application, ultimately improving the optimization efficiency and optimization effect of the target application.

[0208] Exemplary media

[0209] After introducing the method of the exemplary embodiment of the present disclosure, next, reference is made to Figure 5 A storage medium according to an exemplary embodiment of the present disclosure is described.

[0210] Figure 5 Schematic diagram of the program product provided by the embodiment of the present disclosure. Figure 5 As shown, a program product 500 for implementing the above method according to an embodiment of the present disclosure is described, which can be a portable compact disk read-only memory (CD-ROM) and includes program code and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto.

[0211] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0212] A readable signal medium may include a data signal transmitted in baseband or as part of a carrier wave, which carries readable program code. Such a transmitted data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium.

[0213] Program code for performing the operations disclosed herein can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN).

[0214] Exemplary devices

[0215] After introducing the medium of the exemplary embodiment of the present disclosure, next, reference is made to Figure 6 、 Figure 7 A device according to an exemplary embodiment of the present disclosure will be described.

[0216] Figure 6 A schematic diagram of the structure of the detection device provided in the embodiment of the present disclosure Figure 1 It should be understood that the detection device of the embodiment of the present disclosure is used for a terminal device, on which a target application is installed, such as Figure 6 As shown, the detection device 600 includes: a detection module 601 and a processing module 602;

[0217] Among them, the detection module 601 is used to detect whether an abnormal event occurs in the target application in response to a trigger operation for starting the target application, and determine whether the target non-transparent page of the target application is exposed; the processing module 602 is used to send abnormal information to the server to indicate that the abnormal event is a startup abnormality when an abnormal event of the target application is detected and it is determined that the target non-transparent page is not exposed.

[0218] In one possible implementation, the detection module 601 is specifically used to: in response to a trigger operation for starting a target application, register an exception receiver and execute an initialization process of the target application; receive abnormal events in the initialization process through the exception receiver; wherein the initialization process of the target application includes at least one of the following: a function initialization process, an initialization process of a third-party library, or a page drawing process.

[0219] In one possible implementation, the detection module 601 is specifically used to: determine the number of executions of the exposure notification code of a preset page in the page drawing process of the target application; in response to the number of executions being greater than or equal to the preset number and the target page of the target application being a non-transparent page, determine that the target non-transparent page of the target application is exposed; wherein, the exposure notification code is inserted into the preset page through aspect-oriented programming (AOP) technology, and if the exposure notification code is executed, it indicates that the corresponding preset page is exposed.

[0220] In a possible implementation, the detection module 601 is specifically configured to: read flag information stored in the Native; and if it is determined that the value of the flag information is a first preset value, determine that the target non-transparent page of the target application is exposed.

[0221] In one possible embodiment, the detection device 600 also includes: a determination module 603, used to determine the number of times the exposure notification code of a preset page is executed in the page drawing process of the target application; in response to the number of executions being equal to the preset number and the target page of the target application being a non-transparent page, setting the value of the flag information to a first preset value; wherein, the exposure notification code is inserted into the preset page through AOP technology, and if the exposure notification code is executed, it indicates that the preset page is exposed.

[0222] In a possible implementation, the detection module 601 is specifically configured to: obtain a root view background color value of the target page; and when the background color value is greater than a background color threshold, determine whether the exposed page is a non-transparent page based on the transparency of the target page.

[0223] In a possible embodiment, the detection device 600 also includes: an acquisition module 604, which is used to obtain log information and abnormal cause corresponding to the abnormal event according to the abnormal type of the abnormal event, and the log information is used to indicate the abnormal location of the abnormal initiation of the abnormality; according to the abnormal type, log information and abnormal cause, obtain abnormal information in a preset format.

[0224] In a possible implementation, the log information includes stack logs and / or system environment snapshot information; the exception type includes at least one of the following: an uncaught exception, an out of memory exception (OMM exception), an unresponsive program (ANR exception), or a native crash.

[0225] In a possible implementation, the detection device 600 further includes: a first sending module 605 for sending first indication information to the server to indicate that the target application is started normally if no abnormal event of the target application is detected and the target non-transparent page of the target application is exposed.

[0226] In a possible implementation, the detection device 600 further includes: a second sending module 606 for sending second indication information to the server indicating that the abnormal event is not a startup abnormality if an abnormal event is detected in the target application and the target non-transparent page is determined to be exposed.

[0227] In a possible implementation, the third-party library includes a third-party software development kit (SDK), and the third-party SDK is used to insert the exposure notification code into a preset page of the target application through AOP technology.

[0228] The above-mentioned detection device provided in the embodiment of the present disclosure can implement each process in the detection method embodiment corresponding to the aforementioned terminal device and achieve the same functions and effects, which will not be repeated here.

[0229] Figure 7 A schematic diagram of the structure of the detection device provided in the embodiment of the present disclosure Figure 2 It should be understood that the detection device of the embodiment of the present disclosure is used for a server, such as Figure 7 As shown, the detection device 700 includes: a receiving module 701, a determining module 702 and an output module 703;

[0230] Among them, the receiving module 701 is used to receive multiple exception information of the target application sent by at least one terminal device. The exception information is sent when each terminal device detects an abnormal event in the target application and determines that the target non-transparent page of the target application is not exposed. The exception information is used to indicate that a startup exception has occurred in the target application; the determination module 702 is used to determine the startup exception rate of the target application based on the exception information; the output module 703 is used to output warning information based on the startup exception rate, and the warning information is used to indicate that the target application should be optimized.

[0231] In one possible embodiment, the exception information includes the exception type, log information and the cause of the exception, and the log information is used to indicate the abnormal location of the abnormal event; the determination module 702 is specifically used to perform at least one of the following: determining the startup exception rate corresponding to the abnormal events of each exception type; determining the startup exception rate corresponding to the abnormal events of each abnormal cause; determining the startup exception rate corresponding to the abnormal events of each abnormal location.

[0232] The above-mentioned detection device provided by the embodiment of the present disclosure can implement each process in the detection method embodiment corresponding to the aforementioned server and achieve the same functions and effects, which will not be repeated here.

[0233] Exemplary Computing Devices

[0234] After introducing the method, medium and apparatus of the exemplary embodiments of the present disclosure, Figure 8 The computing device of the exemplary embodiment of the present disclosure is described. It should be understood that Figure 8 The computing device 800 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.

[0235] Figure 8 This is a schematic diagram of the structure of the computing device provided in the embodiment of the present disclosure. Figure 8 As shown, computing device 800 is implemented as a general-purpose computing device. Components of computing device 800 may include, but are not limited to, at least one processing unit 801, at least one storage unit 802, and a bus 803 connecting different system components (including processing unit 801 and storage unit 802).

[0236] The bus 803 includes a data bus, a control bus, and an address bus.

[0237] The storage unit 802 may include readable media in the form of volatile memory, such as random access memory (RAM) 812 and / or cache memory 822 , and may further include readable media in the form of non-volatile memory, such as read-only memory (ROM) 832 .

[0238] The storage unit 802 may also include a program / utility 852 having a set (at least one) of program modules 842, such program modules 842 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0239] The computing device 800 may also communicate with one or more external devices 804 (e.g., a keyboard, a pointing device, etc.). Such communication may be performed via an input / output (I / O) interface 805. Furthermore, the computing device 800 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 806. Figure 8 As shown, network adapter 806 communicates with other modules of computing device 800 via bus 803. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with computing device 800, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0240] It should be noted that although several units / modules or sub-units / modules of the timing update device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in a single unit / module. Conversely, the features and functions of a single unit / module described above can be further divided and embodied by multiple units / modules.

[0241] Furthermore, although the methods of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all illustrated operations must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0242] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed, and the division into various aspects does not mean that the features in these aspects cannot be combined to benefit. Such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the appended claims.

Claims

1. A method for detecting application startup anomalies, applied to a terminal device having a target application installed thereon, the method comprising: In response to a trigger operation for starting the target application, detecting whether an abnormal event occurs in the target application, and determining whether a target non-transparent page of the target application is exposed by using aspect-oriented programming (AOP) technology to determine the execution of exposure notification code inserted into a preset page of the target application, where the target non-transparent page is the first page viewed by a user during the application startup process; If an abnormal event of the target application is detected and it is determined that the target non-transparent page is not exposed, abnormal information indicating that the abnormal event is a startup abnormality is sent to the server.

2. The detection method according to claim 1, wherein detecting whether an abnormal event occurs in the target application comprises: In response to a trigger operation for starting the target application, registering an exception receiver and executing an initialization process of the target application; receiving, through the exception receiver, an abnormal event in the initialization process; The initialization process of the target application includes at least one of the following: a function initialization process, a third-party library initialization process, or a page drawing process.

3. The detection method according to claim 1, wherein determining whether a target non-transparent page of the target application is exposed based on the execution of the exposure notification code inserted into the preset page of the target application using aspect-oriented programming (AOP) technology comprises: Determining the number of executions of the exposure notification code of the preset page during the page drawing process of the target application; In response to the execution number being greater than or equal to a preset number, and the target page of the target application being a non-transparent page, determining that the target non-transparent page of the target application is exposed; The exposure notification code is inserted into the preset page by using aspect-oriented programming (AOP) technology. If the exposure notification code is executed, it indicates that the corresponding preset page is exposed.

4. The detection method according to claim 1, wherein determining whether a target non-transparent page of the target application is exposed based on the execution of the exposure notification code inserted into the preset page of the target application using aspect-oriented programming (AOP) technology comprises: Read the flag information stored in Native; If it is determined that the value of the flag information is the first preset value, it is determined that the target non-transparent page of the target application is exposed.

5. The detection method according to claim 4, wherein the value of the flag information is set in the following manner: Determining the number of executions of the exposure notification code of the preset page during the page drawing process of the target application; In response to the execution count being equal to a preset count and the target page of the target application being a non-transparent page, setting the value of the flag information to a first preset value; in, The exposure notification code is inserted into the preset page through the AOP technology. If the exposure notification code is executed, it indicates that the preset page is exposed.

6. The detection method according to claim 3 or 5, wherein the target page of the target application is determined to be a non-transparent page by: Get the background color value of the root view of the target page; When the background color value is greater than a background color threshold, it is determined whether the target page of the target application is a non-transparent page according to the transparency of the target page.

7. The detection method according to any one of claims 1 to 5, further comprising: after detecting an abnormal event of the target application; Obtaining log information and an abnormal cause corresponding to the abnormal event according to the abnormal type of the abnormal event, wherein the log information is used to indicate the abnormal location of the startup abnormality; The exception information in a preset format is obtained according to the exception type, the log information and the exception cause.

8. The detection method according to claim 7, wherein the log information includes stack logs and / or system environment snapshot information; The exception type includes at least one of the following: Uncaught Exception, Out of Memory (OMM) exception, Program No Response (ANR) exception, or Native crash.

9. The detection method according to any one of claims 1 to 5, further comprising: If no abnormal event of the target application is detected and the target non-transparent page of the target application is exposed, first indication information for instructing the target application to start normally is sent to the server.

10. The detection method according to any one of claims 1 to 5, further comprising: If it is detected that an abnormal event occurs in the target application and it is determined that the target non-transparent page is exposed, second indication information indicating that the abnormal event is not a startup abnormality is sent to the server.

11. The detection method according to claim 2, wherein the third-party library includes a third-party software development kit (SDK), and the SDK is used to insert the exposure notification code into a preset page of the target application through AOP technology.

12. A method for detecting application startup anomalies, applied to a server, the method comprising: receiving a plurality of exception information of a target application sent by at least one terminal device, the exception information being sent when each of the terminal devices detects an exception event occurring in the target application and determines, through aspect-oriented programming (AOP) technology, that a target non-transparent page of the target application is not exposed based on the execution of an exposure notification code inserted into a preset page of the target application, the exception information indicating that a startup exception has occurred in the target application, the target non-transparent page being the first page viewed by a user during the application startup process; Determining a startup abnormality rate of the target application based on the abnormal information; Outputting warning information according to the startup abnormality rate, wherein the warning information is used to instruct to optimize the target application.

13. The detection method according to claim 12, wherein the abnormal information includes an abnormality type, log information, and an abnormality cause, and the log information is used to indicate the abnormal location of the abnormal event; Determining the startup exception rate of the target application based on the exception information includes at least one of the following: Determine the startup abnormality rate corresponding to abnormal events of each abnormal type; Determine the startup abnormality rate corresponding to the abnormal events of each abnormal cause; Determine the startup abnormality rate corresponding to the abnormal events at each abnormal location.

14. A computer-readable storage medium, wherein computer-executable instructions are stored in the computer-readable storage medium, and when a processor executes the computer-executable instructions, the detection method according to any one of claims 1 to 13 is implemented.

15. A device for detecting application startup anomalies, applied to a terminal device having a target application installed thereon, the device comprising: a detection module, configured to detect whether an abnormal event occurs in the target application in response to a trigger operation for starting the target application, and determine whether a target non-transparent page of the target application is exposed by executing exposure notification code inserted into a preset page of the target application using aspect-oriented programming (AOP) technology, where the target non-transparent page is the first page viewed by a user during application startup; The processing module is configured to, when detecting an abnormal event of the target application and determining that the target non-transparent page is not exposed, send abnormal information indicating that the abnormal event is a startup abnormality to a server.

16. The detection device according to claim 15, wherein the detection module is specifically configured to: in response to a trigger operation for starting the target application, register an exception receiver and execute an initialization process of the target application; and receive an exception event in the initialization process through the exception receiver; in, The initialization process of the target application includes at least one of the following: a function initialization process, a third-party library initialization process, or a page drawing process.

17. The detection device according to claim 15, wherein the detection module is specifically configured to: determine a number of executions of an exposure notification code for a preset page during a page drawing process of the target application; and in response to the number of executions being greater than or equal to a preset number and the target page of the target application being a non-transparent page, determine that the target non-transparent page of the target application is exposed; in, The exposure notification code is inserted into the preset page by using aspect-oriented programming (AOP) technology. If the exposure notification code is executed, it indicates that the corresponding preset page is exposed.

18. The detection device according to claim 15, wherein the detection module is specifically configured to: read flag information stored in Native; If it is determined that the value of the flag information is the first preset value, it is determined that the target non-transparent page of the target application is exposed.

19. The detection device according to claim 18, further comprising: a determination module, configured to determine the number of executions of the exposure notification code of the preset page during the page drawing process of the target application; In response to the execution count being equal to a preset count and the target page of the target application being a non-transparent page, setting the value of the flag information to a first preset value; The exposure notification code is inserted into the preset page through the AOP technology. If the exposure notification code is executed, it indicates that the preset page is exposed.

20. The detection device according to claim 17 or 19, wherein the detection module is specifically configured to: Get the background color value of the root view of the target page; When the background color value is greater than a background color threshold, it is determined whether the target page of the target application is a non-transparent page according to the transparency of the target page.

21. The detection device according to any one of claims 15 to 19, further comprising: An acquisition module, configured to acquire log information and an abnormal cause corresponding to the abnormal event according to the abnormal type of the abnormal event, wherein the log information is used to indicate the abnormal location of the startup abnormality; The exception information in a preset format is obtained according to the exception type, the log information and the exception cause.

22. The detection device according to claim 21, wherein the log information comprises stack logs and / or system environment snapshot information; The exception type includes at least one of the following: Uncaught Exception, Out of Memory (OMM) exception, Program No Response (ANR) exception, or Native crash.

23. The detection device according to any one of claims 15 to 19, further comprising: The first sending module is configured to send first indication information for indicating that the target application is started normally to the server if no abnormal event of the target application is detected and the target non-transparent page of the target application is exposed.

24. The detection device according to any one of claims 15 to 19, further comprising: The second sending module is configured to send second indication information to the server indicating that the abnormal event is not a startup abnormality if an abnormal event is detected in the target application and the target non-transparent page is determined to be exposed.

25. The device for detecting application startup anomalies according to claim 16, wherein the third-party library comprises: A third-party software development kit (SDK) is used to insert the exposure notification code into a preset page of the target application through AOP technology.

26. A device for detecting application startup anomalies, applied to a server, the device comprising: a receiving module, configured to receive multiple exception information of a target application sent by at least one terminal device, wherein the exception information is sent when each terminal device detects an exception event occurring in the target application and determines, based on the execution of an exposure notification code inserted into a preset page of the target application using aspect-oriented programming (AOP) technology, that a target non-transparent page of the target application is not exposed, the exception information being used to indicate that a startup exception has occurred in the target application, and the target non-transparent page is the first page viewed by a user during the application startup process; A determination module, configured to determine a startup exception rate of the target application based on the exception information; An output module is used to output warning information according to the startup abnormality rate, wherein the warning information is used to instruct to optimize the target application.

27. The detection device according to claim 26, wherein the abnormal information includes an abnormality type, log information, and an abnormality cause, and the log information is used to indicate the abnormal location of the abnormal event; The determining module is specifically configured to perform at least one of the following: Determine the startup abnormality rate corresponding to abnormal events of each abnormal type; Determine the startup abnormality rate corresponding to the abnormal events of each abnormal cause; Determine the startup abnormality rate corresponding to the abnormal events at each abnormal location.

28. A computing device comprising: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor and at least the computer-executable instructions stored in the memory enable the at least one processor to execute the detection method according to any one of claims 1 to 13.

29. A computer program product, comprising a computer program; when the computer program is executed, the detection method according to any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Startup exception processing method and device, electronic equipment and storage medium

    CN110837430A

  • Application abnormal data acquisition method and device, computer equipment and storage medium

    CN112181769A