Abnormality processing method and device
By displaying the interactive identifier when the application crashes continuously to a preset number, users can directly download patches or the latest version of the installation package, solving the problem of application startup crashes, simplifying the operation process, and improving the user experience.
Patent Information
- Application Number
- CN202410205306.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-23
- Publication Date
- 2025-08-26
AI Technical Summary
When users use the application, the application crashes during the startup stage, causing the user to be unable to use it normally. The existing solution operates complexly and has poor user experience.
When the number of consecutive startup crashes in the application reaches a preset number, the interactive identifier is displayed. Users can trigger the operation to solve the startup crash through the interactive identifier, including downloading patch files or the latest version of the installation package, clearing the local cache file and restarting the application.
It simplifies user operations, improves user experience, enables users to quickly restore normal use of the application, and avoids the cumbersome reinstallation process.
Smart Images

Figure CN120540897A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an exception handling method and device. Background Art
[0002] With the development of computer technology, more and more applications (APPs) have emerged. In some scenarios, when a user is using an application, the application may crash during the startup phase, causing the user to be unable to use the application normally.
[0003] Currently, if an app crashes during startup, users need to perform a series of operations to resume using the app, which is complex and leads to a poor user experience. Specifically, the user can first uninstall the current app, then open the App Store (another app), search for the latest version of the app from the App Store, install it, and then log in again to continue using the app.
[0004] Therefore, there is an urgent need for a solution that can solve the above problems. Summary of the Invention
[0005] In order to solve or at least partially solve the above technical problems, the embodiments of the present application provide an exception handling method and device.
[0006] In a first aspect, an embodiment of the present application provides an exception handling method, the method comprising:
[0007] Receive application launch operations;
[0008] In response to the application startup operation, when the number of startup crashes of the application reaches a preset number, at least one interaction identifier is displayed, and the at least one interaction identifier is used to trigger an interaction operation to resolve the startup crash.
[0009] Optionally, the at least one interaction identifier includes:
[0010] An application optimization identifier and / or an application download identifier, wherein the application optimization identifier is used to trigger the download of a patch file for resolving the startup crash, and the application download identifier is used to trigger the download of an installation package for the latest version of the application.
[0011] Optionally, if the at least one interaction identifier includes the application optimization identifier, the method further includes:
[0012] In response to the operation triggered by the application optimization identifier, the local cached files of the application are cleared, and the patch file is downloaded from the server. The local cached files include configuration information historically sent by the server to the application.
[0013] Optionally, clearing files locally cached by the application includes:
[0014] Clear the files in the local cache except the target file, where the target file is a file that matches the file name included in the whitelist, and the file names in the whitelist are names of files related to user data.
[0015] Optionally, after downloading the patch file from the server, the method further includes:
[0016] restarting the application;
[0017] The application is repaired using the patch file, and the repaired application is run.
[0018] Optionally, if the at least one interaction identifier includes the application download identifier, the method further includes:
[0019] In response to the operation triggered by the application download identifier, the installation package of the latest version of the application is downloaded from the server, and the installation package is installed in the form of overwriting installation.
[0020] Optionally, when the number of startup crashes of the application program reaches a preset number, displaying at least one interactive indicator includes:
[0021] When the application crashes continuously for a predetermined number of times, a prompt message is displayed, prompting the user to enter safe mode.
[0022] In response to confirming the operation of entering the safety mode, the at least one interaction identifier is displayed.
[0023] In a second aspect, an embodiment of the present application provides an exception handling device, the device comprising:
[0024] A receiving unit, configured to receive an application startup operation;
[0025] A display unit is used to display at least one interaction identifier in response to the application startup operation when the number of startup crashes of the application reaches a preset number, and the at least one interaction identifier is used to trigger an interaction operation to resolve the startup crash.
[0026] Optionally, the at least one interaction identifier includes:
[0027] An application optimization identifier and / or an application download identifier, wherein the application optimization identifier is used to trigger the download of a patch file for resolving the startup crash, and the application download identifier is used to trigger the download of an installation package for the latest version of the application.
[0028] Optionally, if the at least one interaction identifier includes the application optimization identifier, the apparatus further includes:
[0029] a clearing unit, configured to clear locally cached files of the application in response to an operation triggered by an optimization identifier for the application;
[0030] The first downloading unit is configured to download the patch file from the server, and the locally cached file includes configuration information that the server has historically sent to the application.
[0031] Optionally, the clearing unit is used to:
[0032] Clear the files in the local cache except the target file, where the target file is a file that matches the file name included in the whitelist, and the file names in the whitelist are names of files related to user data.
[0033] Optionally, the device further includes:
[0034] a restart unit, configured to restart the application after downloading the patch file from the server;
[0035] a repair unit, configured to repair the application program using the patch file;
[0036] The running unit is used to run the repaired application program.
[0037] Optionally, if the at least one interaction identifier includes the application download identifier, the apparatus further includes:
[0038] a second downloading unit, configured to download an installation package of the latest version of the application from a server in response to an operation triggered by the application download identifier;
[0039] The installation unit is configured to install the installation package in an overlay installation form.
[0040] Optionally, the display unit is used to:
[0041] When the application crashes continuously for a predetermined number of times, a prompt message is displayed, prompting the user to enter safe mode.
[0042] In response to confirming the operation of entering the safety mode, the at least one interaction identifier is displayed.
[0043] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a processor and a memory;
[0044] The processor is used to execute instructions stored in the memory, so that the electronic device executes the method described in any one of the first aspects above.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium comprising instructions, wherein the instructions instruct a device to execute any of the methods described in the first aspect above.
[0046] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect above.
[0047] Compared with the prior art, the embodiments of the present application have the following advantages:
[0048] An embodiment of the present application provides an exception handling method, which can be applied to an application. A user can trigger an application startup operation, and accordingly, the application can receive the application startup operation and respond to the application startup operation. In an embodiment of the present application, if the application crashes continuously for a preset number of times, the application can display at least one interactive identifier, and the at least one interactive identifier is used to trigger an interactive operation to resolve the startup crash. In this way, the user can trigger the interactive operation to resolve the startup crash through the at least one interactive identifier to resolve the startup crash, thereby enabling the user to use the application normally. It can be seen that, using this solution, the user does not need to perform a series of operations, and can trigger the interactive operation to resolve the startup crash through the at least one interactive identifier. The user operation is convenient, which is conducive to improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 A flowchart of an exception handling method provided in an embodiment of the present application;
[0051] Figure 2 A schematic diagram of the structure of a page provided in an embodiment of the present application;
[0052] Figure 3 A schematic diagram of a page corresponding to a security mode provided in an embodiment of the present application;
[0053] Figure 4 A flowchart of an information processing method provided in an embodiment of the present application;
[0054] Figure 5 A schematic diagram of the structure of an exception handling device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to help those skilled in the art better understand the present invention, 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 the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0056] Various non-limiting embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0057] Exemplary Methods
[0058] See also Figure 1 , which is a flow chart of an exception handling method provided in an embodiment of the present application. Figure 1 The method described above can be applied to an application program, wherein the application program can also be referred to as a client. In this embodiment, the method can include the following steps: S101-S102.
[0059] S101: Receive an application startup operation.
[0060] The user can trigger the application startup operation. The embodiment of the present application does not specifically limit the way in which the user triggers the application startup operation. Any operation that can be triggered by the user to start the application belongs to the application startup operation mentioned in this application. In a specific example, the application startup operation can be an operation that triggers the application to perform a cold start. Among them, a cold start means that before the application is started, there is no process information of the application in the operating system running the application. For example: the user can click on the application icon to start the application. In this case, the application startup operation can be a click operation triggered by the icon of the application. At this time, the click operation triggered by the icon of the application is also an operation that triggers the application to perform a cold start.
[0061] After the user triggers the application launch operation, the application may receive the application launch operation.
[0062] S102: In response to the application startup operation, when the number of startup crashes of the application reaches a preset number, display at least one interaction identifier, where the at least one interaction identifier is used to trigger an interaction operation to resolve the startup crash.
[0063] After receiving the application startup operation, the application can respond to the application startup operation. If there is a problem with the software code of the application or the configuration of the server corresponding to the application has changed, the application may crash at startup, that is, the application cannot run normally.
[0064] Generally, when an application crashes at startup, the user will re-trigger the application startup operation. However, if there is a problem with the application's software code or the configuration of the server corresponding to the application has changed, the application will continuously crash at startup. In this case, in order to simplify user operations while still allowing users to use the application normally, the application can display at least one interactive identifier in response to the application startup operation when the number of startup crashes in the application reaches a preset number. Each interactive identifier in the at least one interaction can be used to trigger an interactive operation to resolve the startup crash.
[0065] The embodiments of the present application do not specifically limit the preset number of times, and the preset number of times can be determined according to actual conditions. In one example, if the preset number of times is set too small, the application will frequently display the at least one interactive identifier, causing interference to the user. If the preset number of times is set too large, the number of consecutive startup crashes will be too many, which will also lead to a poor user experience and even user loss. Therefore, the preset number of times can be set to a reasonable value. For example, the preset number of times can be set to 5.
[0066] In an embodiment of the present application, the application can count the number of times it crashes during startup. The startup crash mentioned in the embodiment of the present application refers to a crash that occurs during the startup phase of the application.
[0067] In a specific example, the startup crash may be a crash of the application within a certain period of time after startup. In addition, considering that the main process of the application crashes, it will cause the application to crash, and accordingly, the user will perceive that the application cannot be used normally. However, the crash of the sub-process does not cause the main process to crash, and accordingly, the crash of the sub-process will not cause the user to perceive that the application cannot be used normally. Therefore, the aforementioned startup crash may be a crash of the main process of the application within a certain period of time after startup.
[0068] The main process crash mentioned here can be a Java crash or a native crash, which is not specifically limited in the embodiments of this application. Among them, a Java crash refers to a crash of software code written in the Java programming language during execution, and a native crash refers to a crash of software code written in the C language or C++ language during execution.
[0069] The embodiment of the present application does not specifically limit the certain time period, and the certain time period can be determined according to actual conditions. In one example, the certain time period can be determined by experiment, for example, the certain time period can be within 8 seconds after the application is started.
[0070] In one example, when S102 is specifically implemented, the application may display at least one interactive identifier on the startup page of the application in response to the application startup operation when the number of startup crashes of the application reaches a preset number.
[0071] In another example, the application can display a prompt message in response to the application startup operation, when the number of startup crashes of the application reaches a preset number, and the prompt message can prompt the user to choose to enter the safe mode. For example, the prompt message can be displayed on the startup page of the application. In one example, the prompt message can also include the reason why the user chooses to enter the safe mode, for example, the application can display Figure 2 The page shown, Figure 2 A schematic diagram of the structure of a page provided in an embodiment of the present application. Figure 2 The page displayed includes a prompt message: The application has crashed five times in a row at startup. Please enter safe mode to resolve the problem.
[0072] If the user triggers the operation of confirming to enter the safe mode, for example, the user Figure 2The confirmation control 210 shown triggers the operation of confirming to enter the safe mode, and the application can display the at least one interactive identifier in response to the operation of confirming to enter the safe mode. For example, the at least one interactive identifier can be displayed on the page corresponding to the safe mode, or on the startup page of the application. Figure 3 To understand, Figure 3 This is a schematic diagram of a page corresponding to a security mode provided in an embodiment of the present application. Figure 3 As shown, the page includes an interaction identifier 301 and an interaction identifier 302. The interaction identifier 301 may be, for example, the application optimization identifier mentioned below, and the interaction identifier 302 may be, for example, the application download identifier mentioned below.
[0073] It should be noted that Figure 2 and Figure 3 It is only shown to facilitate understanding of the relevant content of this solution and does not constitute a limitation on the embodiments of this application.
[0074] Regarding safe mode, it should be noted that safe mode is different from the normal usage mode of an application. In safe mode, the normal processing flow of the application is interrupted. In safe mode, the application can execute processing logic related to safe mode. In the embodiment of this application, the processing logic related to safe mode includes displaying at least one interaction identifier and subsequent processing logic related to the at least one interaction identifier.
[0075] In one example, the at least one interaction identifier may include an application optimization identifier, which is used to trigger the download of a patch file to resolve the startup crash. Accordingly, after the application downloads the patch file, it can run the patch file to fix the startup crash.
[0076] For this situation, considering that the application crashes at startup, it is very likely that the configuration on the server has changed, while the configuration used locally by the application is still the one before the change. Therefore, in one example, if the user triggers an operation for the application optimization identifier, the application can clear the local cached files of the application in response to the operation triggered for the application optimization identifier, and download the patch file from the server. Among them, the locally cached files may include configuration information that the server has historically sent to the application. In this way, by clearing the locally cached files, the configuration information that the server has historically sent to the application can be cleared, thereby avoiding the application running the aforementioned configuration information and causing the application to crash at startup.
[0077] In some scenarios, it is considered that the files cached locally by the application include files related to user data, for example, files in the draft box. If the files related to user data are deleted, it will cause certain losses to the user. Therefore, when clearing the locally cached files, these files related to user data can be retained. As a specific example, when clearing the locally cached files, they can be deleted in conjunction with a whitelist. The whitelist may include the names of files that cannot be deleted, and the files that cannot be deleted mentioned here may be the files related to user data mentioned above. Specifically, the names of the locally cached files can be matched with the names in the whitelist, and the files in the locally cached files that match the file names included in the whitelist are determined as target files, and other files in the locally cached files except the target files are cleared. The files that match the file names included in the whitelist may be files whose file names include the file names included in the whitelist.
[0078] In one example, after downloading the patch file from the server, the application can further restart the application. And, in response to the restart of the application, the patch file is used to repair the application, and the repaired application is run. The repair of the application using the patch file mentioned here can be, for example, running the patch file. After running the patch file to repair the application, the application can be run normally. In this way, the user only needs to optimize the identification trigger operation for the aforementioned application, and the application can complete the download of the patch file, restart the application, run the patch file to repair the application, and run the repaired application normally. The user operation is simple, which effectively improves the user experience.
[0079] In another example, the at least one interaction identifier may include an application download identifier. The application download identifier is used to trigger the download of the latest version of the installation package for the application. Accordingly, after the application downloads the latest version of the installation package, it can install the latest version, thereby resolving the aforementioned startup crash issue.
[0080] In one example, if the user triggers an operation for the application download identifier, the application can download the latest version of the installation package of the application from the server in response to the operation triggered for the application download identifier, and install the installation package. In one example, in order to retain user data, the installation package can be installed in the form of an overlay installation. This can solve the aforementioned startup crash problem and also retain user data. In this way, the user only needs to trigger an operation for the aforementioned application download identifier, and the application can complete the download of the latest version of the installation package and the installation of the installation package. The user operation is simple, which effectively improves the user experience.
[0081] The above describes the exception handling method provided by the embodiment of the present application. Next, the method flow of the application program execution is described in conjunction with a specific scenario. Figure 4 , which is a flow chart of an information processing method provided in an embodiment of the present application.
[0082] Figure 4 The method shown may include the following S201-S207.
[0083] S201: Receive an application startup operation.
[0084] If the application crashes continuously upon startup, for example, the number of consecutive startup crashes reaches a preset number, S202 - S203 are executed.
[0085] If there is no abnormality in the application, execute S207.
[0086] S202: Display prompt information, wherein the prompt information prompts the user to choose to enter the safe mode.
[0087] Among them, the way to display prompt information can refer to Figure 2 .
[0088] S203: In response to the operation of confirming the entry into the safe mode, an application optimization identifier and an application download identifier are displayed.
[0089] Among them, the method of displaying the application optimization logo and application download logo can be referred to Figure 3 .
[0090] If the user triggers an operation based on the application optimization identifier, then S204 - S205 are executed; if the user triggers an operation based on the application download identifier, then S207 is executed.
[0091] S204: Clear the local cache files of the application and download the patch file from the server.
[0092] S205: Restart the application program, repair the application program using the patch file, and run the repaired application program.
[0093] S206: Download the latest version of the installation package of the application from the server, and install the installation package in an overwriting installation form.
[0094] S207: Start and run the application.
[0095] In the specific implementation of S207, various initialization items of the application program may be loaded and run. After the various initialization items are run normally, the application program may be run normally.
[0096] Exemplary devices
[0097] Based on the method provided in the above embodiment, the embodiment of the present application further provides a device, which is described below in conjunction with the accompanying drawings.
[0098] See also Figure 5 , Figure 5 A schematic diagram of the structure of an exception handling device provided in an embodiment of the present application. Figure 5 The device 500 shown can be used to execute the exception handling method provided by the above method embodiment.
[0099] The device 500 may specifically include, for example: a receiving unit 501 and a display unit 502 .
[0100] Receiving unit 501, used to receive an application startup operation;
[0101] The display unit 502 is used to display at least one interaction identifier in response to the application startup operation when the number of startup crashes of the application reaches a preset number. The at least one interaction identifier is used to trigger an interaction operation to resolve the startup crash.
[0102] Optionally, the at least one interaction identifier includes:
[0103] An application optimization identifier and / or an application download identifier, wherein the application optimization identifier is used to trigger the download of a patch file for resolving the startup crash, and the application download identifier is used to trigger the download of an installation package for the latest version of the application.
[0104] Optionally, if the at least one interaction identifier includes the application optimization identifier, the apparatus further includes:
[0105] a clearing unit, configured to clear locally cached files of the application in response to an operation triggered by an optimization identifier for the application;
[0106] The first downloading unit is configured to download the patch file from the server, and the locally cached file includes configuration information that the server has historically sent to the application.
[0107] Optionally, the clearing unit is used to:
[0108] Clear the files in the local cache except the target file, where the target file is a file that matches the file name included in the whitelist, and the file names in the whitelist are names of files related to user data.
[0109] Optionally, the device further includes:
[0110] a restart unit, configured to restart the application after downloading the patch file from the server;
[0111] a repair unit, configured to repair the application program using the patch file;
[0112] The running unit is used to run the repaired application program.
[0113] Optionally, if the at least one interaction identifier includes the application download identifier, the apparatus further includes:
[0114] a second downloading unit, configured to download an installation package of the latest version of the application from a server in response to an operation triggered by the application download identifier;
[0115] The installation unit is configured to install the installation package in an overlay installation form.
[0116] Optionally, the display unit 502 is used to:
[0117] When the application crashes continuously for a predetermined number of times, a prompt message is displayed, prompting the user to enter safe mode.
[0118] In response to confirming the operation of entering the safety mode, the at least one interaction identifier is displayed.
[0119] Since the device 500 is a device corresponding to the method provided in the above method embodiment, the specific implementation of each unit of the device 500 is based on the same concept as the above method embodiment. Therefore, regarding the specific implementation of each unit of the device 500, please refer to the description part of the above method embodiment, which will not be repeated here.
[0120] An embodiment of the present application further provides an electronic device, the electronic device comprising a processor and a memory;
[0121] The processor is configured to execute instructions stored in the memory, so that the electronic device executes the exception handling method provided in the above method embodiment.
[0122] An embodiment of the present application provides a computer-readable storage medium, including instructions, wherein the instructions instruct a device to execute the exception handling method provided by the above method embodiment.
[0123] An embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the exception handling method provided in the above method embodiment.
[0124] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0125] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0126] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. An exception handling method, characterized in that: The method comprises: Receive application launch operations; In response to the application startup operation, when the number of startup crashes of the application reaches a preset number, at least one interaction identifier is displayed, and the at least one interaction identifier is used to trigger an interaction operation to resolve the startup crash.
2. The method according to claim 1, characterized in that The at least one interaction identifier includes: An application optimization identifier and / or an application download identifier, wherein the application optimization identifier is used to trigger the download of a patch file for resolving the startup crash, and the application download identifier is used to trigger the download of an installation package for the latest version of the application.
3. The method according to claim 2, characterized in that If the at least one interaction identifier includes the application optimization identifier, the method further includes: In response to the operation triggered by the application optimization identifier, the local cached files of the application are cleared, and the patch file is downloaded from the server. The local cached files include configuration information historically sent by the server to the application.
4. The method according to claim 3, characterized in that The clearing of files locally cached by the application includes: Clear the files in the local cache except the target file, where the target file is a file that matches the file name included in the whitelist, and the file names in the whitelist are names of files related to user data.
5. The method according to claim 3 or 4, characterized in that After downloading the patch file from the server, the method further includes: restarting the application; The application is repaired using the patch file, and the repaired application is run.
6. The method according to claim 2, characterized in that If the at least one interaction identifier includes the application download identifier, the method further includes: In response to the operation triggered by the application download identifier, the installation package of the latest version of the application is downloaded from the server, and the installation package is installed in the form of overwriting installation.
7. The method according to claim 1, characterized in that The displaying of at least one interactive indicator when the number of startup crashes of the application reaches a preset number of times includes: When the application crashes continuously for a predetermined number of times, a prompt message is displayed, prompting the user to enter safe mode. In response to confirming the operation of entering the safety mode, the at least one interaction identifier is displayed.
8. An exception handling device, characterized in that: The device comprises: A receiving unit, configured to receive an application startup operation; A display unit is used to display at least one interaction identifier in response to the application startup operation when the number of startup crashes of the application reaches a preset number, and the at least one interaction identifier is used to trigger an interaction operation to resolve the startup crash.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory; The processor is configured to execute instructions stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The method comprises instructions for instructing a device to execute the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to perform the method according to any one of claims 1 to 7.