Program crash repair method and device, equipment, storage medium and product
By detecting local crash protection policies when the application starts and fixing the software development tool set based on this policy, the problem of crashes during application startup is solved, improving the repair effect and user experience.
Patent Information
- Application Number
- CN202510023586.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-13
AI Technical Summary
The existing technology is difficult to solve the problem of crashes during application startup in a timely manner, and the program crash repair effect is poor.
By detecting whether a local crash protection policy is used when the preset application was last started normally, if used, crash repairs are performed on the preset software development toolset, including disabling or clearing cached data.
It realizes timely solving the problem of crashes during application startup, improves the program crash repair effect, and improves the user experience.
Smart Images

Figure CN119988073A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a program crash repair method, device, equipment, storage medium and product. Background Art
[0002] With the popularization of mobile Internet, the number of mobile Internet users has also exploded. Today, there are more than 4 billion mobile Internet users in the world. These users mainly access the Internet through applications (APPs). Therefore, the stability of application usage has become particularly important, and application crashes have a particularly significant impact on user experience. Among application crashes, crashes that occur during the startup process have the greatest impact on users. All users will go through the application startup stage. Application crashes occur before users have time to perform other operations on the application, which seriously affects user retention and satisfaction.
[0003] As the software development model evolves towards rapid iteration and online updates, updates such as function optimization and performance improvement are often launched in applications based on user needs. If the third-party software development toolkit (SDK) widely used in applications has security vulnerabilities or code defects in the update, it will often further increase the security risks of the system. At present, the crash caused by the software development toolkit is generally handled by hot update, that is, when the development staff detects a large-scale crash of the software program, they fix the program crash problem by modifying part of the code and issuing it. Since the code of the software development toolkit is provided by external developers, its internal implementation is usually a "black box" for application developers. The development staff cannot modify the code of the software development toolkit according to the crash situation, and it is difficult to solve the crash during the application startup process in a timely manner, and the program crash repair effect is poor. Summary of the invention
[0004] The embodiments of the present application provide a program crash repair method, apparatus, device, storage medium and product to solve the technical problems in the related art that the program crash repair scheme is difficult to promptly solve the crash situation that occurs during the application startup process, and the program crash repair effect is poor. It can promptly solve the crash situation that occurs during the application startup process, improve the program crash repair effect, and enhance the user experience.
[0005] In a first aspect, an embodiment of the present application provides a program crash repair method, comprising:
[0006] During the startup process of the preset application, detecting whether the preset application was started normally last time;
[0007] In the case where the preset application was started normally last time, detecting whether the local crash protection strategy was used in the last startup of the preset application, wherein the local crash protection strategy is generated based on a preset software development tool set that causes the preset application to crash continuously when detecting that the preset application crashes continuously when starting;
[0008] In the case where the local crash protection policy was used when the preset application was started last time, crash repair processing is performed on the preset software development tool set according to the local crash protection policy.
[0009] In a second aspect, an embodiment of the present application provides a program crash repair device, including a startup detection module, a policy detection module and a repair processing module, wherein:
[0010] The startup detection module is configured to detect whether the preset application was started normally last time during the startup process of the preset application;
[0011] The policy detection module is configured to detect whether the local crash protection policy was used when the preset application was last started normally, and the local crash protection policy is generated based on the preset software development tool set that causes the preset application to crash continuously when the preset application is detected to crash continuously when the preset application is started normally.
[0012] The repair processing module is configured to perform crash repair processing on the preset software development tool set according to the local crash protection strategy when the preset application was last started using the local crash protection strategy.
[0013] In a third aspect, an embodiment of the present application provides a program crash recovery device, including: a memory and one or more processors;
[0014] The memory is used to store one or more programs;
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the program crash repair method as described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to perform the program crash repair method as described in the first aspect.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of a device reads and executes the computer program from the computer-readable storage medium, so that the device performs the program crash repair method described in the first aspect.
[0018] The embodiment of the present application performs crash repair processing on the preset software development tool set according to the local crash protection policy when the preset application was last started normally and the local crash protection policy was used when the preset application was last started, so as to disable the preset software development tool set and / or clear the cached data of the preset software development tool set according to the crash repair method corresponding to the local crash protection policy, wherein the local crash protection policy is generated based on the preset software development tool set that causes the preset application to continuously crash when continuous startup crashes are detected in the preset application. Compared with the crash repair method of the hot update code, there is no need to modify, verify, and release the hot update code, and the situation in which the preset application crashes during the startup process due to an abnormality in the preset software development tool set can be promptly resolved, thereby improving the program crash repair effect, ensuring the smooth startup of the preset application, and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a flow chart of a program crash repair method provided by an embodiment of the present application;
[0020] Figure 2 is a flow chart of another program crash repair method provided by an embodiment of the present application;
[0021] Figure 3 It is a structural schematic diagram of a program crash repair device provided in an embodiment of the present application;
[0022] Figure 4 It is a structural diagram of a program crash repair device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The above process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The above process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0024] The program crash repair method provided in the present application can be applied to the crash repair of application programs. It aims to generate a local crash protection strategy based on the preset software development tool set that causes the preset application program to continuously crash when the preset application program crashes at startup, so as to promptly resolve the situation in which the preset application program crashes during the startup process due to anomalies in the preset software development tool set during the startup process of the application program, thereby improving the program crash repair effect.
[0025] In the existing program crash repair scheme, it is generally carried out by hot update code repair, for example, the information of calling the target function in the dynamic link library file used to call the target function is replaced with the information of calling the replacement function. When calling the dynamic library to call the target function, the legality is verified, and the replacement function is called to run the repair code. However, this loss-repair method has many operation steps and insufficient real-time performance. It needs to be repaired manually, and then the corresponding repair code is released and sent to the application, and then the application executes the repair code. During this period, more crashes may occur. Or the number of abnormal startups of the client application is obtained; if the number of abnormal startups is greater than the preset maximum abnormal startup number threshold, the client application enters the safe mode and cleans up the local cache of the client application, but this repair method cannot handle crashes in the startup phase. If the application crashes in the startup phase, that is, it crashes before the repair code is sent, it will not be able to receive the repair code and repair the program crash. Based on this, a program crash repair method according to an embodiment of the present application is provided to solve the technical problems that the existing program crash repair scheme is difficult to solve the crash in the application startup process in a timely manner, and the program crash repair effect is poor.
[0026] Figure 1A flowchart of a program crash repair method provided in an embodiment of the present application is given. The program crash repair method provided in an embodiment of the present application can be executed by a program crash repair device, which can be implemented in hardware and / or software and integrated in the program crash repair device.
[0027] The following description is made by taking the program crash repair device executing the program crash repair method as an example. Figure 1 , the program crash repair method includes:
[0028] S110: During the process of starting the preset application, detecting whether the preset application was started normally last time.
[0029] Exemplarily, after the preset application (APP) starts to start, it is detected during the startup process of the preset application whether the preset application was started normally the last time. Optionally, it can be determined whether the preset application crashed during the last startup process based on the log information corresponding to the preset application (such as crash logs, system logs, etc., which can record relevant information about the crash of the preset application, such as crash stack information), so as to determine whether the preset application was started normally the last time during the startup process.
[0030] In one embodiment, the preset application is started normally, which can be that the preset application is started according to the conventional startup method (for example, it is started without adopting the crash protection strategy) and no crash occurs during the startup process, or it can be started with the crash protection strategy (for example, the local crash protection strategy, the background crash protection strategy, etc.) and no crash occurs during the startup process.
[0031] S120: In the case where the preset application was started normally last time, detecting whether the local crash protection strategy was used when the preset application was started last time.
[0032] Exemplarily, when the preset application is started normally last time, it is detected whether the local crash protection strategy was used when the preset application was started last time. Among them, the local crash protection strategy provided by this solution is generated according to the preset software development tool set that causes the preset application to crash continuously when the preset application is detected to crash continuously when starting. The crash repair method corresponding to the local crash protection strategy includes disabling the preset software development tool set and / or clearing the cache data of the preset software development tool set. The preset software development tool set can be one or more software development tool sets.
[0033] The local crash protection strategy provided by this solution can be used to instruct the processing of the preset software development toolset that causes continuous startup crashes in the preset application (processing the entire preset software development toolset). Optionally, the preset software development toolset can be processed by disabling the preset software development toolset during the startup process of the preset application, and / or clearing the cache related to the preset software development toolset. By processing the entire preset software development toolset, there is no need to pay attention to the code situation of the preset software development toolset. Compared with the crash repair method of the related technology that can only repair crashes such as collection out of bounds, unimplemented methods, KVO defense, and wild pointer problems, this solution can effectively handle various crash types of the preset software development toolset, and can effectively ensure the normal startup of the preset application.
[0034] In one possible embodiment, the preset application crashes continuously at startup, which may be the case when the preset application crashes for a preset number of consecutive times (the preset number of times may be 3-10 times) within a preset time length (the preset time length may be 0-20 seconds) of the startup process. For example, if the preset application crashes within 10 seconds during three consecutive startups, or if the preset application crashes within 10 seconds during five consecutive startups, it can be considered that the preset application crashes continuously at startup. This solution determines whether the preset application crashes continuously at startup based on whether the preset application crashes for a preset number of consecutive times within a preset time length of the startup process, accurately determines the timing of generating a local crash protection strategy, and ensures the smooth startup of the preset application.
[0035] S130: In case the local crash protection policy was used when the preset application was started last time, crash repair processing is performed on the preset software development tool set according to the local crash protection policy.
[0036] Exemplarily, when the preset application was started normally last time and the local crash protection policy was used when the preset application was started last time, in order to ensure that the preset application continues to start normally and reduce the situation where the preset application crashes at startup due to related anomalies of the preset software development toolset, the preset software development toolset continues to be crash repaired according to the local crash protection policy, for example, the preset software development toolset is disabled and / or the cached data of the preset software development toolset is cleared according to the crash repair method corresponding to the local crash protection policy.
[0037] Optionally, the local crash protection policy can be used to instruct disabling of a preset software development toolset, and / or clearing a cache associated with the preset software development toolset. In one possible embodiment, crash repair processing is performed on the preset software development toolset according to the local crash protection policy, which may be disabling the preset software development toolset according to the local crash protection policy, or clearing cache data of the preset software development toolset. For example, the preset software development toolset indicated by the local crash protection policy is disabled according to the local crash protection policy, or the cache associated with the preset software development toolset is cleared. After disabling the preset software development toolset or clearing the related cache, the abnormality of the preset software development toolset no longer affects the startup process of the preset application, and the preset application can continue to start.
[0038] In one embodiment, after completing the crash repair process for the preset software development tool set, the subsequent startup process of the preset application can continue without waiting for the development staff to write the hot update code for the cause of the crash and then download the hot update code from the background, causing the program crash repair to be seriously delayed and the preset application to be unavailable.
[0039] This solution uses local strategies to automatically avoid application startup crashes, bypassing program crash repair solutions that rely on developer intervention and code re-release, improving the response speed and real-time performance of program crash repair. It is superior to static repair methods based on embedded code in terms of crash repair types, and can dynamically respond to multiple crash types, effectively reducing the negative impact of sudden application crashes on user experience, improving user satisfaction, reducing user churn, and improving user stickiness.
[0040] In the above, by starting the preset application normally for the last time and using the local crash protection policy when starting the preset application last time, crash repair processing is performed on the preset software development toolset according to the local crash protection policy, so as to disable the preset software development toolset and / or clear the cached data of the preset software development toolset according to the crash repair method corresponding to the local crash protection policy, wherein the local crash protection policy is generated based on the preset software development toolset that causes the preset application to continuously crash when continuous startup crashes are detected in the preset application. Compared with the crash repair method of the hot update code, there is no need to modify, verify, and release the hot update code, and the situation in which the preset application crashes during the startup process due to an abnormality in the preset software development toolset can be promptly resolved, thereby improving the program crash repair effect, ensuring the smooth startup of the preset application, and enhancing the user experience.
[0041] Based on the above embodiments, Figure 2A flowchart of another program crash repair method provided in an embodiment of the present application is given, and the program crash repair method is a specific embodiment of the above-mentioned program crash repair method. Figure 2 , the program crash repair method includes:
[0042] S210: Detecting whether there is a background crash protection strategy during the startup of a preset application program, where the background crash protection strategy is issued by a background server.
[0043] S220: In the case where a background crash protection strategy exists, crash repair processing is performed on a preset software development tool set according to the background crash protection strategy.
[0044] Exemplarily, after the preset application starts to start, it is detected whether the background crash protection strategy is saved in the program crash repair device. When it is detected that the background crash protection strategy is saved, the preset software development tool set can be crash repaired according to the background crash protection strategy. After completing the crash repair process of the preset software development tool set, the program crash repair process can be ended, and the subsequent startup process of the preset application can be continued. In one embodiment, when there is no background crash protection strategy, jump to step S230 to continue to detect whether the preset application was started normally last time.
[0045] Among them, the background crash protection strategy is issued by the background server. For example, the development staff analyzes the preset software development tool set that causes the preset application to crash continuously when it starts up, and generates a background crash protection strategy for the preset software development tool set, and uploads it to the background server. Each program crash repair device can download the background crash protection strategy from the background server. The background crash protection strategy provided by this solution can be used to instruct the processing of the preset software development tool set that causes the preset application to crash continuously when it starts up (processing the entire preset software development tool set). The configuration of the background crash protection strategy can refer to the local crash protection strategy. Optionally, the processing method for the preset software development tool set can be to disable the preset software development tool set during the startup process of the preset application, and / or clear the cache related to the preset software development tool set. By processing the entire preset software development tool set, there is no need to pay attention to the code situation of the preset software development tool set, and various crash types of the preset software development tool set can be effectively processed, which can effectively ensure the normal startup of the preset application.
[0046] Optionally, after the preset application starts to start, the background crash protection policy can be downloaded from the background server, and then the preset software development tool set can be crash repaired according to the background crash protection policy. Compared with the method of configuring hot update code on the background server, this solution greatly shortens the response time of program crash repair by instructing the crash repair of the preset software development tool set through the background crash protection policy, and improves the repair efficiency and the stability of user experience.
[0047] In one embodiment, the timing of pulling the background crash protection policy can be configured to be earlier than the initialization timing of other software development tool sets, and the data format of the background crash protection policy is relatively simple. After pulling the background crash protection policy and saving it locally, the user can apply the background crash protection policy the next time the preset application is started, avoiding the crash of the preset application startup process without perception. Optionally, the data format of the background crash protection policy can be consistent with the data format of the local crash protection policy, and the comparison result of the version number of the background crash protection policy and the local crash protection policy can be used to determine whether to overwrite the local crash protection policy generated locally.
[0048] In one possible embodiment, the background crash protection strategy and local crash protection strategy provided by the present solution may include crash repair signaling, the crash repair signaling is used to instruct the execution of a preset crash repair code, and the crash repair code is used to perform crash repair processing on a preset software development tool set (e.g., disabling a preset software development tool set, and / or clearing caches related to the preset software development tool set). Optionally, the crash protection strategy can be recorded through JSON data (e.g., the crash repair signaling is represented by JSON data), and the crash protection strategy is generated through a brief crash protection strategy, which can improve the efficiency of generating and issuing the crash protection strategy and improve the efficiency of program crash repair.
[0049] In one embodiment, the background crash protection policy and local crash protection policy provided by the present solution can support version iteration and validity period management, and configure the validity period for the crash protection policy to prevent users who have pulled the background crash protection policy or generated the local crash protection policy from always starting in this safe mode. When the anomaly of the preset software development toolset is fixed, the preset application can be returned to the previous startup mode by issuing a new processing strategy, or the preset application can be returned to the previous startup mode when the crash protection policy expires.
[0050] Through the version control mechanism of the crash protection policy, automatic update and replacement can be achieved after the release of a new version of the crash protection policy with a higher priority (the priority of the background crash protection policy is higher than the priority of the local crash protection policy), ensuring that the user's device always applies the optimal policy. The crash protection policy can also be managed for expiration according to the preset validity period. The crash protection policy will automatically become invalid after the expiration date, avoiding unexpected impacts that may be caused by the long-term retention of the crash protection policy on the user's device, and ensuring the user's normal usage experience and system stability.
[0051] Optionally, the preset crash repair code may be pre-configured in the program crash repair device, or in the program installation package of the preset application, or may be sent to the program crash repair device through the background server. When the program crash repair device performs crash repair processing on the preset software development tool set according to the crash protection policy (background crash protection policy or local crash protection policy), it may execute the crash repair code indicated by the locally stored crash repair signaling according to the crash repair signaling in the crash protection policy, and enable the corresponding thread to perform crash repair processing on the preset software development tool set.
[0052] For example, when some users experience a crash, the relevant crash information will be reported to the server backend in real time. By analyzing these crash data, developers can determine whether a large-scale crash problem is caused by a sudden exception in a certain online software development toolset. In response to this situation, developers can configure background crash protection policies to provide advance protection for users who have not yet triggered a crash. When these users start the preset application, the crash protection policy client will pull the background crash protection policy from the background server and apply the background crash protection policy in this or the next startup phase, thereby effectively avoiding potential crash risks.
[0053] In one embodiment, developers can analyze the collected crash attribution data to accurately identify abnormal growth in crash rates in specific regions, versions, device models, or operating systems. After locating the specific cause of the crash (such as a problem caused by a certain software development tool set), the corresponding acquired crash protection strategy can be issued through the signaling mechanism. Signaling is a simple piece of data issued in the early stage of client startup, which can be received before the startup process begins. Even if the application policy is delayed, it can ensure that the preset application automatically takes effect at the next startup, effectively curbing the further spread of program crash problems and significantly reducing the negative impact of program crashes on user experience.
[0054] This solution does not need to wait for the developer to fix the problem. It can generate and issue a background crash protection strategy to repair the program crash by determining the preset software development tool set that causes the preset application to crash continuously at startup, thereby realizing a quick repair of the program crash. At the same time, since the amount of data that needs to be issued for the hot update code is large, the crash may occur before the hot update code is issued, resulting in the inability to repair the crash in the early stage of startup. This solution uses simple signaling data to generate crash repair code to execute the local preset code, which can effectively repair the crash generated in the early stage and ensure the smooth startup of the program. The background crash protection strategy issued by the crash repair signaling can accurately locate the key problems in the startup stage, and there is no need to modify, publish and verify the code version, which greatly shortens the response time of the program crash repair, improves the repair efficiency and the stability of the user experience. The hot update method of the related technology may not receive the complete hot update code after the crash occurs in the early stage, resulting in a repair failure. The crash protection strategy issued by this solution has a small amount of data and an early issuance stage, which can repair the crash in the early stage of program startup.
[0055] S230: In the absence of a background crash protection policy, detecting whether the preset application was started normally last time.
[0056] When there is no background crash protection strategy, it is detected whether the preset application was started normally last time. If the preset application was started normally last time, jump to step S260, and if the preset application was not started normally last time, jump to step S240.
[0057] S240: In the case where the preset application was not started normally last time, determining whether the preset application crashes during continuous startup.
[0058] S250: In the event that a preset application crashes continuously upon startup, determine a preset software development tool set that causes the preset application to crash continuously upon startup, generate a local crash protection strategy based on the preset software development tool set, and perform crash repair processing on the preset software development tool set according to the local crash protection strategy.
[0059] Exemplarily, when the preset application was not started normally last time, it is determined whether the preset application has a continuous startup crash. For example, when the preset application crashes for a preset number of consecutive times within a preset time length of the startup process, it can be determined that the preset application has a continuous startup crash, and when the number of consecutive crashes of the preset application within the preset time length of the startup process is less than the consecutive preset number of times, it can be considered that the preset application has not a continuous startup crash. Optionally, when it is determined that the preset application has not a continuous startup crash, the current program crash repair process can be terminated, and the subsequent startup process of the preset application can be continued.
[0060] In one embodiment, when it is determined that a preset application has continuous startup crashes, the preset software development tool set that causes the preset application to have continuous startup crashes is determined, and a local crash protection policy is generated based on the preset software development tool set, such as determining a crash repair signaling indicating disabling the preset software development tool set, and / or clearing a cache associated with the preset software development tool set, and generating and saving a local crash protection policy based on the crash repair signaling.
[0061] After generating the local crash protection policy, the preset software development tool set can be crash repaired according to the local crash protection policy. When the preset software development tool set is crash repaired according to the local crash protection policy, the crash repair code indicated by the locally saved crash repair signaling can be executed, and the corresponding thread can be enabled to perform crash repair on the preset software development tool set. The subsequent startup process of the preset application will perform program crash repair based on the local crash protection policy before receiving the background crash protection policy or the crash protection policy expires, so as to ensure the normal startup of the preset application.
[0062] This solution generates a local crash protection strategy based on the preset software development tool set that causes the preset application to continuously crash when the preset application was not started normally last time and the preset application crashes continuously at startup, and promptly repairs the program crash for this startup process based on the local crash protection strategy to ensure the normal startup of this preset application. The next time the preset application is started, the local crash protection strategy can continue to be used to repair the program crash to ensure the subsequent normal startup of the preset application.
[0063] In one possible embodiment, the program crash repair method provided by the present solution may also obtain a crash stack collected during the startup process of a preset application before generating a local crash protection strategy based on a preset software development tool set, and determine the preset software development tool set that causes continuous startup crashes of the preset application based on the crash stack.
[0064] Exemplarily, when the startup of a preset application is detected, if the preset application crashes, a corresponding crash stack will be generated. This solution obtains the crash stack collected during the startup process of the preset application (for example, searching and obtaining the crash stack by backtracing the floating point register (fp register)), and determines the preset software development tool set that causes the preset application to crash continuously at startup based on the crash stack. For example, the SDK address segment corresponding to the top address of the crash stack is determined, and the software development tool set corresponding to the SDK address segment is the preset software development tool set that causes the preset application to crash continuously at startup. This solution can accurately generate a local crash protection strategy and ensure the accuracy of program crash repair by accurately determining the preset software development tool set that causes the preset application to crash continuously at startup based on the crash stack.
[0065] In one embodiment, the program crash repair method provided by the present solution generates a local crash protection strategy based on a preset software development tool set, which may include: determining a crash repair method based on the number and / or time of consecutive startup crashes of a preset application; generating a local crash protection strategy based on the crash repair method and the preset software development tool set.
[0066] In one embodiment, different crash repair methods can be configured according to different numbers and / or times of continuous startup crashes, wherein the crash repair method includes disabling a preset software development tool set and clearing cache data of the preset software development tool set, and crash repair methods with different repair strengths can be configured according to the number and / or time of continuous startup crashes corresponding to different severities. Exemplarily, the number and / or time of continuous startup crashes of a preset application are determined, wherein the time of continuous startup crashes can be understood as the time from the start of the preset application to the occurrence of the crash.
[0067] The crash repair method is determined based on the number of consecutive startup crashes and / or time of the preset application determined above. For example, if the number of consecutive startup crashes and / or the time range are within 3 consecutive startup crashes and / or within 10 seconds, the corresponding crash repair method may be disabling the preset software development tool set; if the number of consecutive startup crashes and / or the time range are within 5 consecutive startup crashes and / or within 10 seconds, the corresponding crash repair method may be clearing the cached data of the preset software development tool set.
[0068] After determining the crash repair method, a crash repair signaling can be generated based on the crash repair method to instruct the preset software development tool set to execute the preset crash repair code (when executing the preset crash repair code, the preset software development tool set will be crash repaired according to the above crash repair method), and a local crash protection strategy can be generated based on the crash repair signaling. This solution determines the crash repair method according to the number and / or time of consecutive startup crashes of the preset application, and generates a local crash protection strategy based on the crash repair method and the preset software development tool set. In the process of generating the local crash protection strategy, an adaptive local crash protection strategy corresponding to the repair strength is generated by dynamically evaluating the severity and frequency of consecutive crashes, and triggering the local protection strategy for continuous startup crashes to ensure that the protection behavior is accurate and effective and does not affect the normal use of the application.
[0069] S260: In the case where the preset application was started normally last time, detecting whether the local crash protection strategy was used when the preset application was started last time.
[0070] S270: In case the local crash protection policy was used when the preset application was started last time, crash repair processing is performed on the preset software development tool set according to the local crash protection policy.
[0071] In the above, by starting the preset application normally for the last time and using the local crash protection policy when starting the preset application last time, crash repair processing is performed on the preset software development toolset according to the local crash protection policy, so as to disable the preset software development toolset and / or clear the cached data of the preset software development toolset according to the crash repair method corresponding to the local crash protection policy, wherein the local crash protection policy is generated based on the preset software development toolset that causes the preset application to continuously crash when continuous startup crashes are detected in the preset application. Compared with the crash repair method of the hot update code, there is no need to modify, verify, and release the hot update code, and the situation in which the preset application crashes during the startup process due to an abnormality in the preset software development toolset can be promptly resolved, thereby improving the program crash repair effect, ensuring the smooth startup of the preset application, and enhancing the user experience. Furthermore, when the preset application was not started normally last time and the preset application crashed continuously upon startup, a local crash protection strategy is generated based on the preset software development tool set that caused the preset application to crash continuously upon startup, and the program crash is repaired in this startup process in a timely manner based on the local crash protection strategy to ensure the normal startup of this preset application, and the next time the preset application is started, the local crash protection strategy can continue to be used to repair the program crash to ensure the subsequent normal startup of the preset application. When a background crash protection strategy exists, the background crash protection strategy can also be used to instruct the crash repair process of the preset software development tool set, which greatly shortens the response time of program crash repair and improves the repair efficiency and stability of the user experience. Through real-time monitoring and analysis of the behavior of code and software development tool sets, it is possible to accurately identify unverified code and abnormal behavior without affecting the normal functions of the application, and to perform corresponding isolation and interception processing. Different from the "after-the-fact repair" or "front-end defense" mode in related technologies, this solution combines the strategies of "after-the-fact repair" for a single device and "front-end defense" for the remaining devices, and can effectively control risky behaviors before they spread, thereby reducing the potential impact on users. While ensuring the security and reliability of software updates, it effectively improves the adaptability of applications in diverse hardware and operating system environments.
[0072] Figure 3 Schematic diagram of a program crash repair device provided by an embodiment of the present application. Figure 3 The program crash repair device includes a startup detection module 31, a strategy detection module 32 and a repair processing module 33.
[0073] Among them, the startup detection module 31 is configured to detect whether the preset application was started normally last time during the startup process of the preset application; the policy detection module 32 is configured to detect whether the local crash protection policy was used when the preset application was started normally last time, and the local crash protection policy is generated according to the preset software development tool set that causes the preset application to continuously crash when it is detected that the preset application has continuously crashed when it is started; the repair processing module 33 is configured to perform crash repair processing on the preset software development tool set according to the local crash protection policy when the local crash protection policy was used when the preset application was started last time.
[0074] In the above, by starting the preset application normally for the last time and using the local crash protection policy when starting the preset application last time, crash repair processing is performed on the preset software development toolset according to the local crash protection policy, so as to disable the preset software development toolset and / or clear the cached data of the preset software development toolset according to the crash repair method corresponding to the local crash protection policy, wherein the local crash protection policy is generated based on the preset software development toolset that causes the preset application to continuously crash when continuous startup crashes are detected in the preset application. Compared with the crash repair method of the hot update code, there is no need to modify, verify, and release the hot update code, and the situation in which the preset application crashes during the startup process due to an abnormality in the preset software development toolset can be promptly resolved, thereby improving the program crash repair effect, ensuring the smooth startup of the preset application, and enhancing the user experience.
[0075] In a possible embodiment, the startup detection module 31 is further configured to:
[0076] Determining whether the preset application has a continuous startup crash when the preset application was not normally launched last time;
[0077] The program crash repair device also includes a policy generation module, which is configured to: in the case where a preset application program crashes continuously upon startup, determine a preset software development tool set that causes the preset application program to crash continuously upon startup, and generate a local crash protection policy based on the preset software development tool set;
[0078] The repair processing module is also configured to: perform crash repair processing on a preset software development tool set according to a local crash protection strategy.
[0079] In a possible embodiment, the policy generation module generates a local crash protection policy based on a preset software development tool set, and is configured as follows:
[0080] Determine a crash repair method according to the number and / or time of consecutive startup crashes of the preset application, the crash repair method including disabling the preset software development tool set and clearing cache data of the preset software development tool set;
[0081] Generate local crash protection strategies based on crash repair methods and preset software development tool sets.
[0082] In a possible embodiment, the program crash repair device further includes a crash analysis module, and the crash analysis module is configured to:
[0083] A crash stack collected during the startup process of a preset application is obtained, and a preset software development tool set causing continuous startup crashes of the preset application is determined according to the crash stack.
[0084] In a possible embodiment, the repair processing module performs crash repair processing on a preset software development tool set according to a local crash protection strategy, and is configured as follows:
[0085] Disable the preset SDK according to the local crash protection policy, or clear the cached data of the preset SDK.
[0086] In a possible embodiment, the local crash protection strategy includes crash repair signaling, where the crash repair signaling is used to instruct execution of a preset crash repair code, and the crash repair code is used to perform crash repair processing on a preset software development tool set.
[0087] In a possible embodiment, the startup detection module is further configured to: detect whether there is a background crash protection strategy during the startup of the preset application, where the background crash protection strategy is issued by the background server;
[0088] The repair processing module is also configured to: in the presence of a background crash protection strategy, perform crash repair processing on a preset software development tool set according to the background crash protection strategy.
[0089] In a possible embodiment, the background crash protection strategy includes crash repair signaling, where the crash repair signaling is used to instruct execution of a preset crash repair code, and the crash repair code is used to perform crash repair processing on a preset software development tool set.
[0090] In a possible embodiment, the continuous startup crash of the preset application may be that the preset application crashes for a preset number of consecutive times within a preset time length during the startup process.
[0091] It is worth noting that in the embodiment of the above-mentioned program crash repair device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.
[0092] The embodiment of the present application also provides a program crash repair device, which can integrate the program crash repair apparatus provided in the embodiment of the present application. Figure 4 Schematic diagram of a program crash repair device provided by an embodiment of the present application. Figure 4 The program crash repair device includes: an input device 43, an output device 44, a memory 42 and one or more processors 41; the memory 42 is used to store one or more programs; when one or more programs are executed by one or more processors 41, the one or more processors 41 implement the program crash repair method provided in the above embodiment. The program crash repair device, equipment and computer provided above can be used to execute the program crash repair method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
[0093] The embodiments of the present application also provide a non-volatile storage medium storing computer executable instructions, which are used to execute the program crash repair method provided in the above embodiments when executed by a computer processor. Of course, the non-volatile storage medium storing computer executable instructions provided in the embodiments of the present application, whose computer executable instructions are not limited to the program crash repair method provided above, can also execute the related operations in the program crash repair method provided in any embodiment of the present application. The program crash repair apparatus, device and storage medium provided in the above embodiments can execute the program crash repair method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the program crash repair method provided in any embodiment of the present application.
[0094] On the basis of the above embodiments, the embodiments of the present application also provide a computer program product. The essence of the technical solution of the present application or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer program product is stored in a storage medium, and includes a number of instructions for enabling a computer device, a mobile terminal or a processor therein to execute all or part of the steps of the program crash repair method provided in each embodiment of the present application.
Claims
1. A program crash repair method, characterized in that: include: During the startup process of the preset application, detecting whether the preset application was started normally last time; In the case where the preset application was started normally last time, detecting whether a local crash protection strategy was used in the last startup of the preset application, the local crash protection strategy being generated according to a preset software development tool set that causes the preset application to continuously crash when continuous startup crashes are detected in the preset application, and the crash repair method corresponding to the local crash protection strategy comprising disabling the preset software development tool set and / or clearing cached data of the preset software development tool set; In the case where the local crash protection policy was used when the preset application was started last time, crash repair processing is performed on the preset software development tool set according to the local crash protection policy.
2. The program crash repair method according to claim 1, characterized in that: After detecting whether the preset application was started normally last time during the startup process of the preset application, the method further includes: In the case that the preset application was not started normally last time, determining whether the preset application has a continuous startup crash; In the event that the preset application crashes continuously upon startup, determine the preset software development tool set that causes the preset application to crash continuously upon startup, generate a local crash protection strategy based on the preset software development tool set, and perform crash repair processing on the preset software development tool set according to the local crash protection strategy.
3. The program crash repair method according to claim 2, characterized in that: The generating a local crash protection strategy based on the preset software development tool set includes: Determining a crash repair method according to the number and / or time of consecutive startup crashes of the preset application; A local crash protection strategy is generated based on the crash repair method and the preset software development tool set.
4. The program crash repair method according to claim 2, characterized in that: Before generating the local crash protection strategy based on the preset software development tool set, the method further includes: A crash stack collected during the startup process of the preset application is obtained, and a preset software development tool set causing continuous startup crashes of the preset application is determined according to the crash stack.
5. The program crash repair method according to claim 1, characterized in that: The performing crash repair processing on the preset software development tool set according to the local crash protection strategy includes: The preset software development tool set is disabled according to the local crash protection policy, or cache data of the preset software development tool set is cleared.
6. The program crash repair method according to claim 1, characterized in that: The local crash protection strategy includes crash repair signaling, where the crash repair signaling is used to instruct execution of a preset crash repair code, and the crash repair code is used to perform crash repair processing on the preset software development tool set.
7. The program crash repair method according to claim 1, characterized in that: Before detecting whether the preset application was started normally last time during the startup process of the preset application, the method further includes: During the startup of a preset application, detecting whether there is a background crash protection strategy, wherein the background crash protection strategy is issued by a background server; In the case where the background crash protection strategy exists, crash repair processing is performed on the preset software development tool set according to the background crash protection strategy.
8. The program crash repair method according to claim 7, characterized in that: The background crash protection strategy includes crash repair signaling, where the crash repair signaling is used to instruct execution of a preset crash repair code, and the crash repair code is used to perform crash repair processing on the preset software development tool set.
9. The program crash repair method according to claim 1, characterized in that: The preset application has continuous startup crashes, including: The preset application crashes within a preset time length during the startup process for a preset number of consecutive times.
10. A program crash repair device, characterized in that: It includes a startup detection module, a strategy detection module and a repair processing module, among which: The startup detection module is configured to detect whether the preset application was started normally last time during the startup process of the preset application; The policy detection module is configured to detect whether the local crash protection policy was used when the preset application was last started normally, and the local crash protection policy is generated based on the preset software development tool set that causes the preset application to crash continuously when the preset application is detected to crash continuously when the preset application is started normally. The repair processing module is configured to perform crash repair processing on the preset software development tool set according to the local crash protection strategy when the preset application was last started using the local crash protection strategy.
11. A program crash recovery device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the program crash repair method as described in any one of claims 1-9.
12. A non-volatile storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to execute the program crash recovery method according to any one of claims 1 to 9 when executed by a computer processor.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the program crash repair method according to any one of claims 1 to 9 is implemented.