Abnormality processing method and device, electronic equipment and storage medium
By monitoring and handling abnormal conditions during application operation and outputting detailed notifications when processing fails, the problem of users not being informed of abnormal information in the existing technology is solved, achieving more efficient exception handling and improving user experience.
Patent Information
- Application Number
- CN202410303291.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2025-09-16
AI Technical Summary
In the existing technology, electronic devices lack an integrated processing process when applications run abnormally, resulting in users failing to obtain abnormal information in a timely manner, increasing user participation, information dispersion, lack of automated intervention, and poor user experience.
Monitor the status of the application during its operation. If any exception occurs, handle the exception and output a detailed notification message, including exception handling details, automatically prohibit the abnormal application from running, and provide user interface management options.
It improves the efficiency of application exception handling, reduces user involvement, centralizes exception information, avoids system freezes or crashes, and improves user experience.
Smart Images

Figure CN120653504A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and more specifically, to an exception handling method, device, electronic equipment, and storage medium. Background Art
[0002] With the development of science and technology, electronic devices are becoming increasingly popular and versatile, becoming essential to people's daily lives. Currently, electronic devices can be used to run applications. However, applications may experience operational anomalies during operation, and electronic devices lack effective solutions for these situations, resulting in inefficient handling of application anomalies. Summary of the Invention
[0003] In view of the above problems, the present application proposes an exception handling method, device, electronic device and storage medium to solve the above problems.
[0004] In a first aspect, an embodiment of the present application provides an exception handling method, the method comprising: during the operation of an application, monitoring the operation status of the application, wherein the operation status includes an abnormal state or a normal state; if the operation status is the abnormal state, performing exception handling on the application to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved; if the exception handling result is that the exception has not been resolved, outputting a notification message, wherein the notification message is used to report to the user detailed information on exception monitoring and exception handling for the application.
[0005] In the second aspect, an embodiment of the present application provides an exception handling device, which includes: an operation status monitoring module, which is used to monitor the operation status of the application during the operation of the application, wherein the operation status includes an abnormal state or a normal state; an exception handling result acquisition module, which is used to perform exception handling on the application to obtain an exception handling result if the operation status is the abnormal state, wherein the exception handling result includes whether the exception has been resolved or not; a notification message output module, which is used to output a notification message if the exception handling result is that the exception has not been resolved, wherein the notification message is used to report detailed information on exception monitoring and exception handling for the application to the user.
[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the above method.
[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which program code is stored, and the program code can be called by a processor to execute the above method.
[0008] The exception handling method, device, electronic device and storage medium provided in the embodiments of the present application monitor the running status of the application during the running process of the application, wherein the running status includes an abnormal state or a normal state. If the running status is an abnormal state, the application is exception handled to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved. If the exception result is that the exception has not been resolved, a notification message is output, wherein the notification message is used to report detailed information about exception monitoring and exception handling for the application to the user, thereby improving the exception handling efficiency of the application by performing exception handling when an application running abnormality is detected and outputting detailed information about the application exception to the user when the exception handling fails. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A schematic diagram of a process flow of an exception handling method provided in an embodiment of the present application is shown;
[0011] Figure 2 A schematic diagram of a process flow of an exception handling method provided in an embodiment of the present application is shown;
[0012] Figure 3 A schematic diagram of a process flow of an exception handling method provided in an embodiment of the present application is shown;
[0013] Figure 4 A schematic diagram of a process flow of an exception handling method provided in an embodiment of the present application is shown;
[0014] Figure 5 A schematic diagram of a process flow of an exception handling method provided in an embodiment of the present application is shown;
[0015] Figure 6 A schematic diagram of a process flow of an exception handling method provided in an embodiment of the present application is shown;
[0016] Figure 7 A schematic diagram of a process flow of an exception handling method provided in an embodiment of the present application is shown;
[0017] Figure 8A module block diagram of an exception handling device provided in an embodiment of the present application is shown;
[0018] Figure 9 A block diagram of an electronic device for executing an exception handling method according to an embodiment of the present application is shown;
[0019] Figure 10 A storage unit for storing or carrying program codes for implementing the exception handling method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0021] Currently, application anomaly monitoring can generally be accomplished through independent anomaly detection tools, basic system monitoring, or third-party security applications. Independent anomaly detection tools refer to independent applications or system tools that monitor electronic device resource usage, such as central processing unit (CPU) and memory usage. These independent anomaly detection tools can provide some basic monitoring functions, but they generally do not include further processing or user notification functions. Basic system monitoring refers to the fact that most operating systems, such as Android, have built-in basic monitoring mechanisms to track application resource usage. However, these mechanisms generally only provide limited information and lack the ability to conduct in-depth analysis or automatically handle abnormal behavior. Third-party security applications refer to some third-party security applications that provide more advanced monitoring functions, including application behavior analysis and some automated processing, but these generally require users to actively install and configure them and may not be deeply integrated with the system.
[0022] Therefore, the above solution has at least the following disadvantages:
[0023] First, lack of integrated processing: Current solutions often lack an integrated processing flow between anomaly detection and user notification. This means that even if an application operation anomaly is detected, the user may not receive a timely notification, resulting in the problem not being resolved in a timely manner.
[0024] Second, high user participation: Most current solutions require active user participation, such as checking monitoring applications, setting alarms, etc. This increases the user's workload and may lead to exacerbated problems if the user fails to respond in a timely manner.
[0025] Third, information dispersion: Exception information and warnings are often scattered across different applications or system tools, which may cause users to miss important warnings, especially for users who do not frequently check these tools.
[0026] Fourth, lack of automated intervention: Most current solutions lack the ability to automatically take action on detected anomalies. Even if some systems or applications can notify users of anomalies, they usually do not automatically take measures to resolve the problem.
[0027] Fifth, poor user experience: Due to the lack of an effective user notification mechanism, even if users receive a warning, they may not know how to respond, which reduces the overall user experience.
[0028] To address the above issues, the inventors, after extensive research, have discovered and proposed the exception handling method, device, electronic device, and storage medium provided in the embodiments of this application. These methods improve the efficiency of application exception handling by performing exception handling when an application is detected to be operating abnormally and providing detailed information about the application exception to the user when exception handling fails. The specific exception handling method is described in detail in the subsequent embodiments.
[0029] See also Figure 1 , Figure 1 The flowchart of the exception handling method provided by an embodiment of the present application is shown. The method is used to improve the exception handling efficiency of the application by performing exception handling when an exception is detected in the application and outputting detailed information about the exception of the application to the user when the exception handling fails. In a specific embodiment, the exception handling method is applied to Figure 8 The abnormality handling device 200 and the electronic device 100 equipped with the abnormality handling device 200 ( Figure 9 ). The following will take electronic devices as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the electronic devices used in this embodiment can include smart phones, tablet computers, wearable electronic devices, etc., which are not limited here. Figure 1 The process shown is described in detail, and the exception handling method may specifically include the following steps:
[0030] Step S110: During the running of the application, the running state of the application is monitored, wherein the running state includes an abnormal state or a normal state.
[0031] In this embodiment, it is possible to detect whether an electronic device is running an application. If it is detected that the electronic device is running an application, the running state of the application can be monitored during the running of the application, wherein the running state can include an abnormal state or a normal state. If it is detected that the electronic device is not running an application, it is possible to continue to detect whether the electronic device is running an application.
[0032] Optionally, the applications run by the electronic device may include video streaming applications, game applications, instant messaging applications, search applications, shopping applications, navigation applications, etc., which are not limited here.
[0033] Optionally, the electronic device running the application may include: the electronic device running the application in the foreground; the electronic device running the application in the background; and / or the electronic device switching between running the application in the foreground and the background, which is not limited here.
[0034] Optionally, the electronic device may run one or more applications. If the electronic device runs one application, the running status of the one application may be monitored during the running of the one application; if the electronic device runs multiple applications, the running status of the multiple applications may be monitored separately during the running of the multiple applications.
[0035] In some embodiments, during the operation of the application, the operating status of the application can be monitored in real time; the operating status of the application can be monitored at preset time intervals; the operating status of the application can be monitored at preset time points; the operating status of the application can be monitored according to other preset rules, etc., which are not limited here.
[0036] As an implementable method, during the running process of the application, the running state of the application can be directly monitored. That is, as long as the application is running on the electronic device, its running state is monitored.
[0037] As another feasible method, during the operation of an application, the application type corresponding to the application can be obtained. If the application type meets the specified application type, the operating status of the application can be monitored; if the application type does not meet the specified application type, the operating status of the application can be not monitored. In other words, only the operating status of applications that meet the specified application type is monitored to balance the operating performance of the application and the power consumption of the electronic device. Optionally, the specified application type may include: game application type, instant messaging application type, video application type, and other application types with high requirements for running smoothness.
[0038] As another feasible method, during the operation of an application, it can be determined whether the application is in a preset list. If the application is in the preset list, the operation status of the application can be monitored; if the application is not in the preset list, the operation status of the application can be not monitored. Optionally, the preset list can include multiple applications, and the probability of operation abnormalities of the multiple applications in the preset list when running on a reference electronic device is greater than a probability threshold. The reference electronic device can be an electronic device of the same model as the electronic device, an electronic device from the same manufacturer as the electronic device, an electronic device of the same price as the electronic device, an electronic device from the same batch as the electronic device, an electronic device from the same period as the electronic device, etc., which are not limited here. That is, only the operation status of applications whose probability of operation abnormalities is greater than the probability threshold is monitored to balance the operation effect of the application and the power consumption of the electronic device.
[0039] In some embodiments, during the operation of an application, the CPU usage of the application can be monitored to determine the operating status of the application based on the CPU usage. Optionally, during the operation of the application, the proportion of CPU resources used by the application within a preset duration (a certain duration) can be determined. If the proportion exceeds a proportion threshold, the operating status of the application can be determined to be abnormal; if the proportion does not exceed the proportion threshold, the operating status of the application can be determined to be normal. As an example, during the operation of an application, it can be determined whether the application is running in the foreground or in the background. If the application is running in the background, the proportion of CPU resources used by the application within a preset duration can be determined. If the proportion exceeds the proportion threshold, the operating status of the application can be determined to be abnormal; if the proportion does not exceed the proportion threshold, the operating status of the application can be determined to be normal.
[0040] In some embodiments, during the operation of an application, the application's memory usage can be monitored to determine the application's operating status based on the memory usage. Optionally, during the operation of the application, the application's memory allocation and release can be tracked. If it is detected that the memory occupied by the application continues to increase over time without being released, it indicates a possible memory leak and the application's operating status is determined to be abnormal. Otherwise, the application's operating status can be determined to be normal.
[0041] In some embodiments, during the operation of an application, the device wake-up status of the application can be monitored to determine the operating status of the application based on the device wake-up status. Optionally, during the operation of an application, the wake-up lock of the application can be monitored. If it is detected that the application uses the wake-up lock excessively (such as the number of times the wake-up lock is used within a preset time period reaches a threshold), the operating status of the application can be determined to be abnormal. Otherwise, it can be determined that the operating status of the application is normal. Among them, if the application uses the wake-up lock excessively when the device should be in sleep mode, it may cause the battery of the electronic device to be consumed rapidly. Therefore, if the application is detected to use the wake-up lock excessively when the device should be in sleep mode, it can be determined that the operating status of the application is abnormal.
[0042] In some embodiments, during the operation of an application, the initiation of services or activities by the application can be monitored to determine the operating status of the application based on the initiation of services or activities. Alternatively, during the use of the application, the frequency and pattern of the application's initiation of services or activities can be detected. If it is detected that the application frequently and unnecessarily initiates services or activities, the operating status of the application can be determined to be abnormal; otherwise, the operating status of the application can be determined to be normal.
[0043] In some embodiments, during the operation of an application, the network usage of the application can be detected to determine the operating status of the application based on the network usage. Optionally, during the operation of the application, the data usage of the application can be detected. If the application has a large amount of data transmission, the operating status of the application can be determined to be abnormal; otherwise, the operating status of the application can be determined to be normal. As an example, during the operation of the application, it can be determined whether the application is running in the foreground or in the background. If it is determined that the application is running in the background and there is a large amount of data transmission, the operating status of the application can be determined to be abnormal.
[0044] In some implementations, during the application's operation, the application's file read and write status can be detected to determine the application's operating status based on the file read and write status. Optionally, during the application's operation, the application's file I / O operations can be tracked. If frequent or large-scale read and write operations are detected, this indicates that the performance and storage space of the electronic device may be affected, and the application's operating status is determined to be abnormal. Otherwise, the application's operating status can be determined to be normal.
[0045] In some embodiments, during the operation of an application, the registration status of the application with respect to a broadcast receiver may be detected, and the operating status of the application may be determined based on the registration status of the broadcast receiver. Optionally, during the operation of the application, the number and frequency of broadcast receivers registered by the application may be monitored. If it is detected that the number of broadcast receivers registered by the application is excessive (e.g., the number is greater than a number threshold) or the frequency is too high (e.g., the frequency is greater than a frequency threshold), the operating status of the application is determined to be abnormal. Otherwise, the operating status of the application may be determined to be normal.
[0046] In some embodiments, during the operation of an application, the duration of the application's service operation can be detected to determine the application's operating status based on the service operation duration. Optionally, during the operation of an application, the duration of background service operation can be tracked. If the operation duration is too long (e.g., the operation duration is greater than a duration threshold), it can be considered that the electronic device may be consuming excessive resources, i.e., the application's operating status is determined to be abnormal. Otherwise, the application's operating status can be determined to be normal.
[0047] In some embodiments, during the operation of an application, the application's sensor usage can be detected to determine the application's operating status based on the sensor usage. Alternatively, during the operation of an application, the application's usage of sensors (such as GPS, accelerometer, etc.) can be monitored. If excessive or inappropriate usage is detected, the application's operating status is determined to be abnormal; otherwise, the application's operating status can be determined to be normal.
[0048] In some embodiments, during the operation of an application, the application's system resource requests can be detected to determine the application's operating status based on the system resource requests. Alternatively, during the operation of an application, the application's access to system resources (such as a camera, microphone, etc.) can be monitored. If improper access requests are detected, the application's operating status is determined to be abnormal; otherwise, the application's operating status can be determined to be normal.
[0049] Step S120: If the running state is the abnormal state, performing exception handling on the application to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved.
[0050] In some implementations, if it is determined that the running state of the application is normal, the application can be kept running without performing exception processing.
[0051] In some embodiments, if it is determined that the running state of the application is an abnormal state, the application can be exception handled and an exception handling result can be obtained. It can be understood that if the running exception of the application is resolved after the exception handling of the application (there is no running exception), then the obtained exception handling result can be determined to be that the exception has been resolved; if the running exception of the application is not resolved after the exception handling of the application (there is still a running exception), then the obtained exception handling result can be determined to be that the exception has not been resolved.
[0052] As an implementable approach, if an application's operating state is determined to be abnormal, the electronic device may attempt to process and resolve the application's operating abnormality and obtain an abnormality handling result. For example, the electronic device may handle the application's abnormality by restarting the application; by shutting down certain processes of the application; by imposing certain operating restrictions on the application; by restricting the application's functionality, etc., without limitation here.
[0053] In some embodiments, after performing exception handling on an application, the operating status of the application can be monitored, and an exception handling result can be obtained based on the monitored operating status. If the monitored operating status is an operating exception, the exception handling result can be determined as an unresolved exception; if the monitored operating status is abnormally normal, the exception handling result can be determined as an resolved exception. Optionally, after performing exception handling on an application, the operating status of the application can be monitored immediately; or, the operating status of the application can be monitored at preset intervals, etc., which are not limited here.
[0054] Step S130: If the exception handling result is that the exception is not resolved, a notification message is output, wherein the notification message is used to report detailed information about the exception monitoring and exception handling performed on the application to the user.
[0055] In some implementations, if it is determined that the exception handling result is that the exception has been resolved, the application program may be kept running and no notification message may be output.
[0056] In some embodiments, if it is determined that the exception handling result is an unresolved exception, a notification message can be output, wherein the notification message can be used to report to the user detailed information on exception monitoring and exception handling for the application. It can be understood that since the notification message includes detailed information on exception monitoring and exception handling for the application, the user can clearly know the detailed cause of the application operation exception, the detailed process of exception handling, and the detailed result of exception handling through the notification message, so that the user can quickly handle the application operation exception accordingly, thereby improving the efficiency of handling the application operation exception. In addition, it can be clearly seen that compared with a simple exception notification, the detailed information including exception monitoring and exception handling for the application can provide the user with a solution to the operation exception, thereby significantly improving the efficiency of handling the operation exception.
[0057] Optionally, the notification message may also be used to report to the user detailed information on abnormality identification performed on the application.
[0058] Optionally, the notification message may also include other solutions to the operation exception for the user to refer to for manual exception resolution, thereby improving the success rate of resolving the operation exception.
[0059] As a first feasible approach, the notification message can be outputted in the form of a pop-up window. It is understandable that the pop-up window can provide an immediate and significant reminder to ensure that the user notices the notification message, which is suitable for important notifications that need to be processed immediately.
[0060] As a second feasible approach, the notification message can be outputted via the system status bar. It is understandable that the system status bar is relatively unobtrusive and does not immediately interrupt the user's current activity, allowing the user to view the notification message at their convenience.
[0061] As a third possible implementation, notification messages can be centrally displayed through a security manager or system management application. It is understood that the security manager or system management application can provide a dedicated place to view and manage all notification messages, which helps to keep notification messages organized and manageable.
[0062] As a fourth feasible approach, the notification message can be outputted by displaying it in the internal notification center of the application. It is understandable that by displaying it in the internal notification center of the application, the notification message can be displayed in a centralized location that is easily accessible without interfering with the user's other activities.
[0063] As a fifth feasible method, the notification message can be output in a user-customized manner. It is understandable that the user-customized manner allows users to choose the notification method that best suits them, thereby improving user experience and satisfaction.
[0064] Of course, the message may also be notified by combining at least two of the above-mentioned multiple implementations, which will not be described in detail here.
[0065] An exception handling method provided in an embodiment of the present application monitors the running status of an application during its operation, wherein the running status includes an abnormal state or a normal state. If the running status is an abnormal state, exception handling is performed on the application to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved. If the exception result is that the exception has not been resolved, a notification message is output, wherein the notification message is used to report detailed information about exception monitoring and exception handling for the application to the user, thereby improving the exception handling efficiency of the application by performing exception handling when an application operation exception is detected and outputting detailed information about the application exception to the user when the exception handling fails.
[0066] See also Figure 2 , Figure 2 The following is a flow chart of the exception handling method provided by an embodiment of the present application. Figure 2 The process shown is described in detail, and the exception handling method may specifically include the following steps:
[0067] Step S210: During the running of the application, the running state of the application is monitored, wherein the running state includes an abnormal state or a normal state.
[0068] Step S220: If the running state is the abnormal state, performing exception handling on the application to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved.
[0069] Step S230: If the exception handling result is that the exception is not resolved, a notification message is output, wherein the notification message is used to report detailed information about the exception monitoring and exception handling for the application to the user.
[0070] For the detailed description of steps S210 to S230 , please refer to steps S110 to S130 , which will not be repeated here.
[0071] Step S240: If the exception handling result is that the exception is not resolved, the application is prohibited from running.
[0072] In some embodiments, if the exception handling result is determined to be an unresolved exception, the application can be prohibited from running. That is, if the exception handling result is determined to be an unresolved exception, the operating system of the electronic device can automatically prohibit the application from running to prevent its continued operation from affecting system performance and user experience.
[0073] Optionally, when the electronic device is prohibited from running the application, the application cannot be run on the electronic device again unless the user actively unbans the application.
[0074] As an implementable manner, after the application is exception handled, the application may continue to run. If the application continues to exhibit the same abnormal behavior during running, the application may be prohibited from running.
[0075] As another feasible manner, after the application program is processed for exception, the application program may continue to be run. If the application program does not exhibit abnormal behavior during the running process, the running of the application program may not be prohibited.
[0076] As another feasible manner, after the application program is processed for exception, the application program may continue to be run. If the application program exhibits different abnormal behaviors during the running process, the running of the application program may not be prohibited.
[0077] Step S250: Displaying a user interface, wherein the user interface is used to manage the application.
[0078] Optionally, the electronic device may provide a user interface that allows the user to view and manage applications identified as abnormal, including viewing detailed information about abnormal monitoring and abnormal handling for the application and choosing whether to re-enable the application. In this embodiment, the electronic device may display a user interface that can be used to manage the application.
[0079] In some embodiments, the user interface may be displayed in response to a display instruction for the user interface; the user interface may be automatically displayed when the current time meets a preset time; the user interface may be automatically displayed when the current parameters of the electronic device meet preset parameters, etc., without limitation herein. As an example, taking the automatic display of the user interface when the current parameters of the electronic device meet preset parameters as an example, the user interface may be automatically displayed when the electronic device switches from a screen-off state to a screen-on state; the user interface may be automatically displayed when the idle time of the electronic device reaches a time threshold, etc., without limitation herein.
[0080] Step S260: If a first operation on the user interface is detected, the detailed information is displayed.
[0081] Optionally, the first operation may include a first click operation, a first press operation, a first slide operation, etc., which are not limited here. The first click operation may include a first single-finger click operation or a first multi-finger click operation; the first press operation may include a first single-finger press operation or a first multi-finger press operation; the first slide operation may include a first single-finger slide operation or a first multi-finger slide operation, etc., which are not limited here.
[0082] In this embodiment, the electronic device may detect operations acting on the user interface while displaying the user interface. If a first operation acting on the user interface is detected, it may be considered that the user desires to view detailed information about abnormal monitoring and abnormal handling of the application through the user interface, and the detailed information may be displayed.
[0083] Step S270: If a second operation acting on the user interface is detected, the operation restriction on the application is lifted.
[0084] Optionally, the second operation may include a second click operation, a second press operation, a second slide operation, etc., which are not limited here. The second click operation may include a second single-finger click operation or a second multi-finger click operation; the second press operation may include a second single-finger press operation or a second multi-finger press operation; the second slide operation may include a second single-finger slide operation or a second multi-finger slide operation, etc., which are not limited here.
[0085] In this embodiment, the electronic device may detect operations acting on the user interface while displaying the user interface. If a second operation acting on the user interface is detected, it may be considered that the user desires to unblock the application (resume the application running on the electronic device), and the operation restriction on the application may be lifted, and the application may subsequently be allowed to run on the electronic device.
[0086] An exception handling method provided by an embodiment of the present application monitors the running status of an application during its operation, wherein the running status includes an abnormal state or a normal state. If the running status is an abnormal state, the application is subjected to exception handling to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or not resolved. If the exception handling result is that the exception has not been resolved, a notification message is output and the application is prohibited from running. The notification message is used to report to the user detailed information on the exception monitoring and exception handling performed on the application, thereby avoiding system freezes or crashes caused by application exceptions. Subsequently, a user interface for managing the application is displayed. If a first operation acting on the user interface is detected, detailed information is displayed. If a second operation acting on the user interface is detected, the running restrictions on the application are lifted, thereby enabling the user to understand and manage the behavior and status of the application and improving the user experience.
[0087] See also Figure 3 , Figure 3 The following is a flow chart of the exception handling method provided by an embodiment of the present application. Figure 3 The process shown is described in detail, and the exception handling method may specifically include the following steps:
[0088] Step S310: During the running of the application, the running state of the application is monitored, wherein the running state includes an abnormal state or a normal state.
[0089] Step S320: If the running state is the abnormal state, performing exception handling on the application to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved.
[0090] For the detailed description of steps S310 to S320 , please refer to steps S110 to S120 , which will not be repeated here.
[0091] Step S330: If the exception handling result is that the exception is not resolved, determine the exception type corresponding to the application.
[0092] In this embodiment, if the exception handling result is determined to be an unresolved exception, the exception type corresponding to the application may be determined. Optionally, the exception type may include one or a combination of: a CPU usage exception type, a memory usage exception type, a device wakeup exception type, a service or activity startup exception type, a network usage exception type, a file read / write exception type, a broadcast receiver registration exception type, a sensor usage exception type, and a resource request exception type.
[0093] In some embodiments, if the exception handling result is determined to be an unresolved exception, an exception analysis can be performed on the application's operational exception to determine the type of exception corresponding to the application. As an practicable approach, if the exception handling result is determined to be an unresolved exception, an exception analysis can be performed on the application's operational exception to obtain characteristics of the application's operational exception, based on which the type of exception corresponding to the application can be determined.
[0094] Step S340: Determine a first presentation method corresponding to the abnormality type from multiple presentation methods.
[0095] Optionally, the electronic device may be pre-configured with multiple display methods, which may include: a pop-up window, a system status bar, a centralized display in a security manager or system management application, a display in an internal notification center of an application, a user-customized display, etc., without limitation herein.
[0096] In this embodiment, when the exception type corresponding to the application is determined, a presentation method corresponding to the exception type may be determined from multiple presentation methods as a first presentation method. Alternatively, when the exception type corresponding to the application is determined, one or more presentation methods corresponding to the exception type may be determined from multiple presentation methods as a first presentation method.
[0097] In some implementations, when the exception type corresponding to the application is determined, the urgency corresponding to the exception type may be determined, and based on the urgency, a first presentation method corresponding to the exception type may be determined from a plurality of presentation methods.
[0098] In some embodiments, the electronic device may pre-set and store a first mapping relationship, wherein the first mapping relationship may include multiple exception types, multiple display methods, and a correspondence between the multiple exception types and the multiple display methods. The correspondence relationship may include one exception type corresponding to one display method; multiple exception types corresponding to one display method; or one exception type corresponding to multiple display methods, etc., without limitation herein. In this embodiment, when determining the exception type corresponding to an application, the display method that has a corresponding relationship with the exception type corresponding to the application can be determined as the first display method based on the first mapping relationship.
[0099] Step S350: Display the notification message based on the first display method.
[0100] In this embodiment, when the first display mode is determined, the notification message can be displayed based on the first display mode, so that the display of the notification message is adapted to the exception type, thereby improving the display effect of the notification message.
[0101] Optionally, if the first display method is the system status bar method, the notification message can be displayed through the system status bar; if the first display method is the pop-up window method, the notification message can be displayed through the pop-up window, etc., which is not limited here.
[0102] An exception handling method provided in an embodiment of the present application monitors the running status of an application during its operation, wherein the running status includes an abnormal state or a normal state. If the running status is an abnormal state, exception handling is performed on the application to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved. If the exception handling result is that the exception has not been resolved, the exception type corresponding to the application is determined, a first display method corresponding to the exception type is determined from multiple display methods, and a notification message is displayed based on the first display method, so that the display method can be adapted to the exception type and the display effect of the notification message can be improved.
[0103] See also Figure 4 , Figure 4 The following is a flow chart of the exception handling method provided by an embodiment of the present application. Figure 4 The process shown is described in detail, and the exception handling method may specifically include the following steps:
[0104] Step S410: During the running of the application, the running state of the application is monitored, wherein the running state includes an abnormal state or a normal state.
[0105] Step S420: If the running state is the abnormal state, performing exception handling on the application to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved.
[0106] For the detailed description of steps S410 to S420 , please refer to steps S110 to S120 , which will not be repeated here.
[0107] Step S430: If the exception handling result is that the exception is not resolved, determine the exception level corresponding to the application.
[0108] In this embodiment, if the exception handling result is determined to be an unresolved exception, the exception level corresponding to the application can be determined. Optionally, the exception level can include, from low to high, level 1, level 2, ... level N; from high to low, level 1, level 2, ... level N; and can include low, medium, and high levels, etc., without limitation herein.
[0109] In some embodiments, if the exception handling result is determined to be an unresolved exception, an exception analysis can be performed on the application's operational exception to determine the application's corresponding abnormality level. As an practicable approach, if the exception handling result is determined to be an unresolved exception, an exception analysis can be performed on the application's operational exception to obtain characteristics of the application's operational abnormality, based on which the application's corresponding abnormality level can be determined.
[0110] Step S440: Determine a second presentation mode corresponding to the abnormality level from a plurality of presentation modes.
[0111] Optionally, the electronic device may be pre-configured with multiple display methods, which may include: a pop-up window, a system status bar, a centralized display in a security manager or system management application, a display in an internal notification center of an application, a user-customized display, etc., without limitation herein.
[0112] In this embodiment, when the abnormality level corresponding to the application is determined, a display method corresponding to the abnormality level can be determined from multiple display methods as the second display method. Optionally, when the abnormality level corresponding to the application is determined, one or more display methods corresponding to the abnormality level can be determined from multiple display methods as the second display method.
[0113] In some implementations, when the exception level corresponding to the application is determined, the urgency corresponding to the exception level may be determined, and based on the urgency, a second presentation method corresponding to the exception level may be determined from multiple presentation methods.
[0114] In some embodiments, the electronic device may pre-set and store a second mapping relationship, wherein the second mapping relationship may include multiple abnormality levels, multiple display methods, and a correspondence between the multiple abnormality levels and the multiple display methods. The correspondence relationship may include one abnormality level corresponding to one display method; multiple abnormality levels corresponding to one display method; or one abnormality level corresponding to multiple display methods, etc., without limitation herein. In this embodiment, when determining the abnormality level corresponding to an application, the display method that has a corresponding relationship with the abnormality level corresponding to the application can be determined as the second display method based on the second mapping relationship.
[0115] Step S450: Display the notification message based on the second display method.
[0116] In this embodiment, when the second display mode is determined, the notification message can be displayed based on the second display mode, so that the display of the notification message is adapted to the abnormality level, thereby improving the display effect of the notification message.
[0117] Optionally, if the second display method is the system status bar method, the notification message can be displayed through the system status bar; if the second display method is the pop-up window method, the notification message can be displayed through the pop-up window, etc., which is not limited here.
[0118] An exception handling method provided in an embodiment of the present application monitors the running status of an application during its operation, wherein the running status includes an abnormal state or a normal state. If the running status is an abnormal state, exception handling is performed on the application to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved. If the exception handling result is that the exception has not been resolved, the exception level corresponding to the application is determined, and a second display method corresponding to the exception level is determined from multiple display methods. The notification message is displayed based on the second display method, so that the display method can be adapted to the exception level and the display effect of the notification message can be improved.
[0119] See also Figure 5 , Figure 5 The following is a flow chart of the exception handling method provided by an embodiment of the present application. Figure 5 The process shown is described in detail, and the exception handling method may specifically include the following steps:
[0120] Step S510: During the running of the application, the running state of the application is monitored, wherein the running state includes an abnormal state or a normal state.
[0121] The detailed description of step S510 can be found in step S110 and will not be repeated here.
[0122] Step S520: If the running state is the abnormal state, obtain the abnormal type corresponding to the application.
[0123] In this embodiment, if the running state corresponding to the application is determined to be an abnormal state, the exception type corresponding to the application can be obtained. Optionally, the exception type can include: a CPU usage exception type, a memory usage exception type, a device wakeup exception type, a service or activity startup exception type, a network usage exception type, a file read / write exception type, a broadcast receiver registration exception type, a sensor usage exception type, and a resource request exception type, or a combination thereof.
[0124] In some implementations, if the operating state corresponding to an application is determined to be abnormal, an exception analysis can be performed on the operating exception of the application to determine the type of exception corresponding to the application. As an practicable approach, if the operating state corresponding to an application is determined to be abnormal, an exception analysis can be performed on the operating exception of the application to obtain characteristics of the operating exception of the application, and based on the characteristics, the type of exception corresponding to the application can be determined.
[0125] Step S530: Determine a target exception handling method corresponding to the exception type from multiple exception handling methods.
[0126] Optionally, the electronic device may be pre-set with multiple exception handling methods, which may include: current limiting handling method, restart handling method, shutdown handling method, etc., which are not limited here.
[0127] In this embodiment, when the exception type corresponding to the application is determined, the exception handling method corresponding to the exception type can be determined from multiple exception handling methods as the target exception handling method. Optionally, when the exception type corresponding to the application is determined, one or more exception handling methods corresponding to the exception type can be determined from multiple exception handling methods as the target exception handling method.
[0128] In some implementations, when the exception type corresponding to the application is determined, the urgency corresponding to the exception type may be determined, and based on the urgency, a target exception handling method corresponding to the exception type may be determined from multiple exception handling methods.
[0129] In some embodiments, the electronic device may pre-set and store a third mapping relationship, wherein the third mapping relationship may include multiple exception types, multiple exception handling methods, and a correspondence between the multiple exception types and the multiple exception handling methods. The correspondence relationship may include one exception type corresponding to one exception handling method; multiple exception types corresponding to one exception handling method; or one exception type corresponding to multiple exception handling methods, etc., without limitation herein. In this embodiment, when determining the exception type corresponding to an application, the exception handling method that has a corresponding relationship with the exception type corresponding to the application can be determined as the target exception handling method based on the third mapping relationship.
[0130] Step S540: performing exception handling on the application based on the target exception handling method to obtain the exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved.
[0131] In this embodiment, when the target exception handling method is determined, the application can be exception handled based on the target exception handling method to obtain an exception handling result, so that the exception handling of the application is adapted to the exception type of the application, thereby improving the exception handling effect.
[0132] Optionally, if the exception type corresponding to the application is a resource request exception type, the target exception handling method may be a current limiting handling method, and accordingly, the application may be current limited to obtain an exception handling result; if the exception type corresponding to the application is a CPU usage exception type (such as CPU usage timeout), the target handling method may be a restart handling method, and accordingly, the application may be restarted to obtain an exception handling result; if the exception type corresponding to the application is a device wake-up exception type (such as the camera is always on), the target exception handling method may be a shutdown handling method, and accordingly, the application may be closed to obtain an exception handling result.
[0133] Step S550: If the exception handling result is that the exception is not resolved, a notification message is output, wherein the notification message is used to report detailed information about exception monitoring and exception handling for the application to the user.
[0134] The detailed description of step S550 can be found in step S130 and will not be repeated here.
[0135] An exception handling method provided in an embodiment of the present application monitors the running status of an application during its operation, wherein the running status includes an abnormal state or a normal state. If the running status is an abnormal state, the exception type corresponding to the application is obtained, a target exception handling method corresponding to the exception type is determined from multiple exception handling methods, and the application is exception handled based on the target exception handling method to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved. If the exception handling result is that the exception has not been resolved, a notification message is output, wherein the notification message is used to report detailed information on exception monitoring and exception handling for the application to the user, thereby adapting the exception handling method to the exception type and improving the exception handling effect.
[0136] See also Figure 6 , Figure 6 The following is a flow chart of the exception handling method provided by an embodiment of the present application. Figure 6 The process shown is described in detail, and the exception handling method may specifically include the following steps:
[0137] Step S610: During the running of the application, the running state of the application is monitored, wherein the running state includes an abnormal state or a normal state.
[0138] The detailed description of step S610 can be found in step S110 and will not be repeated here.
[0139] Step S620: If the running state is the abnormal state, restart the application and continue to monitor the running state of the application.
[0140] In some implementations, if it is determined that the running state corresponding to the application is an abnormal state, the application may be restarted and the running state of the application may continue to be monitored.
[0141] As an implementable approach, if it is determined that the running state corresponding to the application is an abnormal state, the application can be restarted, and the running state of the application is always monitored during this process.
[0142] As another feasible method, if it is determined that the running status corresponding to the application is an abnormal state, the application can be restarted and the monitoring of the running status of the application can be stopped. Then, if the application is restarted successfully, the monitoring of the running status of the application can be started.
[0143] Step S630: If the running state of the application is still in the abnormal state when the number of restarts reaches the number threshold, it is determined that the exception handling result is that the exception is not resolved.
[0144] Optionally, the electronic device can be provided with a retry mechanism. If the application still exhibits abnormal behavior after being automatically restarted, the application can be restarted again, up to a retry threshold. If the application still exhibits abnormal behavior when the number of retries reaches the threshold, it can be determined that the operation abnormality of the application has not been resolved.
[0145] In this embodiment, if the running state of the application is still in an abnormal state when the number of restarts reaches the number threshold, it can be determined that the exception handling result is an unresolved exception. In some embodiments, if the electronic device still detects that the running state corresponding to the application is an abnormal state after the application is restarted, the application can be restarted again and the running state corresponding to the application can be continued to be monitored. At the same time, the number of restarts of the application can be recorded, and the number of restarts can be compared with the number threshold to determine whether the number of restarts reaches the number threshold. Optionally, if the number of restarts reaches the number threshold and the running state corresponding to the application is monitored to be an abnormal state, it can be determined that the exception handling result is an unresolved exception; if the number of restarts does not reach the number threshold and the running state corresponding to the application is monitored to be an abnormal state, the application can be restarted again and the running state corresponding to the application can be continued to be monitored. At the same time, the number of restarts of the application can be recorded, and the number of restarts can be compared with the number threshold to determine whether the number of restarts reaches the number threshold.
[0146] Step S640: If the exception handling result is that the exception is not resolved, a notification message is output, wherein the notification message is used to report detailed information about the exception monitoring and exception handling for the application to the user.
[0147] The detailed description of step S640 can be found in step S130 and will not be repeated here.
[0148] An exception handling method provided by an embodiment of the present application monitors the running status of an application during its operation, wherein the running status includes an abnormal state or a normal state. If the running status is an abnormal state, the application is restarted and the running status of the application is continued to be monitored. If the running status of the application is still an abnormal state when the number of restarts reaches a threshold, the exception handling result is determined to be an unresolved exception. If the exception handling result is an unresolved exception, a notification message is output, wherein the notification message is used to report detailed information about exception monitoring and exception handling for the application to the user, thereby reducing resource waste by attempting to perform exception handling by automatically restarting the application when the number of restarts reaches a threshold.
[0149] See also Figure 7 , Figure 7 The following is a flow chart of the exception handling method provided by an embodiment of the present application. Figure 7 The process shown is described in detail, and the exception handling method may specifically include the following steps:
[0150] Step S710: During the running of the application, the running state of the application is monitored, wherein the running state includes an abnormal state or a normal state.
[0151] The detailed description of step S710 can be found in step S110 and will not be repeated here.
[0152] Step S720: If the running state is the abnormal state, closing the target abnormal process of the application and continuing to monitor the running state of the application.
[0153] In some implementations, if it is determined that the running state corresponding to the application is an abnormal state, the target abnormal process of the application may be closed, and the running state of the application may continue to be monitored.
[0154] As an implementable approach, if it is determined that the corresponding running state of the application is an abnormal state, the target abnormal process of the application can be closed, and the running state of the application can be monitored all the time during this process.
[0155] As another feasible method, if it is determined that the corresponding running status of the application is an abnormal state, the target abnormal process of the application can be closed and the monitoring of the running status of the application can be stopped. Afterwards, when the target abnormal process of the application is successfully closed, the monitoring of the running status of the application can be started.
[0156] In some embodiments, an application may include multiple processes, and when the electronic device runs the application, it may be one or more processes included in the multiple processes running the application. Optionally, if it is determined that the running state corresponding to the application is an abnormal state, an abnormality analysis may be performed on the running abnormality of the application to determine the abnormal process from the multiple processes included in the application as the target abnormal process, and close the target abnormal process and continue to monitor the running state of the application. Alternatively, if it is determined that the running state corresponding to the application is an abnormal state, an abnormality analysis may be performed on the running abnormality of the application to determine the abnormal process from the multiple processes included in the application, and determine the main process (such as a process strongly associated with the running abnormality) from the abnormal process as the target abnormal process, and close the target abnormal process and continue to monitor the running state of the application.
[0157] Step S730: If the running state of the application is still the abnormal state when the target abnormal process is closed, it is determined that the exception handling result is that the exception is not resolved.
[0158] In this embodiment, if the running state of the application remains abnormal after the target abnormal process is closed, the exception handling result can be determined as an unresolved exception. In some embodiments, if the electronic device still detects that the running state corresponding to the application is abnormal after the target abnormal process is closed, it can be considered that closing the target abnormal process cannot resolve the running abnormality, and the exception handling result can be determined as an unresolved exception.
[0159] Step S740: If the exception handling result is that the exception is not resolved, a notification message is output, wherein the notification message is used to report detailed information about exception monitoring and exception handling for the application to the user.
[0160] The detailed description of step S740 can be found in step S130 and will not be repeated here.
[0161] An exception handling method provided by an embodiment of the present application monitors the running status of an application during its operation, wherein the running status includes an abnormal state or a normal state. If the running status is an abnormal state, the target abnormal process of the application is closed and the running status of the application continues to be monitored. If the running status of the application is still an abnormal state after the target abnormal process is closed, the exception handling result is determined to be an unresolved exception. If the exception handling result is an unresolved exception, a notification message is output, wherein the notification message is used to report detailed information on exception monitoring and exception handling for the application to the user, thereby attempting to perform exception handling by automatically closing the target abnormal process of the application, thereby reducing resource waste.
[0162] See also Figure 8 , Figure 8 The module block diagram of the exception handling device provided by an embodiment of the present application is shown below. Figure 8 As illustrated in the block diagram, the exception handling device 200 includes: an operation status monitoring module 210, an exception handling result obtaining module 220, and a notification message output module 230, wherein:
[0163] The running status monitoring module 210 is used to monitor the running status of the application during the running of the application, wherein the running status includes an abnormal state or a normal state.
[0164] The exception handling result obtaining module 220 is configured to perform exception handling on the application program to obtain an exception handling result if the running state is the abnormal state, wherein the exception handling result includes whether the exception has been resolved or not resolved.
[0165] Furthermore, the exception handling result obtaining module 220 includes: an exception type obtaining submodule, a target exception handling method determining submodule, and a first exception handling result obtaining submodule, wherein:
[0166] The exception type acquisition submodule is used to obtain the exception type corresponding to the application program if the running state is the abnormal state.
[0167] The target exception handling method determination submodule is used to determine a target exception handling method corresponding to the exception type from multiple exception handling methods.
[0168] The first exception handling result obtaining submodule is configured to perform exception handling on the application based on the target exception handling method to obtain the exception handling result.
[0169] Furthermore, the exception handling result obtaining module 220 includes: an application restart submodule and a second exception handling result obtaining submodule, wherein:
[0170] The application restart submodule is used to restart the application program and continue to monitor the running status of the application program if the running status is the abnormal status.
[0171] The second exception handling result obtaining submodule is configured to determine that the exception handling result is that the exception is not resolved if the running state of the application is still in the abnormal state when the number of restarts reaches a threshold.
[0172] Furthermore, the exception handling result obtaining module 220 includes: a process closing submodule and a third exception handling result obtaining submodule, wherein:
[0173] The process closing submodule is used to close the target abnormal process of the application program and continue to monitor the running state of the application program if the running state is the abnormal state.
[0174] The third exception handling result obtaining submodule is configured to determine that the exception handling result is that the exception is not resolved if the running state of the application is still in the abnormal state after the target abnormal process is closed.
[0175] The notification message output module 230 is configured to output a notification message if the exception handling result is that the exception is not resolved, wherein the notification message is used to report to the user detailed information on the exception monitoring and exception handling performed on the application.
[0176] Furthermore, the notification message output module 230 includes: an exception type determination submodule, a first display mode determination submodule, and a first notification message display submodule, wherein:
[0177] The exception type determination submodule is configured to determine the exception type corresponding to the application program if the exception handling result is that the exception is not resolved.
[0178] The first display mode determination submodule is configured to determine a first display mode corresponding to the abnormality type from a plurality of display modes.
[0179] The first notification message display submodule is configured to display the notification message based on the first display method.
[0180] Furthermore, the notification message output module 230 includes: an abnormality level determination submodule, a second display mode determination submodule, and a second notification message display submodule, wherein:
[0181] The exception level determination submodule is configured to determine the exception level corresponding to the application program if the exception handling result is that the exception is not resolved.
[0182] The second display mode determination submodule is configured to determine a second display mode corresponding to the abnormality level from among a plurality of display modes.
[0183] The second notification message display submodule is configured to display the notification message based on the second display method.
[0184] Furthermore, the exception handling device 200 further includes: an application program prohibition module, wherein:
[0185] The application prohibition module is used to prohibit the application from running if the exception handling result is that the exception is not resolved.
[0186] Furthermore, the exception handling device 200 further includes: a user interface display module, a detailed information display module, and an operation restriction contact module, wherein:
[0187] The user interface display module is used to display a user interface, wherein the user interface is used to manage the application.
[0188] The detailed information display module is configured to display the detailed information if a first operation acting on the user interface is detected.
[0189] The operation restriction contact module is used to release the operation restriction on the application program if a second operation acting on the user interface is detected.
[0190] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0191] In several embodiments provided in this application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0192] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0193] See also Figure 9 , which shows a structural block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 can be an electronic device capable of running applications, such as a smartphone, a tablet computer, an e-book, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0194] The processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and circuits to connect various components within the electronic device 100. It executes instructions, programs, code sets, or instruction sets stored in the memory 120, and accesses data stored in the memory 120 to perform various functions and process data within the electronic device 100. Optionally, the processor 110 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing displayed content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 110 and may be implemented separately via a communication chip.
[0195] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing functions (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat history data), etc., created by the electronic device 100 during use.
[0196] See also Figure 10 , which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 300 stores program code, which can be called by a processor to execute the method described in the above method embodiment.
[0197] The computer-readable storage medium 300 can be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 300 has storage space for program code 310 for executing any of the method steps described above. These program codes can be read from or written to one or more computer program products. The program code 310 can be compressed, for example, in a suitable form.
[0198] In summary,.
[0199] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An exception handling method, characterized in that: The method comprises: During the running of the application, monitoring the running state of the application, wherein the running state includes an abnormal state or a normal state; If the running state is the abnormal state, performing exception handling on the application to obtain an exception handling result, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved; If the exception handling result is that the exception is not resolved, a notification message is output, wherein the notification message is used to report detailed information about exception monitoring and exception handling for the application to the user.
2. The method according to claim 1, characterized in that The method further comprises: If the exception handling result is that the exception is not resolved, the application is prohibited from running.
3. The method according to claim 2, characterized in that After prohibiting the application from running if the exception handling result is that the exception is not resolved, the method further includes: Displaying a user interface, wherein the user interface is used to manage the application; If a first operation acting on the user interface is detected, displaying the detailed information; and / or If a second operation acting on the user interface is detected, the operation restriction on the application is lifted.
4. The method according to claim 1, wherein If the exception handling result is that the exception is not resolved, outputting a notification message includes: If the exception handling result is that the exception is not resolved, determining the exception type corresponding to the application; Determining a first presentation method corresponding to the abnormality type from a plurality of presentation methods; The notification message is displayed based on the first display manner.
5. The method according to claim 1, wherein If the exception handling result is that the exception is not resolved, outputting a notification message includes: If the exception handling result is that the exception is not resolved, determining the exception level corresponding to the application; determining a second presentation method corresponding to the abnormality level from a plurality of presentation methods; The notification message is displayed based on the second display manner.
6. The method according to any one of claims 1 to 5, characterized in that If the running state is the abnormal state, performing exception handling on the application to obtain an exception handling result includes: If the running state is the abnormal state, obtaining the abnormal type corresponding to the application; Determining a target exception handling method corresponding to the exception type from a plurality of exception handling methods; Exception handling is performed on the application based on the target exception handling method to obtain the exception handling result.
7. The method according to any one of claims 1 to 5, characterized in that If the running state is the abnormal state, performing exception handling on the application to obtain an exception handling result includes: If the running state is the abnormal state, restarting the application and continuing to monitor the running state of the application; If the running state of the application is still in the abnormal state when the number of restarts reaches the number threshold, it is determined that the exception handling result is that the exception is not resolved.
8. The method according to any one of claims 1 to 5, characterized in that If the running state is the abnormal state, performing exception handling on the application to obtain an exception handling result includes: If the running state is the abnormal state, closing the target abnormal process of the application and continuing to monitor the running state of the application; If the running state of the application program is still in the abnormal state after the target abnormal process is closed, it is determined that the abnormality handling result is that the abnormality is not resolved.
9. An exception handling device, characterized in that: The device comprises: An operating status monitoring module is used to monitor the operating status of the application during the operation of the application, wherein the operating status includes an abnormal state or a normal state; an exception handling result obtaining module, configured to perform exception handling on the application program to obtain an exception handling result if the running state is the abnormal state, wherein the exception handling result includes whether the exception has been resolved or the exception has not been resolved; A notification message output module is used to output a notification message if the exception handling result is that the exception is not resolved, wherein the notification message is used to report to the user detailed information on exception monitoring and exception handling for the application.
10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory is coupled to the processor and stores instructions. When the instructions are executed by the processor, the processor performs the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 8.