A kind of method and device for managing application program unloading
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and device for managing application program unloading.
Background technology
With the use of smart mobile phone, people meet the joy in life by installing types of applications program in smart mobile phone
Happy, study and the various needs of work, with the growth of usage time, the application program of installation can be more and more, and very
More application programs is exactly to be automatically set as starting up when installation.
At present, the mobile phone for non-root can not change the starting up of mobile phone, therefore, when the application journey of starting up
When sequence is excessive, problems with will be caused:Take excessive memory system, consume substantial amounts of mobile phone electricity so that mobile phone it is anti-
Answer speed to reduce, influence the experience of user.
The content of the invention
In order to solve that excessive memory system is taken in smart mobile phone, consume substantial amounts of mobile phone electricity so that mobile phone it is anti-
Answer speed to reduce, influence the experience problem of user, an embodiment of the present invention provides it is a kind of manage application program unloading method and
Device.The technical solution is as follows:
First aspect, there is provided a kind of method for managing application program unloading, the described method includes:
Pre-set the inquiry moment;
When current time is the inquiry moment, the last for obtaining corresponding application programs successively from time array starts
Time;
Time is started according to the last and current time calculates to obtain the not actuated time value of current application program, according to
The time value judges whether to meet default discharge time;
When the time value meets default discharge time, unloading management is carried out to current application program.
Preferably, it is described pre-set inquiry the moment before further include:
Settling time array, is stored in the startup time of application program as respective element in the time array, will
Initial time of the time of application program as respective element is installed, the last that the time array is used to store application program opens
The dynamic time.
Preferably, it is described to calculate to obtain the not actuated of current application program according to last startup time and current time
Time value, judges whether to meet default discharge time according to the time value, including:
The last that current time is subtracted to the corresponding application program of currentElement starts the time, obtains current application program
Not actuated time value, judges whether the time value is greater than or equal to default discharge time, and the default discharge time refers to not
When starting application program the time unloaded whether is needed for prompting.
It is preferably, described that unloading management is carried out to current application program when the time value meets default discharge time,
Including:
When the time value meets default discharge time, whether the corresponding application program of current time array element is judged
For starting up's application program;
If starting up's application program, then selection prompting frame is shown, and corresponding behaviour is performed according to the selection of user
Make;
If not starting up's application program, then judge whether also have next element in the time array, when depositing
In next element, then obtain next element and obtain the not actuated time value of corresponding application programs, return continues to count
Evaluation time value, performs corresponding steps.
Preferably, it is described if starting up's application program, then show selection prompting frame, and held according to the selection of user
The corresponding operation of row, specifically includes:
Judge the type of the options of user, when the type of user's options is unloads type, then unload current application
Program;When the type of user's options is type of backup, then unloads and back up current application program;When the class of user's options
Type is when ignoring type of message, then not perform operation.
Second aspect, there is provided a kind of device for managing application program unloading, described device include:
Presetting module, for pre-seting the inquiry moment;
Acquisition module, when current time is the inquiry moment, corresponding application programs are obtained from time array successively
Last start the time;
Judgment module, according to the last start time and current time calculate to obtain current application program it is not actuated when
Between be worth, judge whether to meet default discharge time according to the time value;
Processing module, when the time value meets default discharge time, unloading management is carried out to current application program.
Preferably, described device further includes:
Module is established, for settling time array, is stored in using the startup time of application program as respective element described
In time array, initial time of the time as respective element of application program will be installed, the time array, which is used to store, answers
Start the time with the last of program.
Preferably, the judgment module is specifically used for the last that current time is subtracted to the corresponding application program of currentElement
Start the time, obtain the not actuated time value of current application program, judge whether the time value is greater than or equal to default unloading
Time, the default discharge time refer to whether need the time unloaded for prompting during not actuated application program.
Preferably, the processing module includes:
Judging unit, for when the time value meets default discharge time, judging that current time array element corresponds to
Application program whether be starting up's application program;
First execution unit, for if starting up's application program, then showing selection prompting frame, and according to user's
Selection performs corresponding operation;
Second execution unit, for if not starting up's application program, then whether also to judge in the time array
There is next element, when there are during next element, then obtain next element to obtain the not actuated of corresponding application programs
Time value, returns and continues calculated time value, performs corresponding steps.
Preferably, first execution unit, the type of the options specifically for judging user, when user's options
When type is unloads type, then current application program is unloaded;When the type of user's options is type of backup, then unload and standby
Part current application program;When the type of user's options is ignores type of message, then operation is not performed.
The beneficial effect that technical solution provided in an embodiment of the present invention is brought is:
The moment is inquired about by setting, management is unloaded to reaching the not actuated program process of preset time within the cycle,
Prompt message is provided the user with, application program is handled accordingly according to the selection of user, with enabled unloading in time seldom
Application program, reduces the occupancy of memory, and reduces the consumption of circuit so that the reaction speed of smart mobile phone improves, and carries
The experience of high user.
Brief description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, without creative efforts, other can also be obtained according to these attached drawings
Attached drawing.
Fig. 1 is a kind of method flow diagram for management application program unloading that the embodiment of the present invention one provides;
Fig. 2 is the detailed step flow chart of step 104 in Fig. 1;
Fig. 3 is the detailed step flow chart of step 202 in Fig. 2;
Fig. 4 is a kind of apparatus structure schematic diagram for managing application program unloading provided by Embodiment 2 of the present invention;
Fig. 5 is the apparatus structure schematic diagram of another management application program unloading provided by Embodiment 2 of the present invention;
Fig. 6 is the structure diagram of processing module 404 in Fig. 5.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
Embodiment one
The embodiment of the present invention one provides a kind of method for managing application program unloading, as shown in Figure 1, the method, bag
Include:
Step 101:Pre-set the inquiry moment.
Wherein, the inquiry moment refers to be used for the corresponding application program of each element in query time array in cycle time
Last time start the time, for example, with one day for the cycle, by daily 12:00 is arranged to the inquiry moment.
Preferably, in the present embodiment, further included before step 101:
Settling time array, is stored in the startup time of application program as respective element in the time array, will
Initial time of the time of application program as respective element is installed.
The last that the time array is used to store application program starts the time, and the element in the time array is corresponding
The time that application program finally starts, for example, when opening one in application, the startup time access time array that this is applied
In corresponding element position, wherein, the initial time of time array element for installation respective application time.
Wherein, the last startup time refers to that last time starts the time of corresponding application programs, for example, the time
First element of array refers to application program " youku.com's client ", when starting " youku.com's client ", will be currently up the time
Simultaneously replace the first current element in the position of first element of access time array.
Step 102:When current time is the inquiry moment, corresponding application programs are obtained successively from time array
Last starts the time.
For example, when current time is the inquiry moment 12:When 00, start inquiry service module, obtained successively from time array
The element of time array is taken, i.e. the last of corresponding application programs starts the time.
Step 103:According to the last start time and current time calculate to obtain current application program it is not actuated when
Between be worth, judge whether to meet default discharge time according to the time value.
Specifically, step 103 specifically includes:The last that current time is subtracted to the corresponding application program of currentElement starts
Time, obtains the not actuated time value of current application program, judges whether the time value is greater than or equal to default discharge time,
The default discharge time refers to whether need the time unloaded for prompting during not actuated application program, for example, setting application
Whether program 60 days is not actuated, prompt to unload.
Step 104:When the time value meets default discharge time, unloading management is carried out to current application program.
Wherein, step 104, as shown in Fig. 2, specifically including:
Step 201:When the time value meets default discharge time, the corresponding application of current time array element is judged
Whether program is starting up's application program,
Step 202:If starting up's application program, then selection prompting frame is shown, and perform according to the selection of user
Corresponding operation;
In the present embodiment, for example, when current application program is starting up's application program, then prompting frame is ejected, it is interior
It is specially " this application has had be not used for 60 days, this application is automatic start application program, it is proposed that unloading " to hold, and provides and " unload
Load ", " unloading backup " and " ignoring this message " select for user.
Specifically, as shown in figure 3, step 202 includes:
Step 301:Judge the type of the options of user,
Step 302:When the type of user's options is unloads type, then current application program is unloaded;
Specifically, the api in PackageManager can be called to unload current application.
Step 303:When the type of user's options is type of backup, then unloads and back up current application program;
Specifically, by " application is backed up " file in this application copy to mobile phone;
Step 304:When the type of user's options is ignores type of message, then operation is not performed.
Step 203:If not starting up's application program, then judge whether also have next member in the time array
Element, when there are during next element, then obtaining next element to obtain the not actuated time value of corresponding application programs, returning
Continue calculated time value, perform corresponding steps.
The embodiment of the present invention one inquires about moment, the application program not actuated to reaching preset time within the cycle by setting
Process unloading management, provides the user with prompt message, application program is handled accordingly according to the selection of user, with enabled
The application program being of little use is unloaded in time, the effective occupancy for reducing memory, and reduce the consumption of circuit so that smart mobile phone
Reaction speed improve, improve the experience of user.
Embodiment two
The embodiment of the present invention two provides a kind of device for managing application program unloading, as shown in figure 4, the method, bag
Include:
Presetting module 401, for pre-seting the inquiry moment;
Wherein, the inquiry moment refers to be used for the corresponding application program of each element in query time array in cycle time
Last time start the time, for example, with one day for the cycle, by daily 12:00 is arranged to the inquiry moment.
Acquisition module 402, when current time is the inquiry moment, obtains respective application journey successively from time array
The last of sequence starts the time;
For example, when current time is the inquiry moment 12:When 00, start inquiry service module, obtained successively from time array
The element of time array is taken, i.e. the last of corresponding application programs starts the time.
Judgment module 403, starts the time according to the last and current time calculates to obtain not opening for current application program
Dynamic time value, judges whether to meet default discharge time according to the time value;
Specifically, judgment module 403 is specifically used for the last that current time is subtracted to the corresponding application program of currentElement
Start the time, obtain the not actuated time value of current application program, judge whether the time value is greater than or equal to default unloading
Time, the default discharge time refer to whether need the time unloaded for prompting during not actuated application program;For example, set
Whether application program 60 days is not actuated, prompt to unload.
Processing module 404, when the time value meets default discharge time, unloading pipe is carried out to current application program
Reason.
With reference to above-described embodiment, as shown in figure 5, described device further includes:
Module 501 is established, for settling time array, the startup time of application program is stored in institute as respective element
State in time array, initial time of the time as respective element of application program will be installed, the time array is used to store
The last of application program starts the time.
The last that the time array is used to store application program starts the time, and the element in the time array is corresponding
The time that application program finally starts, for example, when opening one in application, the startup time access time array that this is applied
In corresponding element position, wherein, the initial time of time array element for installation respective application time.
Wherein, the last startup time refers to that last time starts the time of corresponding application programs, for example, the time
First element of array refers to application program " youku.com's client ", when starting " youku.com's client ", will be currently up the time
Simultaneously replace the first current element in the position of first element of access time array.
Specifically, as shown in fig. 6, processing module 404 includes:
Judging unit 601, for when the time value meets default discharge time, judging current time array element pair
Whether the application program answered is starting up's application program;
First execution unit 602, for if starting up's application program, then show selection prompting frame, and according to
The selection at family performs corresponding operation;
In the present embodiment, for example, when current application program is starting up's application program, then prompting frame is ejected, it is interior
It is specially " this application has had be not used for 60 days, this application is automatic start application program, it is proposed that unloading " to hold, and provides and " unload
Load ", " unloading backup " and " ignoring this message " select for user.
Specifically, the first execution unit 602 is specifically used for the type for judging the options of user, when the class of user's options
When type is unloads type, then current application program is unloaded;When the type of user's options is type of backup, then unloads and back up
Current application program;When the type of user's options is ignores type of message, then operation is not performed.
Wherein it is possible to the api in PackageManager is called to unload current application;, will when selection unloading backup
In " application backup " file in this application copy to mobile phone.
Second execution unit 603, for if not starting up's application program, then judge in the time array whether
Also next element, when there are during next element, then obtain next element to obtain not opening for corresponding application programs
Dynamic time value, returns and continues calculated time value, performs corresponding steps.
With reference to above-described embodiment, as shown in figure 5, described device further includes:
Module 501 is established, for settling time array, the startup time of application program is stored in institute as respective element
State in time array, initial time of the time as respective element of application program will be installed, the time array is used to store
The last of application program starts the time.
The last that the time array is used to store application program starts the time, and the element in the time array is corresponding
The time that application program finally starts, for example, when opening one in application, the startup time access time array that this is applied
In corresponding element position, wherein, the initial time of time array element for installation respective application time.
Wherein, the last startup time refers to that last time starts the time of corresponding application programs, for example, the time
First element of array refers to application program " youku.com's client ", when starting " youku.com's client ", will be currently up the time
Simultaneously replace the first current element in the position of first element of access time array.
The embodiment of the present invention two inquires about moment, the application program not actuated to reaching preset time within the cycle by setting
Process unloading management, provides the user with prompt message, application program is handled accordingly according to the selection of user, with enabled
The application program being of little use is unloaded in time, reduces the occupancy of memory, and reduce the consumption of circuit so that the reaction of smart mobile phone
Speed improves, and improves the experience of user.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment
To complete, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent replacement, improvement and so on, should all be included in the protection scope of the present invention.