[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN107402835B - Application program exception handling method and device, storage medium and mobile terminal - Google Patents

Application program exception handling method and device, storage medium and mobile terminal Download PDF

Info

Publication number
CN107402835B
CN107402835B CN201710612237.9A CN201710612237A CN107402835B CN 107402835 B CN107402835 B CN 107402835B CN 201710612237 A CN201710612237 A CN 201710612237A CN 107402835 B CN107402835 B CN 107402835B
Authority
CN
China
Prior art keywords
application program
log
abnormal
file
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.)
Expired - Fee Related
Application number
CN201710612237.9A
Other languages
Chinese (zh)
Other versions
CN107402835A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710612237.9A priority Critical patent/CN107402835B/en
Publication of CN107402835A publication Critical patent/CN107402835A/en
Application granted granted Critical
Publication of CN107402835B publication Critical patent/CN107402835B/en
Expired - Fee Related 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/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • 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/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0775Content or structure details of the error report, e.g. specific table structure, specific error fields
    • 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/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • 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/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses an application program exception handling method, an application program exception handling device, a storage medium and a mobile terminal. The method comprises the following steps: continuously outputting the log information of the running application program to a cache space of the mobile terminal in the process of running the application program to generate a log cache file; when detecting that an abnormal log generation event is triggered, determining a target application program with an abnormality; and locally generating an abnormal log file of the target application program based on the log cache file. According to the technical scheme provided by the embodiment of the invention, the abnormal log file of the abnormal application program can be obtained locally and timely by the mobile terminal on the premise of not opening a log switch, and the abnormal log file of the abnormal application program which is difficult to reproduce at a low probability can be obtained efficiently and accurately.

Description

Application program exception handling method and device, storage medium and mobile terminal
Technical Field
The embodiment of the invention relates to the technical field of data management, in particular to an application program exception handling method and device, a storage medium and a mobile terminal.
Background
Various application programs are installed in mobile terminals such as mobile phones and the like, the mobile terminals realize corresponding functions by running the application programs, some abnormal conditions are inevitable in the running process of the application programs, and how to acquire abnormal log information of the application programs is taken as a processing basis for the application program abnormity, so that the method becomes an important problem of application program management of the mobile terminals. The related art scheme for performing exception handling on an application program by using log information of the application program has a defect and needs to be improved.
Disclosure of Invention
The embodiment of the invention provides an application program exception handling method and device, a storage medium and a mobile terminal, which can locally and timely acquire a log file of an abnormal application program at the mobile terminal.
In a first aspect, an embodiment of the present invention provides an exception handling method for an application program, including:
continuously outputting the log information of the running application program to a cache space of the mobile terminal in the process of running the application program to generate a log cache file;
when detecting that an abnormal log generation event is triggered, determining a target application program with an abnormality;
and locally generating an abnormal log file of the target application program based on the log cache file.
In a second aspect, an embodiment of the present invention provides an exception handling apparatus for an application program, including:
the log cache file generation module is used for continuously outputting the log information of the running application program to the cache space of the mobile terminal in the process of running the application program to generate a log cache file;
the target application program determining module is used for determining the target application program with the abnormity when the abnormity log generation event is detected to be triggered;
and the abnormal log file generation module is used for locally generating an abnormal log file of the target application program based on the log cache file.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the exception handling method of the application program provided in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a mobile terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor, when executing, implements the exception handling method for an application program as provided in the first aspect.
According to the embodiment of the invention, the log information of the running application program is continuously output to the cache space of the mobile terminal in the process of running the application program to generate the log cache file, when the abnormal log generation event is detected to be triggered, the abnormal target application program is determined, the abnormal log file of the target application program is locally generated based on the log cache file, and the log file of the abnormal application program can be locally and timely acquired at the mobile terminal.
Drawings
FIG. 1 is a flow chart of a method for exception handling for an application provided in the prior art;
FIG. 2 is a flowchart of an exception handling method for an application according to an embodiment of the present invention;
FIG. 3 is a flowchart of an exception handling method for an application according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an interactive interface for generating a log file according to an embodiment of the present invention;
FIG. 5 is a flowchart of an exception handling method for an application according to an embodiment of the present invention;
FIG. 6 is a flowchart of an exception handling method for an application according to an embodiment of the present invention;
FIG. 7 is a flowchart of an exception handling method for an application according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of an exception handling apparatus for an application according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention are described in further detail below with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Fig. 1 is a flowchart illustrating an exception handling method for an application program in the prior art, where as shown in fig. 1, the exception handling method for an application program in the prior art includes the following steps:
and step 10, starting.
And 11, detecting an operation instruction which is acted on the touch screen by a user and is used for opening a log switch. For example, the set information is input through the touch screen to enter an engineering mode interface, and the log information is subsequently output to the Cache space.
And step 12, providing a loader log access interface for the user by the system kernel.
And step 13, calling a logger C/C + + log interface provided by the kernel.
And step 14, calling a logger java log interface provided by the kernel. The android system defines a Log interface in an application framework layer, and exemplarily, the path of the Log interface is as follows, framework/base/core/java/android/util/Log.
And step 15, outputting the Log information of each application program (application) to a cache space through a Log interface.
And step 16, detecting a log unloading operation instruction acted by the user in the touch screen log switch control. For example, a log dump command entered by a user in a touchscreen engineering mode interface is detected.
And step 17, storing the log information of all the applications in a cache space.
And step 18, ending.
As described above, according to the method provided in the prior art, in the mobile terminal, the log switch may be turned on to obtain the log information of the mobile terminal, for example, the setting information is input through the dial pad to enter the engineering mode, and the corresponding command is input in the engineering mode to obtain the log information of the mobile terminal, which is obviously not convenient and intuitive enough, and the method generally waits for the abnormal recurrence after the application is abnormal to obtain the abnormal log information, while the user does not turn on the log switch in the process of running the application using the mobile terminal in general, and cannot obtain the effective log information for the abnormal problem of the application which is not easily reproducible at low probability.
In addition, the following processing methods also exist in the prior art: all running application programs are monitored, the abnormity of the application programs in the running process is monitored, corresponding log information is obtained and uploaded to a server, and an engineer obtains the log information through a log interaction interface displayed by the server to perform abnormity analysis. The processing mode needs to monitor each running application program, is high in cost, and cannot directly obtain the log information of the abnormal application program locally.
Fig. 2 is a flowchart of an exception handling method for an application according to an embodiment of the present invention, where the method of this embodiment may be performed by an exception handling apparatus for an application, the apparatus may be implemented by hardware and/or software, and the apparatus may be disposed inside a mobile terminal as a part of the mobile terminal.
As shown in fig. 2, the exception handling method for an application program provided in this embodiment includes the following steps:
step 101, continuously outputting the log information of the running application program to the cache space of the mobile terminal in the process of running the application program, and generating a log cache file.
The running application programs comprise foreground application programs and background application programs, the application programs comprise mobile terminal system preinstalled application programs, such as 'information', 'telephone', 'setting' or 'ring tone', and the like, and further comprise third-party application programs, such as 'WeChat', 'Paibao', 'Tianmao' or 'Aiqiyi', and the like, which are installed by a user subsequently.
The log switch of the mobile terminal may be in an off state prior to this step, i.e. without entering the engineering mode.
The number of the running application programs is one or more, and a plurality of log cache files can be generated according to the running time, wherein one log cache file may have log information of a plurality of application programs, and one application program may have corresponding log information in a plurality of log cache files.
And 102, when the abnormal log generation event is triggered, determining the target application program with the abnormality.
The event of generating the abnormal log may be triggered by detecting an abnormal log generation instruction of a user acting on the mobile terminal, or detecting that process information of one or more target application programs meets a set abnormal judgment condition.
The exception may be an application program flashing back, a low response speed of the application program, an application icon overlapping, or a setting option being unable to be set or being set with an error, or the like.
And 103, locally generating an abnormal log file of the target application program based on the log cache file.
And screening all log information corresponding to the target application program from the log cache file, and locally generating an abnormal log file of the target application program in the mobile terminal so as to facilitate a user to obtain the abnormal log file from the local. For example, the user may obtain the exception log file from the local site and view the exception log file, and may query, via a network, such as a forum, a post, or a microblog, the exception log file for the reason and the solution of the exception and the exception generation actually existing in the target application program.
According to the method provided by the embodiment, the log information of the running application program is continuously output to the cache space of the mobile terminal in the process of running the application program to generate the log cache file, when the abnormal log generation event is triggered, the target application program with the abnormality is determined, and the abnormal log file of the target application program is locally generated based on the log cache file.
On the basis of the above embodiment, after generating the exception log file of the target application program, the following steps may be further included: and transferring the abnormal log file to a file management directory of the mobile terminal.
The abnormal log file can be transferred to a directory of a target application program in a Backup folder in file management of the mobile terminal.
On the basis of the above embodiment, after generating the exception log file of the target application program, the following steps may be further included: if the cache space is full, removing the log cache file which is generated in the cache space and the time of which meets the set condition, otherwise, not removing the log cache file in the cache space.
After the abnormal log file of the target application program is generated and stored, if the cache space is not full, the cache space is not cleared, and the log information of other application programs is prevented from being cleared. If the cache space is full, the log cache file with early generation time in the cache space or a part of log information in the log cache file is eliminated.
On the basis of the above embodiment, the method may further include the following steps: and deleting the abnormal log files in the file management directory according to the unloading time of the abnormal log files. The expired log files can be automatically deleted according to the unloading time, for example, only three abnormal log files which are recently unloaded at present are saved.
On the basis of the foregoing embodiment, the determining, in step 102, that the target application program has the exception may include: determining an abnormal target application program, and acquiring an application identifier of the target application program; the step 103 may include: and screening out the log information corresponding to the application identifier from the log cache file through a preset log information acquisition interface, and generating an abnormal log file of the target application program. The preset log information obtaining Interface is a pre-written Application Programming Interface (API) for obtaining an abnormal log file of a specified Application from a log cache file. The application identifier may be an application package name, for example, the package name of the desktop application is com. A plurality of log cache files may exist in the cache space, log information of a plurality of application programs may exist in one log cache file, and all log information corresponding to the application identifier may be screened from the log cache files in the cache space according to the application identifier to generate an abnormal log file of the target application program.
Fig. 3 is a flowchart of an exception handling method for another application according to an embodiment of the present invention. As shown in fig. 3, the method provided by this embodiment includes the following steps:
step 201, continuously outputting the log information of the running application program to the cache space of the mobile terminal in the process of running the application program, and generating a log cache file.
Step 202, when an abnormal log generation instruction acted on the mobile terminal by a user is detected, determining a target application program with an abnormality according to the abnormal log generation instruction.
If the user finds that one or more application programs are abnormal in the running process, the abnormal log of one or more application programs can be backed up by clicking a backup option or a key on the mobile terminal, and the abnormal target application program is determined by clicking the backup option or the key by the user. For example, if the user finds that the currently running WeChat is flashed back, the user may open a log backup application program for executing the method provided by the embodiment of the present invention, and after the application program is opened, the mobile terminal displays a backup interactive interface, and when the mobile terminal detects a click instruction of a backup option applied to the interactive interface by the user, it determines that the one or more application programs are the target application program selected by the user and having an abnormality.
Illustratively, fig. 4 is a schematic diagram of an interactive interface for generating a log file according to an embodiment of the present invention. As shown in fig. 4, after the user finds that the wechat is abnormal in flash back, the user clicks the log backup application icon on the desktop, the mobile terminal displays the recovery and backup interactive interface M shown in fig. 4, clicks the "new backup" option a, displays a list of various applications (not shown in the figure) to be newly backed up, and after the user selects the wechat application, the user performs subsequent generation operation of the wechat abnormal log file.
And 203, locally generating an abnormal log file of the target application program based on the log cache file.
As shown in fig. 4, after a click command of the user on the "new backup" option a is detected and the WeChat is determined, an abnormal log file of the WeChat is locally generated based on the log cache file.
Among them, an option B of "moving the mobile phone" shown in fig. 4 is a backup operation performed when the application backup in the mobile terminal is migrated or copied to another device. The mobile terminal will make different responses when detecting the click command of the user acting on the 'new backup' option and the 'mobile phone moving' option. And if the click command of the user acting on the 'mobile phone moving' option is detected, the operation of generating the abnormal log file of the target application program is not executed, so that the power consumption and unnecessary trouble of the user caused by the operation of screening log information by the background to generate the abnormal log file are avoided. And if a click instruction of the user acting on the 'new backup' option is detected, executing the operation of generating the abnormal log file of the target application program.
The step 202 may further include obtaining an application identifier of the target application program, and the step 203 may include: and screening out the log information corresponding to the application identifier from the log cache file through a preset log information acquisition interface, and generating an abnormal log file of the target application program. The application identification may be an application package name.
And step 204, transferring the abnormal log file to a file management directory of the mobile terminal.
According to the method provided by the embodiment of the invention, a user participates in the generation of the abnormal log file, the backup operation of the abnormal log is carried out when the user finds that the running application program is abnormal, the mobile terminal determines the abnormal target application program when detecting the abnormal log generation instruction acted on the mobile terminal by the user, the abnormal log file of the target application program is locally generated based on the log cache file in the cache space, and the abnormal log file of the abnormal application program can be accurately and timely acquired when the application program is abnormal.
Fig. 5 is a flowchart of an exception handling method for an application according to another embodiment of the present invention. As shown in fig. 5, the exception handling method for an application program provided in this embodiment includes the following steps:
step 301, continuously outputting the log information of the running application program to the cache space of the mobile terminal in the process of running the application program, and generating a log cache file.
Step 302, when it is detected that the current process information meets the set abnormality judgment condition, determining that the application program corresponding to the current process information is the abnormal target application program.
The Process information includes a Process name and a Process Identifier (PID) corresponding to the Process name. Whether the process is restarted or not can be judged according to the process information, and the restarting times of the process in the set time are recorded; and when the restart times is greater than a set threshold, determining that the current process meets a set abnormal judgment condition.
Whether the PID corresponding to the process name of the current process information is the same as the PID corresponding to the process name read last time can be judged according to the process information recorded in the mobile terminal, and if not, the process is determined to be restarted.
The process information may also include memory growth information for the process. Correspondingly, when the increment value of the memory occupied by the current process in the preset time is larger than the set increment threshold, the current process is determined to meet the set abnormal judgment condition. The memory growth information of the process can be acquired from a server or locally. Generally, the memory occupied by the application program during running is fixed, so that the memory occupied by the application program during running is within a stable range for a period of time. And determining that the application program is abnormal in operation when the increase value of the memory occupied by the application program in the preset time is larger than the set increase threshold value.
And 303, locally generating an abnormal log file of the target application program based on the log cache file.
The step 302 may further include obtaining an application identifier of the target application program, and the step 303 may include: and screening out the log information corresponding to the application identifier from the log cache file through a preset log information acquisition interface, and generating an abnormal log file of the target application program. The application identification may be an application package name. Wherein the application package name may be the same as a process name of a corresponding application program.
And step 304, transferring the abnormal log file to a file management directory of the mobile terminal.
According to the method provided by the embodiment, when the mobile terminal detects that the application program is abnormal, the abnormal log file of the abnormal target application program is locally generated based on the log cache file in the cache space, and the abnormal log file of the abnormal application program can be timely and automatically acquired locally when the application program is abnormal.
For convenience of understanding, the following uses the Android system as an example, and a brief description is made on the exception handling process of the application program based on the Android system framework.
As shown in fig. 6, the exception handling method for an application program provided in this embodiment includes the following steps:
and step 20, starting.
And step 21, detecting an operation instruction which is acted on the touch screen by a user and is used for backing up the target application program log, wherein the current log switch is in a closed state. For example, the user acts on a touch command to restore the "new backup" option under the backup and restore application.
And step 22, providing a loader log access interface for the user by the system kernel.
And step 23, calling a logger C/C + + log interface provided by the kernel.
And 24, calling a logger java log interface provided by the kernel. The android system defines a Log interface in an application framework layer, and exemplarily, the path of the Log interface is as follows, framework/base/core/java/android/util/Log.
And 25, outputting the Log information of each application program (application) to a cache space through a Log interface.
And step 26, screening the log information of the target application program from the cache space containing all the application log information, and transferring to a file management Backup file.
According to the method provided by the embodiment, when a user finds that the specified application program is abnormal, the recovery and backup application program provided by the embodiment is opened, so that local backup of abnormal log information of the specified application program can be realized, the log generation and dump commands do not need to be input again in the engineering mode, the acquisition method of the abnormal log of the application program is simple, convenient and intuitive, the abnormal log file of the application program can be timely and accurately acquired when the application program is abnormal, and the abnormal reproduction is not needed.
And step 27, ending.
Fig. 7 is a flowchart of an exception handling method for another application according to an embodiment of the present invention. As shown in fig. 7, the exception handling method for an application program provided in this embodiment includes the following steps:
step 401, continuously outputting the log information of the running application program to the cache space of the mobile terminal in the process of running the application program, and generating a log cache file.
Step 402, when detecting an abnormal log generation instruction acted on the mobile terminal by a user, determining a target application program with an abnormality according to the abnormal log generation instruction.
And step 403, acquiring the application identifier of the target application program.
And step 404, screening out log information corresponding to the application identifier from the log cache file through a preset log information acquisition interface, and generating an abnormal log file of the target application program.
And 405, transferring the abnormal log file to a file management directory of the mobile terminal.
Step 406, determining whether the cache space is full, if so, performing step 407, otherwise, performing step 408.
And 407, clearing the log cache file which is generated in the cache space and has time meeting set conditions.
Step 408, not clearing the log cache file in the cache space.
The method provided by the embodiment can acquire the abnormal log file of the abnormal application program locally and timely at the mobile terminal, and can efficiently and accurately acquire the abnormal log file of the abnormal application program which is difficult to reproduce at a low probability.
Fig. 8 is a schematic structural diagram of an exception handling apparatus for an application according to an embodiment of the present invention, where the exception handling apparatus may be implemented by software and/or hardware and is integrated in a mobile terminal. As shown in fig. 8, the apparatus includes a log cache file generating module 51, a target application determining module 52, and an abnormality log file generating module 53.
The log cache file generating module 51 is configured to continuously output log information of an application program to be executed to a cache space of the mobile terminal in a process of executing the application program, and generate a log cache file;
the target application program determining module 52 is configured to determine a target application program in which an exception occurs when detecting that an exception log generation event is triggered;
the abnormal log file generating module 53 is configured to locally generate an abnormal log file of the target application program based on the log cache file.
According to the device provided by the embodiment, the log information of the running application program is continuously output to the cache space of the mobile terminal in the process of running the application program to generate the log cache file, when the abnormal log generation event is triggered, the target application program with the abnormality is determined, and the abnormal log file of the target application program is locally generated based on the log cache file.
On the basis of the foregoing embodiment, the target application determination module is specifically configured to:
when an abnormal log generation instruction acted on the mobile terminal by a user is detected, determining an abnormal target application program according to the abnormal log generation instruction; or,
when detecting that the current process information meets the set abnormal judgment condition, determining that the application program corresponding to the current process information is the abnormal target application program.
On the basis of the above embodiment, the determining, by the target application determining module, the target application in which the exception has occurred includes:
determining an abnormal target application program, and acquiring an application identifier of the target application program;
the abnormal log file generation module is specifically configured to:
and screening out the log information corresponding to the application identifier from the log cache file through a preset log information acquisition interface, and generating an abnormal log file of the target application program.
On the basis of the above embodiment, the apparatus further includes:
and the abnormal log file transferring module is used for transferring the abnormal log file to a file management directory of the mobile terminal after the abnormal log file of the target application program is generated.
On the basis of the above embodiment, the apparatus further includes:
and the abnormal log file deleting module is used for deleting the abnormal log files in the file management directory according to the unloading time of the abnormal log files.
On the basis of the above embodiment, the apparatus further includes:
and the log cache file clearing module is used for clearing the log cache file generated in the cache space and meeting the set condition in time if the cache space is full after the abnormal log file of the target application program is generated, and otherwise, not clearing the log cache file in the cache space.
On the basis of the above embodiment, the application programs include native application programs and/or third party application programs.
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for exception handling for an application program, the method including: continuously outputting the log information of the running application program to a cache space of the mobile terminal in the process of running the application program to generate a log cache file; when detecting that an abnormal log generation event is triggered, determining a target application program with an abnormality; and locally generating an abnormal log file of the target application program based on the log cache file.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the above-mentioned exception handling operation of the application program, and may also perform related operations in the exception handling method of the application program provided by any embodiment of the present invention.
The embodiment of the invention provides a mobile terminal, which can comprise an exception handling device of an application program provided by any embodiment of the invention. Fig. 9 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention, and as shown in fig. 9, the mobile terminal may include: a memory 601, a Central Processing Unit (CPU) 602 (also called a processor, hereinafter referred to as CPU), and the memory 601, configured to store executable program codes; the processor 602 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 601, for performing: continuously outputting the log information of the running application program to a cache space of the mobile terminal in the process of running the application program to generate a log cache file; when detecting that an abnormal log generation event is triggered, determining a target application program with an abnormality; and locally generating an abnormal log file of the target application program based on the log cache file.
The mobile terminal further includes: peripheral interfaces 603, RF (Radio Frequency) circuitry 605, audio circuitry 606, speakers 611, power management chip 608, input/output (I/O) subsystem 609, touch screen 612, other input/control devices 610, and external ports 604, which communicate via one or more communication buses or signal lines 607.
It should be understood that the illustrated mobile terminal 600 is merely one example of a mobile terminal and that the mobile terminal 600 may have more or fewer components than shown, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes in detail a mobile terminal for handling application program exception provided in this embodiment, where the mobile terminal is a mobile phone as an example.
A memory 601, the memory 601 being accessible by the CPU602, the peripheral interface 603, and the like, the memory 601 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
A peripheral interface 603, said peripheral interface 603 may connect input and output peripherals of the device to the CPU502 and the memory 601.
An I/O subsystem 609, the I/O subsystem 609 may connect input and output peripherals on the device, such as a touch screen 612 and other input/control devices 610, to the peripheral interface 603. The I/O subsystem 609 may include a display controller 6091 and one or more input controllers 6092 for controlling other input/control devices 610. Where one or more input controllers 6092 receive electrical signals from or transmit electrical signals to other input/control devices 610, the other input/control devices 610 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is noted that the input controller 6092 may be connected to any one of: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
A touch screen 612, which touch screen 612 is an input interface and an output interface between the user terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like.
The display controller 6091 in the I/O subsystem 609 receives electrical signals from the touch screen 612 or transmits electrical signals to the touch screen 612. The touch screen 612 detects a contact on the touch screen, and the display controller 6091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 612, that is, to implement a human-computer interaction, where the user interface object displayed on the touch screen 612 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 605 is mainly used to establish communication between the mobile phone and the wireless network (i.e., network side), and implement data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving short messages, e-mails, etc. In particular, RF circuitry 605 receives and transmits RF signals, also referred to as electromagnetic signals, through which RF circuitry 605 converts electrical signals to or from electromagnetic signals and communicates with a communication network and other devices. RF circuitry 605 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC (CODEC) chipset, a Subscriber Identity Module (SIM), and so forth.
The audio circuit 606 is mainly used to receive audio data from the peripheral interface 603, convert the audio data into an electric signal, and transmit the electric signal to the speaker 611.
The speaker 611 is used to convert the voice signal received by the handset from the wireless network through the RF circuit 605 into sound and play the sound to the user.
And a power management chip 608 for supplying power and managing power to the hardware connected to the CPU602, the I/O subsystem, and the peripheral interface 603.
The mobile terminal provided by the embodiment of the invention generates a log cache file by continuously outputting the log information of the running application program to a cache space of the mobile terminal in the process of running the application program, determines a target application program with an abnormality when an abnormal log generation event is triggered, and locally generates an abnormal log file of the target application program based on the log cache file.
The foregoing is considered as illustrative of the preferred embodiments of the invention and technical principles employed. The present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in more detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the claims.

Claims (6)

1. An exception handling method for an application program, comprising:
continuously outputting the log information of the running application program to a cache space of the mobile terminal in the process of running the application program to generate a log cache file;
when detecting that an abnormal log generation event is triggered, determining a target application program with an abnormality;
screening all log information corresponding to the target application program from the log cache file, and locally generating an abnormal log file of the target application program;
transferring the abnormal log file to a file management directory of the mobile terminal;
according to the unloading time of the abnormal log file, deleting the abnormal log file in the file management directory;
wherein the exception log generation event being triggered comprises: detecting an abnormal log generation instruction acted on the mobile terminal by a user;
when the abnormal log generation event is detected to be triggered, the determining of the target application program with the abnormality comprises the following steps:
when an abnormal log generation instruction acted on the mobile terminal by a user is detected, determining an abnormal target application program according to the abnormal log generation instruction;
the method for determining the abnormal target application program comprises the following steps:
determining an abnormal target application program, and acquiring an application identifier of the target application program;
the screening out all log information corresponding to the target application program from the log cache file, and the locally generating an abnormal log file of the target application program comprises:
and screening out the log information corresponding to the application identifier from the log cache file through a preset log information acquisition interface, and generating an abnormal log file of the target application program.
2. The method of claim 1, further comprising, after generating the exception log file for the target application:
if the cache space is full, removing the log cache file which is generated in the cache space and the time of which meets the set condition, otherwise, not removing the log cache file in the cache space.
3. The method of claim 1, wherein the application comprises a native application and/or a third party application.
4. An exception handling apparatus for an application program, comprising:
the log cache file generation module is used for continuously outputting the log information of the running application program to the cache space of the mobile terminal in the process of running the application program to generate a log cache file;
the target application program determining module is used for determining the target application program with the abnormity when the abnormity log generation event is detected to be triggered;
the abnormal log file generation module is used for screening all log information corresponding to the target application program from the log cache file and locally generating an abnormal log file of the target application program;
the abnormal log file transferring module is used for transferring the abnormal log file to a file management directory of the mobile terminal after the abnormal log file of the target application program is generated;
the abnormal log file deleting module is used for deleting the abnormal log files in the file management directory according to the unloading time of the abnormal log files;
wherein the exception log generation event being triggered comprises: detecting an abnormal log generation instruction acted on the mobile terminal by a user;
the target application determination module is specifically configured to:
when an abnormal log generation instruction acted on the mobile terminal by a user is detected, determining an abnormal target application program according to the abnormal log generation instruction;
the target application program determining module determines the abnormal target application program to comprise the following steps:
determining an abnormal target application program, and acquiring an application identifier of the target application program;
the abnormal log file generation module is specifically configured to:
and screening out the log information corresponding to the application identifier from the log cache file through a preset log information acquisition interface, and generating an abnormal log file of the target application program.
5. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out an exception handling method for an application program according to any one of claims 1 to 3.
6. A mobile terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the exception handling method of the application program according to any one of claims 1-3 when executing the computer program.
CN201710612237.9A 2017-07-25 2017-07-25 Application program exception handling method and device, storage medium and mobile terminal Expired - Fee Related CN107402835B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710612237.9A CN107402835B (en) 2017-07-25 2017-07-25 Application program exception handling method and device, storage medium and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710612237.9A CN107402835B (en) 2017-07-25 2017-07-25 Application program exception handling method and device, storage medium and mobile terminal

Publications (2)

Publication Number Publication Date
CN107402835A CN107402835A (en) 2017-11-28
CN107402835B true CN107402835B (en) 2021-04-06

Family

ID=60402281

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710612237.9A Expired - Fee Related CN107402835B (en) 2017-07-25 2017-07-25 Application program exception handling method and device, storage medium and mobile terminal

Country Status (1)

Country Link
CN (1) CN107402835B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090173A (en) * 2017-12-14 2018-05-29 广东欧珀移动通信有限公司 Delet method, device, terminal and the storage medium of record screen file
CN107908802A (en) * 2017-12-26 2018-04-13 广东欧珀移动通信有限公司 log processing method, device, terminal device and storage medium
CN108196969A (en) * 2017-12-28 2018-06-22 努比亚技术有限公司 Restart monitoring and localization method, mobile terminal and computer readable storage medium
CN108363659B (en) * 2018-02-23 2021-06-29 青岛海信移动通信技术股份有限公司 Method and device for processing abnormity of electronic equipment
CN109782982A (en) * 2018-12-29 2019-05-21 北京奇安信科技有限公司 A kind of processing method and terminal reading log
CN111381943B (en) * 2018-12-29 2024-03-12 深圳Tcl数字技术有限公司 Application program flash-back processing method, intelligent terminal and storage medium
CN110321271B (en) * 2019-06-03 2022-05-31 平安科技(深圳)有限公司 Method, device, equipment and storage medium for acquiring abnormal information based on Monkey
CN110764977B (en) * 2019-09-27 2023-11-10 赛诺贝斯(北京)营销技术股份有限公司 Alarm method and device for realizing system safety
CN112306826A (en) * 2020-02-24 2021-02-02 北京字节跳动网络技术有限公司 Method and apparatus for processing information for terminal
CN112783731B (en) * 2021-01-29 2023-09-05 北京百度网讯科技有限公司 Abnormal device detection method, device and storage medium
CN113407415A (en) * 2021-06-28 2021-09-17 四川虹美智能科技有限公司 Log management method and device of intelligent terminal
CN113867999B (en) * 2021-08-30 2022-09-30 荣耀终端有限公司 Application exception handling method, terminal and computer readable storage medium
CN113835961B (en) * 2021-09-23 2023-05-16 中国联合网络通信集团有限公司 Alarm information monitoring method, device, server and storage medium
CN113608990B (en) * 2021-10-08 2022-02-01 上海豪承信息技术有限公司 Terminal performance detection method, device and storage medium
CN114185502B (en) * 2021-12-15 2024-05-14 平安科技(深圳)有限公司 Log printing method, device, equipment and medium based on production line environment
CN115220648B (en) * 2022-01-26 2024-07-26 广州汽车集团股份有限公司 Data writing flow statistics method and device and electronic equipment
CN116701134B (en) * 2022-10-14 2024-05-17 荣耀终端有限公司 Data processing method and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6078930A (en) * 1997-02-28 2000-06-20 Oracle Corporation Multi-node fault-tolerant timestamp generation
US6230246B1 (en) * 1998-01-30 2001-05-08 Compaq Computer Corporation Non-intrusive crash consistent copying in distributed storage systems without client cooperation
CN104253704A (en) * 2013-06-28 2014-12-31 腾讯科技(深圳)有限公司 Terminal log reporting method, device and system
CN106201756A (en) * 2016-07-12 2016-12-07 努比亚技术有限公司 Log acquisition device, mobile terminal and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572413B (en) * 2013-10-29 2017-11-24 上海斐讯数据通信技术有限公司 A kind of electronic equipment preserves the method and electronic equipment of system journal
CN105204969B (en) * 2014-06-30 2018-10-30 腾讯科技(深圳)有限公司 Abnormal log processing method and abnormal log processing unit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6078930A (en) * 1997-02-28 2000-06-20 Oracle Corporation Multi-node fault-tolerant timestamp generation
US6230246B1 (en) * 1998-01-30 2001-05-08 Compaq Computer Corporation Non-intrusive crash consistent copying in distributed storage systems without client cooperation
CN104253704A (en) * 2013-06-28 2014-12-31 腾讯科技(深圳)有限公司 Terminal log reporting method, device and system
CN106201756A (en) * 2016-07-12 2016-12-07 努比亚技术有限公司 Log acquisition device, mobile terminal and method

Also Published As

Publication number Publication date
CN107402835A (en) 2017-11-28

Similar Documents

Publication Publication Date Title
CN107402835B (en) Application program exception handling method and device, storage medium and mobile terminal
WO2019228080A1 (en) Method and apparatus for establishing application prediction model, storage medium and terminal
EP3575961B1 (en) Method and apparatus for updating application prediction model, storage medium, and terminal
CN109508198B (en) Application program installation method and device, storage medium and terminal
US9542172B2 (en) Automatic updating of applications
CN108038231B (en) Log processing method and device, terminal equipment and storage medium
CN108153647B (en) Log processing method and device, terminal equipment and storage medium
CN108804153B (en) Application program preloading method and device, storage medium and terminal
CN106357921B (en) A kind of data sharing method of application, device and mobile terminal
CN109408465B (en) File attribution information recording method, device, storage medium and terminal
CN108874466B (en) Control calling method, electronic device and computer readable storage medium
CN109936481A (en) Principal and subordinate's server switching method, device, electronic equipment and storage medium
CN107844342B (en) Control method and device for keeping application program alive, storage medium and mobile terminal
CN108710515B (en) Application preloading method and device, storage medium and terminal
CN107026933B (en) Multi-open application message management method and device and intelligent terminal
JP2017510008A (en) Firmware restoration method, apparatus, terminal, program, and recording medium
CN105208015A (en) Application multi-account login processing method and device and terminal device
CN112148579B (en) User interface testing method and device
US11082480B2 (en) File information system management system and method
CN107844341B (en) Process starting control method and device, storage medium and mobile terminal
CN107609120B (en) Log information reporting method and device, storage medium, ADSP and terminal
CN106648737B (en) A kind of control method of application, device and mobile terminal
CN109491825B (en) Method, device, storage medium and terminal for positioning abnormal starting problem
CN109983428A (en) A kind of operating method and device of application
CN106776847B (en) Method and device for deleting media file and mobile terminal

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
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210406

CF01 Termination of patent right due to non-payment of annual fee