CN114489917B - Processing method for abnormal exit of application program, electronic equipment and readable storage medium - Google Patents

Processing method for abnormal exit of application program, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114489917B
CN114489917B CN202210355559.0A CN202210355559A CN114489917B CN 114489917 B CN114489917 B CN 114489917B CN 202210355559 A CN202210355559 A CN 202210355559A CN 114489917 B CN114489917 B CN 114489917B
Authority
CN
China
Prior art keywords
interface
abnormal
information
application program
target application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210355559.0A
Other languages
Chinese (zh)
Other versions
CN114489917A (en
Inventor
朱潇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210355559.0A priority Critical patent/CN114489917B/en
Publication of CN114489917A publication Critical patent/CN114489917A/en
Application granted granted Critical
Publication of CN114489917B publication Critical patent/CN114489917B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/45Structures or tools for the administration of authentication
    • G06F21/46Structures or tools for the administration of authentication by designing passwords or checking the strength of passwords
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/481Exception handling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/482Application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority

Abstract

The embodiment of the application provides a processing method for abnormal exit of an application program, electronic equipment and a readable storage medium, wherein the method is executed by the electronic equipment, the electronic equipment is provided with a target application program, and the method comprises the following steps: responding to the starting operation of the target application program, and determining whether the target application program is abnormally exited in the last running process; if the target application program is abnormally exited in the last running process, acquiring jump information of an abnormal interface and user input data in the abnormal interface; the abnormal interface is an interface where the target application program is located when abnormal exit occurs last time, and the user input data comprises input contents of a user in the abnormal interface and input positions of the input contents in the abnormal interface; recovering the abnormal interface according to the jump information of the abnormal interface; and restoring the input content at the input position in the abnormal interface according to the input data of the user. The method can recover the abnormal interface and improve the user experience.

Description

Processing method for abnormal exit of application program, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a method, an electronic device, and a readable storage medium for processing an abnormal exit of an application.
Background
In order to meet different requirements of users, various Applications (APPs) are installed in electronic devices. During the use process of the application program, the abnormal exit can be caused by the failure of the application program or the operating system. The fault includes, but is not limited to, a program fault (bug) type fault or a resource type fault. Program fault class faults such as null pointer induced application crash (crash). A resource class failure may cause the OOM killers (out of memory killers) of the system to be flushed, for example, due to a memory leak, thereby causing the application to be flushed.
The abnormal exit of the application program caused by any fault type causes very poor user experience.
Disclosure of Invention
The application provides a processing method for abnormal exit of an application program, an electronic device and a readable storage medium, which can recover an abnormal interface and contents input by a user in the abnormal interface, do not need repeated operation of the user, and improve user experience.
In a first aspect, the present application provides a method for processing an abnormal exit of an application, where the method is performed by an electronic device, and the electronic device is installed with a target application, and the method includes:
responding to the starting operation of the target application program, and determining whether the target application program is abnormally exited in the last running process; if the target application program is abnormally exited in the last running process, acquiring jump information of an abnormal interface and user input data in the abnormal interface; the abnormal interface is an interface where the target application program is located when abnormal exit occurs last time, and the user input data comprises input contents of a user in the abnormal interface and input positions of the input contents in the abnormal interface; recovering the abnormal interface according to the jump information of the abnormal interface; and restoring the input content at the input position in the abnormal interface according to the input data of the user.
Optionally, the jump information of the abnormal interface may be information of an Activity (Activity) of the abnormal interface, for example, information of a name, a tag, and the like of the Activity.
Alternatively, the input location may be characterized by the identity of the control in the interface. The content input by the user may be, for example, characters input by the user, imported pictures, drawn images, or selected options.
In the method for processing abnormal exit of the application program, when the target application program exits abnormally last time, the abnormal interface is recovered according to the jump information of the abnormal interface and the user input data in the abnormal interface by acquiring the jump information of the abnormal interface and the user input data in the abnormal interface, and the input content is recovered at the input position of the abnormal interface according to the user input data. Therefore, when the user restarts the target application program, the user does not need to repeat the operation of interface jump and input the content repeatedly, the continuity of user operation is ensured, the complexity of user operation is reduced, and the user experience is improved.
In a possible implementation manner, recovering the abnormal interface according to the jump information of the abnormal interface includes: starting the abnormal interface according to the jump information of the abnormal interface; if the starting of the abnormal interface fails, acquiring the jump information of the dependent interface of the abnormal interface; the dependency interface of the exception interface is an interface used for inputting first information, and the first information is used for generating first dependency information necessary for starting the exception interface; starting the dependent interface of the abnormal interface according to the jump information of the dependent interface of the abnormal interface; acquiring first information input by a user through a dependence interface of an abnormal interface, and generating first dependence information according to the first information; and starting the abnormal interface according to the first dependency information and the jump information of the abnormal interface.
In the implementation mode, under the condition that the abnormal interface fails to start, the method jumps to the dependent interface of the abnormal interface, acquires the first information through the dependent interface, generates the first dependent information, relieves the dependence, and jumps to the abnormal interface. Therefore, when the abnormal interface is recovered, even if the dependent interface exists, the recovery can be realized, and the applicability and the practicability of the method are improved.
In a possible implementation manner, the first dependency information includes at least one of authentication success information and user authorization information, where the authentication success information is used to represent that the identity information of the user conforms to a preset authority check rule, and the user authorization information is used to represent that the user has an execution authority for a preset operation.
Optionally, the authentication success information may be a preset authentication code. The user authorization information may be a preset authorization code.
Optionally, the dependency interface may be an account login interface and/or a permission application interface.
In one possible implementation manner, in response to a start operation of the target application, before determining whether an abnormal exit occurs during a last running process of the target application, the method further includes: detecting the abnormality of the target application program in the running process of the target application program, and generating abnormal information, wherein the abnormal information comprises the jump information of an abnormal interface; the user input data is saved prior to the target application exiting.
Optionally, the exception information may include one or more of information of an application program in which an exception occurs, jump information of an exception interface, time when the exception occurs, and an exception type.
In the implementation mode, the abnormity of the target application program is detected in the running process of the target application program, the abnormal information is generated, and the user input data in the abnormal interface is stored, so that the abnormal interface and the content input by the user in the abnormal interface can be conveniently recovered when the target application program is subsequently started, the user does not need to repeat the operation of interface jump, the user does not need to repeatedly input the content, the continuity of user operation is ensured, the complexity of user operation is reduced, and the user experience is improved.
In one possible implementation, saving the user input data before the target application exits includes: newly building a data storage thread, and setting the priority of the data storage thread as the highest priority; user input data is saved based on the data save thread.
In the implementation mode, a data storage thread is newly created, and the priority of the data storage thread is set as the highest priority, so that after the abnormality is detected, the operation of the target application program can be intercepted for a short time, a Central Processing Unit (CPU) is seized, and the target application program is prevented from exiting immediately, so that the user input data in the abnormal interface can be stored in time, and the subsequent recovery of the input content of the user in the abnormal interface is facilitated. Moreover, the priority of the data saving thread is set to be the highest priority, so that the situation that the data saving module cannot execute the function and the like due to application non-response (ANR) of the target application program can be prevented, the timeliness and the reliability of saving the data input by the user are further ensured, and the content input by the user in the abnormal interface can be conveniently recovered in the following process.
In one possible implementation, detecting an exception occurring in a target application includes: and monitoring a preset exception signal of the target application program, wherein the preset exception signal is used for representing the exception of the application program which can cause the exit of the application program.
In one possible implementation, the preset exception signal includes at least one of a kill process SIGKILL signal, a process suspend sigup signal, and an apply unresponsive ANR signal.
In the implementation mode, the abnormity of the target application program can be simply and conveniently detected by monitoring the preset abnormity signal of the target application program, and the abnormity detection efficiency and accuracy are improved.
In one possible implementation manner, determining whether an abnormal exit occurs during the last running process of the target application includes: determining whether abnormal information in the last running process of the target application program exists or not; if so, determining that the exception occurs in the last running process of the target application program; and if not, determining that no exception occurs in the last running process of the target application program.
It can be understood that the electronic device may store the exception information of a plurality of application programs, or store the exception information of the target application program in the multiple running processes, and by determining whether the exception information of the target application program in the last running process exists, it can be simply and directly determined whether the exception exits in the last running process of the target application program, so as to improve the efficiency of exception detection and exception recovery.
In one possible implementation, after the input position in the exception interface restores the input content according to the user input data, the method further includes: and deleting the exception information of the target application program.
In the implementation mode, after the recovery of the abnormal interface and the input content in the abnormal interface is completed, the abnormal information of the target application program is deleted, so that the electronic equipment can store the abnormal information when the target application program is subsequently abnormal, the electronic equipment can be enabled to have no abnormal information when the target application program is abnormal, the information is the abnormal information which is abnormal last time when the target application program has the abnormal information, the historical operation condition of the target application program can be conveniently determined, the interface recovery can be conveniently performed, and the algorithm operation efficiency can be improved.
In a possible implementation, the method further includes: and if the target application program does not exit abnormally in the last running process, starting a preset starting interface of the target application program.
Optionally, the preset starting interface may be a preset default interface when the target application program is started.
In the implementation mode, the preset starting interface of the target application program is started under the condition that the target application program does not abnormally exit in the last running process, so that the normal starting of the target application program is ensured.
In one possible implementation, an electronic device is installed with an operating system, and the method includes: the operating system responds to the starting operation of the target application program, determines whether the target application program is abnormally exited in the last running process, if the target application program is abnormally exited in the last running process, the operating system acquires the jump information of the abnormal interface, and recovers the abnormal interface according to the jump information of the abnormal interface; and the target application program acquires the user input data in the abnormal interface and restores the input content at the input position in the abnormal interface according to the user input data.
Alternatively, the operating system may be a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, a cloud architecture, or the like. In a specific embodiment, the operating system is an Android operating system, and the operating system includes an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer. The target application may be located at the application layer of the operating system.
It can be understood that the operating system facilitates interface jumping as compared to the target application program; and because the user operates the target application program in a complex way and has strong randomness, and the target application program mostly has a data protection mechanism, the target application program is convenient to acquire and display the user input data compared with an operating system. In the implementation mode, the interface is skipped by the operating system according to the historical running condition of the target application program, the input content of the user in the abnormal interface is recovered by the target application program, and the recovery of the abnormal interface is realized through the hybrid architecture. Therefore, the advantage that the interface jump is conveniently carried out by the operating system is utilized, the advantage that the target application program is convenient to acquire and display the data input by the user is utilized, the advantage and the advantage are matched with each other, the convenience and the flexibility of recovering the abnormal interface are improved, the efficiency of processing the abnormal exit of the target application program is improved, and the execution pressure of the operating system is reduced. Moreover, the content input by the user is recovered through the target application program, so that the content input by the user in the interface can not be acquired by the operating system, and the safety of the data input by the user is ensured.
In one possible implementation manner, an operating system includes a historical operating condition determining module, an exception detecting module, and an activity management service, which are located in an application framework layer, and the operating system determines whether an exception exit occurs in a last operating process of a target application program in response to a start operation on the target application program, and if the exception exit occurs in the last operating process of the target application program, the operating system obtains jump information of an exception interface and restores the exception interface according to the jump information of the exception interface, including:
the historical operating condition determining module responds to the starting operation of the target application program and determines whether the target application program is abnormally exited in the last operating process; if the target application program is abnormally exited in the last running process, the historical running condition determining module acquires the skipping information of the abnormal interface from the abnormality detecting module; and the activity management service recovers the abnormal interface according to the jump information of the abnormal interface.
In a possible implementation manner, the target application program includes a dependency configuration file, the dependency configuration file is used for storing jump information of a dependency interface of a target interface, the target interface refers to an interface in which the dependency interface exists in the target application program, the dependency interface of the target interface refers to an interface for inputting target information, the target information is used for generating dependency information necessary for starting the target interface, and the application program framework layer further includes a dependency information generation module; the activity management service recovers the abnormal interface according to the jump information of the abnormal interface, and comprises the following steps: the activity management service starts the abnormal interface according to the jump information of the abnormal interface; if the starting of the abnormal interface fails, the activity management service acquires the jump information of the dependent interface of the abnormal interface from the dependence configuration file, and starts the dependent interface of the abnormal interface according to the jump information of the dependent interface of the abnormal interface; the method comprises the steps that a dependence information generation module obtains first information input by a user through a dependence interface of an abnormal interface and generates first dependence information according to the first information; the first information is target information corresponding to a dependent interface of the abnormal interface, and the first dependent information is required by starting the abnormal interface; and the activity management service starts the abnormal interface according to the first dependence information and the jump information of the abnormal interface.
That is, the dependency configuration file may store interface-dependent jump information of at least one target interface. The at least one target interface includes an exception interface. Target information input in a dependent interface of the abnormal interface is called first information, and the dependent information of the abnormal interface is called the first dependent information.
Optionally, the dependency configuration file may include jump information of a target interface in the target application program, jump information of the dependency interface, a correspondence between the target interface and the dependency interface, and the like.
In the implementation mode, the jump information of the target interface and the dependent interface of the target interface is saved in the dependent configuration file, when the starting of the abnormal interface fails, the jump is firstly made to the dependent interface of the abnormal interface, the dependent information is generated by acquiring the related information through the dependent interface, the dependence is removed, and then the jump is made to the abnormal interface. Therefore, when the abnormal interface is recovered, even if the dependent interface exists, the recovery can be realized, and the applicability and the practicability of the method are improved.
In one possible implementation, a target application includes a data saving module and a data restoring module, and the target application acquires user input data in an exception interface and restores input content at an input position in the exception interface according to the user input data, including: and the data recovery module acquires the user input data from the data storage module and recovers the input content at the input position in the abnormal interface.
In the implementation mode, the data recovery module and the data storage module are designed in the target application program, the recovery of the input content of the user in the abnormal interface is realized through the data recovery module, the advantage that the target application program is convenient to acquire and display the user input data is fully utilized, the execution pressure of an operating system is reduced, the user input data is prevented from being acquired by the operating system, and the safety of the user input data is ensured.
In one possible implementation, the operating system includes an activity management service located in an application framework layer, the application framework layer further includes a data recovery interface, the data recovery interface is interfaced with a data recovery module, the data recovery module obtains user input data from a data saving module, and recovers input content at an input location in an exception interface, including: and the activity management service calls a data recovery interface, acquires user input data from the data storage module through the data recovery module, and recovers input contents at an input position in the abnormal interface.
In the implementation mode, the application program framework layer of the operating system provides a data recovery interface, and the application program can realize the recovery of the abnormal interface according to the data recovery module corresponding to the provided interface adaptation, so that the operating system can adapt and interface more application programs, the openness of the operating system is ensured, and the flexibility of application program design is ensured.
In one possible implementation, the operating system includes an exception detection module located at an application framework layer, the target application includes a data saving module, and the operating system determines whether an exception exit occurs during a last running process of the target application in response to a start operation of the target application, and the method further includes: in the running process of the target application program, an abnormality detection module detects abnormality of the target application program and generates abnormality information, wherein the abnormality information comprises jump information of an abnormal interface; and saving the user input data through the data saving module.
In the implementation mode, the data storage module is used for storing the user input data in the abnormal interface, the advantage that the target application program is convenient to acquire and store the user input data is fully utilized, the execution pressure of an operating system is relieved, the user input data is prevented from being acquired by the operating system, and the safety of the user input data is ensured.
In a possible implementation manner, the application framework layer further includes a data saving interface, the data saving interface is interfaced with the data saving module, and user input data is saved through the data saving module, including: and the abnormity detection module calls a data storage interface and stores the user input data through the data storage module.
In the implementation mode, the application program architecture layer of the operating system provides a data storage interface, and the target application program can realize the detection of the application program abnormity and the storage of user input data according to the data storage module corresponding to the provided interface adaptation, so that the operating system can adapt and interface more application programs, the openness of the operating system is ensured, and the flexibility of application program design is ensured.
In one possible implementation, the data storage interface is an asynchronous interface.
In the implementation mode, the data storage interface adopts an asynchronous interface, so that the CPU can be seized conveniently after the abnormality detection module detects abnormality, the operation of the target application program is intercepted for a short time, and the target application program is prevented from exiting immediately, so that the user input data in the abnormal interface can be stored in time, and the subsequent recovery of the content input by the user in the abnormal interface is facilitated.
In one possible implementation, the operating system includes an exception detection module located at an application framework layer, and after the input content is restored at an input position in the exception interface according to the user input data, the method further includes: and the abnormity detection module deletes the abnormity information of the target application program.
In the implementation mode, after the recovery of the abnormal interface and the input content in the abnormal interface is completed, the abnormality detection module deletes the abnormal information of the target application program, so that the abnormal information is conveniently stored by the abnormality detection module when the target application program is subsequently abnormal, the abnormal information is not generated by the abnormality detection module when the target application program is abnormal, the information is the abnormal information which is abnormal last time when the target application program has the abnormal information, and thus the historical operation condition determination module is convenient to determine the historical operation condition of the target application program, so that the interface recovery is convenient, and the algorithm operation efficiency is improved.
In a possible implementation, the method further includes: and if the target application program does not exit abnormally in the last running process, starting a preset starting interface of the target application program by the operating system.
Optionally, the preset launch interface of the target application program may be launched through an activity management service located in an application framework layer in the operating system.
In the implementation mode, the operating system starts the preset starting interface of the target application program under the condition that the target application program does not abnormally exit in the last running process, so that the normal starting of the target application program is ensured.
In a second aspect, the present application provides an apparatus, which is included in an electronic device, and which has a function of implementing the behavior of the electronic device in the first aspect and the possible implementation manners of the first aspect. The functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-described functions. Such as a receiving module or unit, a processing module or unit, etc.
In a third aspect, the present application provides an electronic device, comprising: a processor, a memory, and an interface; the processor, the memory and the interface cooperate with each other to enable the electronic device to perform any one of the methods of the first aspect.
In a fourth aspect, the present application provides a chip comprising a processor. The processor is adapted to read and execute the computer program stored in the memory to perform the method of the first aspect and any possible implementation thereof.
Optionally, the chip further comprises a memory, and the memory is connected with the processor through a circuit or a wire.
Further optionally, the chip further comprises a communication interface.
In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the processor is enabled to execute any one of the methods in the technical solutions of the first aspect.
In a sixth aspect, the present application provides a computer program product comprising: computer program code for causing an electronic device to perform any of the methods of the first aspect when the computer program code runs on the electronic device.
Drawings
Fig. 1 is a schematic structural diagram of an example of an electronic device according to an embodiment of the present disclosure;
FIG. 2 is a block diagram of an exemplary software architecture of an electronic device according to an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating an exemplary software architecture for a method for handling an exception exit of an application according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating an example of a method for handling an exception exit of an application according to an embodiment of the present application;
fig. 5 is a schematic diagram of an interface change corresponding to an example of a processing method for an abnormal exit of an application program according to an embodiment of the present application;
fig. 6 is a schematic flowchart of an example of a processing method for an abnormal exit of an application program in an application program restart scenario according to an embodiment of the present application;
FIG. 7 is a diagram illustrating an example of an exception interface and a dependency interface to be recovered according to an embodiment of the present application;
FIG. 8 is a schematic diagram of another example of an exception interface and a dependency interface to be recovered according to an embodiment of the present application;
FIG. 9 is a flowchart illustrating a method for handling an exception exit of an application according to an embodiment of the present application;
FIG. 10 is a schematic diagram illustrating an example of interface changes in a recovery process of an abnormal interface with a dependency interface according to an embodiment of the present application;
fig. 11 is a flowchart illustrating a processing method for an abnormal exit of an application according to another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.
In the following, the terms "first", "second" and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", "third" may explicitly or implicitly include one or more of the features.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically stated.
In order to better understand the embodiments of the present application, terms or concepts that may be referred to in the embodiments are explained below.
OOM Killer, which is a mechanism used by linux kernel to kill processes to release memory when system memory is severely insufficient.
An application program is application software that enables an electronic device to perform tasks for a user.
A process (process) is a running activity of an application on a data set, and is a basic unit for resource allocation and scheduling by an operating system. Each process occupies a block address space, and the application program runs on the operating system in the form of one or more processes to realize corresponding functions.
A thread (thread), an entity of a process, is a smaller fundamental unit that a process can run independently. A thread may share all of the resources owned by a process with other threads belonging to the same process. One thread can create and withdraw another thread, and multiple threads in the same process can execute concurrently.
Activity (Activity), is a component of an application. The electronic device can interact with a user through a screen to complete a certain task, and Activity is a basic unit for the electronic device to interact with the user.
Service (Service): the application component can run in the background of the electronic equipment without a User Interface (UI). Services may be invoked by other components.
Activity Manager Service (AMS), a service of the Android system, is used to manage various activities, control the life cycle of activities, dispatch message events, low memory management, and the like.
The Android system finds a corresponding component according to the description of the Intent, transmits the Intent to the called component and completes the calling of the component. Intent can be applied not only to interactions between applications, but also to interactions between activities or services within applications.
Listening, registering a listener (callback function) or similar signal acquisition device with the observed person, which is automatically notified of the change when the observed person changes.
Crash refers to exit caused by exception of user process or system process in the process of executing.
The following describes a processing method for exception exit of an application program, which is provided by the present application, with reference to an embodiment and a drawing.
When a user uses an application program, the application program is abnormally quitted, so that the user experience is poor. Especially, the user is using the application program to process some important works, such as editing a large number of characters, processing a large number of pictures, browsing important news or operating complicated network jumps, and the like, and the abnormal exit of the application program can further amplify the bad experience of the user.
In view of the above, an embodiment of the present application provides a method for processing an abnormal exit of an application program, which is used to detect the abnormal exit of the application program, and when the application program is started next time, restore an interface to an interface (hereinafter referred to as an abnormal interface) displayed by the application program when the abnormality occurs, so as to improve user experience.
The method can be applied to electronic devices which can be provided with application programs (APPs), such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, Augmented Reality (AR)/Virtual Reality (VR) devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, Personal Digital Assistants (PDAs), and the like, and the embodiment of the application does not limit the specific types of the electronic devices at all.
For example, fig. 1 is a schematic structural diagram of an example of an electronic device 100 provided in the embodiment of the present application. The electronic 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, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may 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, and the like.
Processor 110 may include one or more processing units, such as: the processor 110 may include 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), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose-input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, a bus or Universal Serial Bus (USB) interface, and the like.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The software system of the electronic device 100 may employ a hierarchical architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes an Android system with a layered architecture as an example, and exemplarily illustrates a software structure of the electronic device 100.
Fig. 2 is a block diagram of a software structure of the electronic device 100 according to the embodiment of the present application. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android operating system is divided into four layers, namely an application layer, an application framework layer, an Android runtime and system library, and a kernel layer from top to bottom. The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications such as camera, gallery, calendar, phone call, map, navigation, Wireless Local Area Network (WLAN), bluetooth, music, video, short message, etc. In addition, it will be appreciated that the application package may also include other applications installed by the user, such as applications for instant messaging (e.g., WeChat)
Figure 23205DEST_PATH_IMAGE001
) And the like.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layers may include an AMS, a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
AMS is used to create Activity to launch a user interface (hereinafter referred to as an interface), manage various activities of Activity, control the lifecycle of Activity, and the like. Activity is a component of an application program, is a basic unit for interaction between an electronic device and a user, and corresponds to one interface. Columns, views, controls, and the like may be included in the interface. The user may enter content in the controls of the interface, such as entering text, importing pictures, drawing images, or selecting options, etc.
The AMS can start the corresponding interface according to the jump information of the interface. The jump information of the interface may include Activity information, such as the name and tag of the Activity. The interface's jump information may be contained in Intent. Specifically, Intent may be defined according to the Activity information corresponding to the interface to indicate which interface is to be launched. AMS creates corresponding Activity according to Intent and displays corresponding interface. It is understood that each control in the interface may have a unique Identity (ID), referred to as a control ID. When a user inputs content in a certain control in the interface, the application program calls a corresponding module to display the content input by the user in the control according to the ID of the control.
It should be noted that, in the embodiment of the present application, regarding the execution of a certain step or the implementation of a certain function by an application program (or a module in the application program), the execution and implementation may be specifically performed by a process or a thread of the application program, and details are not described in the following embodiments.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions of the electronic device 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to notify download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Android runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application layer and the application framework layer as binary files. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media libraries (media libraries), three-dimensional graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, and the like.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, composition, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
Based on the software architecture shown in the embodiment of fig. 2, exemplarily, fig. 3 is a schematic diagram of a software architecture to which an application abnormal exit processing method provided in the embodiment of the present application is applicable.
As shown in fig. 3, in this embodiment, the application layer may include a desktop launcher (launcher), where the launcher is configured to expose all icons of the applications that can be opened in the system on the desktop of the electronic device, monitor operations performed by the user on the application icons in the desktop, and notify the AMS.
In addition, in this embodiment, the application program that needs to implement the recovery of the abnormal interface may include a data saving module, a data recovery module, and a dependent configuration file. Fig. 3 illustrates an application a as an example.
The data storage module is used for storing user input data in the interface. The user input data includes, but is not limited to, content entered by the user in the interface and an input location for the content entered by the user in the interface. Alternatively, the input position may be represented by a widget ID where the content input by the user is located.
The dependency configuration file is used for storing the jump information of the dependency interface corresponding to the interface in the application program. The dependent interface of an interface refers to an interface for a user to input target information to generate the dependent information of the interface. The dependency information for an interface refers to the information necessary to launch the interface. For example, for a certain interface a, it is necessary to have information B to start the interface a, and the generation of the information B may be performed by inputting corresponding target information in the interface C by a user, and generating the information B according to the target information input by the user. Then, the interface C is called the interface a dependent interface, and the information B is called the interface a dependent information.
Optionally, the dependency information includes, but is not limited to, authentication success information (also referred to as identity verification success information, etc.) and user authorization information.
The authentication success information is used for representing that the identity information of the user accords with a preset authority verification rule. The authentication success information may include, for example, information representing that the account number and the password match, or information representing that the account number and the verification code match, and the like. For example, some interfaces of some applications need to be authenticated through a user account and a password, and the interfaces can be displayed after the authentication is successful. To display these interfaces, the account and password of the user need to be acquired and verified. If the account number is matched with the password, the authentication is successful, and authentication success information is generated. And the interfaces can be skipped to only after the authentication success information is obtained. The user account and the password can be obtained from a preset storage position, and can also be input by a user on a login interface, wherein the login interface is a dependent interface of the interfaces. In a specific embodiment, the authentication success information may be a preset authentication code.
The user authorization information is used for representing the consent or permission of the acquired user and has the execution authority for the preset operation. User authorization information may include, for example, information characterizing user consent to certain protocols, provisions, or notifications, etc. For example, some interfaces of some applications require a user to confirm agreement with a preset protocol before they can be displayed. If the user opinion information is the consent authorization, the user authorization information is generated. The user can jump to these interfaces only after obtaining the authorization information of the user. The user opinion information refers to information representing whether the user agrees to authorization. The user opinion information can be obtained from a preset storage position, and can also be input in an authority application interface by a user, wherein the authority application interface is a dependent interface of the interfaces. If the user inputs the consent authorization on the permission application interface (for example, the user clicks the "consent" control on the permission application interface), user authorization information is generated. In a specific embodiment, the user authorization information may be a preset authorization code.
Of course, the dependency information may also be other information as needed, and this is not limited in this embodiment of the present application.
Optionally, the dependency configuration file of the application program may include jump information of an interface in the application program, jump information of a dependency interface, a correspondence between the interface and the dependency interface, and the like. The jump information of the dependent interface comprises the name of the Activity corresponding to the dependent interface, the label of the Activity and the like. The dependency configuration file of an application may be, for example, an application manifest (manifest. xml) of the application in the Android system, and the manifest. xml may be stored in a root directory of the application.
And the data recovery module is used for recovering and displaying the content input by the user in the interface according to the user input data.
As shown in fig. 3, in the embodiment, the application framework layer may be provided with a data saving interface and a data restoring interface. The application framework layer may include an AMS, an anomaly detection module, a historical operating condition determination module, and a dependency information generation module.
The data storage interface is used for being in butt joint with a data storage module in the application program. The data recovery interface is used for interfacing with a data recovery module in the application layer.
The abnormity detection module is used for detecting abnormity in the running process of the application program, determining the abnormity information of the application program, calling the data storage interface before exiting the application program, and storing user input data in the abnormity interface through the data storage module. The exception is an exception that causes the application to exit. The exception information includes, but is not limited to, information of an application program in which an exception occurred, jump information of an exception interface, time and type of the exception occurred, and the like.
And the historical operating condition determining module is used for determining whether the application program is abnormally exited in the last operating process according to the detection result of the abnormality detecting module and informing the determined result to the AMS. Specifically, the historical operating condition determining module determines whether abnormal information exists in the last operating process of the application program according to the abnormal information determined by the abnormal detecting module; if the abnormal exit exists, the abnormal exit is determined to occur in the last operation process of the application program, otherwise, the abnormal exit is determined not to occur in the last operation process of the application program. And under the condition that the application program is abnormally exited last time, the historical operating condition determining module sends the jump information of the abnormal interface to the AMS.
The AMS is used for creating Activity according to the result determined by the historical operating condition determining module under the condition that a starting instruction of the application program is received so as to display a corresponding interface. Specifically, if the application program does not abnormally quit in the last running process, the AMS starts a preset starting interface, wherein the preset starting interface is a preset default interface when the application program is started; and if the application program is abnormally exited in the last running process, the AMS skips to the abnormal interface according to the skip information of the abnormal interface, calls the data recovery interface, and performs recovery display on the user input data in the abnormal interface through the data recovery module.
In addition, in the process of recovering the abnormal interface, the AMS is specifically used for jumping to the abnormal interface according to the jumping information of the abnormal interface and determining whether the jumping is successful; and if the jump fails, acquiring the jump information of the dependent interface of the abnormal interface from the dependent configuration file, and jumping to the dependent interface.
As described above, the dependency interface is used for a user to input information to generate dependency information. The dependence information generation module is used for generating dependence information according to information input by a user through the dependence interface or according to information acquired from a preset storage position. According to the difference of the dependency information, the dependency information generation module can be, for example, an authentication module, and is specifically configured to perform authority verification according to information input by a user, and if the authority verification passes, generate authentication success information; or, the dependency information generating module may be an authorization module, and is specifically configured to determine whether the user agrees with authorization according to information input by the user, and generate user authorization information if the user agrees with authorization.
For convenience of description and in order to embody the interaction between the application program and the operating system, in the following embodiments, the application program layer is described as the application side, and the layers below the application program layer (i.e., the application framework layer, the system library, the kernel layer, and the like) are generally described as the system side.
The following specifically explains a processing method for abnormal exit of an application program according to the embodiment of the present application, by taking an electronic device having a structure shown in fig. 1 and 3 as an example, with reference to the accompanying drawings and application scenarios.
It can be understood that the application program may include the following application scenarios during the use process: 1) starting an application program for the first time; 2) the application program exits abnormally; 3) the application is restarted. The following embodiment takes an application program a as an example, and describes a processing method for abnormal exit of the application program provided by the present application in the above three application scenarios with reference to fig. 4.
1) First launch application A
According to the method, the preset starting interface a of the application program A is displayed in the scene of starting the application program A for the first time.
For example, fig. 4 is a flowchart illustrating an example of a processing method for an abnormal exit of an application program according to an embodiment of the present application. As shown in fig. 4, the method includes:
s401, clicking an icon of the application program A of the desktop by the user.
The application program A comprises a data saving module, a data recovery module and a dependent configuration file. Referring to fig. 5, fig. 5 is a schematic view of an interface change corresponding to a processing method for an abnormal exit of an application program according to an embodiment of the present application. Taking the electronic device as a mobile phone and the application program a as a memo as an example, as shown in (a) of fig. 5, a plurality of application program icons are displayed on a desktop of the mobile phone, and a user clicks the application icon of the memo.
S402, responding to the click operation of the user by the launcher on the application side, and informing the AMS on the system side to start the interface of the application program A.
Optionally, the launcher may send an Activity initiation message to the AMS, where the Activity initiation message carries information of the application a, for example, a name of the application a or other identity of the application a. Referring to fig. 5, for an application a as a memo, when a user clicks an icon of a memo on a desktop, a launcher sends an Activity initiation message to an AMS in response to the user's click, where the Activity initiation message carries information of the memo.
S403, the AMS on the system side receives the notification of the launcher on the application side, and notifies the historical operating condition determining module to determine whether the application program A abnormally exits in the last operating process.
Optionally, the AMS may send an operation condition query message to the historical operation condition determining module, where the operation condition query message may carry information of the application program a, for example, a name or other identity of the application program a. The operation condition query message is used for instructing the historical operation condition determining module to determine whether abnormal exit occurs in the last operation process of the application program A.
S404, the historical operating condition determining module of the system side receives the notification of the AMS, and obtains the abnormal information of the application program A in the last operating process from the abnormal detecting module.
As a possible implementation manner, the historical operating condition determining module may send an application exception query message to the exception detecting module, where the application exception query message may carry information of the application program a. And the anomaly detection module responds to the application anomaly query message, queries the anomaly information of the application program A and returns the query result to the historical operating condition determination module. It can be understood that if an abnormality occurs in the running process of the application program a, the abnormality detection module can query the abnormal information of the application program a, and then the abnormal information of the application program a is sent to the historical running condition determination module by the abnormality detection module; if no abnormality occurs in the running process of the application program a, the abnormality detection module cannot inquire the abnormal information of the application program a, and the abnormality detection module may feed back a null message to the historical running condition determination module, or send another preset message representing that no abnormal information of the application program a exists, or feed back no message to the historical running condition determination module. The embodiment of the application does not limit the method, and the method can be designed according to actual requirements. The specific method of the abnormality detection module for detecting an abnormality is explained in the following embodiments.
It is understood that the application a runs for a period of time, and may not have an exception, may have an exception, or may have multiple exceptions. Every time an abnormality occurs, the information determined by the abnormality detection module is called a set of abnormal information. In one embodiment, the anomaly detection module may store each set of detected anomaly information of the application program a, that is, the anomaly detection module may store a plurality of sets of anomaly information of the application program a. In this case, optionally, the anomaly detection module may determine whether there is anomaly information in the last running process of the application program a in the plurality of sets of anomaly information, and send the determination result to the historical running condition determination module. Optionally, the exception detection module may also send all exception information of the application program a to the historical operating condition determination module, and the historical operating condition determination module determines whether the exception information in the last operating process exists in the multiple sets of exception information. Specifically, the historical operating condition determining module may determine whether the abnormal information in the last operating process exists according to all the abnormal information of the application program a, and by combining the creation time of each Activity, the destruction time of the Activity, and the like in the last operating process of the application program a.
In another embodiment, the exception detection module may also delete all exception information of the application program a when a preset requirement is met (for example, the exception interface recovery is completed), so that after the application program a is abnormal and before the exception interface is recovered, the exception detection module only stores a set of exception information of the application program a, that is, the exception information in the last operation process of the application program a. Therefore, when the abnormality detection module acquires the abnormality information of the application program A from the abnormality detection module, if the abnormality information of the application program A exists, the abnormality detection module indicates that the application program A is abnormal in the last operation process; if the abnormal information of the application program A does not exist, the fact that the application program A does not have abnormality in the last running process is indicated. That is to say, the anomaly detection module only stores the anomaly information of the application program a in the last operation process, so that the historical operation condition determination module can determine the operation condition of the application program a conveniently, and the operation efficiency of the algorithm is improved.
S405, the historical operating condition determining module of the system side determines whether the application program A is abnormally exited in the last operating process according to the acquired result of the abnormal information of the application program A.
If the historical operating condition determining module acquires the abnormal information of the application program A in the last operating process from the abnormal detection module, determining that the application program A is abnormally exited in the last operating process; and if the historical operating condition determining module does not acquire the abnormal information of the application program A in the last operating process from the abnormal detecting module, determining that the application program A does not exit abnormally in the last operating process.
In the application scenario of this embodiment, the application program a is started for the first time, and therefore, the historical operating condition determining module does not obtain the abnormal information of the application program a in the last operating process from the abnormality detecting module, and determines that the abnormal exit does not occur in the last operating process, and then the steps S406 to S407 are executed.
And S406, the historical operating condition determining module at the system side sends the determined result (the application program A does not abnormally exit in the last operating process) to the AMS.
S407, the AMS on the system side starts a preset starting interface a.
Specifically, the AMS starts a first preset Activity to start a preset starting interface a. The first preset Activity refers to the Activity corresponding to the preset starting interface a of the application program A. Optionally, the AMS may query jump information of the preset starting interface a in the root directory of the application a, determine information of the first preset Activity, and create the first preset Activity according to the information of the first Activity, so as to display the preset starting interface a.
Subsequently, the user operates the application program a, and the application program a on the application side and the related module on the system side realize the related function of the application program a in response to the user operation.
Referring to fig. 5, in the case that the operation shown in fig. 5 (a) is the first start of the memo, the mobile phone displays a preset start interface (note interface) of the memo as shown in fig. 5 (b). Assuming that the user clicks on the new control 501 in the note interface in fig. 5 (b) and enters some text in the new note text box, the interface display is as shown in fig. 5 (c).
2) Application A Exception Exit
Continuing with fig. 5, assume that the memo is abnormally exited when the interface displayed on the mobile phone is the interface shown in fig. 5 (c). According to the scheme in the traditional technology, after the application exits abnormally, the interface cannot be restored to the interface operated by the user, and the input data of the user cannot be stored, so that the content input by the user in the interface cannot be restored, and the user experience is poor. The method provided by the embodiment of the application detects the application program A in real time, and calls the data storage interface to store the user input data when the application program A is abnormal, so that the content input by the user in the abnormal interface can be recovered subsequently, and the user experience is improved.
Referring to fig. 4, in this embodiment, the method for processing the abnormal exit of the application program may include:
and S408, in the running process of the application program A, detecting the abnormality of the application program A in real time by an abnormality detection module at the system side, and determining abnormality information.
Optionally, the anomaly detection module may detect an anomaly by monitoring a preset anomaly signal in the running process of the application program a. And if the application program A generates a preset abnormal signal in the running process, determining that the application program A is abnormal. The preset exception signal is used for representing that an exception occurs in the application program, and the exception can cause the application program to exit. In a specific embodiment, the preset exception signal may include at least one of a SIGKILL signal, a sigup signal, and an ANR signal. The SIGKILL signal, i.e., kill signal, is a signal for a killing process. The sigup signal is also called a process suspend signal, and is a signal indicating that a terminal is suspended or a process is dead. The ANR signal is used to characterize the current application as non-responsive or response timed-out. Of course, the above signals are only examples and do not cause any limitation to the methods provided by the embodiments of the present application.
When detecting that the application program is abnormal, the abnormality detection module determines abnormal information, namely determines one or more of the abnormal application program, jump information of an abnormal interface, abnormal time, abnormal type and the like. It is understood that, according to the requirement, the anomaly detection module may be configured to detect an anomaly in the running process of the multiple application programs, and determine anomaly information of the multiple application programs. Optionally, the anomaly detection module may store the anomaly information of each application program in a form of a table, a matrix, or the like.
And S409, after the abnormality detection module at the system side detects that the application program A is abnormal, requesting the service of the data storage module by calling the data storage interface.
In other words, after the anomaly detection module on the system side detects that the application program a is anomalous, the data saving interface is called, so that the data saving module provides data saving service.
Optionally, the data saving interface may adopt an asynchronous interface. After the anomaly is detected by the anomaly detection module, a system side establishes a data storage thread in the process of the application program A and sets the priority of the data storage thread as the highest priority. The data saving thread is used for saving the user input data in the abnormal interface by a data saving module of the application program A. And after the data saving module finishes saving, the system side destroys the data saving thread.
In the implementation mode, the data storage interface adopts an asynchronous interface, and the priority executed by the data storage module is set to be the highest priority, so that after the abnormality detection module detects that the application program A is abnormal, the CPU can be preempted, the operation of the application program A is intercepted for a short time, and the application program A is prevented from exiting immediately, so that the user input data in the abnormal interface can be stored in time, and the subsequent recovery of the content input by the user in the abnormal interface is facilitated. Moreover, the priority of the data storage thread is set to be the highest priority, so that the situation that the data storage module cannot execute functions due to ANR of the application program A can be prevented, the timeliness and the reliability of storing the data input by the user are further ensured, and the content input by the user in an abnormal interface can be recovered conveniently in the follow-up process.
In a particular embodiment, the function of the data saving interface may be onExit (), for example. And after the abnormality detection module detects that the application program A is abnormal, calling back onExit ().
S410, the data storage module of the application side application program A stores the user input data in the abnormal interface.
And the data storage module of the application program A is in butt joint with the data storage interface, and when the data storage interface is called by the abnormality detection module, the data storage module responds to the calling and stores the user input data in the abnormal interface based on the data storage thread. That is, the data saving module of the application a executes the data saving interface, and taking the function of the data saving interface as onExit () as an example, the data saving module executes the onExit () callback interface.
Optionally, the data saving module may perform persistent saving on the user input data in the abnormal interface, for example, save the user input data in a hard disk, so that the saved user input data may be continuously accessed after the application program a is restarted or the electronic device is restarted, thereby improving the reliability of data saving and further improving the reliability of recovery of the abnormal interface.
S411, the AMS on the system side exits the interface of the application program A.
And after finishing storing the data input by the user, destroying the data storage thread by the system side. And if the exception occurs, the AMS destroys the Activity corresponding to the exception interface, and the application program A exits.
Continuing with the memo shown in fig. 5 as an example, the interface displayed on the mobile phone is the interface shown in fig. 5 (c), the anomaly detection module detects an anomaly, determines anomaly information, and calls the data saving interface to save the user input data of the interface shown in fig. 5 (c) through the data saving module of the application a. After the saving is completed, the memo exits, and the mobile phone returns to the desktop interface, as shown in (d) of fig. 5.
According to the processing method for abnormal exit of the application program, the abnormality detection module detects the abnormality of the application program, the abnormal information is obtained when the application program is abnormal, the data storage interface can be called, and the user input data in the abnormal interface is stored through the data storage module, so that the abnormal interface and the content input by the user in the abnormal interface can be conveniently recovered when the application program is restarted subsequently, the user does not need to repeat the operation of interface jump, the user does not need to repeatedly input the content, the continuity of user operation is guaranteed, the complexity of user operation is reduced, and the user experience is improved.
In addition, it can be understood that the operating system is convenient for monitoring various states of the application program in the running process compared with the application program; and because the user operates the application program in a complex way, the randomness is strong, and the application program mostly has a data protection mechanism, the application program is convenient to obtain the user input data compared with an operating system. In the method provided by this embodiment, the anomaly detection module is disposed on the system side, and the data storage module is disposed on the application side, that is, the operating system detects an anomaly of the application program, the application program stores data, and the application anomaly detection and the storage of user input data are realized through a hybrid architecture. Therefore, the advantage that the operating system is convenient to monitor the running state of the application program is utilized, the advantage that the application program is convenient to acquire the data input by the user is utilized, the operating system and the application program are matched with each other, the convenience and flexibility of application program abnormity detection and data storage are improved, the efficiency of processing the abnormity exit of the application program is improved, and the execution pressure of the operating system is reduced. Moreover, the application program stores the user input data, so that the input information of the user in the interface can not be acquired by the operating system, and the safety of the user input data is ensured. In addition, the application program framework layer of the operating system provides a data storage interface, and the application program can realize the detection of the application program abnormity and the storage of user input data according to the data storage module corresponding to the provided interface adaptation, so that the operating system can adapt and interface more application programs, the openness of the operating system is ensured, and the flexibility of application program design is ensured.
3) Application a restart
Referring to fig. 5, after finding that the memo exits, the user clicks a memo icon in fig. 5 (d) to restart the memo. In this case, the method provided in this embodiment restores and displays the abnormal interface when the previous abnormal exit occurs, so that the interface is restored to the interface before the exit, as shown in (e) of fig. 5. It can be seen from the figure that after the abnormal interface is recovered, the interface displayed by the mobile phone is the interface operated by the user before the memo exits, and all information input by the user is restored in the interface, so that the interface can be recovered without the user operation, the user does not need to input characters again, the continuity of the user operation is ensured, and the user experience is improved.
Fig. 6 is a schematic flowchart of a processing method for an abnormal exit of an application program in an application program restart scenario according to an embodiment of the present application, as shown in fig. 6, the method includes:
s601, the user clicks the icon of the application program A of the desktop again.
S602, responding to the click operation of the user by the launcher on the application side, and informing the AMS on the system side to start the interface of the application program A.
S603, the AMS on the system side receives the notification of the launcher on the application side, and notifies the historical operating condition determining module to determine whether the application program A abnormally exits in the last operating process.
S604, the historical operating condition determining module on the system side receives the notification of the AMS, and obtains the abnormal information of the application program A in the last operating process from the abnormal detecting module.
And S605, the historical operating condition determining module of the system side determines whether the application program A is abnormally exited in the last operating process according to the acquired result of the abnormal information of the application program A.
The specific execution process of steps S601 to S605 is the same as steps S401 to S405 in the embodiment shown in fig. 4, and is not repeated.
If the application program A does not abnormally exit in the last running process, the historical running condition determining module of the system side sends the determined result (the abnormal exit does not occur in the last running process) to the AMS, and the AMS of the system side starts a first preset starting interface a. Specifically, refer to steps S406 and S407 in the embodiment shown in fig. 4, which are not described again.
In this embodiment, an example in which an abnormal exit occurs during the last operation of the application program a is described. The historical operating condition determining module on the system side determines that the application program A is abnormally exited in the last operating process, and executes the steps S606 to S610.
And S606, the historical operating condition determining module of the system side sends the determined result (abnormal exit occurs in the last operating process) and the skip information of the abnormal interface to the AMS.
And S607, the AMS at the system side jumps to the abnormal interface according to the jump information of the abnormal interface.
Specifically, the AMS on the system side starts the corresponding Activity according to the Activity information corresponding to the abnormal interface.
And S608, the AMS at the system side requests services from the data recovery module through the data recovery interface.
In other words, the AMS on the system side calls the data recovery interface to cause the data recovery module to provide data recovery services.
In a particular embodiment, the function of the data recovery interface may be, for example, onRestore (). AMS calls back onRestore ().
S609, the data recovery module of the application side application program A obtains user input data in the abnormal interface from the data storage module.
And the data recovery module is in butt joint with the data recovery interface, and when the AMS calls the data recovery module, the data recovery module responds to the call to acquire user input data in the abnormal interface. That is, the data recovery module of the application a executes the data recovery interface to recover the content input by the user in the abnormal interface. Taking the data recovery interface as onRestore () for example, the data recovery module executes the onRestore () callback interface to recover and display the content input by the user in the abnormal interface.
Optionally, the data recovery module may store a path of the user input data according to the data storage module, preset a path of the user input data acquired by the data recovery module, and acquire the user input data in the abnormal interface according to the path.
S610, the data recovery module of the application side application program A recovers the content input by the user in the abnormal interface according to the data input by the user.
Specifically, the data recovery module displays the content input by the user at the input position according to the input position in the data input by the user, so as to realize recovery display of the content input by the user.
According to the processing method for the abnormal exit of the application program, when the user starts the application program, the historical operating condition of the application program is determined through the historical operating condition determining module, when the abnormal exit occurs in the last operating process of the application program, the user jumps to the abnormal interface according to the jump information of the abnormal interface in the abnormal information, and the content input by the user in the abnormal interface is recovered through the data recovery module. Therefore, the user does not need to repeat the operation of interface jump and input the content repeatedly, the continuity of the user operation is ensured, the complexity of the user operation is reduced, and the user experience is improved.
In addition, the operating system is convenient for interface jump compared with a target application program; and because the user operates the application program complicatedly and has strong randomness, and the target application program mostly has a data protection mechanism, the target application program is convenient to acquire and display the user input data compared with an operating system. In the method provided by this embodiment, the historical operating condition determining module is disposed on the system side, and the data recovery module is disposed on the application side, that is, the operating system jumps the interface according to the historical operating condition of the application program, the application program recovers the input content of the user in the abnormal interface according to the data stored by the data storage module, and the recovery of the abnormal interface is realized through the hybrid architecture. Therefore, the advantage that the operating system is convenient for interface jumping is utilized, the advantage that the application program is convenient for acquiring and displaying user input data is utilized, the operating system and the application program are matched with each other, the convenience and flexibility of recovering the abnormal interface of the application program are improved, the efficiency of processing abnormal exit of the application program is improved, and the execution pressure of the operating system is reduced. Moreover, the content input by the user is recovered through the application program, so that the content input by the user in the interface can not be acquired by the operating system, and the safety of the data input by the user is ensured. In addition, the application program framework layer of the operating system provides a data recovery interface, and the application program can realize the recovery of the abnormal interface according to the data recovery module corresponding to the provided interface adaptation, so that the operating system can adapt and interface more application programs, the openness of the operating system is ensured, and the flexibility of application program design is ensured.
In one embodiment, after step S610, the method further comprises:
s611, when the AMS at the system side determines that the abnormal interface is recovered, the AMS informs the abnormal detection module to delete the abnormal information of the application program A.
And S612, deleting the abnormal information of the application program A by the abnormal detection module at the system side.
In the implementation mode, when the AMS determines that the recovery of the abnormal interface is completed, the AMS informs the abnormality detection module to delete the abnormal information of the application program, so that the abnormality detection module can store the abnormal information when the subsequent abnormality of the application program occurs, the abnormality detection module can not generate the abnormal information when the abnormality of the application program does not occur, the information is the abnormal information which is abnormal in the last time when the abnormality of the application program occurs, and the historical operation condition determination module can determine the historical operation condition of the application program, so that the interface recovery is facilitated, and the algorithm operation efficiency is improved.
In some embodiments, there is also an application scenario, when jumping and recovering an abnormal interface, it needs to rely on the dependency information generated by the information input by some other interfaces, that is, there is a dependency interface in the abnormal interface to be recovered. According to the difference of the dependency information, several examples of the abnormal interface to be recovered with the dependency interface are listed below, which are only used as examples and do not cause any limitation to the present application.
1) Relying on information as authentication success information
Some interfaces of some application programs can realize skipping after acquiring the information of successful authentication. For example, in some application programs, a user needs to jump to a preset interface after performing account login on an account login interface, and then the corresponding interface is displayed. Generally, a user may set to remember an account and a password, and the application may store the account and the password of the user in a preset storage location. When a preset interface needs to be started, firstly, an account password is obtained from a preset storage position, the account and the password are verified, and after the account and the password are verified, authentication success information (namely, dependence information) is generated. The AMS can start the preset interface after acquiring the authentication success information.
However, in order to ensure the security of the user account, some application programs set valid periods for the account and the password, and when the valid periods are exceeded, the user needs to input the account and the password again. Or, when the user logs in the account on another device, the account and the password saved in the application program in the current electronic device are invalid, and the user is required to re-input the account and the password. Under the circumstances, when the method provided by the embodiment of the application is used for restoring the preset interface, the stored account number and the password exceed the validity period or are invalid, and the account number and the password are not verified, so that the information which is successfully authenticated cannot be acquired, and the situation that the user cannot jump to the preset interface occurs, and the user needs to jump to a dependent interface to acquire the information to generate the dependent information so as to relieve the dependence.
For example, fig. 7 is a schematic diagram of an example of an abnormal interface and a dependency interface to be recovered according to the embodiment of the present application. With WeChat
Figure 550132DEST_PATH_IMAGE001
For example, fig. 7 (a) is a schematic diagram of a WeChat main interface, and fig. 7 (b) is a schematic diagram of a dependent interface (i.e., an account login interface) of the WeChat main interface.
If WeChat
Figure 595449DEST_PATH_IMAGE001
If the interface shown in fig. 7 (a) is abnormal and exits in the last operation process, the account and the password of the user need to be acquired when the interface is restored by the method provided by the embodiment of the present application. In the recovery process, if the stored account and password exceed the validity period, the account and password are not verified, and the authentication success information cannot be obtained, so that the user cannot jump to the wechat host interface corresponding to the diagram (a) in fig. 7, and needs to jump to the account login interface shown in the diagram (b) in fig. 7 first. The user inputs the account password in the interface shown in fig. 7 (b), and after the authentication is successful, the user further jumps to the interface shown in fig. 7 (a).
2) Authorizing information for a user in dependence on the information
Some interfaces of some application programs can realize the jump only after acquiring the authorization information of the user. For example, in some application programs, a user can jump to a preset interface after clicking an agreement control in an authority application interface, and a corresponding interface is displayed. Under the circumstance, when the method provided by the embodiment of the application is adopted to recover the preset interface, the authority application interface needs to apply for the authority to the user, and after the authority application is successful, the user authorization information is generated. And the AMS jumps to a preset interface after acquiring the user authorization information.
For example, fig. 8 is a schematic diagram of another example of an abnormal interface and a dependent interface to be recovered according to an embodiment of the present application. Taking a registration system of a certain hospital as an example, fig. 8 (a) is a schematic diagram of a treatment card selection interface, and fig. 8 (b) is a schematic diagram of a registration request interface. If the interface shown in fig. 8 (a) is abnormal and exits in the last running process of the application program, when the interface is restored by the method provided by the embodiment of the present application, it is necessary to jump to the interface shown in fig. 8 (b) first and apply for an authority to the user. If the user clicks "i have read and agreed" on the interface shown in fig. 8 (b), the permission application is successful, user authorization information is generated, and the AMS jumps to the visit card selection interface shown in fig. 8 (a).
For the case that a dependent interface exists in the abnormal interface to be recovered, the embodiment of the present application may specifically implement the abnormal interface recovery by the following manner:
optionally, the interface with the dependent interface may be configured with the jump information of the dependent interface. As a possible implementation manner, the interface-dependent jump information may be configured in a dependency configuration file in the application-side application program, for example, android manifest. Optionally, the jump information of the dependent interface may be, for example, an Activity name or an Activity label of the dependent interface.
Fig. 9 is a flowchart illustrating another example of a processing method for an abnormal exit of an application program according to an embodiment of the present application. As shown in fig. 9, taking an example that the exception interface b1 has a dependency interface b2, the S607 and AMS on the system side jumps to the exception interface according to the jump information of the exception interface, including:
s901, the AMS at the system side jumps to the abnormal interface b1 according to the jump information of the abnormal interface b1 and determines whether the jump is successful.
Specifically, the AMS jumps to the corresponding Activity according to the Activity information corresponding to the exception interface b 1.
Optionally, for an abnormal interface with a dependency interface, the dependency information of the abnormal interface is obtained first. And after the dependency information is acquired, jumping to an abnormal interface. It is understood that the result of jumping to the exception interface may be a successful jump or a failed jump. For example, as described in the above embodiment, when the account password exceeds the validity period, the account password is invalid, or the user authorization information cannot be acquired, a jump failure may occur.
If the jump is successful, continuing to execute S609 and S610 in the embodiment shown in FIG. 6, and resuming the display of the content input by the user in the abnormal interface, thereby completing the resumption of the abnormal interface b 1; if the jump fails, steps S902 to S907 are executed, and then S609 and S610 in the embodiment shown in fig. 6 are continuously executed to resume displaying the content input by the user in the abnormal interface, thereby completing the recovery of the abnormal interface b 1.
Optionally, the result of the interface jump may be characterized by a preset jump result code.
S902, the AMS on the system side acquires the jump information of the dependent interface b2 of the exception interface b1 from the dependent configuration file.
As shown in the above embodiment, the dependency configuration file may be stored under the root directory of the application. And when the jump of the abnormal interface fails, the AMS acquires the jump information of the dependent interface corresponding to the jump information of the abnormal interface from the dependent configuration file under the root directory of the application program according to the jump information of the abnormal interface.
And S903, the AMS on the system side jumps to the dependent interface b2 according to the jump information of the dependent interface b 2.
In a specific embodiment, a dependency tag can be added to the Activity of the exception interface, and the dependency tag is used for marking jump information of the dependency interface of the exception interface.
Alternatively, the procedure of the above process may be as follows:
<activity
android:name=“.MainActivity”
android:label=“MainActivity”
android:depend=“.TargetActivity”
android:theme=“@style/Theme.Testtleak.NoActionBar”>
</activity>
wherein, android is dependent label of Activity, and TargetActivity is dependent interface of MainActivity. When the abnormal interface to be restored is MainActivity and the MainActivity can not be displayed (or has errors) by directly restoring and jumping to, the abnormal interface to be restored can jump to TargetActivity according to the dependency label.
S904, the system side dependency information generation module acquires the information input by the user through the dependency interface b 2.
S905, the system side dependency information generation module generates the dependency information of the abnormal interface b1 according to the information input by the user at the dependency interface b 2.
And S906, the dependency information generation module on the system side sends the dependency information to the AMS.
S907, the AMS on the system side starts the abnormal interface b1 according to the dependency information of the abnormal interface b1 and the jump information of the abnormal interface b 1.
Fig. 10 is a schematic diagram illustrating an example of interface changes in an abnormal interface recovery process with a dependent interface according to an embodiment of the present application. With WeChat
Figure 429806DEST_PATH_IMAGE001
For example, fig. 10 (a) is a schematic view of an exception interface. When the user inputs the characters shown in the drawing in the dialog box shown in the drawing (a) in fig. 10, the WeChat
Figure 837654DEST_PATH_IMAGE001
And (5) performing breakdown flash back. In the interface recovery process, since the display of the interface depends on the account and the password in the login interface and the account password is expired, the process jumps to the dependent interface shown in (b) of fig. 10. When the user inputs an account number and a password in the interface shown in fig. 10 (b) and clicks the "agree and verify" control, the user jumps to the interface to be restored, and displays an abnormal interface and user input data, as shown in fig. 10 (c).
As can be seen from the above process, in the method provided in this embodiment, by storing the jump information of the interface and the corresponding dependent interface in the dependent configuration file, when the abnormal interface cannot jump, the method jumps to the dependence of the abnormal interface first, acquires the relevant information through the dependent interface to generate the dependent information, releases the dependence, and then jumps to the abnormal interface. Therefore, when the abnormal interface is recovered, even if the dependent interface exists, the recovery can be realized, and the applicability and the practicability of the method are improved.
The method for processing the application program exception exit provided by the embodiment of the present application is further described below with reference to the above embodiments. Fig. 11 is a flowchart illustrating a further example of a processing method for an abnormal exit of an application program according to an embodiment of the present application. In this embodiment, the application having the abnormal interface recovery function is referred to as a target application, and in this embodiment, the execution main body of each step refers to the above embodiments, and is not described again. As shown in fig. 11, the method includes:
s1101, in the running process of the target application program, detecting the abnormality of the target application program, and generating abnormal information, wherein the abnormal information comprises the jump information of an abnormal interface.
And S1102, before the target application program exits, saving the user input data.
And S1103, exiting the target application program.
S1104, responding to the restart operation of the target application program, and determining whether the target application program is abnormally exited in the last running process; if the target application program is abnormally exited in the last running process, executing step S1105; if the target application program has not been exited abnormally in the last running process, step S1114 is executed.
S1105, obtaining the jump information of the abnormal interface and the user input data in the abnormal interface; the abnormal interface refers to an interface where the target application program is located when abnormal exit occurs last time, and the user input data comprises input contents of the user in the abnormal interface and input positions of the input contents in the abnormal interface.
And S1106, starting the abnormal interface according to the jump information of the abnormal interface.
S1107, determining whether the abnormal interface is started successfully; if the abnormal interface fails to start, go to step S1108; if the abnormal interface is successfully started, step S1112 is executed.
S1108, skipping information of a dependent interface of the abnormal interface is obtained; the dependency interface of the exception interface is an interface for inputting first information, and the first information is used for generating first dependency information necessary for starting the exception interface.
Optionally, the dependency information of the exception interface may be obtained from a dependency configuration file. The dependency configuration file is used for storing the interface-dependent jump information of the target interface. The target interface refers to an interface in which a dependent interface exists in the target application. The dependent interface of the target interface refers to an interface for inputting target information. The target information is used to generate dependency information necessary to launch the target interface.
That is, the dependency configuration file may store interface-dependent jump information of at least one target interface. The at least one target interface includes an exception interface. Target information input in a dependent interface of the abnormal interface is called first information, and the dependent information of the abnormal interface is called the first dependent information.
In one embodiment, the first dependency information includes at least one of authentication success information and user authorization information, the authentication success information is used for representing that identity information of the user conforms to a preset authority check rule, and the user authorization information is used for representing that consent or permission of the user is obtained and that the user has an execution authority for a preset operation.
And S1109, starting the dependent interface of the abnormal interface according to the jump information of the dependent interface of the abnormal interface.
S1110, first information input by a user through a dependence interface of the abnormal interface is obtained, and first dependence information is generated according to the first information.
S1111, jumping to the abnormal interface according to the first dependency information and the jumping information of the abnormal interface.
S1112, restoring the input content at the input position in the abnormal interface according to the user input data.
And S1113, deleting the abnormal information of the target application program.
And S1114, starting a preset starting interface of the target application program.
In one embodiment, step S1102, prior to exiting the target application, saves the user input data, including: newly building a data storage thread, and setting the priority of the data storage thread as the highest priority; user input data is saved based on the data save thread.
In one embodiment, the detecting the exception of the target application in step S1101 includes:
and monitoring a preset exception signal of the target application program, wherein the preset exception signal is used for representing the exception of the application program which can cause the exit of the application program.
In one embodiment, the preset exception signal includes at least one of a kill progress (SIGKILL) signal, a progress pending (sigup) signal, and an application non-response (ANR) signal.
In one embodiment, the step S1104 of determining whether an abnormal exit occurs during the last running of the target application includes: determining whether abnormal information in the last running process of the target application program exists or not; if so, determining that the exception occurs in the last running process of the target application program; and if not, determining that no exception occurs in the last running process of the target application program.
For the specific implementation process and beneficial effects of each step in this embodiment, reference is made to the above embodiments, and details are not repeated.
The above details an example of the processing method for exception exit of the application program provided in the embodiment of the present application. It will be appreciated that the electronic device, in order to implement the above-described functions, comprises corresponding hardware and/or software modules for performing the respective functions. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, with the embodiment described in connection with the particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional modules according to the method example, for example, the functional modules may be divided into the functional modules corresponding to the functions, such as the detection unit, the processing unit, the display unit, and the like, or two or more functions may be integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
It should be noted that all relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
The electronic device provided by the embodiment is used for executing the processing method for the abnormal exit of the application program, so that the same effect as the effect of the implementation method can be achieved.
In case of an integrated unit, the electronic device may further comprise a processing module, a storage module and a communication module. The processing module can be used for controlling and managing the action of the electronic equipment. The memory module can be used to support the electronic device in executing stored program codes and data, etc. The communication module can be used for supporting the communication between the electronic equipment and other equipment.
The processing module may be a processor or a controller. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. A processor may also be a combination of computing functions, e.g., a combination of one or more microprocessors, a Digital Signal Processing (DSP) and a microprocessor, or the like. The storage module may be a memory. The communication module may specifically be a radio frequency circuit, a bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
In an embodiment, when the processing module is a processor and the storage module is a memory, the electronic device according to this embodiment may be a device having the structure shown in fig. 1.
The embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the processor is enabled to execute the processing method for processing the abnormal exit of the application program in any of the above embodiments.
The embodiment of the present application further provides a computer program product, when the computer program product runs on a computer, the computer is enabled to execute the relevant steps, so as to implement the processing method for abnormal exit of the application program in the above embodiment.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component or a module, and may include a processor and a memory connected to each other; when the device runs, the processor can execute the computer execution instruction stored in the memory, so that the chip executes the processing method for the abnormal exit of the application program in the above method embodiments.
The electronic device, the computer-readable storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, so that the beneficial effects achieved by the electronic device, the computer-readable storage medium, the computer program product, or the chip may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Through the description of the foregoing embodiments, those skilled in the art will understand that, for convenience and simplicity of description, only the division of the functional modules is used for illustration, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the device may be divided into different functional modules, so as to complete all or part of the functions described above.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a module or a unit may be divided into only one logic function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented as a software functional unit and sold or used as a separate product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (21)

1. A method for handling an abnormal exit of an application, the method being performed by an electronic device, wherein the electronic device is installed with a target application, the method comprising:
responding to the starting operation of the target application program, and determining whether the target application program is abnormally exited in the last running process;
if the target application program is abnormally exited in the last running process, acquiring jump information of an abnormal interface and user input data in the abnormal interface; the abnormal interface is an interface where the target application program is located when abnormal exit occurs last time, and the user input data comprises input contents of a user in the abnormal interface and input positions of the input contents in the abnormal interface;
recovering the abnormal interface according to the jump information of the abnormal interface;
restoring the input content at the input position in the abnormal interface according to the user input data;
the recovering the abnormal interface according to the jump information of the abnormal interface comprises the following steps: starting the abnormal interface according to the jump information of the abnormal interface; if the abnormal interface fails to start, acquiring jump information of a dependent interface of the abnormal interface, wherein the dependent interface of the abnormal interface is an interface used for inputting first information, and the first information is used for generating first dependent information required for starting the abnormal interface; starting the dependent interface of the abnormal interface according to the jump information of the dependent interface of the abnormal interface; acquiring the first information input by a user through a dependence interface of the abnormal interface, and generating the first dependence information according to the first information; and starting the abnormal interface according to the first dependency information and the jump information of the abnormal interface.
2. The method according to claim 1, wherein the first dependency information includes at least one of authentication success information and user authorization information, the authentication success information is used for representing that the identity information of the user conforms to a preset authority check rule, and the user authorization information is used for representing that the user has an execution authority for a preset operation.
3. The method of claim 1, wherein before determining whether an exception exit occurs during a last running of the target application in response to a start operation of the target application, the method further comprises:
detecting the abnormality of the target application program in the running process of the target application program, and generating abnormality information, wherein the abnormality information comprises the jump information of the abnormal interface;
saving the user input data before the target application exits.
4. The method of claim 3, wherein saving the user input data prior to exiting the target application comprises:
newly building a data storage thread, and setting the priority of the data storage thread as the highest priority;
saving the user input data based on the data saving thread.
5. The method of claim 3, wherein the detecting the exception occurring in the target application comprises:
and monitoring a preset exception signal of the target application program, wherein the preset exception signal is used for representing the exception of the application program which can cause the exit of the application program.
6. The method of claim 5, wherein the predetermined exception signal comprises at least one of a kill process SIGKILL signal, a process suspend SIGHUP signal, and an apply unresponsive ANR signal.
7. The method of claim 1, wherein the determining whether the target application program has been exited abnormally since it was last run comprises:
determining whether abnormal information exists in the last running process of the target application program;
if so, determining that the target application program is abnormal in the last running process;
and if not, determining that no exception occurs in the last running process of the target application program.
8. The method of claim 1, wherein after the input location in the exception interface resumes the input content according to the user input data, the method further comprises:
and deleting the abnormal information of the target application program.
9. The method of claim 1, further comprising:
and if the target application program does not exit abnormally in the last running process, starting a preset starting interface of the target application program.
10. The method of any one of claims 1 to 9, wherein the electronic device is installed with an operating system, the method comprising:
the operating system responds to the starting operation of the target application program and determines whether the target application program is abnormally exited in the last running process, if the target application program is abnormally exited in the last running process, the operating system acquires the jump information of the abnormal interface and recovers the abnormal interface according to the jump information of the abnormal interface;
and the target application program acquires user input data in the abnormal interface and restores the input content in the input position in the abnormal interface according to the user input data.
11. The method according to claim 10, wherein the operating system includes a historical operating condition determining module, an exception detecting module and an activity management service, which are located in an application framework layer, and the operating system determines whether an exception exit occurs during a last operating process of the target application program in response to a starting operation of the target application program, and if the exception exit occurs during the last operating process of the target application program, the operating system obtains jump information of an exception interface and restores the exception interface according to the jump information of the exception interface, including:
the historical operating condition determining module responds to the starting operation of the target application program and determines whether the target application program is abnormally exited in the last operating process;
if the target application program is abnormally exited in the last running process, the historical running condition determining module acquires the jump information of the abnormal interface from the abnormal detecting module;
and the activity management service recovers the abnormal interface according to the jump information of the abnormal interface.
12. The method according to claim 11, wherein the target application program comprises a dependency configuration file, the dependency configuration file is used for storing jump information of a dependency interface of a target interface, the target interface is an interface in which the dependency interface exists in the target application program, the dependency interface of the target interface is an interface for inputting target information, the target information is used for generating dependency information necessary for starting the target interface, and the application framework layer further comprises a dependency information generation module;
the activity management service recovers the abnormal interface according to the jump information of the abnormal interface, and the activity management service comprises the following steps:
the activity management service starts the abnormal interface according to the jump information of the abnormal interface;
if the abnormal interface fails to be started, the activity management service acquires the jump information of the dependent interface of the abnormal interface from the dependency configuration file, and starts the dependent interface of the abnormal interface according to the jump information of the dependent interface of the abnormal interface;
the dependence information generation module acquires first information input by a user through a dependence interface of the abnormal interface and generates first dependence information according to the first information; the first information is target information corresponding to a dependent interface of the abnormal interface, and the first dependent information is dependent information required for starting the abnormal interface;
and the activity management service starts the abnormal interface according to the first dependency information and the jump information of the abnormal interface.
13. The method of claim 10, wherein the target application comprises a data saving module and a data restoring module, and wherein the target application obtains user input data in the exception interface and restores the input content at the input location in the exception interface according to the user input data, comprising:
and the data recovery module acquires the user input data from the data storage module and recovers the input content at the input position in the abnormal interface.
14. The method of claim 13, wherein the operating system comprises an activity management service at an application framework layer, wherein the application framework layer further comprises a data recovery interface, wherein the data recovery interface interfaces with the data recovery module, wherein the data recovery module retrieves the user input data from the data save module and recovers the input content at the input location in the exception interface, and wherein the method comprises:
and the activity management service calls the data recovery interface, acquires the user input data from the data storage module through the data recovery module, and recovers the input content at the input position in the abnormal interface.
15. The method of claim 10, wherein the operating system comprises an exception detection module located at an application framework layer, wherein the target application comprises a data saving module, wherein the operating system is responsive to a start operation for the target application to determine whether an exception exit has occurred during a last run of the target application, and wherein the method further comprises:
in the running process of the target application program, the abnormality detection module detects abnormality of the target application program and generates abnormality information, wherein the abnormality information comprises jump information of the abnormal interface;
and saving the user input data through the data saving module.
16. The method of claim 15, wherein the application framework layer further comprises a data saving interface, the data saving interface interfacing with the data saving module, the saving of the user input data by the data saving module comprising:
and the abnormality detection module calls the data storage interface and stores the user input data through the data storage module.
17. The method of claim 16, wherein the data retention interface is an asynchronous interface.
18. The method of claim 10, wherein the operating system comprises an exception detection module at an application framework layer, and wherein after restoring the input content at the input location in the exception interface based on the user input data, the method further comprises:
and the abnormity detection module deletes the abnormity information of the target application program.
19. The method of claim 10, further comprising:
and if the target application program does not exit abnormally in the last running process, starting a preset starting interface of the target application program by the operating system.
20. An electronic device, comprising: a processor, a memory, and an interface;
the processor, the memory, and the interface cooperate to cause the electronic device to perform the method of any of claims 1-19.
21. A computer-readable storage medium, in which a computer program is stored which, when executed by a processor, causes the processor to carry out the method of any one of claims 1 to 19.
CN202210355559.0A 2022-04-06 2022-04-06 Processing method for abnormal exit of application program, electronic equipment and readable storage medium Active CN114489917B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210355559.0A CN114489917B (en) 2022-04-06 2022-04-06 Processing method for abnormal exit of application program, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210355559.0A CN114489917B (en) 2022-04-06 2022-04-06 Processing method for abnormal exit of application program, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN114489917A CN114489917A (en) 2022-05-13
CN114489917B true CN114489917B (en) 2022-09-02

Family

ID=81488724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210355559.0A Active CN114489917B (en) 2022-04-06 2022-04-06 Processing method for abnormal exit of application program, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114489917B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114896097B (en) * 2022-07-13 2023-06-13 荣耀终端有限公司 Application program non-response processing method and electronic equipment
CN115129505B (en) * 2022-09-02 2023-07-07 荣耀终端有限公司 Processing method and device for abnormal exit of application program
CN116208705B (en) * 2023-04-24 2023-09-05 荣耀终端有限公司 Equipment abnormality recovery method and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552591A (en) * 2020-03-25 2020-08-18 中国平安财产保险股份有限公司 Page abnormity recovery method, device, equipment and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7996716B2 (en) * 2008-06-12 2011-08-09 International Business Machines Corporation Containment and recovery of software exceptions in interacting, replicated-state-machine-based fault-tolerant components
CN106919489B (en) * 2016-08-02 2020-03-10 阿里巴巴集团控股有限公司 Method and device for monitoring abnormal exit of application interface of application program
CN111459715A (en) * 2019-01-20 2020-07-28 华为技术有限公司 Application exception recovery
CN111221671B (en) * 2019-11-27 2024-03-22 中国银行股份有限公司 Processing method and device for abnormal exit of application program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552591A (en) * 2020-03-25 2020-08-18 中国平安财产保险股份有限公司 Page abnormity recovery method, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN114489917A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
US11803451B2 (en) Application exception recovery
CN114489917B (en) Processing method for abnormal exit of application program, electronic equipment and readable storage medium
CN113032766B (en) Application authority management method and device
CN114020652B (en) Application program management method and electronic equipment
CN115328563B (en) System starting method and electronic equipment
EP3021250A1 (en) Electronic device and method for suggesting response manual in occurrence of denial
CN115017534B (en) File processing authority control method, device and storage medium
CN115048642B (en) Communication method between trusted applications in multi-trusted execution environment and electronic equipment
WO2020172874A1 (en) File processing method and terminal device
EP4095723B1 (en) Permission reuse method, permission reuse-based resource access method, and related device
CN115879088A (en) Authority checking method and electronic equipment
CN112540839B (en) Information changing method, device, electronic equipment and storage medium
CN115022458A (en) Method, system, electronic device and medium for processing loss of electronic device
CN110704157B (en) Application starting method, related device and medium
CN115017487B (en) Switching method for login account of electronic equipment and electronic equipment
CN116302295B (en) Interface display method
CN115033193B (en) Screen turning processing method and device, medium and electronic equipment
CN116049812B (en) Method for accessing hardware resources and electronic equipment
CN115016665B (en) Frozen screen fault detection method, electronic equipment and computer readable storage medium
CN115981576B (en) Method for sharing data, electronic device and storage medium
CN115357273B (en) Reminding method for system upgrading and electronic equipment
CN114706633B (en) Preloading method, electronic device and storage medium
CN115686338B (en) Screen splitting method and electronic equipment
CN113536387A (en) Terminal and method for detecting integrity of kernel data
CN117130627A (en) Fitting upgrading method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant