CN108052431A - Terminal program exception closing information processing method, device, terminal - Google Patents
Terminal program exception closing information processing method, device, terminal Download PDFInfo
- Publication number
- CN108052431A CN108052431A CN201711298086.0A CN201711298086A CN108052431A CN 108052431 A CN108052431 A CN 108052431A CN 201711298086 A CN201711298086 A CN 201711298086A CN 108052431 A CN108052431 A CN 108052431A
- Authority
- CN
- China
- Prior art keywords
- exception
- information
- stack information
- terminal
- closing
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3051—Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3065—Monitoring arrangements determined by the means or processing involved in reporting the monitored data
Abstract
The present invention provides a kind of terminal program exception closing information processing method, device and terminal, starts monitoring interface when target program starts;Stack information is recorded in real time when the target program is run and is stored in local;When the monitoring interface monitoring to target program is closed extremely, exception stack information is obtained;According to process of the target program described in the exception stack Information recovering when closing extremely;The exception stack information is removed after being successfully recovered, records stack information in real time again.According to process of the exception stack Information recovering target program when closing extremely, it can cause state when target program backs within abnormal close, improve user experience and program safety.
Description
Technical field
The present invention relates to technical field of information processing, and specifically, the present invention relates to a kind of terminal programs to close letter extremely
Cease processing method, device and terminal.
Background technology
Application program in the process of running, occurs abnormal and can not normally perform if running into the reasons such as program execution error
Or when exiting, client will be caused to collapse.After application exception is closed or is collapsed, a part of application program has automatic weight
The function of newly starting, but application program can only realize restarting, when application program can not return to abnormal closing or collapse
State, this is inconvenient for a user, such as application crash when paying the bill, and can may also cause payment wrong
By mistake the problem of.
In addition, application program has abnormal or collapse to report program, that is, when application program is abnormal or is collapsed
When, application exception or crash info can be collected, is then transferred to server, by developer to application exception
Or crash info is analyzed.But it if when the application program of multiple terminals is based on very same reason collapse, will cause
Application exception or crash info repeat to report by multiple terminals so that server needs to repeat to store and analysis, using journey
Sequence is abnormal or collapse analysis efficiency is low.
The content of the invention
The purpose of the present invention is intended at least solve one of above-mentioned technological deficiency, and particularly application program can not return to
The technological deficiency of state when abnormal closing or collapse.
The present invention provides a kind of terminal program exception closing information processing method, and applied to terminal, the described method includes such as
Lower step:
Start monitoring interface when target program starts;
Stack information is recorded in real time when the target program is run and is stored in local;
When the monitoring interface monitoring to target program is closed extremely, exception stack information is obtained;
According to process of the target program described in the exception stack Information recovering when closing extremely;
The exception stack information is removed after being successfully recovered, records stack information in real time again.
In one of the embodiments, step is further included:
Recover failure after again according to the exception stack Information recovering target program extremely close when process,
If the frequency of failure is more than preset times, it is no longer attempt to recover process of the target program when closing extremely.
In one of the embodiments, applied to Android system, the monitoring interface is
UncaughtExceptionHandler methods.
In one of the embodiments, applied to Android system;
Stack information is recorded by Application.ActivityLifecycleCallbacks methods in real time and is stored
In local.
In one of the embodiments, applied to Android system, abnormal heap is obtained by getStackTraceInfo methods
Stack information.
In one of the embodiments, step is further included:
The first summary info will be generated comprising the error information of the exception stack information;
First summary info is uploaded onto the server, for server by first summary info with it is stored
Abnormal summary info of closing is compared;
The feedback information of server feedback is received, if receiving the server feedback feedback information that it fails to match, on
The exception stack information is passed to server.
In one of the embodiments, described report an error also has been abandoned before the error information being generated the first summary info
End message in information.
In one of the embodiments, if being not received by the server feedback feedback that it fails to match in preset time
Information then uploads the exception stack information to server.
In one of the embodiments, if receiving the feedback information of the successful match of server feedback, abandon uploading
The exception stack information is to server.
In one of the embodiments, if receiving the feedback information of the solution prompting of server feedback, shown to user
Show the solution prompting.
In one of the embodiments, it is automatic to upgrade if receiving the feedback information upgraded automatically of server feedback
The target program.
The present invention also provides a kind of terminal program exception closing information processing unit, applied to terminal, including:
Monitoring module, for starting monitoring interface when target program starts;
Logging modle, for recording stack information in real time when the target program is run and being stored in local;
Acquisition module, for when the monitoring interface monitoring to target program is closed extremely, obtaining exception stack information;
Recovery module, for process of the target program when closing extremely according to the exception stack Information recovering;
The recovery module removes the exception stack information after being successfully recovered, the logging modle records heap in real time again
Stack information.
In one of the embodiments, the recovery module is additionally operable to:
Recover failure after again according to the exception stack Information recovering target program extremely close when process,
If the frequency of failure is more than preset times, it is no longer attempt to recover process of the target program when closing extremely.
In one of the embodiments, applied to Android system, the monitoring interface is
UncaughtExceptionHandler methods.
In one of the embodiments, applied to Android system;
The logging modle records heap in real time by Application.ActivityLifecycleCallbacks methods
Stack information is simultaneously stored in local.
In one of the embodiments, applied to Android system, the acquisition module passes through getStackTraceInfo side
Method obtains exception stack information.
In one of the embodiments, further include:
Generation module generates the first summary info for that will include the error information of the exception stack information;
Uploading module, for first summary info to be uploaded onto the server, so that server is made a summary described first
Information is compared with stored abnormal summary info of closing;
Receiving module, for receiving the feedback information of server feedback, if receive server feedback it fails to match
Feedback information, then uploading module upload the exception stack information to server.
In one of the embodiments, the generation module is also lost before the error information is generated the first summary info
The end message in the error information is abandoned.
In one of the embodiments, if the receiving module is not received by of server feedback in preset time
Feedback information with failure, then the uploading module upload the exception stack information to server.
In one of the embodiments, if the receiving module receives the feedback letter of the successful match of server feedback
Breath, then the uploading module abandons uploading the exception stack information to server.
In one of the embodiments, reminding module is further included;If the receiving module receives the solution of server feedback
The feedback information certainly prompted, then the reminding module to user show it is described solve prompt.
In one of the embodiments, upgraded module is further included;If the receiving module receives oneself of server feedback
The feedback information of upgrading is moved, then the upgraded module upgrades the target program automatically.
The present invention also provides a kind of terminal, including:
Touch-sensitive display;
One or more processors;
Memory;
One or more application program, wherein one or more of application programs are stored in the memory and quilt
It is configured to be performed by one or more of processors, one or more of programs are configured to:It performs according to any of the above-described
Terminal program exception closing information processing method described in item embodiment.
Above-mentioned terminal program exception closing information processing method, device and terminal starts prison when target program starts
Control interface;Stack information is recorded in real time when the target program is run and is stored in local;It is arrived in the monitoring interface monitoring
When target program is closed extremely, exception stack information is obtained;According to target program described in the exception stack Information recovering different
Process when often closing;The exception stack information is removed after being successfully recovered, records stack information in real time again.According to abnormal heap
Process of the stack Information recovering target program when closing extremely, can cause shape when target program backs within abnormal close
State improves user experience and program safety.
The additional aspect of the present invention and advantage will be set forth in part in the description, these will become from the following description
It obtains substantially or is recognized by the practice of the present invention.
Description of the drawings
Above-mentioned and/or additional aspect and advantage of the invention will become from the following description of the accompanying drawings of embodiments
Substantially and it is readily appreciated that, wherein:
Fig. 1 is the terminal program exception closing information process flow figure of one embodiment;
Fig. 2 be one embodiment error information after the method flow diagram uploaded onto the server;
Fig. 3 is the terminal program exception closing information processing unit module map of one embodiment;
Fig. 4 is that the server of one embodiment receives the processing unit module map of terminal abnormal closing information.
Specific embodiment
The embodiment of the present invention is described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end
Same or similar label represents same or similar element or has the function of same or like element.Below with reference to attached
The embodiment of figure description is exemplary, and is only used for explaining the present invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singulative " one " used herein, " one
It is a ", " described " and "the" may also comprise plural form.It is to be further understood that is used in the specification of the present invention arranges
Diction " comprising " refers to there are the feature, integer, step, operation, element and/or component, but it is not excluded that presence or addition
Other one or more features, integer, step, operation, element, component and/or their group.
Those skilled in the art of the present technique are appreciated that unless otherwise defined all terms used herein are (including technology art
Language and scientific terminology), there is the meaning identical with the general understanding of the those of ordinary skill in fields of the present invention.Should also
Understand, those terms such as defined in the general dictionary, it should be understood that have in the context of the prior art
The consistent meaning of meaning, and unless by specific definitions as here, idealization or the meaning of overly formal otherwise will not be used
To explain.
Those skilled in the art of the present technique are appreciated that " terminal " used herein above, " terminal device " both include wireless communication
The equipment of number receiver, only possesses the equipment of the wireless signal receiver of non-emissive ability, and including receiving and transmitting hardware
Equipment, have on both-way communication chain road, can perform both-way communication reception and emit hardware equipment.This equipment
It can include:Honeycomb or other communication apparatus, show with single line display or multi-line display or without multi-line
The honeycomb of device or other communication apparatus;PCS (Personal Communications Service, person communication system), can
With combine voice, data processing, fax and/or data communication capabilities;PDA (Personal Digital Assistant, it is personal
Digital assistants), radio frequency receiver, pager, the Internet/intranet access, web browser, notepad, day can be included
It goes through and/or GPS (Global Positioning System, global positioning system) receiver;Conventional laptop and/or palm
Type computer or other equipment, have and/or the conventional laptop including radio frequency receiver and/or palmtop computer or its
His equipment." terminal " used herein above, " terminal device " they can be portable, can transport, mounted on the vehicles (aviation,
Sea-freight and/or land) in or be suitable for and/or be configured to, in local runtime and/or with distribution form, operate in the earth
And/or any other position operation in space." terminal " used herein above, " terminal device " can also be communicating terminal, on
Network termination, audio/video playback terminal, such as can be PDA, MID (Mobile Internet Device, mobile Internet
Equipment) and/or there are the equipment such as the mobile phone of audio/video playback or smart television, set-top box.
Fig. 1 is the terminal program exception closing information process flow figure of one embodiment.The present invention provides a kind of end
Program exception closing information processing method is held, applied to terminal, described method includes following steps:
Step S110:Start monitoring interface when target program starts.
When target program starts, pre-buried monitoring interface starts, this monitoring interface is abnormal for monitoring programme.With peace
Exemplified by tall and erect system, program exception (Exception) is generally divided into two classes:One kind is CheckedException (different during compiling
Often), one kind is UncheckedException (run-time exception).In the method, monitoring is run-time exception.Common
Run-time exception for example include IllegalArgumentException, IllegalStateException,
NullPointerException, IndexOutOfBoundsException etc..By taking Android system as an example, this monitoring connects
Mouth can be java.lang.Thread.UncaughtExceptionHandler interfaces.
Step S120:Stack information is recorded in real time when target program is run and is stored in local.By taking Android system as an example,
Stack information can be recorded in real time by Application.ActivityLifecycleCallbacks methods and be stored in this
Ground.
Self defined class is realized and registration interface Application.ActivityLifecycleCallbacks, then in mesh
When beacon course sequence just starts registerActivityLifecycleCallbacks () function is called to be registered, in mesh
The establishment and destruction of Activity is monitored during beacon course sort run, the state change that record Activity in real time forms storehouse letter
Breath, and stack information is being locally stored in the form of a file in real time so that striding course information communication can be carried out and shared
Information.
Step S130:Interface monitoring is being monitored to during target program closing extremely, is obtaining exception stack information.Exception stack
Stack information when information, that is, target program is closed extremely.
It can be different come monitoring objective program by java.lang.Thread.UncaughtExceptionHandler interfaces
It often closes, the UncaughtExceptionHandler interfaces are containing there are one pure virtual functions:public abstract void
uncaughtException(Thread thread,Throwableex)。
UncheckedException can terminate thread when occurring, and system will notify at this time
UncaughtExceptionHandler interfaces are told thread and corresponding exception that the interface is terminated, then will be adjusted
With uncaughtException functions.If the handler is not set explicitly, the acquiescence of corresponding sets of threads can be called
handler.If we will capture the exception, it is necessary to realize our own handler, and by being set with minor function
It puts:
public static void setDefaultUncaughtExceptionHandler
(Thread.UncaughtExceptionHandler handler)
Realize customized handler, it is only necessary to inherit the UncaughtExceptionHandler interfaces, and realize
UncaughtException methods.Few examples code is as follows:
After catching the exception, we also need to know the information of collapse storehouse, us is so contributed to analyze the original of collapse
Cause searches the Bug of code.The printStackTrace methods of exception object are used to print abnormal stack information, according to
The output of printStackTrace methods is as a result, we can find abnormal source, and trace into the abnormal mistake triggered all the way
Journey mainly obtains stack information using getStackTraceInfo methods, and few examples code is as follows:
In some embodiments, it may not need the whole stack informations of acquisition, and can be (such as preceding 5 N layers before acquisition storehouse
Layer) information, developer can be with required design.
Step S140:According to process of the exception stack Information recovering target program when closing extremely.
When target program occurs abnormal, target program is called according to exception stack information by function readjustment
StartActivities () method starts multiple Activity so as to recover Activity stacks, to recover target program different
Process when often closing, the stack sequence of this multiple Activity and relevant information are from having stored in the local abnormal heap
Stack information.When closing extremely, movable Activity is recorded in exception stack information target program, passes through abnormal heap
Stack sequence and relevant information in stack information can recover state of the target program when closing extremely.For example, user uses mesh
Mark application is just collapsed in delivery operation, and exception stack information is by the activity (Activity) recorded when collapsing and services
(Service) etc. information, then can recover target program different by the stack sequence in exception stack information and relevant information
Pay status when often closing.
Step S150:Exception stack information is removed after being successfully recovered, records stack information in real time again.
After target program successfully starts up and returns to state when exception is closed, above-mentioned exception stack information will be removed,
To record stack information again.
In some embodiments, recover after failing again according to exception stack Information recovering target program when closing extremely
Process, if the frequency of failure is more than preset times, be no longer attempt to recover process of the target program when closing extremely, and voluntarily
The process of intended application is destroyed, target program is equivalent to and voluntarily kills the process of oneself.
In some embodiments, it is typically different to target program in monitoring interface monitoring before exception stack information is eliminated
When exception stack information is obtained when often closing, upload onto the server after the error information that exception stack information will be contained,
It is analyzed for research staff.
Therefore, before exception stack information is eliminated, uploaded to after the error information that can will contain exception stack information
Server, Fig. 2 are the method uploaded onto the server after the error information of one embodiment, will be uploaded onto the server after error information
Method include the following steps:
Step S131:The first summary info will be generated comprising the error information of exception stack information.
In the conventional technology, error information is typically to contain end message, such as terminal models, date of manufacture etc.
Nonessential information, and these information are to be helped for analysis program exception or collapse there is no what in many cases, therefore
It is contemplated that these point of necessary information is lost.Therefore, error information mainly includes exception stack information, and and does not include
Error information is generated the first summary info according to digest algorithm, such as will include exception stack information and discarding by end message
The error information of end message generates first summary info using MD5 Message Digest 5s.
Step S132:First summary info is uploaded onto the server, for server by the first summary info with having stored
Abnormal summary info of closing be compared.
The abnormal closing summary info largely uploaded by each terminal is stored in server, these close summary infos extremely
And generated by the error information that each terminal is collected in application exception or collapse, abnormal heap is contained in error information
Stack information, but and not comprising end message.First summary info and these stored abnormal summary infos of closing are carried out
It compares, can repeat to store to avoid identical abnormal summary info of closing.
Step S133:The feedback information of server feedback is received, if receiving the server feedback feedback that it fails to match
Information then uploads exception stack information to server.
First summary info is compared server with stored abnormal summary info of closing, if do not had in server
There is the abnormal closing summary info identical with the first summary info, then server will send the feedback letter that it fails to match to terminal
Breath or server do not send any feedback information to terminal.If the former, the matching that terminal receives server feedback is lost
The feedback information lost then uploads the stack information to server.If the latter, terminal is (such as 10 points in preset time
Clock) be not received by server feedback it fails to match the feedback information of successful match, then exception stack information is uploaded to service
Device.
If being stored with the abnormal closing summary info identical with the first summary info in server, server will be to end
End sends the feedback information of successful match.If terminal receives the feedback information of the successful match of server feedback, abandon
Exception stack information is passed to server.
In some embodiments, no matter the first summary info and server it is stored it is abnormal close summary info whether
With success, server all will be to terminal feedback solutions, such as prompting user setting terminal parameter, download patch, upgrade version
This etc..When prompting user's download patch or upgraded version, it is straightforward to provide download the network address of patch or upgraded version so that
User can repair terminal program by a key by way of downloading patch or upgraded version;Or benefit can be directly downloaded automatically
Fourth or upgraded version.
Therefore, if terminal receives the feedback information of the solution prompting of server feedback, shown to user and solve prompting,
Such as provide a user the suggestion that terminal parameter is set.Or if terminal to receive upgrading automatically for server feedback anti-
Feedforward information, then automatic escalation target program.
First summary info (data volume is less) by through abandon end message (such as terminal models, date of manufacture) and comprising
The error information of exception stack information and generate, it is identical with the first summary info different first to judge whether server has been stored with
Summary info is often closed, if without just uploading detailed exception stack information (data volume is larger), it is clear that be avoided that terminal repeats
The larger above-mentioned exception stack information of data volume is uploaded, but also server improves application program without repeating to store and analyze
Abnormal or collapse analysis efficiency.
The first summary info generated according to error information is through abandoning end message so that the first summary letter of generation
Breath will not be because of the different and different of terminal (such as terminal models), thus can cause:Even if various different terminals because
Very same reason is closed extremely, server also need to only store one group it is abnormal close summary info, and avoid different terminals all on
It passes the abnormal of same cause and closes error information, it is also possible that server is stored without repetition and analysis, improve application program
Abnormal or collapse analysis efficiency.
Corresponding above-mentioned terminal program exception closing information processing method is closed extremely the present invention also provides a kind of terminal program
Information processing unit is closed, applied to terminal, Fig. 3 is the terminal program exception closing information processing unit module of one embodiment
Figure, the device include:Monitoring module 110, logging modle 120, acquisition module 130, recovery module 140.
Monitoring module 110 is used to start monitoring interface when target program starts;Logging modle 120 is used in target program
Stack information is recorded during operation in real time and is stored in local;Acquisition module 130 is used for different to target program in monitoring interface monitoring
When often closing, exception stack information is obtained;Recovery module 140 is used for according to exception stack Information recovering target program in abnormal pass
Process when closing;Recovery module 140 removes exception stack information after being successfully recovered, logging modle 120 records storehouse in real time again
Information.
Monitoring module 110 starts monitoring interface when target program starts.
When target program starts, pre-buried monitoring interface starts, this monitoring interface is abnormal for monitoring programme.With peace
Exemplified by tall and erect system, program exception (Exception) is generally divided into two classes:One kind is CheckedException (different during compiling
Often), one kind is UncheckedException (run-time exception).In the method, monitoring is run-time exception.Common
Run-time exception for example include IllegalArgumentException, IllegalStateException,
NullPointerException, IndexOutOfBoundsException etc..By taking Android system as an example, this monitoring connects
Mouth can be java.lang.Thread.UncaughtExceptionHandler interfaces.
Logging modle 120 records stack information when target program is run and is stored in local in real time.Using Android system as
Example, can be recorded stack information in real time and be stored in by Application.ActivityLifecycleCallbacks methods
It is local.
Self defined class is realized and registration interface Application.ActivityLifecycleCallbacks, then in mesh
When beacon course sequence just starts registerActivityLifecycleCallbacks () function is called to be registered, in mesh
The establishment and destruction of Activity is monitored during beacon course sort run, the state change that record Activity in real time forms storehouse letter
Breath, and stack information is being locally stored in the form of a file in real time so that striding course information communication can be carried out and shared
Information.
Acquisition module 130 obtains exception stack when monitoring module 110 monitors interface monitoring and closed extremely to target program
Information.Stack information when exception stack information, that is, target program is closed extremely.
Monitoring module 110 can be supervised by java.lang.Thread.UncaughtExceptionHandler interfaces
It controls target program to close extremely, the UncaughtExceptionHandler interfaces are containing there are one pure virtual functions:public
abstract void uncaughtException(Thread thread,Throwableex)。
UncheckedException can terminate thread when occurring, and system will notify at this time
UncaughtExceptionHandler interfaces are told thread and corresponding exception that the interface is terminated, then will be adjusted
With uncaughtException functions.If the handler is not set explicitly, the acquiescence of corresponding sets of threads can be called
handler.If we will capture the exception, it is necessary to realize our own handler, and by being set with minor function
It puts:
public static void setDefaultUncaughtExceptionHandler
(Thread.UncaughtExceptionHandler handler)
Realize customized handler, it is only necessary to inherit the UncaughtExceptionHandler interfaces, and realize
UncaughtException methods.Few examples code is as follows:
After catching the exception, we also need to know the information of collapse storehouse, us is so contributed to analyze the original of collapse
Cause searches the Bug of code.The printStackTrace methods of exception object are used to print abnormal stack information, according to
The output of printStackTrace methods is as a result, we can find abnormal source, and trace into the abnormal mistake triggered all the way
Journey mainly obtains stack information using getStackTraceInfo methods, and few examples code is as follows:
In some embodiments, acquisition module 130 may not need the whole stack informations of acquisition, and can be before acquisition storehouse
The information of N layers (such as first 5 layers), developer can be with required design.
Process of the recovery module 140 according to exception stack Information recovering target program when closing extremely.
When target program occurs abnormal, target program is called according to exception stack information by function readjustment
StartActivities () method starts multiple Activity so as to recover Activity stacks, to recover target program different
Process when often closing, the stack sequence of this multiple Activity and relevant information are from having stored in the local abnormal heap
Stack information.When closing extremely, movable Activity is recorded in exception stack information target program, recovery module
140 can recover state of the target program when closing extremely by the stack sequence in exception stack information and relevant information.
Recovery module 140 removes exception stack information after being successfully recovered, logging modle 120 again believe in real time by record storehouse
Breath.After target program successfully starts up and returns to state when exception is closed, recovery module 140 will remove above-mentioned exception stack
Information, so that logging modle 120 records stack information again.
In some embodiments, recover after failing again according to exception stack Information recovering target program when closing extremely
Process, if the frequency of failure is more than preset times, be no longer attempt to recover process of the target program when closing extremely, and voluntarily
The process of intended application is destroyed, target program is equivalent to and voluntarily kills the process of oneself.
In some embodiments, it is typically different to target program in monitoring interface monitoring before exception stack information is eliminated
When exception stack information is obtained when often closing, upload onto the server after the error information that exception stack information will be contained,
It is analyzed for research staff.Therefore, described device can also include with lower module (not shown):Generation module, uploading module connect
Receive module.
Generation module generates the first summary info for that will include the error information of the exception stack information;Uploading module
For first summary info to be uploaded onto the server, so that server is by first summary info and stored exception
Summary info is closed to be compared;Receiving module is used to receive the feedback information of server feedback, if receiving server feedback
The feedback information that it fails to match then uploads the exception stack information to server.
Generation module will generate the first summary info comprising the error information of exception stack information.
In the conventional technology, error information is typically to contain end message, such as terminal models, date of manufacture etc.
Nonessential information, and these information are to be helped for analysis program exception or collapse there is no what in many cases, therefore
It is contemplated that these point of necessary information is lost.Therefore, error information mainly includes exception stack information, and and does not include
Error information is generated the first summary info according to digest algorithm, such as will include exception stack information and discarding by end message
The error information of end message generates first summary info using MD5 Message Digest 5s.
Uploading module uploads onto the server the first summary info, for server by the first summary info with it is stored
Abnormal summary info of closing is compared.
The abnormal closing summary info largely uploaded by each terminal is stored in server, these close summary infos extremely
And generated by the error information that each terminal is collected in application exception or collapse, abnormal heap is contained in error information
Stack information, but and not comprising end message.First summary info and these stored abnormal summary infos of closing are carried out
It compares, can repeat to store to avoid identical abnormal summary info of closing.
Receiving module receives the feedback information of server feedback, if receiving the server feedback feedback letter that it fails to match
It ceases, then uploading module uploads exception stack information to server.
First summary info is compared server with stored abnormal summary info of closing, if do not had in server
There is the abnormal closing summary info identical with the first summary info, then server will send the feedback letter that it fails to match to terminal
Breath or server do not send any feedback information to terminal.If the former, receiving module receives of server feedback
Feedback information with failure, then uploading module upload the stack information to server.If the latter, receiving module is default
(such as 10 minutes) are not received by server feedback it fails to match the feedback information of successful match in time, then uploading module
Exception stack information is uploaded to server.
If being stored with the abnormal closing summary info identical with the first summary info in server, server will be to end
End sends the feedback information of successful match.If receiving module receives the feedback information of the successful match of server feedback, on
Transmission module abandons uploading exception stack information to server.
In some embodiments, no matter the first summary info and server it is stored it is abnormal close summary info whether
With success, server all will be to terminal feedback solutions, such as prompting user setting terminal parameter, download patch, upgrade version
This etc..When prompting user's download patch or upgraded version, it is straightforward to provide download the network address of patch or upgraded version so that
User can repair terminal program by a key by way of downloading patch or upgraded version;Or benefit can be directly downloaded automatically
Fourth or upgraded version.
Therefore, described device can also include reminding module or upgraded module (not shown), if receiving module receives
The feedback information of the solution prompting of server feedback, then reminding module is shown to user solves prompting, such as provides a user and set
Put the suggestion of terminal parameter.Or if receiving module receives the feedback information upgraded automatically of server feedback, upgrade
The automatic escalation target program of module.
First summary info (data volume is less) by through abandon end message (such as terminal models, date of manufacture) and comprising
The error information of exception stack information and generate, it is identical with the first summary info different first to judge whether server has been stored with
Summary info is often closed, if without just uploading detailed exception stack information (data volume is larger), it is clear that be avoided that terminal repeats
The larger above-mentioned exception stack information of data volume is uploaded, but also server improves application program without repeating to store and analyze
Abnormal or collapse analysis efficiency.
The first summary info generated according to error information is through abandoning end message so that the first summary letter of generation
Breath will not be because of the different and different of terminal (such as terminal models), thus can cause:Even if various different terminals because
Very same reason is closed extremely, server also need to only store one group it is abnormal close summary info, and avoid different terminals all on
It passes the abnormal of same cause and closes error information, it is also possible that server is stored without repetition and analysis, improve application program
Abnormal or collapse analysis efficiency.
The present invention also provides a kind of terminal, including:Touch-sensitive display;One or more processors;Memory;One or
Multiple application programs, wherein one or more application programs are stored in memory and are configured as being handled by one or more
Device performs, and one or more programs are configured to:Perform the terminal program exception closing information according to any of the above-described embodiment
Processing method.
The embodiment of the present invention additionally provides mobile terminal, as shown in figure 4, for convenience of description, illustrating only and the present invention
The relevant part of embodiment, particular technique details do not disclose, refer to present invention method part.The terminal can be
Including mobile phone, tablet computer, PDA (Personal Digital Assistant, personal digital assistant), POS (Point of
Sales, point-of-sale terminal), the arbitrary terminal device such as vehicle-mounted computer, by terminal for exemplified by mobile phone:
Fig. 4 is illustrated that the block diagram with the part-structure of the relevant mobile phone of terminal provided in an embodiment of the present invention.Reference chart
4, mobile phone includes:Radio frequency (Radio Frequency, RF) circuit 1510, memory 1520, input unit 1530, display unit
1540th, sensor 1550, voicefrequency circuit 1560, Wireless Fidelity (wireless fidelity, Wi-Fi) module 1570, processor
The components such as 1580 and power supply 1590.It will be understood by those skilled in the art that the handset structure shown in Fig. 4 is not formed pair
The restriction of mobile phone can include either combining some components or different component cloth than illustrating more or fewer components
It puts.
Each component parts of mobile phone is specifically introduced with reference to Fig. 4:
RF circuits 1510 can be used for receive and send messages or communication process in, signal sends and receivees, particularly, by base station
After downlink information receives, handled to processor 1580;In addition, the data sending of uplink will be designed to base station.In general, RF circuits
1510 include but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier (Low Noise
Amplifier, LNA), duplexer etc..In addition, RF circuits 1510 can also be led to by wireless communication and network and other equipment
Letter.Above-mentioned wireless communication can use any communication standard or agreement, include but not limited to global system for mobile communications (Global
System of Mobile communication, GSM), general packet radio service (General Packet Radio
Service, GPRS), CDMA (Code Division Multiple Access, CDMA), wideband code division multiple access
(Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution,
LTE), Email, Short Message Service (Short Messaging Service, SMS) etc..
Memory 1520 can be used for storage software program and module, and processor 1580 is stored in memory by operation
1520 software program and module, so as to perform the various function application of mobile phone and data processing.Memory 1520 can be led
To include storing program area and storage data field, wherein, storing program area can storage program area, needed at least one function
Application program (such as vocal print playing function, image player function etc.) etc.;Storage data field can be stored uses institute according to mobile phone
Data (such as voice data, phone directory etc.) of establishment etc..It is stored in addition, memory 1520 can include high random access
Device, can also include nonvolatile memory, and a for example, at least disk memory, flush memory device or other volatibility are consolidated
State memory device.
Input unit 1530 can be used for the number for receiving input or character information and generate with the user setting of mobile phone with
And the key signals input that function control is related.Specifically, input unit 1530 may include touch panel 1531 and other inputs
Equipment 1532.Touch panel 1531, also referred to as touch-screen collect user on it or neighbouring touch operation (such as user
Use the behaviour of any suitable object such as finger, stylus or attachment on touch panel 1531 or near touch panel 1531
Make), and corresponding attachment device is driven according to preset formula.Optionally, touch panel 1531 may include touch detection
Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band
The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it
Contact coordinate is converted into, then gives processor 1580, and the order that processor 1580 is sent can be received and performed.In addition,
The polytypes such as resistance-type, condenser type, infrared ray and surface acoustic wave may be employed and realize touch panel 1531.Except touch surface
Plate 1531, input unit 1530 can also include other input equipments 1532.Specifically, other input equipments 1532 can include
But it is not limited in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operation lever etc.
It is one or more.
Display unit 1540 is each available for the information and mobile phone for showing by information input by user or being supplied to user
Kind menu.Display unit 1540 may include display panel 1541, optionally, liquid crystal display (Liquid may be employed
Crystal Display, LCD), the forms such as Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED)
To configure display panel 1541.Further, touch panel 1531 can cover display panel 1541, when touch panel 1531 detects
To processor 1580 on it or after neighbouring touch operation, is sent to determine the type of touch event, device is followed by subsequent processing
1580 provide corresponding visual output according to the type of touch event on display panel 1541.Although in Fig. 4, touch panel
1531 and display panel 1541 are the components independent as two to realize the input of mobile phone and input function, but in some realities
Apply in example, can be integrated by touch panel 1531 and display panel 1541 and that realizes mobile phone output and input function.
Mobile phone may also include at least one sensor 1550, such as optical sensor, motion sensor and other sensors.
Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein, ambient light sensor can be according to ambient light
Light and shade adjust the brightness of display panel 1541, proximity sensor can close display panel when mobile phone is moved in one's ear
1541 and/or backlight.As one kind of motion sensor, accelerometer sensor can detect in all directions (generally three axis) and add
The size of speed can detect that size and the direction of gravity when static, application (such as the horizontal/vertical screen available for identification mobile phone posture
Switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;As for mobile phone also
The other sensors such as configurable gyroscope, barometer, hygrometer, thermometer, infrared ray sensor, details are not described herein.
Voicefrequency circuit 1560, loud speaker 1561, microphone 1562 can provide the audio interface between user and mobile phone.Audio
The transformed electric signal of the voice data received can be transferred to loud speaker 1561, is converted by loud speaker 1561 by circuit 1560
For vocal print signal output;On the other hand, the vocal print signal of collection is converted to electric signal by microphone 1562, by voicefrequency circuit 1560
Voice data is converted to after reception, then after voice data output processor 1580 is handled, through RF circuits 1510 to be sent to ratio
Voice data is exported to memory 1520 to be further processed by such as another mobile phone.
Wi-Fi belongs to short range wireless transmission technology, and mobile phone can help user's transceiver electronics by Wi-Fi module 1570
Mail, browsing webpage and access streaming video etc., it has provided wireless broadband internet to the user and has accessed.Although Fig. 4 is shown
Wi-Fi module 1570, but it is understood that, and must be configured into for mobile phone is not belonging to, completely it can exist as needed
Do not change in the scope of the essence of invention and omit.
Processor 1580 is the control centre of mobile phone, using various interfaces and the various pieces of connection whole mobile phone,
Memory 1520 is stored in by running or performing the software program being stored in memory 1520 and/or module and call
Interior data perform the various functions of mobile phone and processing data, so as to carry out integral monitoring to mobile phone.Optionally, processor
1580 may include one or more processing units;Preferably, processor 1580 can integrate application processor and modulation /demodulation processing
Device, wherein, the main processing operation system of application processor, user interface and application program etc., modem processor is mainly located
Manage wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 1580.
Mobile phone is further included to the power supply 1590 (such as battery) of all parts power supply, it is preferred that power supply can pass through power supply
Management system and processor 1580 are logically contiguous, so as to realize management charging, electric discharge and power consumption pipe by power-supply management system
The functions such as reason.
Although being not shown, mobile phone can also include camera, bluetooth module etc., and details are not described herein.
In embodiments of the present invention, the processor 1580 included by the terminal also has following functions:It is opened in target program
Start monitoring interface when dynamic;Stack information is recorded in real time when the target program is run and is stored in local;In the monitoring
Interface monitoring obtains exception stack information to during target program exception closing;According to mesh described in the exception stack Information recovering
Process of the beacon course sequence when closing extremely;The exception stack information is removed after being successfully recovered, records stack information in real time again.
Namely processor 1580 possesses the function of performing above-mentioned any embodiment terminal program exception closing information processing method, herein
It repeats no more.
Above-mentioned terminal program exception closing information processing method, device and terminal starts prison when target program starts
Control interface;Stack information is recorded in real time when the target program is run and is stored in local;It is arrived in the monitoring interface monitoring
When target program is closed extremely, exception stack information is obtained;According to target program described in the exception stack Information recovering different
Process when often closing;The exception stack information is removed after being successfully recovered, records stack information in real time again.According to abnormal heap
Process of the stack Information recovering target program when closing extremely, can cause shape when target program backs within abnormal close
State improves user experience and program safety.
It should be understood that although each step in the flow chart of attached drawing is shown successively according to the instruction of arrow,
These steps are not that the inevitable order according to arrow instruction performs successively.Unless it expressly states otherwise herein, these steps
Execution there is no stringent orders to limit, can perform in the other order.Moreover, at least one in the flow chart of attached drawing
Part steps can include multiple sub-steps, and either these sub-steps of multiple stages or stage are not necessarily in synchronization
Completion is performed, but can be performed at different times, execution sequence is also not necessarily to carry out successively, but can be with other
Either the sub-step of other steps or at least a portion in stage perform step in turn or alternately.
The above is only some embodiments of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also should
It is considered as protection scope of the present invention.
Claims (10)
1. a kind of terminal program exception closing information processing method, which is characterized in that applied to terminal, the described method includes as follows
Step:
Start monitoring interface when target program starts;
Stack information is recorded in real time when the target program is run and is stored in local;
When the monitoring interface monitoring to target program is closed extremely, exception stack information is obtained;
According to process of the target program described in the exception stack Information recovering when closing extremely;
The exception stack information is removed after being successfully recovered, records stack information in real time again.
2. terminal program exception closing information processing method according to claim 1, which is characterized in that further include step:
Recover failure after again according to the exception stack Information recovering target program extremely close when process, if lose
Number is lost more than preset times, then is no longer attempt to recover process of the target program when closing extremely.
3. terminal program exception closing information processing method according to claim 1, which is characterized in that applied to Android system
System, the monitoring interface is UncaughtExceptionHandler methods.
4. terminal program exception closing information processing method according to claim 1, which is characterized in that applied to Android system
System records stack information by Application.ActivityLifecycleCallbacks methods and is stored in this in real time
Ground.
5. terminal program exception closing information processing method according to claim 1, which is characterized in that applied to Android system
System obtains exception stack information by getStackTraceInfo methods.
6. terminal program exception closing information processing method according to claim 1, which is characterized in that further include step:
The first summary info will be generated comprising the error information of the exception stack information;
First summary info is uploaded onto the server, so that server is by first summary info and stored exception
Summary info is closed to be compared;
The feedback information of server feedback is received, if receiving the server feedback feedback information that it fails to match, uploads institute
Exception stack information is stated to server.
7. terminal program exception closing information processing method according to claim 6, which is characterized in that by the letter that reports an error
The end message in the error information has also been abandoned before breath the first summary info of generation.
8. terminal program exception closing information processing method according to claim 6, which is characterized in that if in preset time
The server feedback feedback information that it fails to match is inside not received by, then uploads the exception stack information to server.
9. a kind of terminal program exception closing information processing unit, which is characterized in that applied to terminal, including:
Monitoring module, for starting monitoring interface when target program starts;
Logging modle, for recording stack information in real time when the target program is run and being stored in local;
Acquisition module, for when the monitoring interface monitoring to target program is closed extremely, obtaining exception stack information;
Recovery module, for process of the target program when closing extremely according to the exception stack Information recovering;
The recovery module removes the exception stack information after being successfully recovered, the logging modle records storehouse letter in real time again
Breath.
10. a kind of terminal, which is characterized in that it includes:
Touch-sensitive display;
One or more processors;
Memory;
One or more application program, wherein one or more of application programs are stored in the memory and are configured
To be performed by one or more of processors, one or more of programs are configured to:It performs according to claim 1~8
Any one of them terminal program exception closing information processing method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711298086.0A CN108052431A (en) | 2017-12-08 | 2017-12-08 | Terminal program exception closing information processing method, device, terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711298086.0A CN108052431A (en) | 2017-12-08 | 2017-12-08 | Terminal program exception closing information processing method, device, terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108052431A true CN108052431A (en) | 2018-05-18 |
Family
ID=62123760
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711298086.0A Pending CN108052431A (en) | 2017-12-08 | 2017-12-08 | Terminal program exception closing information processing method, device, terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108052431A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109766701A (en) * | 2018-06-26 | 2019-05-17 | 360企业安全技术(珠海)有限公司 | For the processing method of abnormal process end operation, device and electronic device |
CN110609767A (en) * | 2019-09-17 | 2019-12-24 | 青岛海信移动通信技术股份有限公司 | Data recovery method and device for terminal |
CN110837433A (en) * | 2019-11-15 | 2020-02-25 | 珠海豹趣科技有限公司 | Performance optimization method and device and electronic equipment |
CN111274503A (en) * | 2020-01-20 | 2020-06-12 | 北京无限光场科技有限公司 | Data processing method and device, electronic equipment and computer readable medium |
CN111897726A (en) * | 2020-07-27 | 2020-11-06 | Tcl通讯(宁波)有限公司 | Abnormity positioning method, abnormity positioning device, storage medium and mobile terminal |
CN112395119A (en) * | 2019-08-12 | 2021-02-23 | 北京达佳互联信息技术有限公司 | Abnormal data processing method, abnormal data processing device, server and storage medium |
CN113157480A (en) * | 2021-04-23 | 2021-07-23 | Oppo广东移动通信有限公司 | Error information processing method, device, storage medium and terminal |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103019879A (en) * | 2013-01-07 | 2013-04-03 | 北京奇虎科技有限公司 | Method and system for processing crash information of browser |
CN104199749A (en) * | 2014-09-17 | 2014-12-10 | 百度在线网络技术(北京)有限公司 | Crash information processing method and crash information processing device |
CN105468478A (en) * | 2015-11-26 | 2016-04-06 | 北京京东尚科信息技术有限公司 | Recovery method and apparatus for business data after application crash |
CN106095621A (en) * | 2016-06-12 | 2016-11-09 | Tcl集团股份有限公司 | The restoration methods of Launcher operation exception and system in a kind of Android system |
EP3209000A1 (en) * | 2016-02-18 | 2017-08-23 | Speech Processing Solutions GmbH | Method to transfer input commands of a hardware device to steer a web application processed in a browser |
-
2017
- 2017-12-08 CN CN201711298086.0A patent/CN108052431A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103019879A (en) * | 2013-01-07 | 2013-04-03 | 北京奇虎科技有限公司 | Method and system for processing crash information of browser |
CN104199749A (en) * | 2014-09-17 | 2014-12-10 | 百度在线网络技术(北京)有限公司 | Crash information processing method and crash information processing device |
CN105468478A (en) * | 2015-11-26 | 2016-04-06 | 北京京东尚科信息技术有限公司 | Recovery method and apparatus for business data after application crash |
EP3209000A1 (en) * | 2016-02-18 | 2017-08-23 | Speech Processing Solutions GmbH | Method to transfer input commands of a hardware device to steer a web application processed in a browser |
CN106095621A (en) * | 2016-06-12 | 2016-11-09 | Tcl集团股份有限公司 | The restoration methods of Launcher operation exception and system in a kind of Android system |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109766701A (en) * | 2018-06-26 | 2019-05-17 | 360企业安全技术(珠海)有限公司 | For the processing method of abnormal process end operation, device and electronic device |
CN109766701B (en) * | 2018-06-26 | 2021-04-27 | 360企业安全技术(珠海)有限公司 | Processing method and device for abnormal process ending operation and electronic device |
CN112395119A (en) * | 2019-08-12 | 2021-02-23 | 北京达佳互联信息技术有限公司 | Abnormal data processing method, abnormal data processing device, server and storage medium |
CN112395119B (en) * | 2019-08-12 | 2024-03-12 | 北京达佳互联信息技术有限公司 | Abnormal data processing method, device, server and storage medium |
CN110609767A (en) * | 2019-09-17 | 2019-12-24 | 青岛海信移动通信技术股份有限公司 | Data recovery method and device for terminal |
CN110609767B (en) * | 2019-09-17 | 2023-10-20 | 青岛海信移动通信技术有限公司 | Data recovery method and device for terminal |
CN110837433A (en) * | 2019-11-15 | 2020-02-25 | 珠海豹趣科技有限公司 | Performance optimization method and device and electronic equipment |
CN111274503A (en) * | 2020-01-20 | 2020-06-12 | 北京无限光场科技有限公司 | Data processing method and device, electronic equipment and computer readable medium |
CN111274503B (en) * | 2020-01-20 | 2024-02-20 | 北京有竹居网络技术有限公司 | Data processing method, device, electronic equipment and computer readable medium |
CN111897726A (en) * | 2020-07-27 | 2020-11-06 | Tcl通讯(宁波)有限公司 | Abnormity positioning method, abnormity positioning device, storage medium and mobile terminal |
CN111897726B (en) * | 2020-07-27 | 2024-01-19 | Tcl通讯(宁波)有限公司 | Abnormality positioning method, abnormality positioning device, storage medium and mobile terminal |
CN113157480A (en) * | 2021-04-23 | 2021-07-23 | Oppo广东移动通信有限公司 | Error information processing method, device, storage medium and terminal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108052431A (en) | Terminal program exception closing information processing method, device, terminal | |
CN106951170A (en) | A kind of split screen treating method and apparatus of mobile terminal, mobile terminal | |
CN107807861B (en) | Screen freezing solution method, mobile terminal and computer readable storage medium | |
CN104093123B (en) | The information-pushing method of application program, device and system, mobile terminal | |
CN107623899B (en) | Information processing method, information processing apparatus, storage medium, and electronic device | |
CN103366104A (en) | Method and device for controlling accessing of application | |
CN108197934A (en) | A kind of method of payment and terminal device | |
CN109922078A (en) | Upgrade control method, mobile terminal and computer readable storage medium | |
CN109885323A (en) | A kind of application program updating method, mobile terminal and readable storage medium storing program for executing | |
CN107908491A (en) | Card screen detection is with solving method, mobile terminal and computer-readable recording medium | |
CN106445719A (en) | Recovery-mode Recovery instruction reading and writing method and device | |
CN109144537A (en) | The method, apparatus that mobile terminal and wearable device upgrade automatically | |
CN107765922A (en) | Card screen detection is with solving method, mobile terminal and computer-readable recording medium | |
CN107704332A (en) | Freeze screen solution method, mobile terminal and computer-readable recording medium | |
CN107766222A (en) | Blank screen detection method, mobile terminal and computer-readable recording medium | |
CN108052391A (en) | Memory Optimize Method, mobile terminal and readable storage medium storing program for executing based on thread deadlock | |
CN107371064A (en) | Mobile terminal and its audio and video playing method and apparatus | |
CN108052406A (en) | Terminal program exception closing information processing method, device, terminal | |
CN109324999A (en) | A kind of method and electronic equipment executing operation based on download instruction | |
CN109828770A (en) | A kind of method for upgrading software, terminal device and server | |
CN107908492A (en) | Blank screen detection method, mobile terminal and computer-readable recording medium | |
CN107861827A (en) | Card screen detection method, mobile terminal and computer-readable recording medium | |
CN107832191A (en) | Blank screen detection method, mobile terminal and computer-readable recording medium | |
CN107818036A (en) | Blank screen detection method, mobile terminal and computer-readable recording medium | |
CN105094869B (en) | Target program determines method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180518 |