CN110032439A - 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 PDF

Info

Publication number
CN110032439A
CN110032439A CN201810023901.0A CN201810023901A CN110032439A CN 110032439 A CN110032439 A CN 110032439A CN 201810023901 A CN201810023901 A CN 201810023901A CN 110032439 A CN110032439 A CN 110032439A
Authority
CN
China
Prior art keywords
resource
type
grade
background application
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810023901.0A
Other languages
Chinese (zh)
Inventor
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810023901.0A priority Critical patent/CN110032439A/en
Publication of CN110032439A publication Critical patent/CN110032439A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/329Power saving characterised by the action undertaken by task scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/506Constraint
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to a kind of method for managing resource, device, mobile terminal and computer readable storage mediums.The above method, comprising: the resource for acquiring at least one resource category uses data;The occupied information of data acquisition corresponding resource type is used according to the resource;Determine background application in the resource constraint grade of the corresponding resource type according to the occupied information;The background application is assigned under the corresponding resource type in resource group corresponding with the resource constraint grade, and configures resource use priority corresponding with the resource constraint grade.Above-mentioned method for managing resource, device, mobile terminal and computer readable storage medium can save power consumption to the different grades of resource constraint of background application dynamic implement, optimization system performance.

Description

Method for managing resource, device, mobile terminal and computer readable storage medium
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 to the different grades of resource constraint of background application dynamic implement, optimization system performance saves power consumption.
A kind of method for managing resource, comprising:
The resource for acquiring at least one resource category uses data;
The occupied information of data acquisition corresponding resource type is used according to the resource;
Determine background application in the resource constraint grade of the corresponding resource type according to the occupied information;
The background application is assigned to resource group corresponding with the resource constraint grade under the corresponding resource type In not, and configure resource use priority corresponding with the resource constraint grade.
A kind of resource management apparatus, comprising:
Data acquisition module, the resource for acquiring at least one resource category use data;
Occupied information obtains module, for using the occupied information of data acquisition corresponding resource type according to the resource;
Level determination module, for determining background application in the resource of the corresponding resource type according to the occupied information Limit grade;
Configuration module, for the background application to be assigned under the corresponding resource type and the resource constraint grade In corresponding resource group, and configure resource use priority corresponding with the resource constraint grade.
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 acquire at least one resource kind The resource of class uses data, and the occupied information of data acquisition corresponding resource type is used according to resource, is determined according to occupied information Background application is assigned under the corresponding resource type and resource by background application in the resource constraint grade of the corresponding resource type In the corresponding resource group of limit grade, and resource use priority corresponding with resource constraint grade is configured, according to resource kind Resource constraint grade of the occupied information dynamic adjustment background application of class under the resource category, can be real to background application dynamic Existing different grades of resource constraint, optimization system performance save power consumption.
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 uses the flow diagram of data to acquire the resource of at least one resource category in one embodiment;
Fig. 6 is that background application is assigned under resource category resource group corresponding with resource constraint grade in one embodiment Flow diagram in not;
Fig. 7 is to be assigned to the background process run in background application under resource category and resource constraint in one embodiment Flow diagram in the corresponding resource group of grade;
Fig. 8 is the block diagram of resource management apparatus in one embodiment;
Fig. 9 is the block diagram of configuration module in one 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, display screen and the input unit of connection.Wherein, memory may include non-volatile memory medium and processing Device.The non-volatile memory medium of mobile terminal is stored with operating system and computer program, and the computer program is by processor To realize a kind of method for managing resource provided in the embodiment of the present application when execution.The processor calculates and controls energy for providing Power supports the operation of entire mobile terminal.Built-in storage in mobile terminal is the computer journey in non-volatile memory medium The operation of sequence provides environment.The display screen of mobile terminal can be liquid crystal display or electric ink display screen etc., input dress It sets and can be the touch layer covered on display screen, be also possible to the key being arranged on mobile terminal case, trace ball or Trackpad, It is also possible to external keyboard, Trackpad or mouse etc..The mobile terminal can be mobile phone, tablet computer or individual digital and help Reason or wearable device etc..It will be understood by those skilled in the art that structure shown in Fig. 1, only with application scheme phase The block diagram of the part-structure of pass does not constitute the restriction for the mobile terminal being applied thereon to application scheme, specific to move Dynamic terminal may include perhaps combining certain components or with different components than more or fewer components as shown in the figure Arrangement.
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, the resource for acquiring at least one resource category uses data.
It may include having one or more resources on mobile terminal, resource may refer to for the operating system to mobile terminal And application program etc. provides any entity or virtual constituent element of service ability.Optionally, the resource on mobile terminal can Including but not limited to CPU, I/O, memory and Internet resources etc..The resource that mobile terminal can acquire at least one resource category uses Data.Resource using data may include resource category occupied ratio within a certain period of time in total, occupy the resource kind Application identities or process identification (PID) of class, and occupation proportion corresponding with application identities or process identification (PID) etc., wherein application identities Can by one of number, letter and symbol etc. or it is a variety of formed, be used for unique identification application, process identification (PID) can be by One of number, letter and symbol etc. or it is a variety of formed, be used for unique identification process.For example, mobile terminal can acquire The resource of CPU uses data, and the resource of CPU using data may include total occupancy of the CPU in 10 seconds, in 10 seconds occupy CPU Application identities or process identification (PID), and CPU usage corresponding with each application identities or process identification (PID) etc., but be not limited to This.
In one embodiment, the activity data of each resource category can be recorded in default file by mobile terminal, can Choosing, the activity data of different resource type is recordable in different default files.What the activity data of resource category can refer to The data that generate when to be that corresponding resource type is occupied provide service ability to the operating system of mobile terminal or application program etc.. For example, can record in the corresponding default file of cpu resource when thering is CPU to start from mobile terminal to the cumulative activation at current time Between and each different process or application etc. from mobile terminal start to current time use CPU cumulative time etc.;Memory Can record in the corresponding default file of resource has in the occupied size of different moments memory and each different process or answers With etc. occupancy memory size etc., but not limited to this.
Optionally, mobile terminal can read the activity data of at least one resource category from default file, and according to this The resource that activity data acquires resource category corresponding with activity data uses data.For example, mobile terminal can be according to preset Collection period from under/proc catalogue /proc/stat file in read CPU start from mobile terminal it is accumulative to current time Working time.The cumulative operation time of the recordable CPU read each time of mobile terminal, and calculate the tired of the CPU that this is recorded The difference between the cumulative operation time of the CPU of working time and last record is counted, the real work of CPU in collection period is obtained Make the time.Mobile terminal can determine that the real working time of CPU and the ratio of collection period, the ratio are in collection period Total occupancy of CPU etc..Mobile terminal can also read memory in the corresponding default file of Duan Congyu memory at regular intervals and work as The memory size etc. that preceding occupied size and currently running each process occupy.It is to be appreciated that other can also be used Mode acquires the resource of resource category using data, is not limited in aforesaid way.
Step 320, the occupied information of data acquisition corresponding resource type is used according to resource.
Mobile terminal can use the corresponding resource category of data using data acquisition and resource according to the resource of resource category Occupied information, wherein occupied information may include the corresponding resource category occupied ratio and currently running each in total The ratio etc. that a application occupies.Optionally, one or more processes can have been run under an application.Mobile terminal can first pass through work Dynamic manager obtains each process run under currently running each application and each application, can be to the lower operation of application Each process is being added up with resource using the occupation proportion of the corresponding resource category of data, and being applied, it is corresponding to occupy this The ratio of resource category.
Step 330, determine background application in the resource constraint grade of corresponding resource type according to occupied information.
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 acquires at least one resource The resource of type uses data, and uses the occupancy letter of the corresponding resource category of data using data acquisition and resource according to resource After breath, background application can be determined in the resource constraint etc. with resource using the corresponding resource category of data according to the occupied information Grade, wherein one or more application can have been run in mobile terminal simultaneously, background application refers to the application in running background.
For example, background application can when resource category occupied large percentage in total corresponding using data with resource Corresponding higher resource constraint grade limits use of the background application to the corresponding resource category;When with resource use data For corresponding resource category when occupied ratio is smaller in total, background application can correspond to lower resource constraint grade, can be used The more corresponding resource category.When background application with resource using the corresponding resource category of data under the large percentage that occupies When, higher resource constraint grade can be corresponded to, limits use etc. of the background application to the corresponding resource category, but be not limited to This.
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 use number according to the resource of different resource type respectively According to the resource constraint grade of setting background application.Resource constraint grade can also be divided otherwise, be not limited in This, different resource type can also divide different resource constraint grades.
In one embodiment, the resource that mobile terminal can be answered using data acquisition and resource using data according to resource The occupied information of type, and the corresponding resource type is obtained in current occupied ratio according to occupied information.Mobile terminal can The corresponding resource type is compared in current occupied ratio with preset first threshold value, if the corresponding resource type is being worked as Preceding occupied ratio is greater than preset first threshold value, then can be according to the occupied ratio-dependent background application in the corresponding resource The resource constraint grade of type, the use to background application in the corresponding resource type limit.If the corresponding resource type It is not more than preset first threshold value in current occupied ratio, mobile terminal can not be to background application in the corresponding resource type Using being limited.Optionally, first threshold can be set according to actual needs, and different resource type can correspond to different One threshold value, for example, the corresponding first threshold of CPU is 40%, the corresponding first threshold of memory is 50% etc., but not limited to this.
Step 340, background application is assigned under corresponding resource type in resource group corresponding with resource constraint grade, And configure resource use priority corresponding with resource constraint grade.
Mobile terminal determine background application with after resource constraint grade of the resource using the corresponding resource category of data, can Background application is added under the corresponding resource type in resource group corresponding with resource constraint grade, and configure and determine The corresponding resource use priority of resource constraint grade.Resource constraint higher grade, and the degree that limitation resource uses is stronger, can be right Answer lower resource use priority.Resource constraint lower grade, and the degree that limitation resource uses is weaker, can correspond to higher money Source use priority.
Optionally, mobile terminal can divide different resource groups based on kernel Cgroup (control group) mechanism, And file node can be used write the mode of configuration and the other resource use priority of each resource group is set, to being assigned to each money Being managed using the time of resource or ratio etc. in the group of source, wherein Cgroup is that the one kind provided in kernel can With the mechanism of physical resource used in limitation, record, isolated process (such as: the resources such as CPU, memory, I/O, network).For Different types of resource, mobile terminal can divide different resource groups.Mobile terminal can load the configuration file of Cgroup, match Set can record in file have the resource group of division, the other resource use priority of each resource group and with resource use priority Corresponding resource dispatching strategy.Resource dispatching strategy may include but be not limited to the process being assigned in resource group and use resource Time, occupy resource ratio, the resource identification used etc..For example, the common limitation rank under configurable Internet resources is corresponding The other application maximum of resource group can occupy 20% Internet resources, the common limitation rank under configurable CPU resource is corresponding Resource group is other to be applied 30 seconds cpu resources etc. can be used in 1 minute, but not limited to this.When needing to add new resource group Not, or the other resource use priority of resource group and resource dispatching strategy are modified, the configuration file for modifying Cgroup can be passed through.
Background application is added to by mobile terminal to be limited using under the corresponding resource category of data with determining resource with resource In the corresponding resource group of grade processed, and resource use priority corresponding with the resource constraint grade of determination is configured, answered from the background With can according to the corresponding resource dispatching strategy of resource group use the corresponding resource type.Optionally, mobile terminal can be simultaneously The resource of multiple resource categories is obtained using data, and obtains the occupancy letter of each resource category one by one using data according to resource Breath.Mobile terminal can determine resource constraint of the background application under different resource type according to the occupied information of each resource category Grade, and background application is assigned under each resource category in resource group corresponding with determining resource constraint grade.Example Such as, mobile terminal according to the occupied information of cpu resource determine background application cpu resource resource constraint grade be depth limit Rank, according to the occupied information of Internet resources determine background application Internet resources resource constraint grade be common limiter stage Not, then background application can be separately dispensed into resource group corresponding with depth limit rank and Internet resources under cpu resource In lower resource group corresponding with common limitation rank.
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..Mobile terminal can acquire the resource of Internet resources using data, and according to money Source uses the occupied information of data acquisition Internet resources.Mobile terminal can determine that background application is provided in network according to the occupied information Resource constraint grade under source, and background application is assigned under Internet resources resource group corresponding with the resource constraint grade In, resource use priority corresponding with the resource constraint grade is configured, the Internet usage of background application is managed.
In the present embodiment, the resource of at least one resource category is acquired using data, and data acquisition is used according to resource The occupied information of corresponding resource type determines background application in the resource constraint etc. of the corresponding resource type according to occupied information Grade, background application is assigned under the corresponding resource type in resource group corresponding with resource constraint grade, and is configured and provided Limit grade corresponding resource use priority in source adjusts background application in the resource according to the occupied information of resource category dynamic Resource constraint grade under type, can be to the different grades of resource constraint of background application dynamic implement, optimization system performance, section Save power consumption.
As shown in figure 5, in one embodiment, the resource that step 310 acquires at least one resource category uses data, packet Include following steps:
Step 502, when foreground has using at runtime, every preset time period acquires the resource occupation number of foreground application According to.
Mobile terminal can be monitored by each application program of the active manager to operation, monitor each application program Operating status variation.Optionally, the operating status of application program may include but be not limited to starting, front stage operation, running background, It exits.Mobile terminal can be obtained by the RunningAppProcessInfo class of active manager at regular intervals All the application lists of operation, for example, obtaining all the application lists being once currently running every 2 seconds, and one by one The operating status for judging each application program being currently running in the application list 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 resource occupation data, resource occupation number According to may include resource category and occupation proportion etc. that the foreground application occupies in time interval corresponding with preset time period.
Step 504, the resource category used according to resource occupation data acquisition foreground application, and acquire foreground application use Resource category at least one resource category resource use data.
The resource category that mobile terminal can be used according to the resource occupation data acquisition foreground application of foreground application, foreground is answered It can be the resource category for including in resource occupation data with the resource category used.For example, the resource occupation number of foreground application According to comprising occupying CPU30%, committed memory 20%, then it can determine that the resource category that the foreground application uses includes CPU and memory Resource.The resource category that foreground application uses is also possible to the resource category that occupation proportion in resource occupation data is greater than preset value Deng, different resource type can set different preset values, for example, the corresponding preset value of cpu resource is 5%, memory source correspondence Preset value be 6%, the corresponding preset value of Internet resources be 3% etc., but not limited to this.Mobile terminal can be by resource occupation data The resource category that middle occupation proportion is greater than preset value is determined as the resource category that foreground application uses.
The resource category that mobile terminal is used according to resource occupation data acquisition foreground application can acquire foreground application use Resource category in the resource of at least one resource category use data, and number is used using data acquisition and resource according to resource According to the occupied information of corresponding resource category, so that it is determined that resource constraint grade of the background application in the corresponding resource type.It moves Dynamic terminal can change the resource constraint grade of background application according to the resource acquired each time using data dynamic, and background application exists Resource constraint grade under resource category can be changed with the resource of the resource category using the variation of data.
In the present embodiment, the resource that can acquire at least one resource category in the resource category that foreground application uses uses Data, and determine resource constraint grade of the background application under at least one resource category, background application can be used The different grades of resource constraint of resource dynamic implement is reduced because background application seizes the feelings such as Caton caused by the resource of foreground application Condition improves system performance.
In one embodiment, background application is assigned to corresponding with resource constraint grade under corresponding resource type by step In resource group, comprising: obtain background application currently in the resource constraint grade of corresponding resource type, if current resource constraint Background application is then assigned to resource constraint etc. under corresponding resource type and determining lower than determining resource constraint grade by grade In the corresponding resource group of grade.
Mobile terminal uses the occupancy of the corresponding resource category of data according to the resource of acquisition using data acquisition and resource Information, and background application is determined after the resource constraint grade of the corresponding resource type according to occupied information, can obtain it is each after Platform is applied currently in the resource constraint grade of the corresponding resource type, and by background application currently in the money of the corresponding resource type Source limit grade is compared with the resource constraint grade determined.If background application is currently limited in the resource of the corresponding resource type Grade processed is greater than or equal to determining resource constraint grade, then the background application is currently used in the resource of the corresponding resource type Priority is less than or equal to the determining corresponding resource use priority of resource constraint grade.Mobile terminal can not change the backstage The resource constraint grade in the corresponding resource type is applied, the background application is made to keep current money in the corresponding resource type Source limit grade.If background application is currently in the resource constraint grade of the corresponding resource type lower than determining resource constraint etc. Grade, then it is corresponding to be currently higher than determining resource constraint grade in the resource use priority of the corresponding resource type for the background application Resource use priority.The background application can be changed to really by mobile terminal in the resource constraint grade of the corresponding resource type The background application can be assigned to corresponding with determining resource constraint grade under the corresponding resource type by fixed resource constraint grade Resource group in, and configure with determine resource constraint ratings match resource use priority.
For example, mobile terminal has determined background application in the resource of memory source according to the resource of memory source using data Limit grade is common limitation rank.If background application is currently depth limit rank in the resource constraint grade of memory source, Depth limit grade is higher than common limitation rank to the limited degree that resource uses, and can not change the resource currently in memory source Limit grade is resource constraint grade of the background application in memory source of depth limit rank.If background application is currently in memory The resource constraint grade of resource is without limitation rank, and no limitation rank is lower than common limiter stage to the limited degree that resource uses Not, then can by currently the resource constraint grade of memory source be without limitation rank background application be assigned in memory source with It is common to limit in the corresponding resource class of rank.
Optionally, mobile terminal determines background application in the resource constraint etc. with resource using the corresponding resource category of data After grade, each background application can be obtained in the occupation proportion of the corresponding resource type.Mobile terminal can determine whether background application at this Whether the occupation proportion of corresponding resource type is greater than default second threshold.If background application is in the occupancy ratio of the corresponding resource type Example is less than or equal to default second threshold, and mobile terminal can not limit the background application in the use of the corresponding resource type The background application, can not be assigned to resource group corresponding with determining resource constraint grade under the corresponding resource type by system In.If background application is greater than default second threshold in the occupation proportion of the corresponding resource type, mobile terminal can answer from the background this With being assigned under the corresponding resource type in resource group corresponding with determining resource constraint grade, and configure and resource group Matched, the use to the background application in the corresponding resource type limits.Optionally, second threshold can be according to practical need It asks and is set, different resource type can correspond to different second thresholds.
It in the present embodiment, can be according to background application currently in the resource constraint grade or occupation proportion of resource category Deng, dynamic adjust background application resource category resource constraint grade, can preferably to different background applications carry out resource Limitation management keeps restriction effect more preferable, optimization system performance, saves power consumption.
As shown in fig. 6, in one embodiment, background application is assigned under corresponding resource type and resource constraint by step In the corresponding resource group of grade, 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 by mobile terminal uses the corresponding resource kind of data with resource Resource group corresponding with determining resource constraint grade, can obtain the application identities of the background application, and according to application under class Mark obtains the subscriber group information of the background application.Subscriber group information may include user group mark etc., wherein user group mark can By one of number, letter and symbol etc. or a variety of to be constituted.
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 resource using the corresponding resource category of data under with really When the corresponding resource group of fixed resource constraint grade, it can directly be inquired according to the subscriber group information of background application and have mapping and close The process identification (PID) of system, compared to the process for playing all operations of traversal to find the process run under background application, directly search and The process identification (PID) that subscriber group information has mapping relations is more convenient.
Step 606, it will be assigned to the matched background process of process identification (PID) under corresponding resource type and resource constraint grade 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 distribute all processes run under background application To and resource using in resource group corresponding with determining resource constraint grade under the corresponding resource category of data, and to backstage Using all processes configuration resource use priority corresponding with the resource constraint grade determined of lower operation, match to can realize Set the purpose that the background application is resource use priority corresponding with determining resource constraint grade.
As shown in fig. 7, optionally, step 606 will be assigned to corresponding resource type with the matched background process of process identification (PID) In lower resource group corresponding with 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 corresponding resource type is assigned under corresponding resource type and money In the corresponding resource group of source limit grade.
Mobile terminal can select the resource category used from all processes run under background process Using the background process of the corresponding resource category of data, and by the resource category used include the corresponding resource type backstage into Journey is added under the corresponding resource type in resource group corresponding with determining resource constraint grade, configuration and the resource determined The corresponding resource use priority of limit grade.Respective resources can be carried out to the process for using different resource type in background application The use of type limits, and resource management can be made more accurate, improves 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 using under the corresponding resource category of data with determining resource In the corresponding resource group of limit grade, unification can be carried out to each process run under background application according to resource constraint grade Resource using management, optimization system performance, save power consumption.
In one embodiment, a kind of method for managing resource is provided, comprising the following steps:
Step (1), the resource for acquiring at least one resource category use data.
Optionally, step (1), comprising: when foreground has using at runtime, every preset time period acquires foreground application Resource occupation data;According to the resource category that resource occupation data acquisition foreground application uses, and acquire what foreground application used The resource of at least one resource category uses data in resource category.
Step (2) uses the occupied information of data acquisition corresponding resource type according to resource.
Step (3) determines background application in the resource constraint grade of corresponding resource type according to occupied information.
Optionally, step (3), comprising: corresponding resource type is obtained in current occupied ratio according to occupied information;If Corresponding resource type is greater than preset first threshold value in current occupied ratio, then according to occupied ratio-dependent background application In the resource constraint grade of corresponding resource type.
Background application is assigned under corresponding resource type in resource group corresponding with resource constraint grade by step (4), And configure resource use priority corresponding with resource constraint grade.
Optionally, step (4), comprising: obtain background application currently in the resource constraint grade of corresponding resource type;If working as Background application is then assigned under corresponding resource type and determination by preceding resource constraint grade lower than determining resource constraint grade The corresponding resource group of resource constraint grade in.
Optionally, step (4), comprising: obtain background application in the occupation proportion of corresponding resource type;If occupation proportion is big In default second threshold, then background application is assigned to resource corresponding with determining resource constraint grade under corresponding resource type In group.
Optionally, step (4), comprising: obtain the subscriber group information of background application;Inquiry has mapping with subscriber group information The process identification (PID) of relationship;It will be assigned to the matched background process of process identification (PID) under corresponding resource type and resource constraint grade pair In the resource group answered.
Optionally, it will be assigned to the matched background process of process identification (PID) under corresponding resource type and resource constraint grade pair In the resource group answered, comprising: the operation characteristic of acquisition and the matched background process of process identification (PID);According to operation characteristic determining The resource category that the background process matched uses;The background process that resource category includes corresponding resource type is assigned to corresponding resource Under type in resource group corresponding with resource constraint grade.
In the present embodiment, the resource of at least one resource category is acquired using data, and data acquisition is used according to resource The occupied information of corresponding resource type determines background application in the resource constraint etc. of the corresponding resource type according to occupied information Grade, background application is assigned under the corresponding resource type in resource group corresponding with resource constraint grade, and is configured and provided Limit grade corresponding resource use priority in source adjusts background application in the resource according to the occupied information of resource category dynamic Resource constraint grade under type, can be to the different grades of resource constraint of background application dynamic implement, optimization system performance, section Save power consumption.
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, a kind of resource management apparatus 800 is provided, including data acquisition module 810, Occupied information obtains module 820, level determination module 830 and configuration module 840.
Data acquisition module 810, the resource for acquiring at least one resource category use data.
Occupied information obtains module 820, for using the occupied information of data acquisition corresponding resource type according to resource.
Level determination module 830, for determining background application in the resource constraint of corresponding resource type according to occupied information Grade.
Optionally, level determination module 830 are also used to obtain corresponding resource type according to occupied information current occupied Ratio, it is true according to occupied ratio if corresponding resource type is greater than preset first threshold value in current occupied ratio Background application is determined in the resource constraint grade of corresponding resource type.
Configuration module 840, for background application to be assigned to money corresponding with resource constraint grade under corresponding resource type In the group of source, and configure resource use priority corresponding with resource constraint grade.
In the present embodiment, the resource of at least one resource category is acquired using data, and data acquisition is used according to resource The occupied information of corresponding resource type determines background application in the resource constraint etc. of the corresponding resource type according to occupied information Grade, background application is assigned under the corresponding resource type in resource group corresponding with resource constraint grade, and is configured and provided Limit grade corresponding resource use priority in source adjusts background application in the resource according to the occupied information of resource category dynamic Resource constraint grade under type, can be to the different grades of resource constraint of background application dynamic implement, optimization system performance, section Save power consumption.
In one embodiment, data acquisition module 810 are also used to apply at runtime, when default when foreground has Between section acquisition foreground application resource occupation data.
Data acquisition module 810 is also used to the resource category used according to resource occupation data acquisition foreground application, and adopts The resource of at least one resource category uses data in the resource category that collection foreground application uses.
In the present embodiment, the resource that can acquire at least one resource category in the resource category that foreground application uses uses Data, and determine resource constraint grade of the background application under at least one resource category, background application can be used The different grades of resource constraint of resource dynamic implement is reduced because background application seizes the feelings such as Caton caused by the resource of foreground application Condition improves system performance.
In one embodiment, configuration module 840 are also used to obtain background application currently in the resource of corresponding resource type Limit grade, if background application is assigned to corresponding money lower than determining resource constraint grade by current resource constraint grade Under source category in resource group corresponding with determining resource constraint grade.
Optionally, configuration module 840 are also used to obtain background application in the occupation proportion of corresponding resource type, if occupying Ratio is greater than default second threshold, then is assigned to background application corresponding with determining resource constraint grade under corresponding resource type Resource group in.
It in the present embodiment, can be according to background application currently in the resource constraint grade or occupation proportion of resource category Deng, dynamic adjust background application resource category resource constraint grade, can preferably to different background applications carry out resource Limitation management keeps restriction effect more preferable, optimization system performance, saves power consumption.
As shown in figure 9, in one embodiment, configuration module 840, including information acquisition unit 842, query unit 844 And adding unit 846.
Information acquisition unit 842, for obtaining the subscriber group information of background application.
Query unit 844, for inquiring the process identification (PID) for having mapping relations with subscriber group information.
Adding unit 846, for that will be assigned to the matched background process of process identification (PID) under corresponding resource type and resource In the corresponding resource group of limit grade.
Optionally, adding unit 846, including collection apparatus subelement, type determine subelement and distribution 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 distributed, the background process for including corresponding resource type for resource category is assigned to corresponding resource type In lower resource group corresponding with resource constraint 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 using under the corresponding resource category of data with determining resource In the corresponding resource group of limit grade, unification can be carried out to each process run under background application according to resource constraint grade Resource using management, optimization system performance, save power consumption.
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:
The resource for acquiring at least one resource category uses data;
The occupied information of data acquisition corresponding resource type is used according to resource;
Determine background application in the resource constraint grade of corresponding resource type according to occupied information;
Background application is assigned under corresponding resource type in resource group corresponding with resource constraint grade, and configure with The corresponding resource use priority of resource constraint grade.
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.
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
The resource for acquiring at least one resource category uses data;
The occupied information of data acquisition corresponding resource type is used according to the resource;
Determine background application in the resource constraint grade of the corresponding resource type according to the occupied information;
The background application is assigned under the corresponding resource type in resource group corresponding with the resource constraint grade, And configure resource use priority corresponding with the resource constraint grade.
2. the method according to claim 1, wherein it is described acquire at least one type resource use data, Include:
When foreground has using at runtime, every preset time period acquires the resource occupation data of foreground application;
According to the resource category that foreground application described in the resource occupation data acquisition uses, and acquires the foreground application and use Resource category at least one resource category resource use data.
3. the method according to claim 1, wherein described determine background application in institute according to the occupied information State the resource constraint grade of corresponding resource type, comprising:
The corresponding resource type is obtained in current occupied ratio according to the occupied information;
If the corresponding resource type is greater than preset first threshold value in current occupied ratio, according to the occupied ratio Example determines background application in the resource constraint grade of the corresponding resource type.
4. the method according to claim 1, wherein described be assigned to the corresponding resource for the background application Under type in resource group corresponding with the resource constraint grade, comprising:
The background application is obtained currently in the resource constraint grade of the corresponding resource type;
If the background application is assigned to the correspondence lower than determining resource constraint grade by current resource constraint grade Under resource category in resource group corresponding with the resource constraint grade of the determination.
5. the method according to claim 1, wherein described be assigned to the corresponding resource for the background application Under type in resource group corresponding with the resource constraint grade, comprising:
The background application is obtained in the occupation proportion of the corresponding resource type;
If the occupation proportion is greater than default second threshold, by the background application be assigned under the corresponding resource type with In the corresponding resource group of the resource constraint grade of the determination.
6. method according to any one of claims 1 to 5, which is characterized in that it is described the background application is assigned to it is described Under corresponding resource type 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;
It will be assigned to the matched background process of the process identification (PID) under the corresponding resource type and the resource constraint grade In corresponding resource group.
7. the method according to weighing and must ask 6, which is characterized in that described to divide with the matched background process of the process identification (PID) It is fitted under the corresponding resource type 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 the corresponding resource type is assigned under the corresponding resource type and the money In the corresponding resource group of source limit grade.
8. a kind of resource management apparatus characterized by comprising
Data acquisition module, the resource for acquiring at least one resource category use data;
Occupied information obtains module, for using the occupied information of data acquisition corresponding resource type according to the resource;
Level determination module, for determining background application in the resource constraint of the corresponding resource type according to the occupied information Grade;
Configuration module, it is corresponding with the resource constraint grade under the corresponding resource type for the background application to be assigned to Resource group in, and configure corresponding with resource constraint grade resource use priority.
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.
CN201810023901.0A 2018-01-10 2018-01-10 Method for managing resource, device, mobile terminal and computer readable storage medium Pending CN110032439A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810023901.0A CN110032439A (en) 2018-01-10 2018-01-10 Method for managing resource, device, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810023901.0A CN110032439A (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
CN110032439A true CN110032439A (en) 2019-07-19

Family

ID=67234203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810023901.0A Pending CN110032439A (en) 2018-01-10 2018-01-10 Method for managing resource, device, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110032439A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110554922A (en) * 2019-09-05 2019-12-10 北京安云世纪科技有限公司 System resource allocation method and device
CN110795323A (en) * 2019-10-29 2020-02-14 Oppo广东移动通信有限公司 Load statistical method, device, storage medium and electronic equipment
CN111445213A (en) * 2020-03-31 2020-07-24 乌鲁木齐众维汇联信息科技有限公司 Network management system for incubation service of park enterprise
US20230012021A1 (en) * 2021-07-08 2023-01-12 EMC IP Holding Company LLC Feature Resource Self-Tuning and Rebalancing

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170034380A1 (en) * 2014-04-08 2017-02-02 Canon Information And Imaging Solutions, Inc. Apparatus, system and method for managing background processing on an image processing device
US20170031721A1 (en) * 2013-04-24 2017-02-02 Samsung Electronics Co., Ltd Method and device for managing memory of user 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
CN107391259A (en) * 2017-07-25 2017-11-24 广东欧珀移动通信有限公司 Method for processing resource and device, computer-readable recording medium, mobile terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170031721A1 (en) * 2013-04-24 2017-02-02 Samsung Electronics Co., Ltd Method and device for managing memory of user device
US20170034380A1 (en) * 2014-04-08 2017-02-02 Canon Information And Imaging Solutions, Inc. Apparatus, system and method for managing background processing on an image processing 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
CN107391259A (en) * 2017-07-25 2017-11-24 广东欧珀移动通信有限公司 Method for processing resource and device, computer-readable recording medium, mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
原始人工作室: "《煮酒论Android》", 31 August 2014 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110554922A (en) * 2019-09-05 2019-12-10 北京安云世纪科技有限公司 System resource allocation method and device
CN110795323A (en) * 2019-10-29 2020-02-14 Oppo广东移动通信有限公司 Load statistical method, device, storage medium and electronic equipment
CN111445213A (en) * 2020-03-31 2020-07-24 乌鲁木齐众维汇联信息科技有限公司 Network management system for incubation service of park enterprise
US20230012021A1 (en) * 2021-07-08 2023-01-12 EMC IP Holding Company LLC Feature Resource Self-Tuning and Rebalancing
US11928517B2 (en) * 2021-07-08 2024-03-12 EMC IP Holding Company LLC Feature resource self-tuning and rebalancing

Similar Documents

Publication Publication Date Title
CN109213539B (en) Memory recovery method and device
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
CN107526640A (en) Method for managing resource, device, mobile terminal and computer-readable recording medium
CN107544842B (en) Applied program processing method and device, computer equipment, storage medium
CN110032439A (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
CN110032267A (en) Information processing method, device, mobile terminal and computer readable storage medium
CN106776036A (en) A kind of resource allocation methods and device
CN109992367A (en) Application processing method and device, electronic equipment, computer readable storage medium
CN109992370A (en) Applied program processing method and device, electronic equipment, computer readable storage medium
CN107526638A (en) Applied program processing method, device, mobile terminal and storage medium
CN109144232A (en) Process handling method and device, electronic equipment, computer readable storage medium
CN108112063A (en) Electric quantity managing method, power management device, terminal and readable storage medium storing program for executing
CN110018902A (en) Internal memory processing method and device, electronic equipment, computer readable storage medium
CN109992399A (en) Method for managing resource, device, mobile terminal and computer readable storage medium
CN110018900A (en) Internal memory processing method and device, electronic equipment, computer readable storage medium
CN106371326A (en) Storage method and apparatus of equipment work scenes
CN110032429B (en) Information processing method and device, mobile terminal and computer readable storage medium
CN110018903A (en) Method for managing resource, device, mobile terminal and computer readable storage medium
CN110046032A (en) Applied program processing method and device, electronic equipment, computer readable storage medium
CN107526637A (en) Applied program processing method, device, mobile terminal and storage medium
CN110032397A (en) Application processing method and device, electronic equipment, computer readable storage medium
CN107491349B (en) Applied program processing method and device, computer equipment, storage medium
CN110018888A (en) Method for managing resource, device, mobile terminal and 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190719

RJ01 Rejection of invention patent application after publication