CN107357704B - Application program detection method, terminal and computer readable storage medium - Google Patents

Application program detection method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN107357704B
CN107357704B CN201710499595.3A CN201710499595A CN107357704B CN 107357704 B CN107357704 B CN 107357704B CN 201710499595 A CN201710499595 A CN 201710499595A CN 107357704 B CN107357704 B CN 107357704B
Authority
CN
China
Prior art keywords
application program
data
application
backed
response
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
CN201710499595.3A
Other languages
Chinese (zh)
Other versions
CN107357704A (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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201710499595.3A priority Critical patent/CN107357704B/en
Publication of CN107357704A publication Critical patent/CN107357704A/en
Application granted granted Critical
Publication of CN107357704B publication Critical patent/CN107357704B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process

Abstract

The invention discloses an application program detection method, a terminal and a computer readable storage medium, and relates to the technical field of terminals, wherein the application program detection method comprises the following steps: monitoring whether the application program has no response or crashes; when the application program has no response or is crashed, searching the backup recovery data before; and when the recovery data backed up before is found, recovering the recovery data backed up before and restarting the application program. The invention eliminates unnecessary redundant data generated when the application program is not responded or crashed by monitoring the condition that the application program is not responded or crashed and resetting the application program data after the condition occurs, ensures the smooth restart of the application program and avoids the problems of complicated operation and influence on the normal use of a user caused by the fact that the application program is required to be reinstalled when the application program is not responded or crashed and cannot be restarted.

Description

Application program detection method, terminal and computer readable storage medium
Technical Field
The present invention relates to the field of terminal device technologies, and in particular, to an application detection method, a terminal, and a computer-readable storage medium.
Background
With the rapid development of the mobile internet technology, mobile terminals (such as mobile phones, tablet computers, etc.) have become increasingly popular, and the functions provided by the mobile terminals are increasing, and a plurality of application programs with various functions can be installed on one terminal device. An application program refers to a software program that is developed to run on an operating system in order to accomplish a specific task or tasks.
In the use process of the mobile terminal, when a system is upgraded, an application program is upgraded or the application program is used, some unnecessary dirty data can appear in data stored in the application program, so that the situation that the application program has no response or is directly crashed can occur, the problem still exists when the application program is restarted, and at this time, a user needs to reinstall the application program, the operation is troublesome, and the normal use of the user is influenced.
Disclosure of Invention
The present invention is directed to an application detection method, a terminal and a computer readable storage medium, and aims to solve the problem in the prior art that the normal use of a user is affected due to complicated operation caused by the fact that an application is not responsive and cannot be restarted and must be reinstalled.
In order to achieve the above object, an aspect of the present invention provides an application detection method, including:
monitoring whether the application program has no response or crashes;
when the application program has no response or is crashed, searching the backup recovery data before;
and when the recovery data backed up before is found, recovering the recovery data backed up before and restarting the application program.
Further, the method further comprises:
and when the previous backup recovery data is not found or cannot be restarted by recovering the previous backup recovery data, deleting the data of the application program and restarting the application program.
Further, before the monitoring whether the application program is in a non-response or crash condition, the method further includes:
selecting application program data needing to be backed up;
after the monitoring whether the application program has no response or crashes, the method further comprises the following steps:
when the application program has no response or is crashed, backing up problem data of the current application program;
and when the data of the application program is deleted and the application program is restarted and fails, recovering the problem data of the backed up application program.
Further, the selecting the application data to be backed up includes:
before the terminal system is upgraded or the application program is upgraded, the application program data needing to be backed up is selected according to the upgrade object.
Further, monitoring whether the application is unresponsive or crashed includes:
when receiving an ANR application no-response prompt, determining that the application has no response;
when a CRASH application CRASH prompt is received, it is determined that the application crashes.
Another aspect of the present invention further provides an application program detecting terminal, where the application program detecting terminal includes: a memory, a processor, and an application detection program stored on the memory and executable on the processor, the application detection program when executed by the processor implementing the steps of:
monitoring whether the application program has no response or crashes;
when the application program has no response or is crashed, searching the backup recovery data before;
and when the recovery data backed up before is found, recovering the recovery data backed up before and restarting the application program.
Further, after the step of searching the previously backed-up recovery data when the application is in a non-response or crash condition, the processor is further configured to execute the application detection program to implement the following steps:
and when the previous backup recovery data is not found or cannot be restarted by recovering the previous backup recovery data, deleting the data of the application program and restarting the application program.
Further, before the step of monitoring whether the application is unresponsive or crashed, the processor is further configured to execute the application detection program to implement the steps of:
selecting application program data needing to be backed up;
after the monitoring whether the application program has no response or crashes, the method further comprises the following steps:
when the application program has no response or is crashed, backing up problem data of the current application program;
and when the data of the application program is deleted and the application program is restarted and fails, recovering the problem data of the backed up application program.
Further, in the step of selecting the application data to be backed up, the processor is further configured to execute the application detection program to implement the following steps:
before the terminal system is upgraded or the application program is upgraded, the application program data needing to be backed up is selected according to the upgrade object.
In another aspect, the present invention further provides a computer readable storage medium storing one or more programs, which are executable by one or more processors to implement the steps of any of the above-described application detection methods.
According to the application program detection method, the terminal and the computer readable storage medium, the situation that no response or breakdown occurs in the application program is monitored, and after the situation occurs, unnecessary redundant data generated when the application program does not respond or breaks down is eliminated by resetting the application program data, so that the application program is ensured to be restarted smoothly, and the problems that the normal use of a user is influenced due to complicated operation caused by reinstallation when the application program does not respond or breaks down and cannot be restarted are solved.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention;
FIG. 2 is a diagram of a wireless communication system for the mobile terminal shown in FIG. 1;
fig. 3 is a flowchart of an application detection method according to an embodiment of the present invention;
FIG. 4 is a flowchart of another method for detecting an application according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an application detection terminal according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation terminal, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for mobile communications), GPRS (General packet radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (frequency Division duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, and the Graphics Processing Unit 1041 processes image data of still pictures or videos obtained by an image capturing terminal (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus pen, or any other suitable object or accessory), and drive a corresponding connection terminal according to a preset program. The touch panel 1071 may include two parts of a touch detection terminal and a touch controller. The touch detection terminal detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing terminal, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external terminal is connected to the mobile terminal 100. For example, the external terminal may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a terminal having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external terminal and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and the external terminal.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and Charging Rules Function) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
Fig. 3 is a flowchart of an application detection method according to a first embodiment of the present invention, as shown in fig. 3, the method includes:
s301, monitoring whether the application program has no response or is crashed;
the monitoring of whether the application program has no response or is crashed can be monitored by respectively monitoring the ANR application program no-response prompt and the CRASH application program CRASH prompt.
For example, when the application program has no response, the application program may print the ANR related information, and when the application program has a CRASH, the application program may print the crach call stack; in this step, step S302 may be executed asynchronously at the positions where the ANR and crach information are printed, so as to implement monitoring.
S302, when the application program has no response or is crashed, searching the backup recovery data;
specifically, in this step, when the application program has no response or crashes, whether the recovery data of the application program has been backed up before is searched by generating the packet name of no response or crashes.
And S303, when the previously backed-up recovery data is found, recovering the previously backed-up recovery data, and restarting the application program.
If the previously backed up recovery data can be found in step S302, in this step, the corresponding data storage directory of the application under the data/data directory is directly deleted, and the previously backed up recovery data is copied; the application is then restarted, and if the startup is successful, further recovery to the previously backed up data may be prompted. The prompt information may be prompted in a text manner through a display screen, or may be prompted in an audio manner through a speaker, which is not limited in the present invention.
Wherein, restarting the application program can be realized by the following modes: and calling a method of startActivityForResult through the application program data packet name to start the application default main page.
The application program detection method provided by the invention eliminates unnecessary redundant data generated when the application program is not responded or crashed by monitoring the condition that the application program is not responded or crashed and resetting the application program data after the condition occurs, ensures that the application program is restarted smoothly, and avoids the problems that the operation is complicated and the normal use of a user is influenced because the application program is not responded or crashed and cannot be restarted because the application program needs to be reinstalled.
Fig. 4 shows an application detection method according to another embodiment of the present invention, where the application detection method includes:
s401, selecting data of a backup application program;
the inventor has found through analysis and research that the terminal generally has the situation that the application program is not responded or crashed when the terminal system is upgraded, the application program is upgraded or the application program is used.
In this step, before the terminal system is upgraded or the application program is upgraded, the application program data to be backed up may be selected according to the upgrade object. For example, if the terminal needs to upgrade the system, a plurality of application data (e.g., WeChat, email, Paibao, etc.) frequently used by the user may be selected as the application data to be backed up; when the terminal needs to upgrade a certain application (for example, american takeout), the corresponding application (american takeout) data may be selected as the application data to be backed up. Or before the terminal starts a plurality of application programs, selecting the application program data to be backed up according to the size of the memory occupied by the operation of the application programs. For example, the terminal simultaneously starts five application programs, namely WeChat, video, games, e-mails and American groups take out, and because the video and the games occupy a large amount of memory during operation, before the video and the games are started, data corresponding to the video and the games are used as application program data to be backed up.
In the step, the application program data to be backed up is selected before the terminal is upgraded, the application program is upgraded or a plurality of application programs are started, so that when the application has no response or is directly crashed, the application program data can be recovered through the backup data before the problem occurs, and the application program is restarted.
S402, monitoring whether the application program has no response or is crashed;
in this step, when receiving an ANR application unresponsive prompt, determining that the application has no response; when a CRASH application CRASH prompt is received, it is determined that the application crashes.
Specifically, the following steps may be performed asynchronously where the printed anr information and/or crash information is monitored to achieve monitoring.
When a plurality of application programs are crashed, a plurality of information (for example, log information) is obtained as relevant information of the crash, a developer can locate the crash according to the information, the collected crash information is relevant modules of the system at the moment and does not comprise modules of the application programs, and the developer needs to analyze a large amount of crash information to locate a specific module of the application program which is crashed.
In order to facilitate the location of the application program where the application program crashes, in this step, when the application program crashes is monitored, the operation of the application program can be divided into several stages, by recording the operation information of the application program in each stage, when the application program crashes, the last successful operation stage is located according to the last recorded operation information, and then the next stage of the stage is the stage where the crash occurs. Therefore, the crash position can be quickly and accurately positioned, and a developer can debug and modify the source code of the application program according to the crash position to solve the problem of the crash commonly occurring on the terminal.
Specifically, the application program may be divided into a plurality of operation phases according to the operation sequence, and the code for implementing the operation recording plug-in is inserted until the end of each operation phase. Therefore, after the phase operation is finished, the operation recording plug-in is called immediately to record the phase operation information. In order to avoid crash caused by failure of calling the operation recording plug-in, the function of the operation recording plug-in can be realized by a very simple method, for example, the operation information of each stage is recorded by a specified variable, and each operation recording plug-in only needs to write the operation information into the specified variable.
Specifically, in an embodiment of the present invention, a phase number corresponding to a corresponding operation phase is preset in each operation record plugin; initializing a designated variable after the application program runs; and since the operation record plug-in corresponding to each stage records the operation success information of the stage, the value of the specified variable is set as the stage number corresponding to the stage.
Illustratively, a global variable running _ state is set, which is initialized to 0 after the application runs. In the operation recording plug-in corresponding to the first stage, the preset stage number is 1, and in the operation recording plug-in corresponding to the second stage, the preset stage number is 2 …, and the preset number corresponding to the nth stage is n. Then, after the first-stage operation is finished, the running record plugin corresponding to the first stage sets the running _ state value to 1; after the second-stage operation is finished, the operation recording plug-in corresponding to the first stage sets the running _ state to be 2 …, and after the nth-stage operation is finished, the operation recording plug-in corresponding to the first stage sets the running _ state to be n. If the m-th stage is successfully executed, the value of running _ state is set to m, and the m + 1-th stage is crashed, the value of running _ state cannot be set to other values, and the last stage of the application program which is successfully executed can be determined according to the current value of running _ state. Thus, when the application program crashes, the position of the application program crashes can be found by acquiring the value of the specified variable.
S403, when the application program has no response or is crashed, backing up problem data of the current application program;
in this step, when the ANR prompt or the CRASH prompt is monitored, the problem data when the ANR prompt or the CRASH prompt occurs is backed up according to the application data that needs to be backed up and is selected in step S401.
For example, if the application data to be backed up selected in step S401 is game data, in this step, when it is monitored that the ANR information is printed, data in a preset time period before no response occurs in the game is backed up as problem data of the application.
S404, searching the previous backup recovery data;
in this step, by generating a packet name without response or breakdown, it is searched whether the recovery data of the application program has been backed up before.
S405, when the previous backup recovery data is found, recovering the previous backup recovery data, and restarting the application program;
the recovery data backed up before recovery in this step may be: directly deleting the corresponding data storage directory of the application program under the data/data directory, and copying the previously backed up recovery data; the application is then restarted, and if the startup is successful, further recovery to the previously backed up data may be prompted. The prompt information may be prompted in a text manner through a display screen, or may be prompted in an audio manner through a speaker, which is not limited in the present invention.
Wherein, restarting the application program can be realized by the following modes: and calling a method of startActivityForResult through the application program data packet name to start the application default main page.
S406, when the previous backup recovery data is not found or cannot be restarted, deleting the data of the application program, and restarting the application program.
In this step, if the previous backup recovery data is not found; or, when the previously backed-up recovery data is recovered and the application cannot be restarted, the application is restarted after the data of the application is directly deleted. Further, if the starting is successful, the user is prompted to delete the data, and then the application program is started.
The application program data deletion mainly comprises the following steps: data of db files under database databases catalogues and xml files under shared _ prefs catalogues; for db file data under the databases, the data in the table in the database can be directly emptied, and for the data of the xml file under the shared _ prefs directory, the values of child nodes in the xml file can be deleted.
S407, when the data of the application program is deleted and the application program is restarted, the problem data of the backed up application program is restored.
When the data of the application program is deleted and the application program cannot be restarted, restoring the problem data of the application program backed up when no response or breakdown occurs in the application program in the step S403; further, a failure to attempt restart of the application may be prompted.
Based on the above embodiments of the method, the present invention further provides an application detection terminal 5, which may specifically be a mobile terminal including a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation terminal, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
As shown in fig. 5, the application detection terminal 5 includes: a memory 51, a processor 52 and an application detection program stored on the memory and executable on the processor, the application detection program when executed by the processor implementing the steps of:
monitoring whether the application program has no response or crashes;
when the application program has no response or is crashed, searching the backup recovery data before;
and when the recovery data backed up before is found, recovering the recovery data backed up before and restarting the application program.
In one embodiment, after the step of searching for the previously backed-up recovery data when the application fails to respond or crashes, the processor is further configured to execute the application detection program to implement the following steps:
and when the previous backup recovery data is not found or cannot be restarted by recovering the previous backup recovery data, deleting the data of the application program and restarting the application program.
In one embodiment, before the step of monitoring whether the application is unresponsive or crashed, the processor is further configured to execute the application detection program to implement the following steps:
selecting application program data needing to be backed up;
after the monitoring whether the application program has no response or crashes, the method further comprises the following steps:
when the application program has no response or is crashed, backing up problem data of the current application program;
and when the data of the application program is deleted and the application program is restarted and fails, recovering the problem data of the backed up application program.
In one embodiment, in the step of selecting the application data to be backed up, the processor is further configured to execute the application detection program to implement the following steps:
before the terminal system is upgraded or the application program is upgraded, the application program data needing to be backed up is selected according to the upgrade object.
In one embodiment, in the step of monitoring whether the application is in a no-response or crash condition, the processor is further configured to execute the application detection program to implement the following steps:
when receiving an ANR application no-response prompt, determining that the application has no response;
when a CRASH application CRASH prompt is received, it is determined that the application crashes.
Yet another aspect of the present invention provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to perform the steps of:
monitoring whether the application program has no response or crashes;
when the application program has no response or is crashed, searching the backup recovery data before;
and when the recovery data backed up before is found, recovering the recovery data backed up before and restarting the application program.
In one embodiment, after the step of searching for the previously backed up recovery data when the application fails to respond or crashes, the one or more programs are executable by the one or more processors to implement the steps of:
and when the previous backup recovery data is not found or cannot be restarted by recovering the previous backup recovery data, deleting the data of the application program and restarting the application program.
In one embodiment, before the step of monitoring whether the application is unresponsive or crashed, the one or more programs are executable by the one or more processors to perform the steps of:
selecting application program data needing to be backed up;
after the monitoring whether the application program has no response or crashes, the method further comprises the following steps:
when the application program has no response or is crashed, backing up problem data of the current application program;
and when the data of the application program is deleted and the application program is restarted and fails, recovering the problem data of the backed up application program.
In one embodiment, in the step of selecting application data to be backed up, the one or more programs are executable by the one or more processors to implement the steps of:
before the terminal system is upgraded or the application program is upgraded, the application program data needing to be backed up is selected according to the upgrade object.
In one embodiment, in the step of monitoring whether the application program is unresponsive or crashed, the one or more programs are executable by the one or more processors to implement the steps of:
when receiving an ANR application no-response prompt, determining that the application has no response;
when a CRASH application CRASH prompt is received, it is determined that the application crashes.
According to the application program detection method, the terminal and the computer readable storage medium, the situation that no response or breakdown occurs in the application program is monitored, and after the situation occurs, unnecessary redundant data generated when the application program does not respond or breaks down is eliminated by resetting the application program data, so that the application program is ensured to be restarted smoothly, and the problems that the normal use of a user is influenced due to complicated operation caused by reinstallation when the application program does not respond or breaks down and cannot be restarted are solved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (6)

1. An application detection method, comprising:
monitoring whether the application program has no response or crashes;
when the application program has no response or is crashed, searching the backup recovery data before;
when the recovery data backed up before is found, recovering the recovery data backed up before, and restarting the application program;
wherein the method further comprises:
when the recovery data backed up before is not found or cannot restart the application program, deleting the data of the application program and restarting the application program;
before the monitoring whether the application program has no response or crashes, the method further comprises the following steps:
selecting application program data needing to be backed up;
after the monitoring whether the application program has no response or crashes, the method further comprises the following steps:
when the application program has no response or is crashed, backing up problem data of the current application program;
and when the data of the application program is deleted and the application program is restarted and fails, recovering the problem data of the backed up application program.
2. The method of claim 1, wherein selecting the application data to be backed up comprises:
before the terminal system is upgraded or the application program is upgraded, the application program data needing to be backed up is selected according to the upgrade object.
3. The method of any one of claims 1-2, wherein monitoring whether the application fails to respond or crashes comprises:
when receiving an ANR application no-response prompt, determining that the application has no response;
when a CRASH application CRASH prompt is received, it is determined that the application crashes.
4. An application detection terminal, comprising: a memory, a processor, and an application detection program stored on the memory and executable on the processor, the application detection program when executed by the processor implementing the steps of:
monitoring whether the application program has no response or crashes;
when the application program has no response or is crashed, searching the backup recovery data before;
when the recovery data backed up before is found, recovering the recovery data backed up before, and restarting the application program;
wherein, when the application program has no response or crashes, after the step of searching the backup recovery data, the processor is further configured to execute the application program detection program to implement the following steps:
when the recovery data backed up before is not found or cannot restart the application program, deleting the data of the application program and restarting the application program;
before the step of monitoring whether the application program has no response or crashes, the processor is further configured to execute the application program detection program to implement the following steps:
selecting application program data needing to be backed up;
after the monitoring whether the application program has no response or crashes, the method further comprises the following steps:
when the application program has no response or is crashed, backing up problem data of the current application program;
and when the data of the application program is deleted and the application program is restarted and fails, recovering the problem data of the backed up application program.
5. The application detection terminal of claim 4, wherein in the step of selecting the application data to be backed up, the processor is further configured to execute the application detection program to implement the following steps:
before the terminal system is upgraded or the application program is upgraded, the application program data needing to be backed up is selected according to the upgrade object.
6. A computer-readable storage medium, storing one or more programs, the one or more programs being executable by one or more processors to perform the steps of the application detection method as claimed in any one of claims 1 to 3.
CN201710499595.3A 2017-06-27 2017-06-27 Application program detection method, terminal and computer readable storage medium Active CN107357704B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710499595.3A CN107357704B (en) 2017-06-27 2017-06-27 Application program detection method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710499595.3A CN107357704B (en) 2017-06-27 2017-06-27 Application program detection method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107357704A CN107357704A (en) 2017-11-17
CN107357704B true CN107357704B (en) 2021-01-01

Family

ID=60272590

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710499595.3A Active CN107357704B (en) 2017-06-27 2017-06-27 Application program detection method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107357704B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108345518A (en) * 2018-03-12 2018-07-31 张立江 A kind of data recovery system after software crash and its restoration methods
CN109344035A (en) * 2018-09-30 2019-02-15 北京奇虎科技有限公司 A kind of progress control method of application program, device, equipment and storage medium
CN109739672A (en) * 2018-11-23 2019-05-10 惠州Tcl移动通信有限公司 Processing method, computer storage medium and the mobile terminal of application crash
CN109901970B (en) * 2019-02-15 2022-05-06 视联动力信息技术股份有限公司 Method and device for monitoring video network terminal
CN110377458B (en) * 2019-07-26 2023-11-10 拉萨新起点文化传播有限公司 Data recovery method, mobile terminal and computer readable storage medium
CN110764810A (en) * 2019-11-05 2020-02-07 四川虹美智能科技有限公司 Android application upgrading and repairing method and terminal equipment
CN111664543B (en) * 2020-05-25 2022-12-13 海信空调有限公司 Air conditioner and control method thereof
CN113849339B (en) * 2020-06-28 2023-07-11 华为技术有限公司 Method, device and storage medium for restoring running state of application program
CN112866022B (en) * 2021-01-12 2023-06-02 北京小米移动软件有限公司 Method, device and medium for reducing system breakdown times of modem
CN113535475A (en) * 2021-07-05 2021-10-22 浙江中控技术股份有限公司 Configuration object starting method and device, electronic device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9110801B2 (en) * 2009-02-10 2015-08-18 International Business Machines Corporation Resource integrity during partial backout of application updates
CN105487980A (en) * 2015-12-04 2016-04-13 Tcl集团股份有限公司 Method and device for repairing running abnormity of application program

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468478B (en) * 2015-11-26 2019-06-04 北京京东尚科信息技术有限公司 Business datum restoration methods and device after a kind of application crashes
CN105955474B (en) * 2016-04-27 2020-06-09 南京秦淮紫云创益企业服务有限公司 Application evaluation prompting method and mobile terminal
CN106201876B (en) * 2016-07-07 2018-11-23 厦门美图移动科技有限公司 A kind of application testing method, device and mobile terminal
CN106201756B (en) * 2016-07-12 2019-09-06 努比亚技术有限公司 Log acquisition device, mobile terminal and method
CN106776148A (en) * 2016-12-30 2017-05-31 维沃移动通信有限公司 The trial method and mobile terminal of a kind of application program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9110801B2 (en) * 2009-02-10 2015-08-18 International Business Machines Corporation Resource integrity during partial backout of application updates
CN105487980A (en) * 2015-12-04 2016-04-13 Tcl集团股份有限公司 Method and device for repairing running abnormity of application program

Also Published As

Publication number Publication date
CN107357704A (en) 2017-11-17

Similar Documents

Publication Publication Date Title
CN107357704B (en) Application program detection method, terminal and computer readable storage medium
CN108040159B (en) Restart positioning method based on hardware drive, mobile terminal and readable storage medium
CN107330035B (en) Operation log synchronization method in database, mobile terminal and computer readable storage medium
CN109766119B (en) Recovery partition upgrade method, terminal and computer readable storage medium
CN110704217A (en) Memory leak detection method, terminal and computer readable storage medium
CN108121613B (en) Memory page-based restart positioning method, mobile terminal and readable storage medium
CN109472157B (en) Application data storage method, mobile terminal and computer storage medium
CN109002547B (en) Log file storage method, mobile terminal and computer readable storage medium
CN108012031B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN108196968B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN108121681B (en) Hot plug implementation method, terminal and storage medium
CN108052430B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN107766222B (en) Black screen detection method, mobile terminal and computer readable storage medium
CN108052437B (en) Restart positioning method, mobile terminal and computer readable storage medium
CN108089937B (en) Direct memory allocation-based restart positioning method, mobile terminal and storage medium
CN109254972B (en) Offline command word bank updating method, terminal and computer readable storage medium
CN108255631B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN107908492B (en) Black screen detection method, mobile terminal and computer readable storage medium
CN110187934B (en) Application control method, terminal and computer readable storage medium
CN109684132B (en) Data backup method of mobile terminal, mobile terminal and storage medium
CN112347067A (en) Log information management and control method and device and computer readable storage medium
CN108268335B (en) Restart positioning method based on system service, mobile terminal and storage medium
CN108228423B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN108076200B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN107872367B (en) Black screen detection method, mobile terminal and computer readable storage medium

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