CN108874109A - The method for cleaning and device of background application - Google Patents
The method for cleaning and device of background application Download PDFInfo
- Publication number
- CN108874109A CN108874109A CN201710345081.2A CN201710345081A CN108874109A CN 108874109 A CN108874109 A CN 108874109A CN 201710345081 A CN201710345081 A CN 201710345081A CN 108874109 A CN108874109 A CN 108874109A
- Authority
- CN
- China
- Prior art keywords
- applications
- application
- background
- precedence information
- cleaning
- 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
- 238000004140 cleaning Methods 0.000 title claims abstract description 51
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000005611 electricity Effects 0.000 claims description 10
- 230000002596 correlated effect Effects 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 5
- 238000005516 engineering process Methods 0.000 abstract description 7
- 230000006870 function Effects 0.000 description 25
- 230000000694 effects Effects 0.000 description 20
- 230000015654 memory Effects 0.000 description 12
- 230000000875 corresponding effect Effects 0.000 description 6
- 238000012163 sequencing technique Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000007418 data mining Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
- G06F1/3203—Power management, i.e. event-based initiation of a power-saving mode
- G06F1/3234—Power saving characterised by the action undertaken
- G06F1/3287—Power saving characterised by the action undertaken by switching off individual functional units in the computer system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5022—Mechanisms to release resources
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- Stored Programmes (AREA)
Abstract
The present invention provides a kind of method for cleaning of background application and devices, wherein this method includes:The whole application just in terminal system running background is read, and obtains the remaining capacity of terminal;The precedence information of each application in all applications is parsed according to preset rules;According to remaining capacity and precedence information, selection one or more application is cleared up in all applications.Through the invention, the technical issues of losing user experience while saving electric quantity consumption in the related technology is solved.
Description
Technical field
The present invention relates to electronic information technical fields, in particular to the method for cleaning and device of a kind of background application.
Background technique
As the function of Android intelligent is stronger and stronger, the application of more and more practical functions is developed out
There is provided convenience in life for user, but the problem of battery durable deficiency increasingly becomes emphasis concerned by people, and it is very much
When mobile phone cruising ability difference reason but can be in running background service although exactly many applications close on foreground
(service), which results in the increases of mobile phone power consumption amount.
In the related technology, the function of some background service cleanings is provided, after such as carrying out according to user-defined white list
The mode of platform cleaning application, clears up background application and the mode of service etc. according to list.
But all there are several drawbacks in these methods:
Many users will not go customized setting to clear up those background services, be on the one hand because will not be arranged, it is another
Aspect is because each application requires individually to be arranged, than relatively time-consuming.Even if user sets each application
It sets, it is also possible to cannot most power saving and the setting of least influence user experience.
All background services are turned off by one key cleaning mode, and will lead to the background service that many users need can not make
With although most power saving, very influence user experience for example if closing the background service of communication applications, just will use family
It can not receive instant message.
In such a way that user's selection enters battery saving mode limitation background service number using imposing uniformity without examining individual cases, do not account for surplus
Relationship between remaining electric quantity curve and background service number can not accomplish taking into account for power saving and user experience, additionally need user
Unlatching could be limited into battery saving mode, it is also not convenient enough.
In response to this, a kind of it is contemplated that user's use habit and again it is contemplated that the intelligence of power consumption curve
Backstage cleaning seems particularly significant.
For the above problem present in the relevant technologies, at present it is not yet found that the solution of effect.
Summary of the invention
The embodiment of the invention provides a kind of method for cleaning of background application and devices, at least to solve to exist in the related technology
While saving electric quantity consumption the technical issues of loss user experience.
According to one embodiment of present invention, a kind of method for cleaning of background application is provided, including:It reads just in terminal
Whole applications of system background operation, and obtain the remaining capacity of the terminal;The whole is parsed according to preset rules to answer
The precedence information of each application in;It is selected in all applications with the precedence information according to the residual electric quantity
One or more application is cleared up.
Optionally, include according to the precedence information that preset rules parse each application in all applications:Obtain institute
State each in all applications apply in predetermined time window from the switching frequency for being switched to foreground from the background;According to the switching frequency
Rate determines the precedence information of each application in all applications, wherein the switching frequency and the precedence information at
It is positively correlated.
Optionally, each in acquisition all applications to apply the switching for being switched to foreground from the background in predetermined time window
Frequency includes:Read each status information for applying each moment in the predetermined time window, wherein the shape
State information includes:Foreground state, background state;The state of each application is counted in the predetermined time window from backstage
State becomes the number of foreground state;The number is determined as each switching applied in the predetermined time window
Frequency.
Optionally, it is selected in all applications with the precedence information according to the residual electric quantity one or more
Include using cleaning is carried out:The number of applications for allowing running background is determined according to the residual electric quantity;In the determining application
When quantity is less than the quantity all applied, the difference that the quantity all applied subtracts the number of applications is calculated;It presses
The difference background application is selected in all applications according to the sequence of the precedence information from low to high;Selected by cleaning
The difference background application selected.
Optionally, it is selected in all applications with the precedence information according to the residual electric quantity one or more
Include using cleaning is carried out:The number of applications for allowing to clear up is determined according to the residual electric quantity;According to the precedence information by
Low to high sequence selects the number of applications background application in all applications;Clear up the selected application number
Measure a background application.
According to another embodiment of the invention, a kind of cleaning plant of background application is provided, including:Processing module,
For reading the whole application just in terminal system running background, and the remaining capacity of the acquisition terminal;Parsing module is used
In the precedence information for parsing each application in all applications according to preset rules;Cleaning modul, for according to described surplus
Remaining electricity and the precedence information selection one or more application in all applications are cleared up.
Optionally, the parsing module includes:Acquiring unit, for obtaining each in all applications apply predetermined
From the switching frequency for being switched to foreground from the background in time window;First determination unit, for determining institute according to the switching frequency
State the precedence information of each application in all applications, wherein the switching frequency is positively correlated with the precedence information.
Optionally, the cleaning modul includes:Second determination unit allows backstage for determining according to the residual electric quantity
The number of applications of operation;Computing unit, for calculating when the determining number of applications is less than the quantity all applied
The quantity all applied subtracts the difference of the number of applications;First selecting unit, for according to the precedence information
Sequence from low to high selects the difference background application in all applications;First cleaning unit, for clearing up
The difference background application of selection.
Optionally, the parsing module:Third determination unit allows that clears up to answer for determining according to the residual electric quantity
Use quantity;Second selecting unit, for being selected in all applications according to the sequence of the precedence information from low to high
The number of applications background application;Second cleaning unit, for clearing up the selected number of applications background application.
According to still another embodiment of the invention, a kind of storage medium is additionally provided.The storage medium is set as storage and uses
In the program code for executing following steps:
The whole application just in terminal system running background is read, and obtains the remaining capacity of the terminal;
The precedence information of each application in all applications is parsed according to preset rules;
According to the residual electric quantity with the precedence information it is described all application in selection one or more application into
Row cleaning.
Through the invention, the whole application just in terminal system running background is read, and obtains the residue of the terminal
Electricity;The precedence information of each application in all applications is parsed according to preset rules;According to the residual electric quantity and institute
Precedence information selection one or more application in all applications is stated to be cleared up.It solves and is saving in the related technology
The technical issues of user experience is lost while electric quantity consumption, minimally shadow while reducing electric quantity consumption to greatest extent
Ring the usage experience of user.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair
Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of hardware block diagram of the mobile terminal of the method for cleaning of background application of the embodiment of the present invention;
Fig. 2 is the flow chart of the method for cleaning of background application according to an embodiment of the present invention;
Fig. 3 is the structural block diagram of the cleaning plant of background application according to an embodiment of the present invention;
Fig. 4 is a kind of android system intelligence based on remaining capacity Yu user's use habit provided in an embodiment of the present invention
The step flow chart of energy backstage method for cleaning.
Specific embodiment
Hereinafter, the present invention will be described in detail with reference to the accompanying drawings and in combination with Examples.It should be noted that not conflicting
In the case of, the features in the embodiments and the embodiments of the present application can be combined with each other.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.
Embodiment 1
Embodiment of the method provided by the embodiment of the present application one can be in mobile terminal, terminal or similar fortune
It calculates and is executed in device.For running on mobile terminals, Fig. 1 is a kind of method for cleaning of background application of the embodiment of the present invention
Mobile terminal hardware block diagram.As shown in Figure 1, mobile terminal 10 may include that one or more (only shows one in figure
It is a) (processor 102 can include but is not limited to the processing of Micro-processor MCV or programmable logic device FPGA etc. to processor 102
Device), memory 104 for storing data and the transmitting device 106 for communication function.Ordinary skill people
Member does not cause to limit it is appreciated that structure shown in FIG. 1 only signal to the structure of above-mentioned electronic device.For example, mobile
Terminal 10 may also include than shown in Fig. 1 more perhaps less component or with the configuration different from shown in Fig. 1.
Memory 104 can be used for storing the software program and module of application software, such as the backstage in the embodiment of the present invention
Corresponding program instruction/the module of the method for cleaning of application, the software journey that processor 102 is stored in memory 104 by operation
Sequence and module realize above-mentioned method thereby executing various function application and data processing.Memory 104 may include
High speed random access memory, may also include nonvolatile memory, as one or more magnetic storage device, flash memory or its
His non-volatile solid state memory.In some instances, memory 104 can further comprise remotely setting relative to processor 102
The memory set, these remote memories can pass through network connection to mobile terminal 10.The example of above-mentioned network includes but not
It is limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Transmitting device 106 is used to that data to be received or sent via a network.Above-mentioned network specific example may include
The wireless network that the communication providers of mobile terminal 10 provide.In an example, transmitting device 106 includes a Network adaptation
Device (Network Interface Controller, NIC), can be connected by base station with other network equipments so as to it is mutual
Networking is communicated.In an example, transmitting device 106 can be radio frequency (Radio Frequency, RF) module, use
In wirelessly being communicated with internet.
A kind of method for cleaning of background application for running on above-mentioned mobile terminal is provided in the present embodiment, and Fig. 2 is root
According to the flow chart of the method for cleaning of the background application of the embodiment of the present invention, as shown in Fig. 2, the process includes the following steps:
Step S202 reads the whole application just in terminal system running background, and obtains the remaining capacity of terminal;
Step S204 parses the precedence information of each application in all applications according to preset rules;Precedence information
It can be indicated with weight;
Step S206, according to remaining capacity and precedence information, selection one or more application is carried out clearly in all applications
Reason.
Through the above steps, the whole application just in terminal system running background is read, and obtains the surplus of the terminal
Remaining electricity;The precedence information of each application in all applications is parsed according to preset rules;According to the residual electric quantity and
Precedence information selection one or more application in all applications is cleared up.It solves and is saving in the related technology
While saving electric quantity consumption the technical issues of loss user experience, while reducing electric quantity consumption to greatest extent minimally
Influence the usage experience of user.
Optionally, the executing subject of above-mentioned steps can be terminal, such as mobile phone, plate etc., but not limited to this.
Optionally, the execution sequence of the remaining capacity and step S204 of the acquisition terminal in step S202 is to can be interchanged
, it can step S204 is first carried out, then executes the remaining capacity for obtaining terminal again.
Optionally, include according to the precedence information that preset rules parse each application in all applications:
S11 obtains each in all applications apply in predetermined time window from the switching frequency for being switched to foreground from the background;
S12, according to switching frequency determine all application in each application precedence information, wherein switching frequency with it is excellent
First grade information is positively correlated, that is, the switching frequency of application is higher, and the priority of application is higher.
In the present embodiment, other default can also use other than determining precedence information in addition to using switching frequency
Rule determines, such as determines according in predetermined time window in the length of time of front stage operation, as the front stage operation time gets over
Long, priority is higher, can also be determined according to the type of application, and the priority of such as application of dialing and instant messaging is higher than it
The priority of the application of his type perhaps determines or according to whether that there are terminal tasks is (noisy according to the customized of user
Clock, memorandum are reminded) determine the priority of corresponding application.
Specifically, S11, obtains and each in all applications apply the switching for being switched to foreground from the background in predetermined time window
Frequency includes:
S21 reads each status information for applying each moment in predetermined time window, wherein status information packet
It includes:Foreground state, background state;
S22, the state for counting each application become the number of foreground state in predetermined time window from background state;
Number is determined as each switching frequency applied in predetermined time window by S23.
In an optional embodiment according to the present embodiment, according to remaining capacity and precedence information in whole applications
Middle selection one or more application carries out cleaning:
S31 determines the number of applications for allowing running background according to remaining capacity;
S32 calculates the quantity all applied and subtracts using number when determining number of applications is less than the quantity all applied
The difference of amount;
S33 selects difference background application according to the sequence of precedence information from low to high in all applications;
S34 clears up selected difference background application.
In another optional embodiment according to the present embodiment, answered according to remaining capacity and precedence information all
Carrying out cleaning with middle selection one or more application includes:
S41 determines the number of applications for allowing to clear up according to remaining capacity;
S42 selects number of applications background application according to the sequence of precedence information from low to high in all applications;
S43 clears up selected number of applications background application.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation
The method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very much
In the case of the former be more preferably embodiment.Based on this understanding, technical solution of the present invention is substantially in other words to existing
The part that technology contributes can be embodied in the form of software products, which is stored in a storage
In medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculate
Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Embodiment 2
Additionally provide a kind of cleaning plant of background application in the present embodiment, the device for realizing above-described embodiment and
Preferred embodiment, the descriptions that have already been made will not be repeated.As used below, predetermined function may be implemented in term " module "
The combination of the software and/or hardware of energy.It is hard although device described in following embodiment is preferably realized with software
The realization of the combination of part or software and hardware is also that may and be contemplated.
Fig. 3 is the structural block diagram of the cleaning plant of background application according to an embodiment of the present invention, as shown in figure 3, the device
Including:
Processing module 30, for reading the whole application just in terminal system running background, and the residue of acquisition terminal
Electricity;
Parsing module 32, for parsing the precedence information of each application in all applications according to preset rules;
Cleaning modul 34, for selecting one or more application in all applications according to remaining capacity and precedence information
It is cleared up.
Optionally, parsing module includes:Acquiring unit, for obtaining each in all applications apply in predetermined time window
It is interior from the switching frequency for being switched to foreground from the background;First determination unit, it is each in all applications for being determined according to switching frequency
The precedence information of application, wherein switching frequency is positively correlated with precedence information.
Optionally, cleaning modul includes:Second determination unit allows answering for running background for determining according to remaining capacity
Use quantity;Computing unit, for calculating the quantity all applied and subtracting when determining number of applications is less than the quantity all applied
Go the difference of number of applications;First selecting unit, for being selected in all applications according to the sequence of precedence information from low to high
Select difference background application;First cleaning unit, for clearing up selected difference background application.
Optionally, parsing module:Third determination unit, for determining the number of applications for allowing to clear up according to remaining capacity;
Second selecting unit, for being answered on selection number of applications backstage in all applications according to the sequence of precedence information from low to high
With;Second cleaning unit, for clearing up selected number of applications background application.
It should be noted that above-mentioned modules can be realized by software or hardware, for the latter, Ke Yitong
Following manner realization is crossed, but not limited to this:Above-mentioned module is respectively positioned in same processor;Alternatively, above-mentioned modules are with any
Combined form is located in different processors.
Embodiment 3
It present embodiments provides a kind of based on the backstage cleaning of the android system of remaining capacity and user's use habit intelligence
Method, this method includes two aspects, first is that user's habit record and analysis part, record the shape of the different moments of each application
State information, and weight (or priority, the similarly hereinafter) sequence that is applied is analyzed according to record data.Second is that based on after remaining capacity
Electricity is divided into several stages by platform cleaning part, number of units after different permissions is set separately for each stage, and according to first
The application sequence got, applying in running background service before only allowing to sort.Intelligence backstage provided by the present invention is cleared up
The considerations of method will be according to the demand of user and to remaining capacity clears up application, is saving electricity by cleaning backstage
While consumption, the decline of user experience is utmostly reduced.
The present embodiment provides one kind it is contemplated that user's use habit and again it is contemplated that the intelligence of power consumption curve
Backstage method for cleaning, to minimally influence the usage experience of user while reducing electric quantity consumption to greatest extent.
Present embodiments provide android system intelligence backstage method for cleaning, it is of course possible to it applies in other operating systems,
The method includes obtaining user to clear up two parts using habit and intelligent use, api interface and increased system are utilized
System service, Fig. 4 are a kind of android system intelligence based on remaining capacity and user's use habit provided in an embodiment of the present invention
The step flow chart of backstage method for cleaning, including:
101) application state database is initialized;
102) it obtains and applies at the status information of different moments, wherein the time is long to the record of historic state information
It is short to can be set, such as can be the record in a charge cycle, the record being also possible in several charge cycles, etc.;
103) according to the historic state information of application, one or more indexs are calculated, according to the size of index to application into
Row setting weight, and to using weight sequencing;
104) it obtains just in the application of running background;
105) real time electrical quantity is obtained, determines the maximum background application number allowed;
106) according to the weight sequencing of current application, in conjunction with maximum allowable background application number 105), determination allows to run
List of application;
107) application that is currently running not in lists is cleared up;Or combine 106) with 101) step, determining will
The background application to be cleaned, and execute cleaning.
Optionally, the present embodiment further includes increasing the system clothes when installing android system newly in equipment factory
Business.
Optionally, the present embodiment further includes that maintenance personnel or manager user are increased by permission, described in change or deletion
The interface of newly-increased system service.
Optionally, the step 101) further includes the knot that maintenance personnel or manager user change database by permission
Structure increases or deletes the data type in database newly.
Optionally, the step 102) further includes the foreground/background information of application, calls the information of other application, closes letter
A series of status informations such as breath.
Optionally, the step 103) further include it is described using weight sequencing can using the occupancy of front and back as according to
According to, can also using from the frequency on foreground is switched to from the background as foundation.In step 103), one or more indexs, packet
It includes using foreground time occupancy (i.e. the foreground time occupies the ratio for applying total duration), further includes nearest a period of time
In window application switching to foreground frequency, etc. also including the use of the historic state information institute recorded, calculated other are each
Item reflects the index using situation.
Optionally, the step 103) further includes the time span of selection analysis, can choose the application to the past one day
State is analyzed, and can also be analyzed one week application state of past.
Optionally, the sequence of step 104) and step 105) is unlimited, can also carry out simultaneously.
Optionally, step 106) can also be the application that is currently running according to after obtained weighted list sequence further according to answering
Retain the high application of weight with number.
Specific implementation process included by the scheme of the present embodiment includes:
The customized system service for recording all application state informations is added in system service, booting when with
Other systems service starts together, is present in the life cycle that mobile phone is entirely opened, and the moment holds the record, and by the letter of record
Breath is stored in special database;
If every time when charging, recording the system service meeting of application state information using a charge cycle as record length
The system broadcasts that mobile phone starts to charge are received, the application state information recorded in database is extracted and analyzed first,
For example number of the application from Background scheduling to foreground can be used as to the judgement using weight height, therefore the weight height that is applied
Low sequence, and saved, then the applicating history state stored in database is emptied, restart primary new
Record;
In addition customized system service of the addition for management backstage application number in system service, service moment monitoring
Background application number, the service obtain the remaining capacity of mobile phone according to system broadcasts, and dynamic determines the background application number allowed, electricity
The background application number allowed when more is also more, and the background application number allowed when electricity is less is then accordingly reduced;
When background application number is more than permitted background application number, then arranged according to the weight for being currently running application
Sequence is applied number and is currently running to close the weight sequencing i.e. lesser application of weight rearward so that allowing to run
Application number it is equal, thus play the role of reduce power consumption.
Specifically, being respectively 4,5,2 times as switched the number on foreground from the background in a record period using A, B, C, then
Obtain weight it is descending be ordered as BAC, such as existed simultaneously from the background using A, B, C within the next unit time, and this
If when according to real time electrical quantity allow application number be 2, according to weight sequencing, C due to beyond allow after number of units and be cleaned.
In the bottom application for being related to source code, the modification on specific source code includes:
In android system application be divided into two component parts of activity and service, wherein activity with answer
Foreground state is then in when applying there are when activity operation with front stage operation correlation.In addition service is divided into again
Startservice and two kinds of bindservice, and bindservice and activity phase is bound, when activity is closed,
Its corresponding bindservice can also be closed together, and startservice can only pass through calling with independent operating
The stopself of stopservice or service could stop startservice operation, therefore with apply running background phase
The service of pass is only startservice, when running using no activity but having startservice operation, is then located
In background operation state.
The starting and closing of Activity is inherently to pass through calling in android system
What the function in ActivityThread.java was realized, if Activity is in kill state, can call
PerformLaunchActivity function makes Activity enter run mode, if Activity is in Stopped state,
It can call performRestartActivity function that Activity is made to enter run mode.If Activity is in operation shape
State then can call performStopActivity that Activity is made to enter termination state.
In addition the starting of startService and the function closed and passed through in calling ActivityThred.java are real
Existing, if Service is in halted state, call handleServiceArgs function that Service is made to enter operation shape
State calls handleStopService to enter halted state if Service is in operating status.
Therefore this example is on the basis of analyzing activity and service opening and closing process, in Android source code
In increase newly for record apply activity and service state system service.
The system service stores application state using the structure of Hash table, the key of Hash table be using packet name,
Value is the class list that function name and allocating time are called in a storage, and calling function entitled above-mentioned five makes
The changed function of activity service state.
The system service provides the interface of inquiry, increase and deletion record, can by call the service provide public affairs
Function is total to realize.
It modifies to five in ActivityThread.java file function mentioned above, makes it in success
The function that newly-increased system service can be called to increase record after the function is run, as long as successfully calling one of function,
Then can by the title for calling function and its corresponding application and it is current at the time of record, to get all using shape
The changed information of state.
By analyzing all record information obtained in a period of time, if had invoked
PerformLaunchActivity function or performRestartActivity function are corresponding without calling
PerformStopActivity function then shows that the during this period of time application has the activity being currently running.If adjusted
With handleServiceArgs function without calling corresponding handleStopService function, then show at this section
There is the start service being currently running in the interior application.If judged using there is the activity being currently running
Foreground state is in the short time, if be currently running using there is the startservice that is currently running and may be not present
Activity then judges that it is in background state.
The period that each application is in front and back is got, according to the time threshold of setting, judges and count recording
Period in meet the backstage tune foreground number of threshold requirement, and be applied Sorted list according to the sequence of number from big to small
Table.
Android background intelligent method for cleaning provided in this embodiment, before the historical data of application is especially applied
The switching moment point on backstage has carried out historical record, and in this, as the data source for the weight index for calculating application.The step
It is accustomed to be subsequent based on data mining user, and proposes more reasonably to provide the foundation using weight sequencing index, according to user
Use habit determines background application weight, and being dynamically determined according to real-time remaining capacity allows using number.Compared with prior art, it ties
Real-time remaining capacity, user's habit weight index are closed, the sequence of background application is determined, is reduced while effectively saving electric quantity consumption
The loss of user experience.
Embodiment 4
The embodiments of the present invention also provide a kind of storage mediums.Optionally, in the present embodiment, above-mentioned storage medium can
To be arranged to store the program code for executing following steps:
S1 reads the whole application just in terminal system running background, and obtains the remaining capacity of terminal;
S2 parses the precedence information of each application in all applications according to preset rules;
S3, according to remaining capacity and precedence information, selection one or more application is cleared up in all applications.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to:USB flash disk, read-only memory (ROM,
Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or
The various media that can store program code such as CD.
Optionally, in the present embodiment, processor is executed according to program code stored in storage medium and is read
Whole applications of terminal system running background, and obtain the remaining capacity of terminal;
Optionally, in the present embodiment, processor is executed according to program code stored in storage medium according to default
The precedence information of each application in rule parsing whole application;
Optionally, in the present embodiment, processor is executed according to program code stored in storage medium according to residue
Electricity and precedence information the selection one or more application in all applications are cleared up.
Optionally, the specific example in the present embodiment can be with reference to described in above-described embodiment and optional embodiment
Example, details are not described herein for the present embodiment.
Obviously, those skilled in the art should be understood that each module of the above invention or each step can be with general
Computing device realize that they can be concentrated on a single computing device, or be distributed in multiple computing devices and formed
Network on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored
It is performed by computing device in the storage device, and in some cases, it can be to be different from shown in sequence execution herein
Out or description the step of, perhaps they are fabricated to each integrated circuit modules or by them multiple modules or
Step is fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific hardware and softwares to combine.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.
Claims (11)
1. a kind of method for cleaning of background application, which is characterized in that including:
The whole application just in terminal system running background is read, and obtains the remaining capacity of the terminal;
The precedence information of each application in all applications is parsed according to preset rules;
Selection one or more application carries out clearly in all applications with the precedence information according to the residual electric quantity
Reason.
2. the method according to claim 1, wherein being answered according to each in preset rules parsing all applications
Precedence information includes:
Obtain each in all applications apply in predetermined time window from the switching frequency for being switched to foreground from the background;
The precedence information of each application in all applications is determined according to the switching frequency, wherein the switching frequency
It is positively correlated with the precedence information.
3. according to the method described in claim 2, it is characterized in that, obtaining each in all applications apply in the predetermined time
Backstage is switched to the switching frequency on foreground and includes in window:
Read each status information for applying each moment in the predetermined time window, wherein the state letter
Breath includes:Foreground state, background state;
The state for counting each application becomes the number of foreground state in the predetermined time window from background state;
The number is determined as each switching frequency applied in the predetermined time window.
4. according to the method in any one of claims 1 to 3, which is characterized in that according to the residual electric quantity with it is described excellent
First grade information selection one or more application in all applications carries out cleaning and includes:
The number of applications for allowing running background is determined according to the residual electric quantity;
When the determining number of applications is less than the quantity all applied, calculates the quantity all applied and subtract institute
State the difference of number of applications;
The difference background application is selected in all applications according to the sequence of the precedence information from low to high;
Clear up the selected difference background application.
5. according to the method in any one of claims 1 to 3, which is characterized in that according to the residual electric quantity with it is described excellent
First grade information selection one or more application in all applications carries out cleaning and includes:
The number of applications for allowing to clear up is determined according to the residual electric quantity;
The number of applications backstage is selected to answer in all applications according to the sequence of the precedence information from low to high
With;
Clear up the selected number of applications background application.
6. a kind of cleaning plant of background application, which is characterized in that including:
Processing module, for reading the whole application just in terminal system running background, and the residue electricity of the acquisition terminal
Amount;
Parsing module, for parsing the precedence information of each application in all applications according to preset rules;
Cleaning modul, for selecting one or more in all applications with the precedence information according to the residual electric quantity
A application is cleared up.
7. device according to claim 6, which is characterized in that the parsing module includes:
Acquiring unit, for obtaining each in all applications apply in predetermined time window from being switched to foreground from the background
Switching frequency;
First determination unit, for determining the precedence information of each application in all applications according to the switching frequency,
Wherein, the switching frequency is positively correlated with the precedence information.
8. the device according to any one of claim 6 to 7, which is characterized in that the cleaning modul includes:
Second determination unit, for determining the number of applications for allowing running background according to the residual electric quantity;
Computing unit, for calculating the whole and answering when the determining number of applications is less than the quantity all applied
Quantity subtracts the difference of the number of applications;
First selecting unit, described in being selected in all applications according to the sequence of the precedence information from low to high
Difference background application;
First cleaning unit, for clearing up the selected difference background application.
9. the device according to any one of claim 6 to 7, which is characterized in that the parsing module:
Third determination unit, for determining the number of applications for allowing to clear up according to the residual electric quantity;
Second selecting unit, described in being selected in all applications according to the sequence of the precedence information from low to high
Number of applications background application;
Second cleaning unit, for clearing up the selected number of applications background application.
10. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein when described program is run
Method described in any one of perform claim requirement 1 to 5.
11. a kind of processor, which is characterized in that the processor is for running program, wherein right of execution when described program is run
Benefit require any one of 1 to 5 described in method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710345081.2A CN108874109A (en) | 2017-05-16 | 2017-05-16 | The method for cleaning and device of background application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710345081.2A CN108874109A (en) | 2017-05-16 | 2017-05-16 | The method for cleaning and device of background application |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108874109A true CN108874109A (en) | 2018-11-23 |
Family
ID=64321004
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710345081.2A Pending CN108874109A (en) | 2017-05-16 | 2017-05-16 | The method for cleaning and device of background application |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108874109A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111400052A (en) * | 2020-04-22 | 2020-07-10 | Oppo广东移动通信有限公司 | Decompression method, decompression device, electronic equipment and storage medium |
CN112256354A (en) * | 2020-11-25 | 2021-01-22 | Oppo(重庆)智能科技有限公司 | Application starting method and device, storage medium and electronic equipment |
WO2021208626A1 (en) * | 2020-04-13 | 2021-10-21 | 华为技术有限公司 | Method and apparatus for keeping application alive, and electronic device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103164269A (en) * | 2011-12-08 | 2013-06-19 | 中兴通讯股份有限公司 | Method and terminal achieving multi-window display of application programs |
CN103631661A (en) * | 2013-11-27 | 2014-03-12 | 青岛海信电器股份有限公司 | Internal storage management method and device |
CN104866069A (en) * | 2015-06-12 | 2015-08-26 | 广东小天才科技有限公司 | Method and device for automatically clearing background application programs |
CN105843650A (en) * | 2016-03-31 | 2016-08-10 | 青岛海信移动通信技术股份有限公司 | Application program management method and device in intelligent terminal |
CN106325990A (en) * | 2016-08-19 | 2017-01-11 | 宇龙计算机通信科技(深圳)有限公司 | Control method of application program, control device and terminal |
-
2017
- 2017-05-16 CN CN201710345081.2A patent/CN108874109A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103164269A (en) * | 2011-12-08 | 2013-06-19 | 中兴通讯股份有限公司 | Method and terminal achieving multi-window display of application programs |
CN103631661A (en) * | 2013-11-27 | 2014-03-12 | 青岛海信电器股份有限公司 | Internal storage management method and device |
CN104866069A (en) * | 2015-06-12 | 2015-08-26 | 广东小天才科技有限公司 | Method and device for automatically clearing background application programs |
CN105843650A (en) * | 2016-03-31 | 2016-08-10 | 青岛海信移动通信技术股份有限公司 | Application program management method and device in intelligent terminal |
CN106325990A (en) * | 2016-08-19 | 2017-01-11 | 宇龙计算机通信科技(深圳)有限公司 | Control method of application program, control device and terminal |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021208626A1 (en) * | 2020-04-13 | 2021-10-21 | 华为技术有限公司 | Method and apparatus for keeping application alive, and electronic device |
CN111400052A (en) * | 2020-04-22 | 2020-07-10 | Oppo广东移动通信有限公司 | Decompression method, decompression device, electronic equipment and storage medium |
CN112256354A (en) * | 2020-11-25 | 2021-01-22 | Oppo(重庆)智能科技有限公司 | Application starting method and device, storage medium and electronic equipment |
CN112256354B (en) * | 2020-11-25 | 2023-05-16 | Oppo(重庆)智能科技有限公司 | Application starting method and device, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107276790B (en) | Method and system for processing service work order | |
CN1805442B (en) | Device and method for providing on-line billing in IMS networks | |
CN104159281B (en) | The electricity saving method and device of mobile terminal | |
CN107734539B (en) | Network selection method and device and access network equipment | |
CN108874109A (en) | The method for cleaning and device of background application | |
CN107528766A (en) | Information-pushing method, apparatus and system | |
Di Francesco et al. | A sharing-and competition-aware framework for cellular network evolution planning | |
US10356693B2 (en) | Network resources brokering system and brokering entity | |
CN104170502A (en) | Resource allocation | |
CN107846678A (en) | The use control method and device of data traffic | |
CN108540568A (en) | Computing capability sharing method and smart machine | |
CN106332208A (en) | Multi-card resource management method and device, and multi-card terminal | |
CN109101326A (en) | A kind of background process management method and device | |
CN109240763A (en) | Application program accelerates method, mobile terminal and the storage medium of starting | |
CN104301874B (en) | Notifications sending method, equipment and system | |
CN108650427A (en) | A kind of call access method, device and electronic equipment | |
WO2015137839A1 (en) | Method for automatic selection and proposal of the optimal communication mean | |
US20190058798A1 (en) | Telecommunication service subscription integration system | |
US8229453B2 (en) | Home zone service | |
CN113064677B (en) | Application running method and device, storage medium and electronic device | |
US20180220432A1 (en) | Network resources brokering system and brokering entity for accessing a network resource with preferential treatment | |
CN102158833A (en) | Method for transmitting short message service (SMS) and SMS gateway | |
Feigin | Analysis of customer patience in a bank call center | |
CN107302487A (en) | Number obtaining method and system on line | |
CN108718449A (en) | Management method, device and the readable storage medium storing program for executing of flow |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20181123 |
|
WD01 | Invention patent application deemed withdrawn after publication |