Application crash processing method and device, equipment and medium

By detecting application crash events, distinguishing code or data crash types, and performing interface switching or clearing cached data, the problem of poor user experience after terminal device application crashes is solved, and rapid repair and stability improvement are achieved.

CN120704922APending Publication Date: 2025-09-26SHENZHEN LEXIN SOFTWARE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510673368.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

After the terminal device application crashes, a new version update needs to be released, resulting in a poor user experience and inability to restore use immediately.

Method used

By detecting application crash events, obtaining crash status information, distinguishing between code crashes and data crashes, and performing interface switching or automatic repairs, including switching between native interfaces, H5 localized interfaces, or browser link interfaces, as well as clearing cached data.

Benefits of technology

Quickly and effectively fix application crashes, reduce user waiting time, and improve user experience and application stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704922A_ABST
    Figure CN120704922A_ABST
Patent Text Reader

Abstract

The invention discloses an application crash processing method and device, equipment and a medium, when it is detected that an application crash event occurs, crash state information of the crash event is obtained, whether a crash positioning result of the crash event is code crash or data crash is determined according to the crash state information, and if the crash positioning result is code crash, the application crash processing method is executed. If the crash event is a data crash event, obtaining a current operation interface where the crash event is located, and controlling the current operation interface to perform interface switching operation based on a preset interface switching mode, and if the crash positioning result is data crash, determining a repair level for automatically repairing the application, and performing clearing operation on cache data of the application according to the repair level. And automatic repair is realized. It can be seen that when the code crash is determined, the interface switching operation is performed based on the preset interface switching mode, and when the data crash is determined, the application is automatically repaired, so that the application crash can be quickly and effectively repaired, and the user experience is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart terminal technology, and in particular to an application crash processing method, device, equipment and medium. Background Art

[0002] With the advancement of terminal device technology, using a variety of apps for work and entertainment has become a commonplace. However, due to the complex operating environments of terminal devices, once an application's native interface crashes, it often requires a new version to be released. If users still need to use the application, they must wait for the new version to be updated and then re-enter the application, which is time-consuming and directly impacts the user experience. Therefore, how to effectively handle app crashes and enhance the user experience has become a pressing issue. Summary of the Invention

[0003] Based on this, it is necessary to address the above technical issues. The embodiments of the present invention provide an application crash processing method, device, equipment and medium, which can effectively handle application crashes and enhance user experience.

[0004] A first aspect of an embodiment of the present application provides a method for handling application crashes, the method comprising: When an application crash event is detected, obtaining crash status information of the crash event; Determining, based on the crash status information, whether a crash location result of the crash event is a code crash or a data crash, wherein a code crash refers to a crash caused by a code problem during application execution, and a data crash refers to a crash caused by a data problem during application execution; If the crash location result is a code crash, the current operation interface where the crash event occurs is obtained, and based on a preset interface switching mode, the current operation interface is controlled to perform an interface switching operation, wherein the current operation interface includes a native interface, an H5 localized interface, or a browser link interface; If the crash location result is a data crash, a repair level for automatically repairing the application is determined, and according to the repair level, cache data of the application is cleared to achieve automatic repair.

[0005] A second aspect of an embodiment of the present application provides an application crash processing device, the crash event processing device comprising: An acquisition module, configured to acquire crash status information of an application crash event when a crash event is detected; a determination module, configured to determine, based on the crash status information, whether a crash location result of the crash event is a code crash or a data crash, wherein a code crash refers to a crash caused by a code problem during application operation, and a data crash refers to a crash caused by a data problem during application operation; A switching module is configured to, if the crash location result is a code crash, obtain the current operation interface where the crash event is located, and control the current operation interface to perform an interface switching operation based on a preset interface switching mode, wherein the current operation interface includes a native interface, an H5 localized interface, or a browser link interface; The repair module is used to determine a repair level for automatically repairing the application if the crash location result is a data crash, and to clear cached data of the application according to the repair level to achieve automatic repair.

[0006] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the application crash handling method as described in the first aspect when executing the computer program.

[0007] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the application crash processing method as described in the first aspect is implemented.

[0008] In summary, the present invention provides an application crash processing method, device, equipment and medium. When an application crash event is detected, the crash status information of the crash event is obtained. According to the crash status information, it is determined whether the crash location result of the crash event is a code crash or a data crash. The code crash refers to the crash of the application due to a code problem during operation, and the data crash refers to the crash of the application due to a data problem during operation. If the crash location result is a code crash, the current operation interface where the crash event is located is obtained, and based on the preset interface switching mode, the current operation interface is controlled to perform an interface switching operation. The current operation interface includes a native interface, an H5 localized interface or a browser link interface. If the crash location result is a data crash, the repair level of the application is determined, and according to the repair level, the cached data of the application is cleared to achieve automatic repair. It can be seen that when the present application determines that the crash location result is a code crash, it obtains the current operation interface where the crash event is located, and then controls the current operation interface to perform interface switching operations based on the preset interface switching mode. When the crash location result is determined to be a data crash, the cached data of the application is cleared to achieve automatic repair, so that the application crash can be repaired quickly and effectively, thereby enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technical personnel in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0010] Figure 1 This is an application environment diagram of an application crash handling method provided by an embodiment of the present invention; Figure 2 This is a flow chart of a method for handling application crashes provided by one embodiment of the present invention; Figure 3 This is a structural diagram of an application crash processing device provided by an embodiment of the present invention; Figure 4 It is a structural diagram of a computer device provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0011] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present invention.

[0012] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0013] It will also be understood that the term "and / or" used in the present description and appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0014] As used in the present specification and the appended claims, the term “if” may be interpreted as “when” or “upon” or “in response to determining”, depending on the context. Similarly, the phrase “if it is determined” or “if compared to [described condition or event]” may be interpreted as meaning “upon determination” or “in response to determination” or “upon comparison to [described condition or event]” or “in response to comparison to [described condition or event]”, depending on the context.

[0015] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0016] References to "one embodiment" or "some embodiments" in the present specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present invention. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0017] It should be understood that the order of execution of the steps in the following embodiments does not necessarily mean the order in which they are executed. The order in which each process is executed should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0018] In order to illustrate the technical solution of the present invention, specific embodiments are provided below.

[0019] See also Figure 1 , is an application environment diagram of an application crash processing method provided by an embodiment of the present invention. An application crash processing method provided by an embodiment of the present invention can be applied in Figure 1 In an application environment, clients communicate with servers. Clients include, but are not limited to, PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and other computer devices. The client here is replaced by a business system. The server can be implemented as a standalone server or a server cluster consisting of multiple servers, which handle application crashes.

[0020] See also Figure 2 , is a flow chart of a method for handling application crashes provided by an embodiment of the present invention, such as Figure 2 As shown, the application crash handling method can be implemented through the following steps.

[0021] S201: When an application crash event is detected, crash status information of the crash event is obtained.

[0022] In step S201, the application crash may be caused by a variety of reasons. For example, during the application startup process or running process, due to some errors in the data packet, some functions of the application enter an infinite loop, which will cause the application to crash. After the crash occurs, the application will often directly exit the running state or automatically enter the restart state. However, for some program crashes, even if the application enters the restart state, it will crash again due to the same problem, which greatly prevents the user from using the application and causes a certain amount of memory overhead on the mobile terminal, while also wasting the user's time. Monitoring the application crash can specifically include monitoring the abnormal exit state during the application running or startup process, and then capturing the crash event by calling a preset function of the operating system, and obtaining the crash status information that caused the crash event through the preset interface of the operating system, wherein the crash status information refers to a series of key information and data automatically recorded by the system when the software or system crashes.

[0023] In one embodiment of the invention, obtaining the crash status information of the crash event includes: Get the code data of the application; Locating a target position in the code data and performing point embedding at the target position; When an application crash event is detected, parsing the feedback data corresponding to the tracking point and determining whether the feedback data includes crash information; If the feedback data includes crash information, the crash status information of the crash event is obtained using a hook function.

[0024] Specifically, by adopting a preset tracking method to track points at specific locations of the application, when an application crash event is detected, the hook function is used to obtain the crash status information of the crash event, that is, by obtaining the code data of the application, the search function, code indexing tool or comments, function names and other identifiers in the code can be used to locate the target location in the code data, and track points are performed at the target location. When the user uses the application to trigger the corresponding operation, the tracking code will collect relevant data and send it to the corresponding data analysis platform, and then obtain feedback data corresponding to the tracking point. Furthermore, when an application crash event is detected, the feedback data is parsed and it is determined whether the feedback data includes crash information. If crash information is included, the crash status information of the crash event is obtained by using the hook function. If crash information is not included, the crash status information of the crash event will not be obtained. In this way, once a crash-related exception error occurs on the page, this hook function can obtain detailed error messages, the source of the erroneous file, the code line number, the column number and the stack trace information and other crash status information, which is convenient for developers to accurately understand the specific circumstances of the crash and perform targeted repairs.

[0025] It should be noted that the preset tracking methods include code tracking and visual tracking, which can be set according to actual conditions. This application does not impose any restrictions on this.

[0026] In this embodiment, when an application crash event is detected, the crash status information of the crash event is obtained so that the user can subsequently understand the cause, location, and context of the crash, thereby performing troubleshooting, repair, and optimization.

[0027] S202: Determine, based on the crash status information, whether the crash location result of the crash event is a code crash or a data crash, wherein the code crash refers to a crash caused by a code problem during the running of the application, and the data crash refers to a crash caused by a data problem during the running of the application.

[0028] In step S202, a code crash refers to a situation where, during the application's execution, the program fails to operate normally due to errors in the code itself (such as syntax errors, logic errors, memory management errors, etc.), resulting in an abnormal exit or freezing. This can typically be caused by programming errors, resource exhaustion, and external interference. Programming errors include array out-of-bounds, null pointer references, and memory leaks; resource exhaustion includes insufficient memory, stack overflows, etc.; and external interference includes operating system errors and hardware failures. The present application determines whether the crash type of the crash event is a code crash or a data crash based on the crash status information. If the crash type is a code crash, step S203 is executed to obtain the current operating interface where the crash event is located and, based on a preset interface switching mode, control the current operating interface to perform an interface switching operation. If the crash type is a data crash, step S204 is executed to determine the repair level for the application and, based on the repair level, clear the application's cached data to achieve automatic repair, thereby restoring the application to normal operation.

[0029] In one embodiment of the invention, determining, based on the crash status information, whether the crash location result of the crash event is a code crash or a data crash includes: Analyze the crash status information based on a preset algorithm to obtain an analysis result; Determining the crash type, crash location, and operation interface level of the crash event based on the analysis result; Determine whether the crash location result of the crash event is a code crash or a data crash according to the crash type, the crash location, and the operation interface level where the crash occurs.

[0030] Specifically, a preset algorithm is used to analyze the crash status information to obtain an analysis result. Based on the analysis result, the crash type, crash location, and operating interface level of the crash event are determined. The crash type refers to the specific classification of the cause of the application crash, which is usually divided based on the nature of the error or the operation that caused the crash. It reflects the category of the problem encountered during the program operation, such as memory problems, data processing problems, and logical errors. The crash location refers to the specific location in the program code where the crash occurred, usually represented by the file name, function name, and line number of the code. It can accurately locate the line of code that caused the crash or the code nearby, helping developers quickly find the problem. The operating interface level of the crash refers to the hierarchical position of the interface component or interface-related operation in an application with a user interface. It is mainly used to determine whether the crash is related to the initialization of the entire interface, the operation of a specific interface element (such as a button or text box), or a specific interface function such as the display and update of interface data. Based on the crash type, crash location, and operating interface level, it is determined whether the crash type of the crash event is a code crash. Through the above steps, the preset algorithm is used to analyze the crash status information, and then the key factors are determined to judge whether the crash type is a code crash or a data crash. This helps to accurately find the root cause of the problem and provide a strong basis for subsequent repair of the crash problem.

[0031] The analysis results primarily identify the specific crash type based on pre-defined identifiers or features corresponding to various crash types. For example, if the analysis results show "OutOfMemoryError," the crash is determined to be a memory-related issue; if there's an "ArrayIndexOutOfBoundsException," it indicates a logical error caused by array operations. Since the analysis results typically provide specific location information such as the function name, code file, and line number, these clues can be used to pinpoint the crash location. For example, if the results indicate a crash in the "UserService.login()" function, located on line 50 of the "UserService.java" file, the code level identifies the issue within this login function. Furthermore, by combining the app's architecture with interface-related identifiers, the crash level can be determined. For example, if the crash occurs in an interface's initialization function (such as the onCreate method of an Activity in Android development), it indicates that the crash occurred at the most basic creation level of the interface. If the crash occurs in a button's click event handler, the issue lies within the interface's interactive component level.

[0032] It should be noted that the preset algorithms can be pattern matching (used to identify known error patterns), exception type classification (classification based on exception type), stack trace parsing (analyzing the function call stack to locate the source of the problem), etc., which can be set specifically according to actual conditions, and this application does not impose any restrictions on this.

[0033] In one embodiment of the invention, determining whether the crash location result of the crash event is a code crash or a data crash based on the crash type, the crash location, and the operation interface level where the crash occurs includes: Determining whether the crash type is a preset code crash type; If the crash type is a preset code crash type, determining that the crash location result of the crash event is a code crash according to the crash location and the operation interface level where the crash occurs; If the crash type is not a preset code crash type, a crash location result of the crash event is determined to be a data crash according to the crash location and the operation interface level where the crash occurs.

[0034] Specifically, the default code crash type is a crash caused by an error in the program's logical flow, such as executing an incorrect code path under specific conditions, which prevents the program from continuing to operate normally. This is likely a code crash. For example, in an order processing system, when calculating the total order price, a multiplication error in the code results in an abnormal calculation result, which in turn causes the program to crash. This is a code crash caused by a code logic error. Alternatively, when a memory leak occurs, where the program continuously requests memory during execution but fails to release it promptly, resulting in a gradual decrease in available memory and ultimately a crash caused by insufficient system resources, this is typically caused by improper memory management in the code and is a code crash. This application does not impose any restrictions on this. This application determines whether the crash type is a default code crash type by primarily examining whether the crash-related factors point to syntax errors, logic errors, improper use of library functions, and other issues within the code itself. If the crash type is a problem clearly caused by improper code writing during code execution, such as a null pointer exception, divide-by-zero error, or type mismatch, it is a default code crash type. The crash location and user interface level of the crash are then used to determine that the crash event is a code crash. For example, in a recursive function, if the recursive termination condition is not set correctly, it may cause a stack overflow and crash, which is a code-level issue. For example, in an Android app, when loading a complex layout file, due to incorrect settings of certain attributes in the layout file, the interface cannot be rendered normally and crashes. This is a code issue in the interface presentation layer. That is, at the user interface level, it is caused by errors in the event handling code corresponding to the interface components (such as errors in the code executed after a button is clicked) or problems in the interface data binding and update code (such as assigning the wrong data type to the interface display element). These situations can basically be judged as code crashes. By determining the crash type in this way, it is possible to more accurately determine whether a crash event is caused by a problem in the code itself based on the crash location and the user interface level. This helps developers quickly locate and fix the code, thereby improving the stability and reliability of the application.

[0035] In this embodiment, a crash caused by incorrect data format, data values ​​outside the expected range, or data integrity compromise may be a data crash. For example, if an image rendering program loads a corrupted image file, causing the program to crash and error while parsing the image data, this is a data crash caused by a data format error. Alternatively, if the program crashes while processing large amounts of data due to excessive volume or uneven data distribution, this may also be data-related. If the crash type is not a predefined code crash type but a predefined data crash type, the crash location is determined to be related to data reading, writing, or processing. If the crash occurs during data reading, such as when reading data from a file, database, or network, this may be due to a problem with the data source or a defect in the data reading code. Based on the crash location and the user interface level, the crash event is then determined to be a data crash. That is, if the crash occurs in the data access layer, such as in database operations or file reading code, the data access code is first checked for correctness. For example, if a SQL statement used to query a database fails and causes a crash due to an error in the SQL statement, this is a code issue in the data access layer. It can be seen that by conducting a comprehensive and detailed analysis of the three aspects of crash type, crash location, and the operating interface level where the crash occurred, it is possible to more accurately determine whether the crash location result of the crash event is a code crash or a data crash.

[0036] It should be noted that the preset code crash type and the preset code crash location can be set according to actual conditions, and this application does not impose any limitation on this.

[0037] In this embodiment, by judging whether the crash type of the crash event is a code crash based on the crash status information, it is possible to quickly and accurately confirm whether the crash is caused by a code problem, which helps to quickly focus on the relevant code area for analysis and repair, avoiding unnecessary time and resources being wasted on other unrelated issues, and improving the efficiency of application crash handling.

[0038] S203: If the crash location result is a code crash, the current operation interface where the crash event occurs is obtained, and based on a preset interface switching mode, the current operation interface is controlled to perform an interface switching operation.

[0039] In step S203, when the crash type of the crash event is determined to be a code crash based on the crash status information, the current operation interface where the crash event is located is obtained and each interface switching mode is defined through instructions, that is, the highest priority: native interface; medium priority: H5 localized interface; low priority: browser link interface, and then based on the interface switching mode, the current operation interface is controlled to perform interface switching operations. It can be seen that no matter which interface crashes, it can be switched immediately, which can more effectively handle the interface switching logic of the interface where the application crashes, and improve the uniformity and scalability of the interface switching logic.

[0040] In one embodiment of the invention, the current operation interface includes a native interface, an H5 localized interface, or a browser link interface, and obtaining the current operation interface where the crash event occurs and controlling the current operation interface to perform an interface switching operation based on a preset interface switching mode includes: If the current operation interface where the crash event occurs is a native interface, the native interface is switched to an H5 localized interface or a browser link interface based on a preset interface switching mode; If the current operation interface where the crash event occurs is an H5 localized interface, then based on a preset interface switching mode, the H5 localized interface is switched to a native interface or a browser link interface; If the current operation interface where the crash event occurs is a browser link mode interface, the browser link mode interface is switched to a native interface or an H5 localized interface based on a preset interface switching mode.

[0041] Specifically, the current operation interface includes a native interface, an H5 localized interface or a browser link interface, and the interface switching mode is highest priority: native interface; medium priority: H5 localized interface; low priority: browser link interface. If the current operation interface where the crash event is located is a native interface, then based on the preset interface switching mode, the native interface will be switched to the H5 localized interface first. If there is a problem with the H5 localized interface, it will be switched to the browser link interface. If the current operation interface where the crash event is located is an H5 localized interface, then based on the preset interface switching mode, the H5 localized interface will be switched to the native interface first. If there is a problem with the native interface, it will be switched to the browser link interface. If the current operation interface where the crash event is located is a browser link interface, then based on the preset interface switching mode, the browser link interface will be switched to the native interface first. If there is a problem with the native interface, it will be switched to the H5 localized interface. And so on, gradually switching the interface from high to low. It can be seen that through the above steps, the impact of crash events on users' normal use of software can be reduced, and users are provided with a variety of interface options, so that they can choose the most suitable interface according to their preferences and needs, thereby improving crash recovery efficiency and user experience, and enhancing the stability and reliability of application operation.

[0042] In one embodiment of the invention, after controlling the current operation interface to perform an interface switching operation, the method includes: After switching to a feasible interface state, a machine learning algorithm is used to repair the current operation interface where the crash event occurs, and after the repair is completed, the feasible interface state is switched to the repaired current operation interface.

[0043] Specifically, when an application encounters an issue with a specific interface during operation (such as a crash, display anomalies, or other issues that severely impact usability), the system automatically switches to a fully functional, stable interface to prevent users from being constantly faced with the problematic interface. This workable interface ensures that users can continue to perform common operations while the original interface issue is fixed, without affecting the overall user experience. After switching to the workable interface, the system analyzes and understands the front-end code using artificial intelligence technologies such as machine learning and natural language processing. For example, it understands the syntax, semantic logic, and common coding patterns of front-end development languages ​​like HTML, CSS, and JavaScript, enabling in-depth analysis of the code involved in the problematic interface. By collecting error information generated when a page crashes (such as the error message output by the browser console, which contains clues such as the file path and line number), analyzing the interrupted page loading process, and comparing the state characteristics of each page during normal operation with the current state of the faulty page, the system can identify the specific page causing the problem. Using a parser, the system can identify syntax and logic bugs, allowing the system to correct these bugs in the front-end code based on correct code logic and design specifications. For example, if the crash is caused by improper data formatting in the code that interacts with the back-end API, the system will adjust the data parsing, encapsulation, and other related code to meet requirements, ensuring correct data transmission and processing, thereby resolving the crash. Once the fixed version is verified and successfully released, and the system determines that it is stable, it will automatically switch back to the settings interface that originally caused the problem, reverting from the previously switched working interface to the previous setup interface. This allows users to continue using the application normally within the familiar interface, and thanks to the previously fixed issue, the interface will no longer experience the previous crash or other issues.

[0044] In this embodiment, when the crash type is determined to be a code crash, the current operation interface where the crash event is located is controlled to perform interface switching operations based on a preset interface switching mode to prevent the crash problem from spreading further and affecting the stability of the entire system. This can quickly avoid the user from being troubled by the crash interface, thereby maintaining user engagement and satisfaction.

[0045] S204: If the crash location result is a data crash, a repair level for automatically repairing the application is determined, and according to the repair level, cached data of the application is cleared to achieve automatic repair.

[0046] In step S204, the crash type of the crash event is determined to be a code crash based on the crash status information. If the crash type of the crash event is a code crash, the current operation interface where the crash event is located is controlled to perform an interface switching operation based on the preset interface switching mode. If the crash type of the crash event is not a code crash, the crash type of the crash event is determined to be a data crash. Then, the repair level for automatically repairing the application is determined, and the cached data of the application is cleared according to the repair level to achieve automatic repair and restore the application to normal state. Data crash refers to the phenomenon that the database system or data storage device stops running unexpectedly for some reason, resulting in the inability to complete the ongoing operation and the inaccessibility, loss or damage of data. It may be caused by hardware failure, software error, network problem and human error. Hardware failure refers to hardware problems such as hard disk damage and server downtime; software error refers to vulnerabilities or errors in the database management system itself; network problem refers to network failure or interruption that may cause the database to be unable to access or update data normally; human error refers to human factors such as accidental deletion of data and incorrect operation of the database. The level of automatic repair can be determined based on the severity of the application startup crash. If the application crashes multiple times, it indicates that the application crashes at a higher level and requires a higher level of repair. If the application crashes frequently, it indicates that the repairs for smaller crashes were ineffective and that crashes are still occurring, requiring a higher level of repair. The advantage of this configuration in this embodiment is that different levels of repair can be set to correspond to different degrees of application crashes, which can better improve the efficiency and scope of application crash repair.

[0047] In one embodiment of the invention, based on the repair level, cached data of the application is cleared to achieve automatic repair, including: Classifying the cache data of the application to obtain a cache level of the cache data; Determining a correspondence between a repair level for automatically repairing the application and the cache level; According to the repair level, cache data of the cache level corresponding to the application is cleared to achieve automatic repair.

[0048] Specifically, cache levels are determined by classifying the application's cached data. This involves pre-determining the tiering rules based on factors such as the cached data's importance, update frequency, and space usage. For example, cached data can be divided into three tiers: Level 1 cache stores the most frequently used and critical data, such as user login information and application configuration data. Loss of this data could impact the application's functionality; Level 2 cache stores data with a moderate update frequency that has a certain impact on application functionality, such as recent browsing history and frequently searched keywords; and Level 3 cache stores temporary data that occupies a large amount of space and is frequently updated, such as image and video caches. Cached data is then tagged: Within the application, each cached data item is assigned a corresponding cache level tag. This can be achieved by adding a field to the cache data storage structure, such as a cache_level field in a database table or a cacheLevel attribute in a cache object. Furthermore, different repair levels can be defined based on the severity of application issues. For example, three repair levels can be defined: minor repair: clears only the L3 cache data to free up some storage space while minimizing disruption to the application's normal use; moderate repair: clears both the L2 and L3 caches to address issues caused by excessive or expired cached data; and major repair: clears all cache levels to completely resolve potential serious application issues. Each repair level is associated with a corresponding cache level to establish a corresponding relationship. This can be achieved using a mapping table. For example, in Python, a dictionary can be used to store this relationship. Add an error detection mechanism to the application. When an application problem is detected, the appropriate repair level is determined based on the severity. For example, if the application only occasionally experiences lag, a minor repair may be sufficient. However, if the application frequently crashes, a major repair may be necessary. Based on the determined repair level, a list of cache levels to be cleared is retrieved from the mapping table. The list is then iterated through to clear the cache data for the corresponding level. As can be seen, automatic repair can involve clearing cached data. Accordingly, after determining the repair level, cached data can be cleared based on the repair level. For example, cached data stored in different directories can be repaired based on the repair level. By clearing cached data, you can free up storage space and reduce memory usage, thereby improving the running speed and responsiveness of the application and restoring the normal operation of the application.

[0049] In this embodiment, when the crash location result is a data crash, automatic repair is achieved by determining the repair level for the application and clearing the cached data of the application according to the repair level to ensure the data integrity and accuracy during the application runtime so that the application can run normally, thereby providing better service quality and meeting user needs.

[0050] In summary, the present invention provides an application crash processing method, device, equipment and medium. When an application crash event is detected, the crash status information of the crash event is obtained. According to the crash status information, it is determined whether the crash location result of the crash event is a code crash or a data crash. The code crash refers to the crash of the application due to a code problem during operation, and the data crash refers to the crash of the application due to a data problem during operation. If the crash location result is a code crash, the current operation interface where the crash event is located is obtained, and based on the preset interface switching mode, the current operation interface is controlled to perform an interface switching operation. The current operation interface includes a native interface, an H5 localized interface or a browser link interface. If the crash location result is a data crash, the repair level of the application is determined, and according to the repair level, the cached data of the application is cleared to achieve automatic repair. It can be seen that when the present application determines that the crash location result is a code crash, it obtains the current operation interface where the crash event is located, and then controls the current operation interface to perform interface switching operations based on the preset interface switching mode. When the crash location result is determined to be a data crash, the cached data of the application is cleared to achieve automatic repair, so that the application crash can be repaired quickly and effectively, thereby enhancing the user experience.

[0051] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of the application crash processing device provided by an embodiment of the present invention. In this embodiment, the terminal includes various units for executing Figure 2 For details, please refer to the steps in the corresponding embodiment. Figure 2 as well as Figure 2 For the convenience of explanation, only the parts related to this embodiment are shown. Figure 3 The application crash processing device 30 includes: an acquisition module 31 , a determination module 32 , a switching module 33 , and a repair module 34 .

[0052] The acquisition module 31 is configured to acquire crash status information of an application crash event when a crash event is detected. a determination module 32 configured to determine, based on the crash status information, whether the crash location result of the crash event is a code crash or a data crash, wherein a code crash refers to a crash caused by a code problem during application operation, and a data crash refers to a crash caused by a data problem during application operation; A switching module 33 is configured to, if the crash location result is a code crash, obtain the current operation interface where the crash event occurs, and control the current operation interface to perform an interface switching operation based on a preset interface switching mode, wherein the current operation interface includes a native interface, an H5 localized interface, or a browser link interface; The repair module 34 is configured to determine a repair level for automatically repairing the application if the crash location result is a data crash, and clear cached data of the application according to the repair level to achieve automatic repair.

[0053] Optionally, the acquisition module 31 is specifically configured to: Get the code data of the application; Locating a target position in the code data and performing point embedding at the target position; When an application crash event is detected, parsing the feedback data corresponding to the tracking point and determining whether the feedback data includes crash information; If the feedback data includes crash information, the crash status information of the crash event is obtained using a hook function.

[0054] Optionally, the determination module 32 is specifically configured to: Analyze the crash status information based on a preset algorithm to obtain an analysis result; Determining the crash type, crash location, and operation interface level of the crash event based on the analysis result; Determine whether the crash location result of the crash event is a code crash or a data crash according to the crash type, the crash location, and the operation interface level where the crash occurs.

[0055] Optionally, the determining module 32 is further configured to: Determining whether the crash type is a preset code crash type; If the crash type is a preset code crash type, determining that the crash location result of the crash event is a code crash according to the crash location and the operation interface level where the crash occurs; If the crash type is not a preset code crash type, a crash location result of the crash event is determined to be a data crash according to the crash location and the operation interface level where the crash occurs.

[0056] Optionally, the switching module 33 is specifically configured to: If the current operation interface where the crash event occurs is a native interface, the native interface is switched to an H5 localized interface or a browser link interface based on a preset interface switching mode; If the current operation interface where the crash event occurs is an H5 localized interface, then based on a preset interface switching mode, the H5 localized interface is switched to a native interface or a browser link interface; If the current operation interface where the crash event occurs is a browser link mode interface, the browser link mode interface is switched to a native interface or an H5 localized interface based on a preset interface switching mode.

[0057] Optionally, the switching module 33 is specifically configured to: After switching to a feasible interface state, a machine learning algorithm is used to repair the current operation interface where the crash event occurs, and after the repair is completed, the feasible interface state is switched to the repaired current operation interface.

[0058] Optionally, the repair module 34 is specifically configured to: Classifying the cache data of the application to obtain a cache level of the cache data; Determining a correspondence between a repair level for automatically repairing the application and the cache level; According to the repair level, cache data of the cache level corresponding to the application is cleared to achieve automatic repair.

[0059] It should be noted that the information interaction, execution process and other contents between the above-mentioned units are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0060] Figure 4 This is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention. Figure 4 As shown, the computer device of this embodiment includes: at least one processor ( Figure 4 Only one is shown), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the steps in any of the above-mentioned application crash handling method embodiments are implemented.

[0061] The computer device may include, but is not limited to, a processor and a memory. Figure 4The above is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include a network interface, a display screen, and an input system.

[0062] In one embodiment, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor in a computer device, the computer device is enabled to perform the steps of any embodiment of an application crash handling method disclosed in the present invention, which are not repeated here. The computer-readable storage medium can be either non-volatile or volatile.

[0063] The processor may be a CPU, other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0064] Memory includes readable storage media, internal memory, and the like. Internal memory can be the internal memory of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage medium. The readable storage medium can be the computer device's hard drive. In other embodiments, it can also be an external storage device, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, or a flash memory card. Furthermore, memory can include both the computer device's internal storage unit and external storage devices. Memory is used to store the operating system, applications, boot loaders, data, and other programs, such as the program code of computer programs. Memory can also be used to temporarily store data that has been output or is about to be output.

[0065] It is understood by those skilled in the art that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0066] Those skilled in the art can clearly understand that for the sake of convenience and brevity in description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0067] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, persons skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A method for handling application crashes, characterized in that: include: When an application crash event is detected, obtaining crash status information of the crash event; Determining, based on the crash status information, whether a crash location result of the crash event is a code crash or a data crash, wherein a code crash refers to a crash caused by a code problem during application execution, and a data crash refers to a crash caused by a data problem during application execution; If the crash location result is a code crash, the current operation interface where the crash event occurs is obtained, and based on a preset interface switching mode, the current operation interface is controlled to perform an interface switching operation, wherein the current operation interface includes a native interface, an H5 localized interface, or a browser link interface; If the crash location result is a data crash, a repair level for automatically repairing the application is determined, and according to the repair level, cache data of the application is cleared to achieve automatic repair.

2. The application crash handling method according to claim 1, wherein: The clearing of cached data of the application according to the repair level to achieve automatic repair includes: Classifying the cache data of the application to obtain a cache level of the cache data; Determining a correspondence between a repair level for automatically repairing the application and the cache level; According to the repair level, cache data of the cache level corresponding to the application is cleared to achieve automatic repair.

3. The application crash processing method according to claim 1, wherein: The determining, based on the crash status information, whether the crash location result of the crash event is a code crash or a data crash includes: Analyze the crash status information based on a preset algorithm to obtain an analysis result; Determining the crash type, crash location, and operation interface level of the crash event based on the analysis result; Determine whether the crash location result of the crash event is a code crash or a data crash according to the crash type, the crash location, and the operation interface level where the crash occurs.

4. The application crash processing method according to claim 3, wherein: The determining, based on the crash type, the crash location, and the operation interface level at which the crash occurs, whether the crash location result of the crash event is a code crash or a data crash includes: Determining whether the crash type is a preset code crash type; If the crash type is a preset code crash type, determining that the crash location result of the crash event is a code crash according to the crash location and the operation interface level where the crash occurs; If the crash type is not a preset code crash type, a crash location result of the crash event is determined to be a data crash according to the crash location and the operation interface level where the crash occurs.

5. The application crash processing method according to claim 1, wherein: When a crash event of an application is detected, obtaining crash status information of the crash event includes: Get the code data of the application; Locating a target position in the code data and performing point embedding at the target position; When an application crash event is detected, parsing the feedback data corresponding to the tracking point and determining whether the feedback data includes crash information; If the feedback data includes crash information, the crash status information of the crash event is obtained using a hook function.

6. The application crash processing method according to claim 1, wherein: The obtaining of the current operation interface where the crash event occurs and controlling the current operation interface to perform an interface switching operation based on a preset interface switching mode includes: If the current operation interface where the crash event occurs is a native interface, the native interface is switched to an H5 localized interface or a browser link interface based on a preset interface switching mode; If the current operation interface where the crash event occurs is an H5 localized interface, then based on a preset interface switching mode, the H5 localized interface is switched to a native interface or a browser link interface; If the current operation interface where the crash event occurs is a browser link mode interface, the browser link mode interface is switched to a native interface or an H5 localized interface based on a preset interface switching mode.

7. The application crash processing method according to claim 1, wherein: After the current operation interface is controlled to perform an interface switching operation, the method includes: After switching to a feasible interface state, a machine learning algorithm is used to repair the current operation interface where the crash event occurs, and after the repair is completed, the feasible interface state is switched to the repaired current operation interface.

8. An application crash processing device, characterized in that: include: An acquisition module, configured to acquire crash status information of an application crash event when a crash event is detected; a determination module, configured to determine, based on the crash status information, whether a crash location result of the crash event is a code crash or a data crash, wherein a code crash refers to a crash caused by a code problem during application operation, and a data crash refers to a crash caused by a data problem during application operation; A switching module is configured to, if the crash location result is a code crash, obtain the current operation interface where the crash event is located, and control the current operation interface to perform an interface switching operation based on a preset interface switching mode, wherein the current operation interface includes a native interface, an H5 localized interface, or a browser link interface; The repair module is used to determine a repair level for automatically repairing the application if the crash location result is a data crash, and to clear cached data of the application according to the repair level to achieve automatic repair.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the crash event processing method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the crash event processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Method for capturing browser state data and electronic equipment

    CN122262396A