Application program exception handling method, system and equipment, medium and program product
By restarting the application after it crashes and monitoring its crashes in a short time, using the policy of cleaning or resetting configuration information to solve repeated crashes caused by configuration information, improving application availability and system stability.
Patent Information
- Application Number
- CN202411395445.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-08-12
AI Technical Summary
The application may crash repeatedly due to configuration information during use, affecting availability, user experience and system stability.
After the application crashes, it will restart and monitor its crashes in a short period of time. If the preset times exceed the number of presets, exceptions will be handled by cleaning or resetting the configuration information, including cleaning or resetting the data and components in the directory.
Improves the repair efficiency of the application, ensures its usability, improves user experience and system stability, and reduces crashes caused by configuration information.
Smart Images

Figure CN120469828A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an application exception handling method, system, device, medium, and program product. Background Art
[0002] With the rapid development of terminal technology, devices such as mobile phones and tablets have become an indispensable part of people's daily lives. Users can install a variety of applications on these devices to meet their needs. However, despite thorough testing during application development, applications can still crash due to the various complex situations they encounter during use, seriously impacting their usability. Therefore, ensuring the normal use of applications is a critical issue that requires urgent attention. Summary of the Invention
[0003] This application provides an application exception handling method, system, device, medium, and program product that can ensure the availability of the target application to a certain extent. The technical solution is as follows:
[0004] In a first aspect, a method for handling application exceptions is provided. In this method, if a target application crashes during operation, a terminal restarts the target application. After the target application is restarted, if the terminal determines that the target application has crashed more than a preset number of times within a first preset time period before the current time, the terminal executes a preset policy, which is a policy for handling the exception by clearing or resetting configuration information.
[0005] If the target application crashes more than the preset number of times within the first preset time period before the current time, it means that the target application crashes repeatedly in a short period of time. Since the repeated crashes of the target application in a short period of time are most likely caused by the configuration information, although the target application is restarted after the crash, the configuration information that caused the crash still exists, so it is very likely to continue to cause the target application to crash. For this reason, in the present application, when the target application crashes during operation, the target application is first restarted, and then, when the target application crashes more than the preset number of times within the first preset time period before the current time, exception handling is performed by clearing or resetting the configuration information, in order to restore the normal use of the target application. In this way, when the target application crashes repeatedly in a short period of time, the terminal can actively repair it, which not only improves the repair efficiency, but also guarantees the availability of the target application to a certain extent, and then guarantees the performance of the target application in terms of business availability, user experience, system stability and system performance to a certain extent.
[0006] In one possible implementation, after the target application is restarted, if the terminal determines that the target application has crashed more than a preset number of times within a first preset time period before the current time, the operation of executing the preset policy may include: after the target application is restarted, the terminal increments the crash count by 1; if the crash count is greater than the preset number, the terminal executes the preset policy if the time between the current time and the target time is less than or equal to the first preset time period. If the crash count is equal to 1, the terminal sets the target time to the current time.
[0007] The target time is the starting time for determining the number of repeated crashes of the target application.
[0008] If the number of crashes is equal to 1, it means that the target application crashes for the first time after a long period of normal operation. Therefore, the target time can be set to the current time to count the number of repeated crashes of the target application starting from the current time.
[0009] If the number of crashes is greater than the preset number, and the duration between the current time and the target time is less than or equal to the first preset duration, it means that the target application crashes repeatedly in a short period of time, so the preset strategy can be executed to try to fix this crash problem.
[0010] Optionally, after adding 1 to the number of crashes, the terminal may set the number of crashes to 1 and the target time to the current time if the number of crashes is greater than a preset number and the duration between the current time and the target time is greater than a first preset duration.
[0011] If the time difference between the current time and the target time is greater than the first preset time, it means that the target application has crashed for the first time after a long period of normal operation. Therefore, the number of crashes can be set to 1, and the target time can be set to the current time to count the number of repeated crashes of the target application from the current time.
[0012] In a possible implementation, after the target application is restarted, if the current running time of the target application is greater than or equal to the second preset time, the terminal sets the number of crashes to 0 and sets the target time to null.
[0013] If the target application's current running time is greater than or equal to the second preset time, it means that the target application has not crashed for a long time after this restart, so it is very likely that the previous crash problem has been solved. Therefore, the number of crashes can be set to 0, and the target time can be set to empty.
[0014] Optionally, the preset strategy may include one or more of the following four repair methods: cleaning up the configuration data in the first directory; disabling or uninstalling the third-party business components in the second directory; resetting the database files in the third directory and / or resetting the Extensible Markup Language XML files in the fourth directory; resetting the configuration data in the fifth directory.
[0015] The first, second, third, fourth, and fifth directories can all be pre-configured. The first directory is used to store configuration data sent by the server and received by the target application. The second directory is the storage directory for third-party business components related to the operation of the target application. The third directory is the storage directory for database files related to the operation of the target application. The fourth directory is the storage directory for XML files related to the operation of the target application. The fifth directory is used to store configuration data related to user operations in the target application.
[0016] Optionally, when the preset strategy includes at least two repair methods, the terminal may execute part or all of the at least two repair methods when executing the preset strategy, that is, may execute one or more of the at least two repair methods.
[0017] In a possible implementation, when the preset strategy includes at least two repair methods, the at least two repair methods both have priorities, and the at least two repair methods exist in order from high to low priority.
[0018] The priority of each of the at least two repair methods can be pre-set by a technician. For example, the at least two repair methods can be determined by the technician based on the crash causes of the target application identified in advance, and the priority of each of the at least two repair methods can be pre-set by the technician based on the likelihood of each cause causing the crash.
[0019] In this case, the terminal may execute one of the at least two repair methods each time the preset policy is executed. Specifically, the terminal's operation of executing the preset policy may be: if the terminal has not executed the preset policy within a third preset time period before the current time, then executing the repair method with the highest priority among the at least two repair methods; if the terminal has executed the preset policy within the third preset time period before the current time, then executing the repair method with a lower priority among the at least two repair methods that was executed last time.
[0020] If the terminal has not executed the preset strategy within the third preset time period before the current time, it means that no repair method has been executed for a long time. Therefore, the repair method with the highest priority among the at least two repair methods can be executed this time to repair the crash problem as much as possible.
[0021] If the terminal has executed the preset strategy within the third preset time period before the current time, it means that a repair method has been executed recently for repair, but the repair was not successful. Therefore, a repair method with a lower priority than the repair method executed last time can be executed this time to try to continue to repair the current crash problem.
[0022] Optionally, if the repair method executed last time was the repair method with the lowest priority among the at least two repair methods, then the repair method with the highest priority among the at least two repair methods may be executed this time.
[0023] In one possible implementation, after executing the preset policy, the terminal may also send a repair completion message to the server if the target application's current runtime is greater than or equal to a fourth preset duration. The repair completion message includes crash information about the target application within the first preset duration before the current time and information about the currently executed preset policy. Optionally, the currently executed preset policy information is used to indicate which specific repair method is being executed.
[0024] The repair completion message is used to indicate that the terminal has successfully repaired the recent repeated crash problem of the target application using the preset strategy (ie, one or more repair methods executed this time).
[0025] In this case, upon receiving the repair completion message, the server may generate a first alert message. Optionally, the first alert message may include the content of the repair completion message. In this way, technicians can analyze the cause of the target application's crash based on the first alert message. Once it is determined that the target application's crash issue can indeed be resolved using the preset policy, they can instruct other terminals installed with the target application to also implement the preset policy to prevent subsequent crashes of the target application.
[0026] As an example, the server can send a first repair message to other terminals installed with the target application, other than the terminal itself. This first repair message includes information about the preset policy in the repair completion message. In this case, upon receiving the first repair message, the terminal can directly execute the preset policy. Alternatively, the terminal can first display a prompt message to inform the user that the relevant repair is required, and then execute the preset policy upon receiving a confirmation action based on the prompt message. This can eliminate potential usage risks of the target application.
[0027] In one possible implementation, the terminal obtains relevant information of each target function in the business core link of the target application during the operation of the target application; the terminal performs anomaly detection based on the relevant information of each target function; the terminal sends an application monitoring message to the server, and the application monitoring message includes relevant information and abnormal conditions of each target function.
[0028] The abnormal situation refers to problems that occur when executing the target function, which affect the normal performance of the target function. Optionally, the abnormal situation may affect one or more of the following: user experience, system performance, system stability, service availability, etc. For example, the abnormal situation may be an application crash, freeze, network delay, etc.
[0029] As an example, after receiving the application monitoring message sent by the terminal, the server analyzes the relevant indicators of each target function in the target application based on the application monitoring information; the server generates a second alarm message when one or more indicators of one or more target functions in the target application are abnormal; the server sends a second repair message to one or more terminals on which the target application is installed, and the second repair message includes a repair strategy.
[0030] The indicator may include one or more of a service availability indicator, a user experience indicator, a system stability indicator, a system performance indicator, and the like.
[0031] The second alarm information may include one or more indicators of the one or more target functions, and may further include relevant information of the one or more target functions and abnormal conditions thereof.
[0032] It should be noted that technicians can perform exception handling based on the second alarm information. For example, technicians can analyze the relevant information and abnormal conditions of the one or more target functions based on the second alarm information to determine whether there is a problem and, if so, set a corresponding repair strategy. For example, the repair strategy may include one or more of a grayscale rollback strategy, a hot or cold repair strategy, etc.
[0033] For example, the repair strategy included in the second repair message may be a grayscale rollback strategy, and the grayscale rollback strategy may include information about the target function to be rolled back and the version to which it needs to be rolled back.
[0034] For example, the repair strategy included in the second repair message is a cold or hot repair strategy, and the cold or hot repair strategy may include a patch file of a target function to be repaired.
[0035] In this application, the terminal can monitor each target function in the core business link of the target application and report the monitoring information to the server. In this way, the server can proactively perceive the real-time health status of the target application during runtime. In this case, the server can proactively repair the target application when a problem occurs, rather than passively repairing it after the user reports it, greatly improving repair efficiency.
[0036] In a second aspect, a communication system is provided. The communication system includes a terminal and a server. The communication system is used to execute the application exception handling method provided in the first aspect.
[0037] In a third aspect, an application exception handling device is provided, which has the function of implementing the application exception handling method described in the first aspect. The application exception handling device includes at least one module, which is used to implement the application exception handling method described in the first aspect.
[0038] In a fourth aspect, a computer device is provided, comprising: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code comprising computer instructions, the one or more processors calling the computer instructions so that the computer device executes the application exception handling method provided in the first aspect above.
[0039] In a fifth aspect, a chip system is provided, which is applied to a computer device. The chip system includes one or more processors, and the one or more processors are used to call computer instructions to enable the computer device to execute the application exception handling method provided in the first aspect above.
[0040] In a sixth aspect, a computer-readable storage medium is provided, which includes instructions. When the instructions are executed on a computer device, the computer device executes the application exception handling method provided in the first aspect.
[0041] In a seventh aspect, a computer program product is provided. When the computer program product is run on a computer device, the computer device executes the application exception handling method provided in the first aspect.
[0042] The technical effects obtained by the above-mentioned second, third, fourth, fifth, sixth and seventh aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1This is a schematic diagram of a technical architecture of an exception handling function provided in an embodiment of the present application;
[0044] Figure 2 is a schematic diagram of a communication system provided in an embodiment of the present application;
[0045] Figure 3 This is a flowchart of a method for handling application exceptions provided by an embodiment of the present application;
[0046] Figure 4 This is a schematic diagram of an application exception handling process provided by an embodiment of the present application;
[0047] Figure 5 This is a flowchart of another application exception handling method provided by an embodiment of the present application;
[0048] Figure 6 This is a schematic diagram of the structure of an application exception handling device provided in an embodiment of the present application;
[0049] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application;
[0050] Figure 8 It is a structural diagram of another computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details.
[0052] It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their collections. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0053] It should be understood that the "one or more" mentioned in this application refers to one, two or more, and the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B. The "and / or" in this article is only a way to describe the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0054] To facilitate the clear description of the technical solutions of this application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or order of execution, and the words "first" and "second" do not necessarily mean different.
[0055] The phrases "one embodiment" or "some embodiments" described in this application mean that the specific features, structures, or characteristics described in the embodiment are included in one or more embodiments of the application. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. that appear in different places in this application do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized.
[0056] The application scenarios involved in the embodiments of the present application are described below.
[0057] With the rapid development of terminal technology, devices such as mobile phones and tablets have become an indispensable part of people's daily lives. Users can install a variety of applications on these devices to meet their needs. However, despite thorough testing during application development, applications may still experience various complex situations during use, leading to unexpected issues such as crashes and freezes. These issues not only affect the user experience but can also lead to the loss of important data.
[0058] For example, in some scenarios, the functional tests of an application in the development, testing, and beta stages are all normal, but after commercial use, users may encounter problems when using certain functions in the application.
[0059] For example, when an app starts, a function is triggered, and a code defect causes the app to crash. Suppose the app restarts after the crash, but the restart triggers the function again, causing the app to crash again, and users will not be able to use the app normally.
[0060] If the application is a system application, such as the System UI or Launcher, its abnormality will have a more serious impact on the use of the terminal. For example, a System UI crash may cause the terminal to restart, and if the System UI falls into a crash loop, the user will not be able to start the device normally. This situation not only seriously affects the user experience, but may also lead to after-sales issues such as returns.
[0061] Therefore, how to quickly detect anomalies that occur during application use and quickly repair them to ensure their availability has become an important issue that requires urgent attention.
[0062] To this end, an embodiment of the present application provides an application exception handling method that can monitor abnormal problems that occur during the operation of the application, and then repair them through active repair by the client or policy issuance by the server to restore normal use of the application.
[0063] The following describes the system architecture involved in the application exception handling method provided in the embodiment of the present application.
[0064] Figure 1 : This is a schematic diagram of the technical architecture of an exception handling function provided in an embodiment of the present application. The exception handling function can be set in a target application installed in the terminal, and the target application can be any application installed in the terminal. For example, the target application can be a system application in the terminal, such as SystemUI or Launcher, or the target application can be a third-party application installed in the terminal, such as a social application, a short video application, etc., which is not limited in the embodiment of the present application.
[0065] It should be noted that the schematic diagram of the technical architecture only shows modules related to the embodiments of the present application. In actual applications, the technical architecture may also include other modules, which are no longer shown one by one.
[0066] like Figure 1 As shown, the technical architecture may include a problem discovery module, a problem location module and a problem solving module.
[0067] The problem discovery module is used to obtain relevant information when executing the target function in the target application. The relevant information of the target function may include information that may affect one or more of user experience, system performance, system stability, business availability, etc.
[0068] For example, the relevant information of the target function may include one or more information of user behavior, event time, user attributes, function usage, performance data, alarm information, etc.
[0069] Among them, user behavior can include operation information such as clicks, swipes, and page visits. Event time can include the timestamp of the event, which can help analyze the time intervals and peak periods of user behavior. User attributes can include user identification, device information (such as model, operating system version, etc.), geographic location, etc. Function usage can include the frequency of use of the target function, the duration of use, etc. Performance data can include the loading time and response time of the target function, which can help evaluate the performance of the application. Alarm information can be information generated by the application or system when the application is abnormal (such as crashing). For example, the alarm information can include one or more of the following: crash time, device information, application version, stack trace, user operation information before the crash, error code, error or abnormal event, etc., which can help quickly locate the problem.
[0070] The target function can cover all aspects of the target application's core business process. The target application's core business process refers to the key components and steps that support the target application's main business processes.
[0071] For example, for SystemUI, its core business process may include: receiving notifications → displaying notifications → user interaction. The specific process for receiving notifications may be: SystemUI receives notifications sent by related applications. The specific process for displaying notifications may be: SystemUI displays the notification in the status bar. The specific process for user interaction may be: the user clicks on the notification and navigates to the corresponding application, or the user slides the notification to close it.
[0072] Tracking monitoring can be performed within the core business process of SystemUI to track relevant information about each target function involved in that core business process. For example, information about the notification display function may include the loading speed and display time of the notification in the status bar; information about the navigation function after the user clicks the notification may include the frequency with which the user successfully enters the application after clicking the notification; and information about the user swiping to close the notification function may include the number of times the user closes the notification and the method used.
[0073] For example, for Launcher, its core service chain may include: application display → user interaction, application display → search function. The specific process of application display may be: Launcher loads and displays icons of various applications installed on the terminal. The specific process of user interaction may be: the user clicks the application icon to launch the corresponding application. The specific process of search function may be: the user uses the search box to quickly find and open applications.
[0074] Point monitoring can be performed in the core business link of the Launcher to track the relevant information of each target function involved in the core business link. For example, the relevant information of the application display function may include the application loading speed; the relevant information of the user interaction function may include the frequency of users clicking to launch the application; the relevant information of the search function may include the usage of the search function.
[0075] For example, for a social networking application, its core service chain may include: message reception → message display → user interaction → message sending. The specific process for message reception may be: the social networking application receives messages from contacts or groups in real time. The specific process for message display may be: the social networking application displays received messages in the chat list and / or notification bar. The specific process for user interaction may be: the user clicks on the chat list to enter a specific chat interface, or the user directly views messages in the notification. The specific process for message sending may be: the user enters and sends new messages in the chat interface to interact with contacts.
[0076] Point-of-care monitoring can be performed within the core business links of social applications to track relevant information about each target function involved in the core business link. For example, information about the message receiving function may include the delay and success rate of message reception; information about the message display function may include the loading time of the message in the chat list and / or notification bar; information about the user interaction function may include the frequency with which users enter a specific chat interface after clicking on the chat list or notification; and information about the message sending function may include the success rate of user message sending and commonly used emoticons or content.
[0077] In some embodiments, technicians can pre-organize and analyze the core business links of the target application to identify the target functions that require tracking. In this way, during the operation of the target application, the problem discovery module in the target application can obtain relevant information about each target function.
[0078] The problem location module is used to perform anomaly detection based on the relevant information of each target function obtained by the problem discovery module.
[0079] For example, for any target function, the problem location module can determine whether the target function has an abnormality based on the relevant information of the target function. The abnormality refers to a problem that occurs during the execution of the target function, which may affect the normal performance of the target function. Optionally, the abnormality may affect one or more of the following: user experience, system performance, system stability, service availability, etc.
[0080] For example, the problem location module determines that the abnormal situation of the target function is an application crash based on the relevant information of the target function. The application crash will affect business availability, user experience, system stability and system performance.
[0081] For example, the problem location module determines that the abnormal situation of the target function is lag based on the relevant information of the target function, and lag will affect both user experience and system performance.
[0082] For example, the problem location module determines that the abnormal situation of the target function is network delay based on the relevant information of the target function. Network delay will affect both user experience and system performance.
[0083] In some embodiments, the target application serves as a client and has a corresponding server. Optionally, the server can be located on a server. The problem location module can also send relevant information about each target function to the server. In some cases, if the problem location module determines that a target function has an abnormality based on the relevant information about the target function, the abnormality can also be sent to the server. The server analyzes and processes the relevant information about each target function and its abnormality.
[0084] The problem solving module is used to repair the abnormal conditions of each target function according to the abnormal conditions determined by the problem location module.
[0085] Optionally, the problem-solving module may include one or more repair strategies, such as a safe mode strategy, a grayscale rollback strategy, a cold and hot repair strategy, etc., which is not limited in the embodiments of the present application. Optionally, the safe mode strategy can be a client-initiated repair strategy, and the grayscale rollback strategy and the cold and hot repair strategy can be repair strategies issued by the server.
[0086] For example, for any target function, if the abnormal condition of the target function is an application crash, the problem solving module may execute a safe mode policy to restore the normal operation of the target application.
[0087] The safe mode policy is a proactive repair strategy for the target application. It handles exceptions by clearing or resetting configuration information.
[0088] Optionally, the security mode policy may include multiple repair methods, and the multiple repair methods may have priorities. The problem solving module may try to repair the problem using the multiple repair methods in descending order of priority.
[0089] For example, the priorities of the multiple repair methods can be determined based on their effectiveness in solving the problem and their impact on user usage, so as to minimize the impact on user usage while effectively solving the problem.
[0090] Different applications may face crashes due to different reasons, so the repair methods and priorities in the security model policies of different applications may be different.
[0091] For a specific target application, technicians can identify crash causes and determine corresponding repair methods based on the identified crash causes as the target application's safe mode policy. Furthermore, technicians can prioritize the various repair methods within the target application's safe mode policy based on the likelihood of each crash cause causing the crash.
[0092] For example, technicians have sorted out the following reasons for SystemUI crashes: 1. Dirty data sent by the server, such as illegal JavaScript object notation (json) data sent by the server, configuration data with certain fields missing, etc.; 2. Third-party business, such as crashes caused by incompatibility of third-party themes, third-party plug-ins, etc.; 3. File operations, such as crashes caused by damage, missing or format errors in database files, extensible markup language (XML) files, etc.; 4. Defects in the own business code, such as crashes caused by user operations, such as errors triggered by switching themes.
[0093] Then, based on the above-mentioned crash causes, the technicians determined that the four repair methods in the SystemUI safe mode strategy could be: Repair method 1. Clean up the configuration data sent by the server; Repair method 2. Disable or uninstall the recently installed third-party business components; Repair method 3. Reset the database files and / or XML files; Repair method 4. Reset the configuration data related to the user operations. Optionally, a prompt message can be displayed first to prompt the user to reset the relevant configuration, such as prompting the user to restore the default theme, and then reset the relevant configuration data after receiving a confirmation operation based on the prompt message.
[0094] As an example, the order of priority of the above four repair methods from high to low may be: repair method 1, repair method 2, repair method 3, and repair method 4.
[0095] It should be noted that the above describes a solution in which the target application installed on the terminal proactively repairs the target application when an abnormality occurs. In some embodiments, the server may also perform the repair, as explained below:
[0096] Figure 2 Schematic diagram of a communication system provided by an embodiment of the present application. Figure 2 The communication system may include a terminal and a server, and the terminal and the server may communicate via a wired connection or a wireless connection.
[0097] The target application installed in the terminal may have an exception handling function, which may be Figure 1 The exception handling function described in the embodiment.
[0098] During operation, the target application in the terminal can obtain relevant information of each target function in the target application and determine abnormal conditions that occur, and then send the relevant information of each target function in the target application and the abnormal conditions to the server.
[0099] It should be noted that each of the one or more terminals can install the target application. In this case, the one or more terminals can send relevant information about each target function in the target application obtained during the operation of the target application to the server, and can further send any abnormal conditions that occur to the server.
[0100] For example, the server may include an application disk monitoring module, a repair module, and a recovery module.
[0101] After the server receives information about each target function in a target application and its abnormal conditions from each of the one or more terminals, the application dashboard monitoring module may analyze relevant indicators of each target function in the target application based on the information about each target function in the target application and its abnormal conditions from each of the one or more terminals. Optionally, the indicators may include one or more of a service availability indicator, a user experience indicator, a system stability indicator, a system performance indicator, and the like.
[0102] For example, if there are a total of 100 terminals installed with the target application, and 60 of them report that target function A in the target application is unavailable due to an error, then the application dashboard monitoring module can determine that the business availability index of target function A in the target application is 40%.
[0103] When the application dashboard monitoring module monitors that the relevant indicators of a target function in the target application meet certain preset conditions, it can generate an alarm message to notify relevant technical personnel to handle it.
[0104] Preset conditions are used to indicate anomalies in related indicators. Preset conditions can be set in advance and can be set by technical personnel based on relevant considerations for the indicator. For example, for the service availability indicator, the preset condition can be that the service availability indicator falls below a first preset threshold, or the preset condition can be that the service availability indicator decreases by a margin greater than or equal to a second preset threshold within a preset period of time.
[0105] Based on the alarm information generated by the application dashboard monitoring module, technicians can analyze the relevant information about the target function and its abnormal conditions to determine whether there is a problem. If a problem exists, they can set a corresponding repair strategy. For example, the repair strategy may include a grayscale rollback strategy and / or a hot and cold repair strategy. Of course, other repair strategies may also be included, and this embodiment of the application is not limited to this.
[0106] For example, if a technician determines that a grayscale rollback policy is required for a specific target function, they can disable the grayscale switch for that target function on the server, thereby rolling back the target function in the target application installed on each terminal to a historical version. In this case, as an example, the repair module can send a grayscale rollback message to each terminal, instructing it to roll back the target function in the target application to a historical version.
[0107] For example, if a technician determines that a hot or cold repair strategy needs to be implemented for a target function, a patch file for the target function can be generated to repair the target function in the target application installed on each terminal. In this case, as an example, the repair module can send the patch file to each terminal, and each terminal can repair the target function in the target application according to the patch file.
[0108] In some embodiments, after the target application in the terminal successfully repairs the crash problem of the target application through a certain repair method in the safe mode policy, the terminal can also send relevant information about the target function in the target application that may cause the crash problem (such as the target function being executed when the crash occurs) and its abnormal situation, as well as the repair method to solve the crash problem to the server.
[0109] After the server receives relevant information about the target function, its abnormal conditions, and the corresponding repair methods, the technicians can analyze the current status of the target application and the specific cause of its crash based on this information. After determining that there is indeed a problem with the target application and that this problem can indeed be solved by the repair method, other terminals with the target application installed can be instructed to also execute this repair method to avoid the target application from crashing later.
[0110] In this case, as an example, the recovery module can send a repair message to other terminals that have the target application installed, instructing the target application in each terminal to execute the repair method. Optionally, after receiving the repair message, the target application can display the repair message to remind the user that the corresponding repair is required. If a confirmation operation is received based on the repair message, the repair method can be executed; or, after receiving the repair message, the target application can directly execute the repair method, that is, actively perform background repair.
[0111] For example, if the target application on Terminal 1 resolves its crash by clearing the configuration data in the first directory, then once the technician has determined that the target application is indeed abnormal and that the abnormality is caused by dirty data sent by the server, they can instruct all other terminals except Terminal 1 to clear the configuration data in the first directory to prevent the target application on other terminals from crashing during operation.
[0112] In some embodiments, after performing emergency repairs through repair messages, technicians can also perform relevant processing based on the root cause of the target application crash. For example, if the root cause of the target application crash is dirty data sent by the server, then technicians need to adjust the server's sending logic to try to avoid the server sending dirty data again to cause exceptions.
[0113] It should be noted that the terminals and servers provided in the above embodiments only use the division of the above-mentioned functional modules as an example when performing exception handling of application programs. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0114] The functional modules in the above embodiments may be integrated into a single processing unit, each functional module may exist physically separately, or two or more functional modules may be integrated into a single processing unit. The above integrated functional modules may be implemented in either hardware or software. Furthermore, the specific names of the functional modules are provided solely for the purpose of distinguishing them from one another and are not intended to limit the scope of protection of the embodiments of this application.
[0115] After describing the technical architecture provided by the embodiment of the present application, the following describes in detail the application exception handling method provided by the embodiment of the present application:
[0116] Figure 3 This is a flowchart of an application exception handling method provided by an embodiment of the present application, see Figure 3 , the method may include the following steps:
[0117] Step 301: If the target application crashes during operation, the terminal restarts the target application.
[0118] The target application can be any application installed in the terminal. For example, the target application can be an application that requires exception handling. For example, the target application can be a system application in the terminal, such as SystemUI or Launcher, or the target application can be a third-party application installed in the terminal, such as a social application or a short video application, etc., which is not limited in this embodiment of the present application.
[0119] Step 302: After the target application is restarted, if the terminal determines that the target application has crashed more than a preset number of times within a first preset time period before the current time, the preset strategy is executed, which is a strategy for handling exceptions by clearing or resetting configuration information.
[0120] The first preset duration can be set in advance. For example, the first preset duration can be 5 minutes, 10 minutes, etc., which is not limited in the embodiment of the present application.
[0121] The preset number of times can be set in advance. The preset number of times can be a positive integer. For example, the preset number of times can be 1, 2, 3, 4, etc., which is not limited in the embodiment of the present application.
[0122] If the target application crashes more than the preset number of times within the first preset time period before the current time, it means that the target application crashes repeatedly in a short period of time. Since the repeated crashes of the target application in a short period of time are most likely caused by the configuration information, although the target application is restarted after the crash, the configuration information that caused the crash still exists, so it is very likely to continue to cause the target application to crash. For this reason, in an embodiment of the present application, when the target application crashes during operation, the target application is first restarted, and then, when the target application crashes more than the preset number of times within the first preset time period before the current time, exception handling is performed by clearing or resetting the configuration information, in order to restore the normal use of the target application. In this way, when the target application crashes repeatedly in a short period of time, the terminal can actively repair it, which not only improves the repair efficiency, but also guarantees the availability of the target application to a certain extent, and then guarantees the performance of the target application in terms of business availability, user experience, system stability and system performance to a certain extent.
[0123] As an example, see Figure 4 The operation of step 302 may include the following steps 3021 to 3029.
[0124] Step 3021: The terminal restarts the target application.
[0125] Step 3022: After the target application is restarted, the terminal increases the number of crashes by 1.
[0126] Step 3023: The terminal determines whether the number of crashes is equal to 1; if the number of crashes is equal to 1, the terminal executes the following step 3024; if the number of crashes is not equal to 1, the terminal executes the following step 3025.
[0127] Step 3024: The terminal sets the target time to the current time.
[0128] The target time is the starting time for determining the number of repeated crashes of the target application.
[0129] If the number of crashes is equal to 1, it means that the target application crashes for the first time after a long period of normal operation. Therefore, the target time can be set to the current time to count the number of repeated crashes of the target application starting from the current time.
[0130] Step 3025: The terminal determines whether the number of crashes is greater than a preset number; if the number of crashes is greater than the preset number, the terminal executes steps 3026 to 3028; if the number of crashes is less than or equal to the preset number, the terminal executes step 3029.
[0131] If the crash count is not equal to 1, it means that the target application has crashed recently. Therefore, it can be determined whether the target application has crashed too many times recently, that is, whether the crash count is greater than a preset number.
[0132] Step 3026: The terminal determines whether the duration between the current time and the target time is less than or equal to the first preset duration; if the duration between the current time and the target time is greater than the first preset duration, execute the following step 3027; if the duration between the current time and the target time is less than or equal to the first preset duration, execute the following step 3028.
[0133] Step 3027: The terminal sets the number of crashes to 1, and sets the target time to the current time, and proceeds to step 3029 below.
[0134] If the time difference between the current time and the target time is greater than the first preset time, it means that the target application has crashed for the first time after a long period of normal operation. Therefore, the number of crashes can be set to 1, and the target time can be set to the current time to count the number of repeated crashes of the target application from the current time.
[0135] Step 3028: The terminal executes the preset strategy and proceeds to step 3029 below.
[0136] If the time interval between the current time and the target time is less than or equal to the first preset time interval, it indicates that the target application program has repeatedly crashed within a short period of time, and thus a preset strategy may be executed to attempt to repair the crash problem.
[0137] Step 3029: The terminal runs the target application.
[0138] In some embodiments, if the current running time of the target application is greater than or equal to the second preset time, the terminal sets the number of crashes to 0 and sets the target time to null.
[0139] The second preset duration can be set in advance. For example, the second preset duration can be 30 seconds, 40 seconds, etc., which is not limited in this embodiment of the present application.
[0140] If the target application's current running time is greater than or equal to the second preset time, it means that the target application has not crashed for a long time after this restart, so it is very likely that the previous crash problem has been solved. Therefore, the number of crashes can be set to 0, and the target time can be set to empty.
[0141] The preset policy can be set in advance. For example, the preset policy can be the security mode policy described above. Optionally, the preset policy can include one or more of the following four repair methods: (1) clearing the configuration data in the first directory; (2) disabling or uninstalling the third-party service components in the second directory; (3) resetting the database files in the third directory and / or resetting the XML files in the fourth directory; (4) resetting the configuration data in the fifth directory.
[0142] The first, second, third, fourth, and fifth directories can all be pre-configured. The first directory is used to store configuration data sent by the server and received by the target application. The second directory is the storage directory for third-party business components related to the operation of the target application. The third directory is the storage directory for database files related to the operation of the target application. The fourth directory is the storage directory for XML files related to the operation of the target application. The fifth directory is used to store configuration data related to user operations in the target application.
[0143] Optionally, when the preset strategy includes at least two repair methods, the terminal in the above step 302 can execute part or all of the at least two repair methods when executing the preset strategy, that is, it can execute one or more of the at least two repair methods.
[0144] In some possible implementations, when the preset strategy includes at least two repair methods, the at least two repair methods both have priorities, and the at least two repair methods exist in order from high to low priority.
[0145] The priority of each of the at least two repair methods can be pre-set by a technician. For example, the at least two repair methods can be determined by the technician based on the crash causes of the target application that have been sorted out in advance, and the priority of each of the at least two repair methods can be set by the technician in advance based on the likelihood of the crash caused by each cause. For example, the four repair methods in the above example can be arranged in descending order of priority as follows: repair method (1), repair method (2), repair method (3), and repair method (4).
[0146] In this case, each time the terminal executes the preset policy, one of the at least two repair methods may be executed. Specifically, the operation of the terminal executing the preset policy in step 302 may be: if the terminal has not executed the preset policy within a third preset time period before the current time, then executing the repair method with the highest priority among the at least two repair methods; if the terminal has executed the preset policy within the third preset time period before the current time, then executing the repair method with a lower priority among the at least two repair methods that was executed last time.
[0147] The third preset duration can be set in advance. For example, the third preset duration can be 1 hour, 2 hours, etc., which is not limited in this embodiment of the present application.
[0148] If the terminal has not executed the preset strategy within the third preset time period before the current time, it means that no repair method has been executed for a long time. Therefore, the repair method with the highest priority among the at least two repair methods can be executed this time to repair the crash problem as much as possible.
[0149] If the terminal has executed the preset policy within the third preset time period before the current time, it means that the terminal has recently executed a repair method to repair the problem, but the repair was not successful. Therefore, a repair method with a lower priority than the repair method executed last time can be executed this time to try to continue repairing the current crash problem. For example, if the repair method executed last time was repair method (2), then repair method (3) can be executed this time.
[0150] Optionally, if the repair method executed last time was the repair method with the lowest priority among the at least two repair methods, then the repair method with the highest priority among the at least two repair methods may be executed this time.
[0151] In some embodiments, after executing the preset policy, if the terminal determines that the target application has not crashed within the fourth preset time period after the current restart, that is, the target application's current running time is greater than or equal to the fourth preset time period, then the terminal can determine that the crash problem of the target application has most likely been successfully repaired. In this case, the terminal can send a repair completion message to the server, and the repair completion message includes crash information of the target application within the first preset time period before the current time and information about the preset policy executed this time. Optionally, the information about the preset policy executed this time is used to indicate which specific repair method is being executed this time.
[0152] Optionally, the crash information may include alarm information generated each time the target application crashes within a first preset time period before the current time. For example, the alarm information may include one or more of the following: crash time, device information, application version, stack trace, user operation information before the crash, error code, error or abnormal event, etc.
[0153] Alternatively, the crash information may include relevant information and abnormal conditions of one or more target functions in the target application within a first preset time period before the current time. Optionally, the one or more target functions may be functions being executed when the target application crashes.
[0154] The repair completion message is used to indicate that the terminal has successfully repaired the recent repeated crash problem of the target application using the preset strategy (ie, one or more repair methods executed this time).
[0155] In this case, upon receiving the repair completion message, the server may generate a first alert message containing the content of the repair completion message. This allows technicians to analyze the cause of the target application's crash based on the first alert message. Once the preset policy is determined to be applicable, the technicians can instruct other terminals with the target application installed to also implement the preset policy, thereby preventing subsequent crashes of the target application.
[0156] In some embodiments, the server can send a first repair message to other terminals that have the target application installed. The first repair message includes the preset policy information in the repair completion message, instructing these terminals to execute the preset policy. In this case, after receiving the first repair message, a terminal can directly execute the preset policy. Alternatively, the terminal can first display a prompt message to inform the user that the relevant repair is required, and then execute the preset policy after receiving a confirmation action based on the prompt message. In this way, potential usage risks of the target application can be eliminated.
[0157] The preceding section describes the active repair logic for the target application. The following section describes the server repair logic:
[0158] Figure 5 This is a flowchart of an application exception handling method provided by an embodiment of the present application. Figure 5 , the method may include the following steps:
[0159] Step 501: During the operation of the target application, the terminal obtains relevant information of each target function in the service core link of the target application.
[0160] For example, the terminal may perform tracking monitoring in the service core link of the target application to track relevant information of each target function involved in the service core link.
[0161] The core links and target functions of the business have been explained in the previous article and will not be repeated here.
[0162] Step 502: The terminal performs an anomaly detection based on the relevant information of each target function to determine whether each target function has an abnormality.
[0163] The abnormal situation refers to problems that occur when executing the target function, which may affect the normal performance of the target function. Optionally, the abnormal situation may be a situation that affects one or more of the following: user experience, system performance, system stability, service availability, etc. For example, the abnormal situation may be an application crash, freeze, network delay, etc., which is not limited in the embodiments of the present application.
[0164] Step 503: The terminal sends an application monitoring message to the server. The application monitoring message includes relevant information of each target function in the target application and its abnormal conditions.
[0165] Step 504: After receiving the application monitoring message, the server performs a related indicator analysis of each target function in the target application according to the application monitoring message.
[0166] The indicator may include one or more of a service availability indicator, a user experience indicator, a system stability indicator, a system performance indicator, and the like.
[0167] It should be noted that each terminal installed with the target application can obtain information about each target function in the target application's core service link and its anomaly status during the operation of the target application and send it to the server. The server can perform relevant indicator analysis based on the information about each target function in the target application and its anomaly status sent by all terminals.
[0168] For example, if a total of 100 terminals have installed the target application, and 60 of them report that target function A in the target application is unavailable due to an error, the server can determine that the service availability index of target function A in the target application is 40%.
[0169] Step 505: The server generates second alarm information when one or more indicators of one or more target functions in the target application program are abnormal.
[0170] The second alarm information may include one or more indicators of the one or more target functions, and may further include relevant information of the one or more target functions and abnormal conditions thereof.
[0171] Optionally, the server may determine that an indicator of one or more target functions in the target application program is abnormal when the indicator meets a preset condition.
[0172] The preset conditions corresponding to each indicator can be different. The preset condition of an indicator is used to indicate that the indicator has an abnormality. The preset conditions can be set in advance. For example, the preset conditions of an indicator can be set based on the technical personnel's consideration of the indicator. For example, for the service availability indicator, the preset condition can be that the service availability indicator is lower than a first preset threshold, or that the decline in the service availability indicator within a preset time period is greater than or equal to a second preset threshold. The first preset threshold, the preset time period, and the second preset threshold can all be set in advance.
[0173] The technician can perform exception handling based on the second alarm information. For example, the technician can analyze the relevant information of the one or more target functions and their abnormal conditions based on the second alarm information to determine whether there is a problem, and set a corresponding repair strategy if there is a problem. For example, the repair strategy may include one or more of a grayscale rollback strategy, a hot and cold repair strategy, etc., which is not limited in the embodiments of the present application.
[0174] Step 506: The server sends a second repair message to one or more terminals where the target application is installed. The second repair message includes a repair policy.
[0175] For example, the repair strategy included in the second repair message may be a grayscale rollback strategy, and the grayscale rollback strategy may include information about the target function to be rolled back and the version to which it needs to be rolled back.
[0176] For example, the repair strategy included in the second repair message is a cold or hot repair strategy, and the cold or hot repair strategy may include a patch file of a target function to be repaired.
[0177] Step 507: After receiving the second repair message, the one or more terminals execute the repair strategy to ensure normal use of the target application.
[0178] In this embodiment of the present application, the terminal can monitor each target function in the core service link of the target application and report the monitoring information to the server. In this way, the server can proactively perceive the real-time health status of the target application during runtime. In this case, the server can proactively repair the target application when a problem occurs, rather than passively repairing it after the user reports it, thereby greatly improving repair efficiency.
[0179] Figure 6 This is a schematic diagram of the structure of an application exception handling device provided in an embodiment of the present application. The device can be implemented as part or all of a computer device by software, hardware, or a combination of both. The computer device can be as follows Figure 7 The computer device of the embodiment. Figure 6 The device includes: a restart module 601 and an execution module 602.
[0180] A restart module 601 is used to restart the target application if the target application crashes during operation;
[0181] Execution module 602 is used to execute a preset strategy after the target application is restarted, if it is determined that the target application has crashed more than a preset number of times within a first preset time period before the current time, and the preset strategy is a strategy for handling exceptions by clearing or resetting configuration information.
[0182] In an embodiment of the present application, when a target application crashes during operation, the device first restarts the target application. Then, if the target application crashes more than a preset number of times within a first preset time period before the current time, the device performs exception handling by clearing or resetting configuration information, in order to restore normal use of the target application. In this way, if the target application repeatedly crashes, the device can proactively repair it, thereby not only improving repair efficiency but also ensuring the availability of the target application to a certain extent.
[0183] It should be noted that: the application exception handling device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to illustrate when handling application exceptions. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0184] The functional units and modules in the above embodiments may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The above integrated units may be implemented in the form of hardware or software functional units. In addition, the specific names of the functional units and modules are only for the purpose of distinguishing them from each other and are not intended to limit the scope of protection of the embodiments of this application.
[0185] The application exception handling device and the application exception handling method provided in the above embodiments belong to the same concept. The specific working process and technical effects brought about by the units and modules in the above embodiments can be found in the method embodiment part and will not be repeated here.
[0186] The application exception handling method provided in the embodiment of the present application can be applied to terminals and servers.
[0187] For example, the terminal can be a mobile phone, a tablet computer, a wearable device, a digital camera, an in-vehicle device, an augmented reality (AR) device, a virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a laptop computer, etc., which is not limited in the embodiments of the present application.
[0188] For example, the server may be a single server, or a server cluster including multiple servers, or a cloud computing service center.
[0189] Figure 7 is a structural diagram of a computer device provided in an embodiment of the present application. The computer device may be the terminal described in the above embodiment. Figure 7The computer device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0190] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the computer device 100. In other embodiments of the present application, the computer device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0191] The processor 110 may include one or more processing units, for example, an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0192] The controller may be the nerve center and command center of the computer device 100. The controller may generate an operation control signal based on the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0193] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0194] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the computer device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0195] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the computer device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created by the computer device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0196] The wireless communication function of the computer device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
[0197] The mobile communication module 150 can provide wireless communication solutions including second generation mobile communication technology (2G) / third generation mobile communication technology (3G) / fourth generation mobile communication technology (4G) / fifth generation mobile communication technology (5G) applied to the computer device 100.
[0198] The wireless communication module 160 can provide wireless communication solutions for application on the computer device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0199] In some embodiments, antenna 1 of computer device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that computer device 100 can communicate with a network and other devices via wireless communication technologies. Wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite-based augmentation system (SBAS).
[0200] The computer device 100 can implement audio functions, such as music playback and recording, through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0201] The computer device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0202] The computer device 100 can implement display functions through a GPU, a display screen 194 , an application processor, and the like.
[0203] Figure 8 is a structural diagram of a computer device provided in an embodiment of the present application, which may be the server described in the above embodiment. Figure 8 , the computer device 200 may include at least one processor 210 , a communication bus 220 , a memory 230 , and at least one communication interface 240 .
[0204] It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the computer device 200. In other embodiments of the present application, the computer device 200 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The components shown in the diagram may be implemented in hardware, software, or a combination of software and hardware.
[0205] The processor 210 may be a microprocessor (including a central processing unit (CPU) etc.), an application-specific integrated circuit (ASIC), or may be one or more integrated circuits for controlling the execution of the program of the present application.
[0206] The communication bus 220 may include a pathway for transmitting information between the aforementioned components.
[0207] The memory 230 may be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disc (including a compact disc read-only memory (CD-ROM), a compact disc, a laser disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium, or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 230 may exist independently and be connected to the processor 210 via the communication bus 220. The memory 230 may also be integrated with the processor 210.
[0208] The communication interface 240 uses any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.
[0209] In a specific implementation, as an embodiment, the processor 210 may include one or more CPUs, such as Figure 8 CPU0 and CPU1 are shown in the figure.
[0210] In a specific implementation, as an embodiment, the computer device 200 may include multiple processors, such as Figure 8 2 and 3. Each of these processors may be a single-core processor or a multi-core processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0211] The memory 230 is used to store program code 231 for executing the solution of the present application, and the processor 210 is used to execute the program code 231 stored in the memory 230. The computer device 200 can implement the solution of the present application through the processor 210 and the program code 231 in the memory 230.
[0212] It should be noted that the embodiments of the present application do not specifically limit the specific structure of the execution subject of the application exception handling method. As long as the code recording the application exception handling method provided by the embodiments of the present application can be executed to perform processing according to the application exception handling method provided by the embodiments of the present application, it is sufficient. For example, the execution subject of the application exception handling method provided by the embodiments of the present application can be a functional module in a computer device that can call and execute programs, or it can be a processing device used in the computer device, such as a chip.
[0213] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0214] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0215] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0216] The embodiments of the present application also provide a computer program product. When the computer program product is run on a computer device, the computer device can implement the steps in the above-mentioned various method embodiments.
[0217] The present application also provides a chip system, which includes a processor coupled to a memory, and the processor executes a computer program stored in the memory to implement the steps of any method embodiment of the present application. The chip system can be a single chip or a chip module composed of multiple chips.
[0218] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL) etc.) or wireless (such as: infrared, wireless, microwave etc.) mode. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (eg, a digital versatile disc (DVD), etc.), or a semiconductor medium (eg, a solid state disk (SSD), etc.).
[0219] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant regulations and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0220] The above are optional embodiments provided for this application and are not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the technical scope disclosed in this application should be included in the scope of protection of this application.
Claims
1. A method for handling application exceptions, characterized in that: The method comprises: If the target application crashes during operation, the terminal restarts the target application; After the target application is restarted, if the terminal determines that the target application has crashed more than a preset number of times within a first preset time period before the current time, the preset strategy is executed, which is a strategy for handling exceptions by clearing or resetting configuration information.
2. The method according to claim 1, wherein After the target application is restarted, if the terminal determines that the target application has crashed more than a preset number of times within a first preset time period before the current time, executing a preset strategy includes: After the target application is restarted, the terminal increases the number of crashes by 1; If the number of crashes is greater than the preset number, the terminal executes the preset strategy when the time interval between the current time and the target time is less than or equal to the first preset time interval; After the terminal increases the number of crashes by 1, the terminal further includes: If the number of crashes is equal to 1, the terminal sets the target time to the current time.
3. The method according to claim 2, wherein After the terminal increases the number of crashes by 1, the terminal further includes: If the number of crashes is greater than the preset number, the terminal sets the number of crashes to 1 and the target time to the current time when the duration between the current time and the target time is greater than the first preset duration.
4. The method according to claim 2 or 3, wherein: The method further comprises: After the target application is restarted, the terminal sets the number of crashes to 0 and sets the target time to null if the current running time of the target application is greater than or equal to a second preset time.
5. The method according to any one of claims 1 to 4, characterized in that: The preset strategy includes one or more of the following four repair methods: Cleaning up configuration data in a first directory, where the first directory is used to store configuration data sent by the server and received by the target application; Disable or uninstall the third-party business components in the second directory; Resetting the database file in the third directory and / or resetting the Extensible Markup Language XML file in the fourth directory; Reset the configuration data under the fifth directory, where the fifth directory is used to store configuration data related to user operations in the target application.
6. The method according to any one of claims 1 to 5, characterized in that: The preset strategy includes at least two repair methods, both of which have priorities, and the terminal executes the preset strategy, including: If the terminal has not executed the preset strategy within a third preset time period before the current time, then executing the repair method with the highest priority among the at least two repair methods; If the terminal has executed the preset strategy within the third preset time period before the current time, then a repair method with a lower priority than the repair method executed last time among the at least two repair methods is executed this time.
7. The method according to any one of claims 1 to 6, characterized in that: After the terminal executes the preset strategy, the method further includes: When the current running time of the target application is greater than or equal to the fourth preset time length, the terminal sends a repair completion message to the server, and the repair completion message includes the crash information of the target application within the first preset time length before the current time and the information of the preset strategy executed this time.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: During the operation of the target application, the terminal obtains relevant information of each target function in the service core link of the target application; The terminal performs anomaly detection based on relevant information of each target function; The terminal sends an application monitoring message to the server, where the application monitoring message includes relevant information and abnormal conditions of each target function.
9. The method according to claim 7, wherein After the terminal sends a repair completion message to the server, the method further includes: After receiving the repair completion message sent by the terminal, the server generates first alarm information; The server sends a first repair message to other terminals installed with the target application except the terminal, where the first repair message includes information about the preset policy in the repair completion message.
10. The method according to claim 8, wherein After the terminal sends the application monitoring message to the server, the method further includes: After receiving the application monitoring message sent by the terminal, the server performs relevant indicator analysis of each target function in the target application according to the application monitoring information; The server generates second alarm information when one or more indicators of one or more target functions in the target application are abnormal; The server sends a second repair message to one or more terminals on which the target application is installed, where the second repair message includes a repair policy.
11. The method according to claim 10, wherein The repair strategy includes a grayscale rollback strategy and / or a cold and hot repair strategy.
12. A communication system, characterized in that: The communication system includes a terminal and a server, and the communication system is configured to execute the method according to any one of claims 1 to 11.
13. A computer device, characterized in that: The computer device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and is configured to store computer program code, where the computer program code includes computer instructions. The one or more processors call the computer instructions to enable the computer device to execute the method according to any one of claims 1 to 8.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium comprises instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 8.
15. A computer program product, characterized in that When the computer program product is run on a computer device, the computer device is caused to perform the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Report information obtaining method, device, equipment and system
CN104572318A
Method and device for repairing running abnormity of application program
CN105487980A
Program crash processing method and device, terminal and storage medium
CN110262838A
Application function exception processing method and device
CN111190755A
Application program starting exception repairing method and device, equipment and storage medium
CN111581021A