CN110018888A - Method for managing resource, device, mobile terminal and computer readable storage medium - Google Patents
Method for managing resource, device, mobile terminal and computer readable storage medium Download PDFInfo
- Publication number
- CN110018888A CN110018888A CN201810023912.9A CN201810023912A CN110018888A CN 110018888 A CN110018888 A CN 110018888A CN 201810023912 A CN201810023912 A CN 201810023912A CN 110018888 A CN110018888 A CN 110018888A
- Authority
- CN
- China
- Prior art keywords
- resource
- internet resources
- application
- background application
- grade
- 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
- 238000000034 method Methods 0.000 title claims abstract description 149
- 230000008569 process Effects 0.000 claims description 114
- 230000015654 memory Effects 0.000 claims description 51
- 238000004590 computer program Methods 0.000 claims description 14
- 238000013507 mapping Methods 0.000 claims description 11
- 238000007726 management method Methods 0.000 description 21
- 238000010586 diagram Methods 0.000 description 17
- 230000006870 function Effects 0.000 description 10
- 230000006854 communication Effects 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000000694 effects Effects 0.000 description 8
- 230000008014 freezing Effects 0.000 description 7
- 238000007710 freezing Methods 0.000 description 7
- 239000011230 binding agent Substances 0.000 description 5
- 230000008859 change Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 3
- 239000004973 liquid crystal related substance Substances 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000005457 optimization Methods 0.000 description 3
- 238000012913 prioritisation Methods 0.000 description 3
- 238000004064 recycling Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 206010037660 Pyrexia Diseases 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000005314 correlation function Methods 0.000 description 1
- 230000006378 damage Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000004886 process control Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- 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/48—Program initiating; Program switching, e.g. by interrupt
-
- 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/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
-
- 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/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- 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]
-
- 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/5016—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 the resource being the memory
-
- 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
-
- 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/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/482—Application
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5021—Priority
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/504—Resource capping
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mobile Radio Communication Systems (AREA)
- Telephone Function (AREA)
Abstract
The invention relates to a kind of method for managing resource, device, mobile terminal and computer readable storage mediums.The above method, comprising: when foreground has using at runtime, every preset time period acquires the Internet usage data of foreground application;Determine background application in the resource constraint grade of Internet resources according to the Internet usage data;The background application is added under Internet resources in resource group corresponding with the resource constraint grade, and is configured and the matched resource use priority of the resource group.Above-mentioned method for managing resource, device, mobile terminal and computer readable storage medium, it can be to the different grades of resource constraint of Internet resources dynamic implement that background application uses, it reduces because background application seizes Caton situation caused by the Internet resources of foreground application, improves system performance.
Description
Technical field
This application involves field of computer technology, more particularly to a kind of method for managing resource, device, mobile terminal and meter
Calculation machine readable storage medium storing program for executing.
Background technique
With the rapid development of Internet, intelligent mobile terminal has become the most common electronic equipment of many users, example
Such as smart phone, plate battery plate.User can install various application program on intelligent mobile terminal and carry out using working as application
Program when being run from the background, can and front stage operation application program seize CPU (Central Processing Unit, in
Central processor), memory, the system resources such as bandwidth, cause to occur the application Caton of front stage operation, system operation slowly and it is mobile eventually
The problems such as end fever.
Summary of the invention
The embodiment of the present application provides a kind of method for managing resource, device, mobile terminal and computer readable storage medium, can
With the different grades of resource constraint of Internet resources dynamic implement used background application, reduction is seized foreground because of background application and is answered
Caton situation caused by Internet resources improves system performance.
A kind of method for managing resource, comprising:
When foreground has using at runtime, every preset time period acquires the Internet usage data of foreground application;
Determine background application in the resource constraint grade of Internet resources according to the Internet usage data;
The background application is added under Internet resources in resource group corresponding with the resource constraint grade, and is matched
It sets and the matched resource use priority of the resource group.
A kind of resource management apparatus, comprising:
Acquisition module, for having when foreground using at runtime, every preset time period acquires the network money of foreground application
Source uses data;
Level determination module, for determining background application in the resource of Internet resources according to the Internet usage data
Limit grade;
Configuration module, for the background application to be added under Internet resources money corresponding with the resource constraint grade
In the group of source, and configure and the matched resource use priority of the resource group.
A kind of mobile terminal, including memory and processor are stored with computer program, the calculating in the memory
When machine program is executed by the processor, so that the processor realizes method as described above.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor
Method as described above is realized when row.
Above-mentioned method for managing resource, device, mobile terminal and computer readable storage medium are applied when foreground and are being run
When, every preset time period acquires the Internet usage data of foreground application, according to the Internet usage number of foreground application
According to determining that background application in the resource constraint grade of Internet resources, and background application is added under Internet resources and the resource
In the corresponding resource group of limit grade, while corresponding resource use priority is configured, it can be to the net that background application uses
The different grades of resource constraint of network resource dynamic implement is reduced because background application seizes card caused by the Internet resources of foreground application
Situation improves system performance.
Detailed description of the invention
Fig. 1 is the block diagram of mobile terminal in one embodiment;
Fig. 2 is the system architecture diagram of method for managing resource in one embodiment;
Fig. 3 is the flow diagram of method for managing resource in one embodiment;
Fig. 4 is the other schematic diagram of resource group of Internet resources in one embodiment;
Fig. 5 is to determine background application in the flow diagram of the resource constraint grade of Internet resources in one embodiment;
Fig. 6 is that background application is added under Internet resources resource group corresponding with resource constraint grade in one embodiment
Other flow diagram;
Fig. 7 is to be added to the background process in background application under Internet resources and resource constraint grade in one embodiment
The corresponding other flow diagram of resource group;
Fig. 8 is the block diagram of resource management apparatus in one embodiment;
Fig. 9 is the block diagram of resource management apparatus in another embodiment;
Figure 10 is the block diagram of mobile terminal in another embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood
The application is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the application, not
For limiting the application.
It is appreciated that term " first " used in this application, " second " etc. can be used to describe various elements herein,
But these elements should not be limited by these terms.These terms are only used to distinguish the first element from the other element.Citing comes
It says, in the case where not departing from scope of the present application, the first client can be known as the second client, and similarly, can incite somebody to action
Second client is known as the first client.The first client and the second client both client, but it is not same visitor
Family end.
Fig. 1 is the block diagram of mobile terminal in one embodiment.As shown in Figure 1, the mobile terminal includes passing through system bus
Processor, memory, network interface, display screen and the input unit of connection.Wherein, memory may include that non-volatile memories are situated between
Matter and processor.The non-volatile memory medium of mobile terminal is stored with operating system and computer program, the computer program
To realize a kind of method for managing resource provided in the embodiment of the present application when being executed by processor.The processor is for providing calculating
And control ability, support the operation of entire mobile terminal.Built-in storage in mobile terminal is in non-volatile memory medium
The operation of computer program provides environment.The network interface of mobile terminal with other terminals for carrying out data transmission.It is mobile whole
The display screen at end can be liquid crystal display or electric ink display screen etc., and input unit can be the touching covered on display screen
Layer is touched, the key being arranged on mobile terminal case, trace ball or Trackpad are also possible to, is also possible to external keyboard, touch-control
Plate or mouse etc..The mobile terminal can be mobile phone, tablet computer or personal digital assistant or wearable device etc..This field
Technical staff is appreciated that structure shown in Fig. 1, only the block diagram of part-structure relevant to application scheme, not
The restriction for the mobile terminal being applied thereon to application scheme is constituted, specific mobile terminal may include than as shown in the figure
More or fewer components perhaps combine certain components or with different component layouts.
Fig. 2 is the system architecture diagram of method for managing resource in one embodiment.As shown in Fig. 2, including in the system architecture
JAVA space layer 210, local ccf layer 220 and kernel (Kernel) space layer 230.It may include freezing in JAVA space layer 210
Management module 212 is tied, what mobile terminal can freeze management module 212 to realize each application to operation by this freezes plan
Slightly, related application that is more to backstage power consumption or seizing a large amount of system resources carries out freeze operation.It is wrapped in local ccf layer 220
Device 224 is managed containing resource prioritization and limitation management device 222 and platform freezing pipe.Mobile terminal can pass through resource prioritization and limitation
The different application of 222 real-time servicing of manager is in different resource use priority and different resource groups, and according to
The demand on upper layer adjusts the resource group of application program to reach optimization performance, saves the effect of power consumption.Mobile terminal can
Freeze manager 224 for the application that can freeze from the background according to the length for entering freeze-off time by platform, is assigned to corresponding pre-
If different levels frozen crust.Optionally, which may include three, be respectively: CPU limitation sleep pattern, CPU freeze
Sleep pattern, process deep freezing mode.Wherein, CPU limit sleep pattern refer to the occupied cpu resource of associated process into
Row limitation, makes associated process occupy less cpu resource, vacant cpu resource is tilted to other not frozen processes, limit
The occupancy to cpu resource has been made, has also accordingly limited process to the occupancy of Internet resources and I/O interface resource;CPU freezes to sleep
Sleep mode, which refers to, forbids associated process using CPU, and retains the occupancy to memory, when being forbidden to use cpu resource, corresponding net
Network resource and I/O interface resource are also prohibited from using;Process deep freezing mode refers in addition to being forbidden to use cpu resource,
Further the occupied memory source of associated process is recycled, the memory of recycling uses for other processes.Optionally, originally
Ground ccf layer 220 may also include interface module, the interface module include exploitation to upper layer binder interface, the frame on upper layer or
The instruction that person sends resource constraint or freeze using the binder interface by offer is to resource prioritization and limitation management
Device 222 and platform freezing pipe manage device 224.
May include in kernel spacing layer 230 UID management module 231, Cgroup module 233, Binder control module 235,
Proceeding internal memory recycling module 237 and freezes time-out and exit module 239.Wherein, UID management module 231 is for realizing based on answering
The resource of User Identity (User Identifier, UID) Lai Guanli third-party application is freezed.It compares
In based on process identity mark (Process Identifier, PID) Lai Jinhang process control, it is more convenient for uniformly managing by UID
Manage the resource of the application of a user.Cgroup module 233 is for providing a set of perfect CPU, CPUSET, memory
(memory), input/output (input/output, I/O) and the relevant resource constraint mechanism of Net.Binder manages module 235
For realizing the control of the priority of backstage binder communication.Proceeding internal memory recycling module 237 is for realizing process deep freezing
Mode can mainly discharge the file area of process when some third-party application is chronically at frozen state in this way, from
And reach the module for saving memory, also accelerate this and applies the speed in starting next time.Freeze time-out and exit module 239 to can be used for
Solve occur freezing the exception that overtime scene generates.By above-mentioned system architecture, it can be achieved that in each embodiment of the application
Method for managing resource.
As shown in figure 3, in one embodiment, providing a kind of method for managing resource, comprising the following steps:
Step 310, when foreground has using at runtime, every preset time period acquires the Internet usage of foreground application
Data.
One or more application program can have been run on mobile terminal simultaneously, it may include front stage operation foreground application and
In the background application of running background.Mobile terminal can be monitored by each application program of the active manager to operation, prison
The operating status of each application program is listened to change.Optionally, the operating status of application program may include but be not limited to starting, foreground
Operation, is exited running background.Mobile terminal can pass through active manager at regular intervals
RunningAppProcessInfo class obtains all the application lists being currently running, for example, obtaining once just every 2 seconds
In all the application lists of operation, and the operation of each application program being currently running in the application list is judged one by one
State is front stage operation or running background.
Optionally, mobile terminal can also monitor the life cycle of each activity (activity), and according to each
The life cycle of activity obtains the operating status for each application program being currently running.Mobile terminal can establish global counting
Device counts each activity to the calling of two methods of onStart and onStop, as onStart of application call
When, global counter adds 1, and as onStop of application call, global counter subtracts 1.When the overall situation meter of application program
When number device is greater than 0, it can illustrate that application program can illustrate to apply in front stage operation when the global counter of application program is equal to 0
Program is in running background.It is to be appreciated that can also be used other modes monitor application program operating status, be not limited on
State several ways.
If mobile terminal detects that the operating status of application program is front stage operation, it can indicate that foreground is applied and transport
Row.Mobile terminal can every preset time period acquisition front stage operation foreground application Internet usage data, network money
Source may include but be not limited to network speed, the occupancy that foreground application occupies in time interval corresponding with preset time period using data
Internet resources ratio etc., wherein the Internet resources ratio of occupancy may refer to the ratio of the network bandwidth occupied and total bandwidth.
Step 320, determine background application in the resource constraint grade of Internet resources according to Internet usage data.
Optionally, mobile terminal can set different resource constraint grades according to actual needs, and resource constraint grade is available
In expression using the confined degree of resource, resource constraint higher grade, and restricted degree can be bigger.Restricted money
Source may include but be not limited to cpu resource, memory source, I/O resource, Internet resources etc..Mobile terminal every preset time period is adopted
After the Internet usage data for collecting foreground application, background application can be determined in Internet resources according to Internet usage data
Resource constraint grade.When the network speed occupied or the network of occupancy provide foreground application in time interval corresponding with preset time period
When the large percentage of source, it may be determined that background application is higher resource constraint grade in Internet resources, limits background application to network
The use of resource.When foreground application in time interval corresponding with preset time period the network speed occupied or the Internet resources of occupancy
When ratio is smaller, it may be determined that background application is lower resource constraint grade in Internet resources, and background application can be used more
Internet resources.
In one embodiment, the resource constraint grade of mobile terminal setting may include without limitation rank, common limiter stage
Not, depth limit rank and freeze rank etc..Without limitation rank may refer to using resource it is unrestricted.Common limitation
Rank, which may refer to apply, can be used less resource, for example 50% resource etc. at most only can be used, but not limited to this.Depth
Limitation rank, which may refer to apply, can be used few resource, for example 20% resource etc. at most only can be used, but not limited to this.
Freeze rank and refers to all behaviors for stopping application using any resource is not available.Optionally, different types of resource
It may include several resource constraint grades of above-mentioned setting, mobile terminal can be answered for different types of resource settings backstage respectively
Resource constraint grade.
Optionally, resource constraint grade different under Internet resources can correspond to different Internet usage data intervals,
For example, Internet resources can be the Internet resources ratio of foreground application occupancy less than 10% without the corresponding section of limitation rank,
The corresponding section of common limitation rank can be the Internet resources ratio of foreground application occupancy between 10%~30%, depth limit
The corresponding section of rank processed can be the Internet resources ratio of foreground application occupancy between 30%~70%, and it is corresponding to freeze rank
Section can be foreground application occupancy Internet resources ratio be greater than 70% etc., but not limited to this.Acquisition for mobile terminal foreground
After Internet usage data within a preset period of time, after being determined according to the section where Internet usage data
The resource constraint grade of platform application.
Step 330, background application is added under Internet resources in resource group corresponding with resource constraint grade, and matched
It sets and the matched resource use priority of resource group.
Mobile terminal determines that background application after the resource constraint grade of Internet resources, can be added to network by background application
Under resource in resource group corresponding with resource constraint grade, and configures resource corresponding with the resource constraint grade determined and use
Priority.Resource constraint higher grade, and the degree that limitation resource uses is stronger, can correspond to lower resource use priority.Money
Source limit grade is lower, and the degree that limitation resource uses is weaker, can correspond to higher resource use priority.Optionally, mobile
Terminal can divide different resource groups based on kernel Cgroup (control group) mechanism, and file node can be used and write
The other resource use priority of each resource group is arranged in the mode of configuration, to be assigned in each resource group using
The time of resource or ratio etc. are managed, wherein Cgroup be the one kind provided in kernel can limit, record, be isolated into
The mechanism of physical resource used in journey (such as: the resources such as CPU, memory, I/O, network).For different types of resource, move
Dynamic terminal can divide different resource groups.Mobile terminal can load the configuration file of Cgroup, and can record in configuration file has
The resource group of division, the other resource use priority of each resource group and scheduling of resource plan corresponding with resource use priority
Slightly.Resource dispatching strategy may include but be not limited to the process being assigned in resource group and use the time of resource, occupy resource
Ratio, the resource identification used etc..For example, the corresponding other application of resource group of common limitation rank under configurable Internet resources
Maximum can occupy 20% Internet resources, and the corresponding resource group of common limitation rank under configurable CPU resource is other to be applied 1
30 seconds cpu resources etc. can be used in minute, but not limited to this.When needing to add new resource group, or modification resource group
Other resource use priority and resource dispatching strategy can pass through the configuration file of modification Cgroup.
Background application is added under Internet resources in resource group corresponding with resource constraint grade by mobile terminal, and matches
Resource use priority corresponding with the resource constraint grade determined is set, background application can be according to the corresponding resource of resource group
Scheduling strategy uses Internet resources.Optionally, the Internet usage of mobile terminal every preset time period acquisition foreground application
Data, and determine according to Internet usage data the resource constraint grade of background application.If this resource constraint etc. determined
Grade is different from the resource constraint grade that the last time determines, mobile terminal can dynamically change the resource constraint grade of background application, and
Background application is added under Internet resources in resource group corresponding with the resource constraint grade that this is determined.Background application exists
The resource constraint grade of Internet resources can change with the variation of the Internet usage data of foreground application.
Fig. 4 is the other schematic diagram of resource group of Internet resources in one embodiment.As shown in figure 4, can be right in mobile terminal
There are four different resource constraint grades for Internet resources setting, and there are four resource groups for division, wherein first resource group pair
Should be without limitation rank, Secondary resource group is corresponding commonly to limit rank, and information resources group corresponds to depth limit rank, the 4th money
Group correspondence in source freezes rank.Four resource groups can respectively correspond different resource use priorities, and first resource group is other
Resource use priority can be higher than Secondary resource group, and the other resource use priority of Secondary resource group can be higher than information resources group
Not, the other resource use priority of information resources group can be higher than the 4th resource group.First resource group without limitation rank is not
The Internet resources that limiting process uses.Less network can be used to provide for the common other Secondary resource group limiting process of limiter stage
Source.Few Internet resources can be used in the information resources group limiting process of depth limit rank.Freeze the 4th resource of rank
Unusable Internet resources of group limiting process etc..After mobile terminal can be determined according to the Internet usage data of foreground application
Platform applies the resource constraint grade in Internet resources, and background application is added to the corresponding resource group of the resource constraint grade
In, the Internet usage of background application is managed.
In the present embodiment, when foreground has using at runtime, every preset time period acquires the network money of foreground application
Source uses data, determines background application in the resource constraint etc. of Internet resources according to the Internet usage data of foreground application
Grade, and background application is added under Internet resources in resource group corresponding with the resource constraint grade, while configuring phase
The resource use priority answered can subtract the different grades of resource constraint of Internet resources dynamic implement that background application uses
It is few because background application seizes Caton situation caused by the Internet resources of foreground application, improve system performance.
As shown in figure 5, in one embodiment, making in the Internet resources of step every preset time period acquisition foreground application
It is further comprising the steps of after data:
Step 502, the resource using information of each background application is obtained.
Mobile terminal may have one or more background applications simultaneously in running background, after can obtaining each be currently running
The resource using information of platform application, resource using information may include occupancy of the background application in running background in different resource
Data, such as background application occupy ratio, the ratio of committed memory, the ratio for occupying Internet resources of CPU etc., but are not limited to
This.
Step 504, the resource category that each background application uses is obtained according to resource using information, and chooses resource category
Background application comprising Internet resources.
Mobile terminal can obtain the resource kind that each background application uses according to the resource using information of each background application
Class.Optionally, the money that mobile terminal can be used according to the resource occupation data acquisition background application for including in resource using information
Source category then can determine the backstage for example, the resource using information of background application includes to occupy CPU30%, committed memory 20%
Using resource category include CPU and memory source.Optionally, the resource that mobile terminal can also set each type corresponds to
Use threshold value, for example, cpu resource it is corresponding using threshold value be 5%, memory source it is corresponding using threshold value be 6%, network money
The corresponding use threshold value in source is 3% etc., but not limited to this.Mobile terminal can extract the different resource for including in resource using information
Occupancy data, when the occupancy data of resource be greater than it is corresponding using threshold value when, mobile terminal, which can determine to be greater than, corresponding uses threshold
The resource of value is the resource category that background application uses.For example, the resource using information of background application includes to occupy CPU30%,
Occupy network 20% etc., the cpu resource and Internet resources of occupancy are all larger than preset using threshold value, then mobile terminal can determine this
The resource category of background application is CPU and Internet resources.
Step 506, resource constraint etc. of the background application in Internet resources of selection is determined according to Internet usage data
Grade.
Mobile terminal can select the resource category used comprising after Internet resources from each background application of operation
Platform application, and determine that the resource category used includes that the backstage of Internet resources is answered according to the Internet usage data of foreground application
Used in the resource constraint grade of Internet resources.Mobile terminal can add the background application that the resource category used includes Internet resources
It is added under Internet resources in resource group corresponding with determining resource constraint grade, and configures and the matched money of resource group
Source use priority, the Internet usage for including the background application of Internet resources to the resource category used are managed.
In the present embodiment, the money that each background application uses can be determined according to the resource using information of each background application
Source category, and the background application that the resource category used includes Internet resources is selected, it include network to the resource category used
The different grades of resource constraint of Internet resources dynamic implement that the background application of resource uses, can more accurate ground background application
The Internet resources of occupancy are controlled, and system performance is improved.
In one embodiment, background application is added under Internet resources corresponding with resource constraint grade by step 330
It in resource group, and configures and the matched resource use priority of resource group, comprising: obtain background application and currently provided in network
The resource constraint grade in source, if current resource constraint grade adds the background application lower than determining resource constraint grade
It is added under Internet resources in resource group corresponding with determining resource constraint grade, and configures and the matched resource of resource group
Use priority.
Mobile terminal determines that background application is limited in the resource of Internet resources according to the Internet usage data of foreground application
After grade processed, each background application can be obtained currently in the resource constraint grade of Internet resources, and by background application currently in net
The resource constraint grade of network resource is compared with the resource constraint grade determined.If background application is currently in the money of Internet resources
Source limit grade is greater than or equal to determining resource constraint grade, then the background application is currently used in the resource of Internet resources excellent
First grade can not change this and answer from the background less than or equal to the determining corresponding resource use priority of resource constraint grade, mobile terminal
Resource constraint grade makes the background application keep current resource constraint grade in Internet resources.If background application is worked as
The preceding resource constraint grade in Internet resources is lower than determining resource constraint grade, then the background application is currently in Internet resources
Resource use priority is higher than the determining corresponding resource use priority of resource constraint grade.Mobile terminal can answer from the background this
Resource constraint grade is changed to determining resource constraint grade, can be added to the background application under Internet resources and determination
The corresponding resource group of resource constraint grade in, and configure used with the resource of the resource constraint ratings match determined it is preferential
Grade.
Optionally, mobile terminal determines background application in Internet resources according to the Internet usage data of foreground application
After resource constraint grade, the Internet resources ratio that each background application occupies can be obtained.Mobile terminal can determine whether that background application accounts for
Whether Internet resources ratio is greater than preset threshold.If the Internet resources ratio that background application occupies is less than or equal to default threshold
Value, mobile terminal can not limit the Internet resources that the background application uses, which can not be added to net
Under network resource in resource group corresponding with determining resource constraint grade.If the Internet resources ratio that background application occupies is greater than
The background application can be added to resource corresponding with determining resource constraint grade under Internet resources by preset threshold, mobile terminal
In group, and configuration is matched with resource group, limits the Internet usage of the background application.
In the present embodiment, can to the different grades of resource constraint of Internet resources dynamic implement that background application uses,
It reduces because background application seizes Caton situation caused by the Internet resources of foreground application, improves system performance.
As shown in fig. 6, in one embodiment, background application is added under Internet resources and resource constraint grade by step
In corresponding resource group, comprising the following steps:
Step 602, the subscriber group information of background application is obtained.
When application program is run, the user group that mobile terminal can be different for the application assigned of operation can pass through
The permission etc. of user group management application program.Background application is added to resource constraint under Internet resources and determining by mobile terminal
The corresponding resource group of grade, can obtain the application identities of the background application, and obtain the background application according to application identities
Subscriber group information, wherein application identities by one of number, letter and symbol etc. or a variety of can form.Subscriber group information
It may include user group mark etc., wherein user group mark can be by one of number, letter and symbol etc. or a variety of carry out structures
At.
Step 604, the process identification (PID) for having mapping relations with subscriber group information is inquired.
Mobile terminal can inquire the process for having mapping relations with subscriber group information according to the subscriber group information of background application
Mark, to obtain each process run under the background application.The kernel spacing layer of mobile terminal can be in real time to belonging to process
Subscriber group information be collected, when process creation or destruction, kernel can be allocated the subscriber group information belonging to process
And release etc., process in the process of running, can also there is a situation where subscriber group informations to change.Kernel spacing layer is in real time to each
Subscriber group information belonging to a process is collected, and can establish the progress informations such as process identification (PID), process title and user group letter
The mapping relations of breath.When mobile terminal need for background application to be added to it is corresponding with determining resource constraint grade under Internet resources
Resource group when, can directly inquire the process identification (PID) for having mapping relations according to the subscriber group information of background application, compare
The process of all operations is traversed to find the process run under background application, directly searches to have to map with subscriber group information and close
The process identification (PID) of system is more convenient.
Step 606, will be added under Internet resources and the resource constraint grade with the matched background process of process identification (PID)
In corresponding resource group.
It, can basis after mobile terminal inquires the process identification (PID) for having mapping relations according to the subscriber group information of background application
Process identification (PID) obtains all processes run under background application.Mobile terminal can add all processes run under background application
Under to Internet resources in resource group corresponding with determining resource constraint grade, and to all processes run under background application
Resource use priority corresponding with the resource constraint grade determined is configured, to can realize that configuring the background application is and determination
The corresponding resource use priority of resource constraint grade purpose.
As shown in fig. 7, optionally, step 606 will be added under Internet resources with the matched background process of process identification (PID) with
In the corresponding resource group of the resource constraint grade, comprising the following steps:
Step 702, the operation characteristic with the matched background process of process identification (PID) is acquired.
Process (Process) is program in computer about the primary operation activity on certain data acquisition system, be system into
The basic unit of row Resource Distribution and Schedule is the basis of operating system configuration.Generally, one can have been run under an application
Or multiple processes, different processes can be used for executing different tasks respectively.The user group of acquisition for mobile terminal and background application
After information has the process identification (PID) of mapping relations, the operation characteristic with the matched background process of process identification (PID) can be acquired.Operation is special
Sign may include but be not limited to the communication event of the currently performed task of background process and other processes, the resource kind currently occupied
Class and ratio etc..
Step 704, resource category that matched background process uses is determined according to operation characteristic.
Mobile terminal can analyze the operation characteristic of acquisition, what the determining and matched background process of process identification (PID) used
Resource category.Optionally, mobile terminal can make according to the resource category and ratio-dependent background process that background process currently occupies
Resource category then can determine the resource kind that the background process uses for example, background process currently occupies cpu resource 30%
Class is cpu resource, and background process currently occupies Internet resources 20%, occupies CPU20%, then can determine what the background process used
Resource category is network and cpu resource etc., but not limited to this.Optionally, mobile terminal can also currently be executed according to background process
Task determine the resource category that background process uses, for example, the currently performed task of background process be downloading task, then can be true
The resource category that the fixed background process uses is Internet resources, and the currently performed task of background process is data loading tasks, then
It can determine that resource category that the background process uses is CPU and memory source etc., but not limited to this.
Step 706, the background process that resource category includes Internet resources is added under Internet resources with resource constraint etc.
In the corresponding resource group of grade.
Mobile terminal can select the resource category used from all processes run under background process and provide comprising network
The background process in source, and by the resource category used include Internet resources background process be added under Internet resources with it is determining
In the corresponding resource group of resource constraint grade, resource use priority corresponding with the resource constraint grade determined is configured.It can
Internet usage limitation only is carried out to the process for using Internet resources in background application, resource management can be made more accurate, mentioned
High system performance.
In the present embodiment, the process identification (PID) with mapping relations can be found according to the subscriber group information of background application,
And by and the matched background process of process identification (PID) be added to resource group corresponding with determining resource constraint grade under Internet resources
In not, unified Internet usage management can be carried out to each process run under background application according to resource constraint grade,
It can also be achieved different grades of resource constraint by the other setting of resource group, optimization system performance saves power consumption.
In one embodiment, the Internet usage data of step every preset time period acquisition foreground application, comprising:
Acquire the Internet usage data of foreground application in real time by kernel spacing, and every preset time period is by Internet usage
Data are packaged into data packet and send user's space to.
It may include having kernel spacing and user's space in the Virtual Space of mobile terminal, kernel spacing can be used for storing kernel
Code and data, user's space can be used for storing the code and data of application program.Kernel spacing possesses higher level of privilege
Not, the process run in kernel spacing can possess the permission of all hardware of access mobile terminal, and the permission of user's space is then
Lower, the part resource of system only can be used in the process run in the user space.
It is applied at runtime when mobile terminal detects that foreground has, the net of foreground application can be acquired in real time by kernel spacing
Network resource uses data, and Internet usage data are packaged into data packet and send user's space to by every preset time period.
Optionally, the Internet usage data of foreground application can be packaged into data packet according to the packet format of agreement by mobile terminal, and
Send user's space to.Kernel spacing is communicated with the mode that asynchronous netlink can be used in user's space, and netlink is
A kind of a kind of special interprocess communication that consumer process may be implemented and is communicated with kernel process.Kernel spacing passes through asynchronous communication
Mode the Internet usage data of foreground application are transferred to user's space, compared to rise user's space active inquiry side
Formula, it is more efficient and convenient, the efficiency of transmission of data can be improved.
After user's space receives the data packet of kernel spacing transmission, data packet can be parsed, obtain foreground application
Internet usage data within a preset period of time.Mobile terminal can analyze foreground application in preset time by user's space
Internet usage data in section, and background application is determined in the resource constraint grade of Internet resources, thus to background application
Internet usage limited.
In the present embodiment, the Internet usage data of foreground application can be acquired by kernel spacing, and by acquisition
Internet usage data are transmitted to user's space and are analyzed, it is possible to provide the clue foundation that more resources limit grade determines,
Background application can be made more accurate in the resource constraint level adjustment of Internet resources, improve resource management effect and system performance.
In one embodiment, a kind of method for managing resource is provided, comprising the following steps:
Step (1), when foreground has using at runtime, every preset time period acquires the Internet usage of foreground application
Data.
Step (2) determines background application in the resource constraint grade of Internet resources according to Internet usage data.
Optionally, step (1), comprising: acquire the Internet usage data of foreground application in real time by kernel spacing, and
Internet usage data are packaged into data packet and send user's space to by every preset time period;Step (2), comprising: pass through
User's space analyzes the Internet usage data, determines background application in the resource constraint grade of Internet resources.
Optionally, after step (1), further includes: obtain the resource using information of each background application;Made according to resource
The resource category used with each background application of acquisition of information, and choose the background application that resource category includes Internet resources;Step
Suddenly (2), comprising: resource constraint grade of the background application in Internet resources of selection is determined according to Internet usage data.
Background application is added under Internet resources in resource group corresponding with resource constraint grade, and matches by step (3)
It sets and the matched resource use priority of resource group.
Optionally, step (3), comprising: obtain background application currently in the resource constraint grade of Internet resources;If current
Background application is then added under Internet resources and limits with determining resource lower than determining resource constraint grade by resource constraint grade
In the corresponding resource group of grade processed, and configure and the matched resource use priority of resource group.
Optionally, step (3), comprising: obtain the Internet resources ratio that background application occupies;If Internet resources ratio is greater than
Background application is then added under Internet resources in resource group corresponding with determining resource constraint grade by preset threshold, and
Configuration and the matched resource use priority of resource group.
Optionally, background application is added under Internet resources in resource group corresponding with resource constraint grade, comprising:
Obtain the subscriber group information of background application;Inquiry has the process identification (PID) of mapping relations with subscriber group information;It will be with process identification (PID)
Matched background process is added under Internet resources in resource group corresponding with resource constraint grade.
Optionally, by and the matched background process of process identification (PID) be added under Internet resources it is corresponding with resource constraint grade
In resource group, comprising: the operation characteristic of acquisition and the matched background process of process identification (PID);It is determined according to operation characteristic matched
The resource category that background process uses;The background process that resource category includes Internet resources is added under Internet resources and resource
In the corresponding resource group of limit grade.
In the present embodiment, when foreground has using at runtime, every preset time period acquires the network money of foreground application
Source uses data, determines background application in the resource constraint etc. of Internet resources according to the Internet usage data of foreground application
Grade, and background application is added under Internet resources in resource group corresponding with the resource constraint grade, while configuring phase
The resource use priority answered can subtract the different grades of resource constraint of Internet resources dynamic implement that background application uses
It is few because background application seizes Caton situation caused by the Internet resources of foreground application, improve system performance.
It should be understood that each step in above-mentioned flow diagram is successively shown according to the instruction of arrow, still
These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps
Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, above-mentioned flow diagram
In at least part step may include that perhaps these sub-steps of multiple stages or stage are not necessarily multiple sub-steps
Completion is executed in synchronization, but can be executed at different times, the execution in these sub-steps or stage sequence is not yet
Necessarily successively carry out, but can be at least part of the sub-step or stage of other steps or other steps in turn
Or it alternately executes.
As shown in figure 8, in one embodiment, providing a kind of resource management apparatus 800, including acquisition module 810, grade
Determining module 820 and configuration module 830.
Acquisition module 810, for having when foreground using at runtime, every preset time period acquires the network of foreground application
Resource uses data.
Level determination module 820, for determining background application in the resource of Internet resources according to Internet usage data
Limit grade.
Configuration module 830, for background application to be added under Internet resources resource group corresponding with resource constraint grade
In not, and configure and the matched resource use priority of resource group.
In the present embodiment, when foreground has using at runtime, every preset time period acquires the network money of foreground application
Source uses data, determines background application in the resource constraint etc. of Internet resources according to the Internet usage data of foreground application
Grade, and background application is added under Internet resources in resource group corresponding with the resource constraint grade, while configuring phase
The resource use priority answered can subtract the different grades of resource constraint of Internet resources dynamic implement that background application uses
It is few because background application seizes Caton situation caused by the Internet resources of foreground application, improve system performance.
As shown in figure 9, in one embodiment, above-mentioned resource management apparatus 800, in addition to including acquisition module 810, grade
Determining module 820 and configuration module 830 further include data obtaining module 840 and selection module 850.
Data obtaining module 840, for obtaining the resource using information of each background application.
Module 850 is chosen, for obtaining the resource category that each background application uses according to resource using information, and is chosen
Resource category includes the background application of Internet resources.
In the present embodiment, the money that each background application uses can be determined according to the resource using information of each background application
Source category, and the background application that the resource category used includes Internet resources is selected, it include network to the resource category used
The different grades of resource constraint of Internet resources dynamic implement that the background application of resource uses, can more accurate ground background application
The Internet resources of occupancy are controlled, and system performance is improved.
In one embodiment, configuration module 830 are also used to obtain background application currently in the resource constraint of Internet resources
Grade, if background application is added under Internet resources by current resource constraint grade lower than determining resource constraint grade
In resource group corresponding with determining resource constraint grade, and configure and the matched resource use priority of resource group.
Optionally, configuration module 830 are also used to obtain the Internet resources ratio of background application occupancy;If Internet resources ratio
Example is greater than preset threshold, then background application is added to resource group corresponding with determining resource constraint grade under Internet resources
In, and configure and the matched resource use priority of resource group.
In the present embodiment, can to the different grades of resource constraint of Internet resources dynamic implement that background application uses,
It reduces because background application seizes Caton situation caused by the Internet resources of foreground application, improves system performance.
In one embodiment, configuration module 830, including acquiring unit, query unit and adding unit.
Acquiring unit, for obtaining the subscriber group information of background application.
Query unit, for inquiring the process identification (PID) for having mapping relations with subscriber group information.
Adding unit, for will be added under Internet resources and resource constraint grade with the matched background process of process identification (PID)
In corresponding resource group.
Optionally, adding unit, including collection apparatus subelement, type determine subelement and addition subelement.
Collection apparatus subelement, for acquiring and the operation characteristic of the matched background process of process identification (PID).
Type determines subelement, for determining resource category that matched background process uses according to operation characteristic.
Subelement is added, the background process for including Internet resources for resource category is added under Internet resources and resource
In the corresponding resource group of limit grade.
In the present embodiment, the process identification (PID) with mapping relations can be found according to the subscriber group information of background application,
And by and the matched background process of process identification (PID) be added to resource group corresponding with determining resource constraint grade under Internet resources
In not, unified Internet usage management can be carried out to each process run under background application according to resource constraint grade,
It can also be achieved different grades of resource constraint by the other setting of resource group, optimization system performance saves power consumption.
In one embodiment, acquisition module 810 are also used to acquire the network money of foreground application in real time by kernel spacing
Source uses data, and Internet usage data are packaged into data packet and send user's space to by every preset time period.
Level determination module 820 is also used to analyze Internet usage data by user's space, determines that background application exists
The resource constraint grade of Internet resources.
In the present embodiment, the Internet usage data of foreground application can be acquired by kernel spacing, and by acquisition
Internet usage data are transmitted to user's space and are analyzed, it is possible to provide the clue foundation that more resources limit grade determines,
Background application can be made more accurate in the resource constraint level adjustment of Internet resources, improve resource management effect and system performance.
Figure 10 is the block diagram of the part-structure of mobile phone relevant to mobile terminal provided by the embodiments of the present application.With reference to figure
10, mobile phone includes: radio frequency (Radio Frequency, RF) circuit 1010, memory 1020, input unit 1030, display unit
1040, sensor 1050, voicefrequency circuit 1060, Wireless Fidelity (wireless fidelity, WiFi) module 1070, processor
The components such as 1080 and power supply 1090.It will be understood by those skilled in the art that handset structure shown in Fig. 10 does not constitute opponent
The restriction of machine may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
Wherein, RF circuit 1010 can be used for receiving and sending messages or communication process in, signal sends and receivees, can be by base station
After downlink information receives, handled to processor 1080;The data of uplink can also be sent to base station.In general, RF circuit includes
But be not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier (Low Noise Amplifier,
LNA), duplexer etc..In addition, RF circuit 1010 can also be communicated with network and other equipment by wireless communication.It is above-mentioned wireless
Any communication standard or agreement, including but not limited to GSM, GPRS, CDMA (Code Division can be used in communication
Multiple Access, CDMA), W-CDMA, long term evolution (Long Term Evolution, LTE), Email, short disappear
Breath service (Short Messaging Service, SMS) etc..
Memory 1020 can be used for storing software program and module, and processor 1080 is stored in memory by operation
1020 software program and module, thereby executing the various function application and data processing of mobile phone.Memory 1020 can be led
It to include program storage area and data storage area, wherein program storage area can be needed for storage program area, at least one function
Application program (such as application program, application program of image player function of sound-playing function etc.) etc.;It data storage area can
Storage uses created data (such as audio data, address list etc.) etc. according to mobile phone.In addition, memory 1020 can wrap
High-speed random access memory is included, can also include nonvolatile memory, for example, at least disk memory, a flash memories
Part or other volatile solid-state parts.
Input unit 1030 can be used for receiving the number or character information of input, and generates and set with the user of mobile phone 1000
It sets and the related key signals of function control inputs.Specifically, input unit 1030 may include touch panel 1032 and other
Input equipment 1034.Touch panel 1032, alternatively referred to as touch screen collect the touch operation (ratio of user on it or nearby
Such as user is using finger, stylus any suitable object or attachment on touch panel 1032 or near touch panel 1032
Operation), and corresponding attachment device is driven according to preset formula.In one embodiment, touch panel 1032 can
Including both touch detecting apparatus and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and examine
Touch operation bring signal is surveyed, touch controller is transmitted a signal to;Touch controller receives touching from touch detecting apparatus
Information is touched, and is converted into contact coordinate, then gives processor 1080, and order that processor 1080 is sent can be received and added
To execute.Furthermore, it is possible to realize touch panel using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves
1032.In addition to touch panel 1032, input unit 1030 can also include other input equipments 1034.Specifically, other are inputted
Equipment 1034 can include but is not limited to one in physical keyboard, function key (such as volume control button, switch key etc.) etc.
Kind is a variety of.
Display unit 1040 can be used for showing information input by user or be supplied to user information and mobile phone it is each
Kind menu.Display unit 1040 may include display panel 1042.In one embodiment, liquid crystal display can be used
(Liquid Crystal Display, LCD), Organic Light Emitting Diode (Organic Light-Emitting Diode,
) etc. OLED forms configure display panel 1042.In one embodiment, touch panel 1032 can cover display panel 1042,
After touch panel 1032 detects touch operation on it or nearby, processor 1080 is sent to determine touch event
Type is followed by subsequent processing device 1080 according to the type of touch event and provides corresponding visual output on display panel 1042.Although
In Figure 10, touch panel 1032 and display panel 1042 are the input and input for realizing mobile phone as two independent components
Function, but in some embodiments it is possible to touch panel 1032 and display panel 1042 are integrated and are realized the input of mobile phone
And output function.
Mobile phone 1000 may also include at least one sensor 1050, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to ring
The light and shade of border light adjusts the brightness of display panel 1042, and proximity sensor can close display when mobile phone is moved in one's ear
Panel 1042 and/or backlight.Motion sensor may include acceleration transducer, can detect all directions by acceleration transducer
The size of upper acceleration can detect that size and the direction of gravity when static, the application that can be used to identify mobile phone posture is (such as horizontal
Vertical screen switching), Vibration identification correlation function (such as pedometer, tap) etc.;In addition, mobile phone can also configure gyroscope, barometer,
Other sensors such as hygrometer, thermometer, infrared sensor etc..
Voicefrequency circuit 1060, loudspeaker 1062 and microphone 1064 can provide the audio interface between user and mobile phone.Sound
Electric signal after the audio data received conversion can be transferred to loudspeaker 1062, by 1062 turns of loudspeaker by frequency circuit 1060
It is changed to voice signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 1064, by voicefrequency circuit
Audio data is converted to after 1060 receptions, then by after the processing of audio data output processor 1080, can be sent out through RF circuit 1010
Another mobile phone is given, or audio data is exported to memory 1020 so as to subsequent processing.
WiFi belongs to short range wireless transmission technology, and mobile phone can help user's transceiver electronics postal by WiFi module 1070
Part, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Figure 10 is shown
WiFi module 1070, but it is understood that, and it is not belonging to must be configured into for mobile phone 1000, it can according to need and save
Slightly.
Processor 1080 is the control centre of mobile phone, using the various pieces of various interfaces and connection whole mobile phone,
By running or execute the software program and/or module that are stored in memory 1020, and calls and be stored in memory 1020
Interior data execute the various functions and processing data of mobile phone, to carry out integral monitoring to mobile phone.In one embodiment,
Processor 1080 may include one or more processing units.In one embodiment, processor 1080 can integrate application processor
And modem, wherein the main processing operation system of application processor, user interface and application program etc.;Modem
Main processing wireless communication.It is understood that above-mentioned modem can not also be integrated into processor 1080.For example,
The processor 1080 can integrate application processor and baseband processor, baseband processor with and the composable tune such as other peripheral chips
Modulator-demodulator.Mobile phone 1000 further includes the power supply 1090 (such as battery) powered to all parts, it is preferred that power supply can pass through
Power-supply management system and processor 1080 are logically contiguous, to realize management charging, electric discharge, Yi Jigong by power-supply management system
The functions such as consumption management.
In one embodiment, mobile phone 1000 can also include camera, bluetooth module etc..
In the embodiment of the present application, processor 880 included by the mobile terminal executes the calculating of storage on a memory
Above-mentioned method for managing resource is realized when machine program.
In one embodiment, which may include memory 1020 and processor 1080, deposit in memory 1020
Computer program is contained, when which is executed by processor 1080, so that processor executes following steps:
When foreground has using at runtime, every preset time period acquires the Internet usage data of foreground application;
Determine background application in the resource constraint grade of Internet resources according to Internet usage data;
Background application is added under Internet resources in resource group corresponding with resource constraint grade, and configuration and resource
The matched resource use priority of group.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, the calculating
Machine program realizes above-mentioned method for managing resource when being executed by processor.
In one embodiment, a kind of computer program product comprising computer program is provided, when it sets in computer
When standby upper operation, so that computer equipment realizes above-mentioned method for managing resource when executing.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a non-volatile computer and can be read
In storage medium, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage is situated between
Matter can be magnetic disk, CD, read-only memory (Read-Only Memory, ROM) etc..
It may include as used herein non-volatile to any reference of memory, storage, database or other media
And/or volatile memory.Suitable nonvolatile memory may include read-only memory (ROM), programming ROM (PROM),
Electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include arbitrary access
Memory (RAM), it is used as external cache.By way of illustration and not limitation, RAM is available in many forms, such as
It is static RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDR SDRAM), enhanced
SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM
(RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM).
Each technical characteristic of embodiment described above can be combined arbitrarily, for simplicity of description, not to above-mentioned reality
It applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, all should be considered as described in this specification.
Each technical characteristic of embodiment described above can be combined arbitrarily, for simplicity of description, not to above-mentioned reality
It applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application
Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.
Claims (10)
1. a kind of method for managing resource characterized by comprising
When foreground has using at runtime, every preset time period acquires the Internet usage data of foreground application;
Determine background application in the resource constraint grade of Internet resources according to the Internet usage data;
The background application is added under Internet resources in resource group corresponding with the resource constraint grade, and configure with
The matched resource use priority of resource group.
2. the method according to claim 1, wherein in the net of every preset time period acquisition foreground application
After network resource uses data, the method also includes:
Obtain the resource using information of each background application;
The resource category that each background application uses is obtained according to the resource using information, and choosing resource category includes network
The background application of resource;
It is described to determine background application in the resource constraint grade of Internet resources according to the Internet usage data, comprising:
Resource constraint grade of the background application in Internet resources of selection is determined according to the Internet usage data.
3. the method according to claim 1, wherein it is described by the background application be added under Internet resources with
In the corresponding resource group of the resource constraint grade, and configure and the matched resource use priority of the resource group, packet
It includes:
The background application is obtained currently in the resource constraint grade of Internet resources;
If the background application is added to Internet resources lower than determining resource constraint grade by current resource constraint grade
In lower resource group corresponding with the resource constraint grade of the determination, and configures and used with the matched resource of the resource group
Priority.
4. the method according to claim 1, wherein it is described by the background application be added under Internet resources with
In the corresponding resource group of the resource constraint grade, and configure and the matched resource use priority of the resource group, packet
It includes:
Obtain the Internet resources ratio that the background application occupies;
If the Internet resources ratio is greater than preset threshold, the background application is added under Internet resources and the determination
The corresponding resource group of resource constraint grade in, and configure with the matched resource use priority of the resource group.
5. method according to any one of claims 1 to 4, which is characterized in that described that the background application is added to network
Under resource in resource group corresponding with the resource constraint grade, comprising:
Obtain the subscriber group information of the background application;
Inquiry has the process identification (PID) of mapping relations with the subscriber group information;
By and the matched background process of the process identification (PID) be added under Internet resources money corresponding with the resource constraint grade
In the group of source.
6. according to the method described in claim 5, it is characterized in that, described will add with the matched background process of the process identification (PID)
It is added under Internet resources in resource group corresponding with the resource constraint grade, comprising:
The operation characteristic of acquisition and the matched background process of the process identification (PID);
The resource category that the matched background process uses is determined according to the operation characteristic;
The background process that resource category includes Internet resources is added under Internet resources corresponding with the resource constraint grade
In resource group.
7. the method according to claim 1, wherein the network of every preset time period acquisition foreground application
Resource uses data, comprising:
Acquire the Internet usage data of foreground application in real time by kernel spacing, and every preset time period is by the network
Resource is packaged into data packet using data and sends user's space to;
It is described to determine background application in the resource constraint grade of Internet resources according to the Internet usage data, comprising:
The Internet usage data are analyzed by the user's space, determine background application in the resource constraint of Internet resources
Grade.
8. a kind of resource management apparatus characterized by comprising
Acquisition module, for having when foreground using at runtime, the Internet resources of every preset time period acquisition foreground application make
Use data;
Level determination module, for determining background application in the resource constraint of Internet resources according to the Internet usage data
Grade;
Configuration module, for the background application to be added under Internet resources resource group corresponding with the resource constraint grade
In not, and configure and the matched resource use priority of the resource group.
9. a kind of mobile terminal, including memory and processor, computer program, the computer are stored in the memory
When program is executed by the processor, so that the processor realizes the method as described in claim 1 to 7 is any.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program
The method as described in claim 1 to 7 is any is realized when being executed by processor.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810023912.9A CN110018888A (en) | 2018-01-10 | 2018-01-10 | Method for managing resource, device, mobile terminal and computer readable storage medium |
PCT/CN2018/123047 WO2019137187A1 (en) | 2018-01-10 | 2018-12-24 | Resource management method and apparatus, mobile terminal and computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810023912.9A CN110018888A (en) | 2018-01-10 | 2018-01-10 | Method for managing resource, device, mobile terminal and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110018888A true CN110018888A (en) | 2019-07-16 |
Family
ID=67188154
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810023912.9A Pending CN110018888A (en) | 2018-01-10 | 2018-01-10 | Method for managing resource, device, mobile terminal and computer readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110018888A (en) |
WO (1) | WO2019137187A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111026456A (en) * | 2019-11-29 | 2020-04-17 | 惠州Tcl移动通信有限公司 | Application management method and device, storage medium and electronic equipment |
CN116744329A (en) * | 2022-10-21 | 2023-09-12 | 荣耀终端有限公司 | Network acceleration method and electronic equipment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150347181A1 (en) * | 2014-05-30 | 2015-12-03 | Apple Inc. | Resource management with dynamic resource policies |
CN106095547A (en) * | 2016-06-03 | 2016-11-09 | 北京小米移动软件有限公司 | Application program networking control method and device |
CN106533988A (en) * | 2016-10-26 | 2017-03-22 | 维沃移动通信有限公司 | Control method for network speed of application and mobile terminal |
US20170118611A1 (en) * | 2015-10-27 | 2017-04-27 | Blackberry Limited | Monitoring resource access |
CN106681475A (en) * | 2016-12-12 | 2017-05-17 | 北京珠穆朗玛移动通信有限公司 | Method for reducing power consumption of mobile terminal and mobile terminal |
CN107193653A (en) * | 2017-04-28 | 2017-09-22 | 北京小米移动软件有限公司 | Method for allocating bandwidth resources, device and storage medium |
CN107391241A (en) * | 2017-06-22 | 2017-11-24 | 努比亚技术有限公司 | Using quick start method, terminal and computer-readable recording medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090028127A1 (en) * | 2007-07-26 | 2009-01-29 | Gordon Kent Walker | Methods and apparatus for providing computational load allocation in a network environment |
CN103176842B (en) * | 2013-03-15 | 2016-04-27 | 广东欧珀移动通信有限公司 | background process management method and mobile terminal thereof |
CN106059952A (en) * | 2016-04-29 | 2016-10-26 | 宇龙计算机通信科技(深圳)有限公司 | Bandwidth application management method and device |
CN107181700A (en) * | 2017-07-19 | 2017-09-19 | 努比亚技术有限公司 | Control method, mobile terminal and the storage medium of application program for mobile terminal |
-
2018
- 2018-01-10 CN CN201810023912.9A patent/CN110018888A/en active Pending
- 2018-12-24 WO PCT/CN2018/123047 patent/WO2019137187A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150347181A1 (en) * | 2014-05-30 | 2015-12-03 | Apple Inc. | Resource management with dynamic resource policies |
US20170118611A1 (en) * | 2015-10-27 | 2017-04-27 | Blackberry Limited | Monitoring resource access |
CN106095547A (en) * | 2016-06-03 | 2016-11-09 | 北京小米移动软件有限公司 | Application program networking control method and device |
CN106533988A (en) * | 2016-10-26 | 2017-03-22 | 维沃移动通信有限公司 | Control method for network speed of application and mobile terminal |
CN106681475A (en) * | 2016-12-12 | 2017-05-17 | 北京珠穆朗玛移动通信有限公司 | Method for reducing power consumption of mobile terminal and mobile terminal |
CN107193653A (en) * | 2017-04-28 | 2017-09-22 | 北京小米移动软件有限公司 | Method for allocating bandwidth resources, device and storage medium |
CN107391241A (en) * | 2017-06-22 | 2017-11-24 | 努比亚技术有限公司 | Using quick start method, terminal and computer-readable recording medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111026456A (en) * | 2019-11-29 | 2020-04-17 | 惠州Tcl移动通信有限公司 | Application management method and device, storage medium and electronic equipment |
CN116744329A (en) * | 2022-10-21 | 2023-09-12 | 荣耀终端有限公司 | Network acceleration method and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
WO2019137187A1 (en) | 2019-07-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109992398A (en) | Method for managing resource, device, mobile terminal and computer readable storage medium | |
CN109992400A (en) | Resource allocation methods, device, mobile terminal and computer readable storage medium | |
CN107092520B (en) | Recommended method, device, storage medium and the mobile terminal of application program | |
CN110018903A (en) | Method for managing resource, device, mobile terminal and computer readable storage medium | |
CN109213539A (en) | A kind of method for recovering internal storage and device | |
CN107526640A (en) | Method for managing resource, device, mobile terminal and computer-readable recording medium | |
CN110032267A (en) | Information processing method, device, mobile terminal and computer readable storage medium | |
CN109992399A (en) | Method for managing resource, device, mobile terminal and computer readable storage medium | |
CN110008008A (en) | Applied program processing method and device, electronic equipment, computer readable storage medium | |
CN109992370A (en) | Applied program processing method and device, electronic equipment, computer readable storage medium | |
CN110032429B (en) | Information processing method and device, mobile terminal and computer readable storage medium | |
CN109992367A (en) | Application processing method and device, electronic equipment, computer readable storage medium | |
CN109144232A (en) | Process handling method and device, electronic equipment, computer readable storage medium | |
CN110032439A (en) | Method for managing resource, device, mobile terminal and computer readable storage medium | |
CN110018904A (en) | Information processing method, device, computer equipment and computer readable storage medium | |
CN107526638A (en) | Applied program processing method, device, mobile terminal and storage medium | |
CN110018900A (en) | Internal memory processing method and device, electronic equipment, computer readable storage medium | |
CN110018902A (en) | Internal memory processing method and device, electronic equipment, computer readable storage medium | |
CN107526637A (en) | Applied program processing method, device, mobile terminal and storage medium | |
CN106371326A (en) | Storage method and apparatus of equipment work scenes | |
CN110018888A (en) | Method for managing resource, device, mobile terminal and computer readable storage medium | |
CN107832131B (en) | Application program closing method and device, storage medium and electronic equipment | |
CN106502827A (en) | A kind of data back up method and equipment | |
CN108270839A (en) | Access frequency control system and method | |
CN110032397A (en) | Application processing method and device, electronic equipment, computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Country or region after: China Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Country or region before: China |