CN109992400A - Resource allocation methods, device, mobile terminal and computer readable storage medium - Google Patents

Resource allocation methods, device, mobile terminal and computer readable storage medium Download PDF

Info

Publication number
CN109992400A
CN109992400A CN201711488967.9A CN201711488967A CN109992400A CN 109992400 A CN109992400 A CN 109992400A CN 201711488967 A CN201711488967 A CN 201711488967A CN 109992400 A CN109992400 A CN 109992400A
Authority
CN
China
Prior art keywords
resource
front stage
resource group
stage operation
assigned
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
CN201711488967.9A
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 CN201711488967.9A priority Critical patent/CN109992400A/en
Publication of CN109992400A publication Critical patent/CN109992400A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/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
    • G06F9/5016Allocation 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
    • 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
    • G06F9/5022Mechanisms to release resources
    • 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
    • G06F9/5038Allocation 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
    • 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
    • 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

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)

Abstract

The invention relates to a kind of resource allocation methods, device, mobile terminal and computer readable storage mediums.The above method, comprising: the operating status when front and back state change occurs for the process that listens to, after determining the process variation;If the operating status after the variation is front stage operation, the process is assigned to first resource group;If the operating status after the variation is running background, the process is assigned to Secondary resource group, the resource use priority of process is higher than the Secondary resource group in the first resource group.Above-mentioned resource allocation methods, device, mobile terminal and computer readable storage medium can carry out dynamic division to the resource for the process that front and back is run, and optimization system performance saves power consumption.

Description

Resource allocation methods, device, mobile terminal and computer readable storage medium
Technical field
This application involves field of computer technology, more particularly to a kind of resource allocation methods, 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 resource allocation methods, device, mobile terminal and computer readable storage medium, can Dynamic division is carried out with the resource of the process run to front and back, optimization system performance saves power consumption.
A kind of resource allocation methods, comprising:
Operating status when front and back state change occurs for the process that listens to, after determining the process variation;
If the operating status after the variation is front stage operation, the process is assigned to first resource group;
If operating status after the variation is running background, the process is assigned to Secondary resource group, described the The resource use priority of process is higher than the Secondary resource group in one resource group.
A kind of resource allocation device, comprising:
Module is monitored, for determining the fortune after the process changes when front and back state change occurs for the process that listens to Row state;
The process is assigned to first if being front stage operation for the operating status after the variation by distribution module Resource group;
The distribution module distributes the process if the operating status being also used to after the variation is running background To Secondary resource group, the resource use priority of process is higher than the Secondary resource group in the first 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 resource allocation methods, device, mobile terminal and computer readable storage medium, when the process that listens to is from from the background When operation variation is front stage operation, process is assigned to first resource group, when the process that listens to changes from front stage operation as backstage When operation, process is assigned to Secondary resource group, the resource use priority of process is higher than Secondary resource group in first resource group, Dynamic division can be carried out to the resource for the process that front and back is run, the process of front stage operation is allowed to obtain more resources, optimization System performance saves 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 resource allocation methods in one embodiment;
Fig. 3 is the flow diagram of resource allocation methods in one embodiment;
Fig. 4 is the flow diagram that resource use priority is configured in one embodiment;
Fig. 5 is to be divided into process and the matched other flow diagram of resource group of resource category in one embodiment;
Fig. 6 is to divide the other schematic diagram of resource group according to resource category in one embodiment;
Fig. 7 is the flow diagram that the resource use priority of background process is improved in one embodiment;
Fig. 8 is the block diagram of resource allocation device in one embodiment;
Fig. 9 is the block diagram of resource allocation device 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, 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 resource allocation methods 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 resource allocation methods 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 Module 224 is managed containing resource prioritization and limitation management module 222 and platform freezing pipe.Mobile terminal can by resource prioritization and The different application of 222 real-time servicing of limitation management module is in different resource use priority and different resource groups, And the resource group of application program is adjusted according to the demand on upper layer to reach optimization performance, save the effect of power consumption.It is mobile Terminal can freeze management module 224 for the application that can freeze from the background according to the length for entering freeze-off time, distribution by platform To the frozen crust of the preset different levels of correspondence.Optionally, which may include three, be respectively: CPU limitation sleep mould Formula, CPU freeze sleep pattern, process deep freezing mode.Wherein, CPU limits sleep pattern and refers to occupied by associated process Cpu resource limited, so that associated process is occupied less cpu resource, by vacant cpu resource to other not frozen Process inclination, limits the occupancy to cpu resource, also accordingly limits process and account for Internet resources and I/O interface resource With;CPU freezes sleep pattern and refers to forbid associated process using CPU, and retains the occupancy to memory, when being forbidden to use CPU money When source, corresponding Internet resources and I/O interface resource are also prohibited from using;Process deep freezing mode, which refers to remove, to be forbidden to use Except cpu resource, further the occupied memory source of associated process is recycled, the memory of recycling makes for other processes With.Optionally, local ccf layer 220 may also include interface module, which includes binder interface of the exploitation to upper layer, The frame on upper layer or the instruction for sending resource constraint using the binder interface by offer or freezing are to resource priority Grade and limitation management module 222 and platform freezing pipe manage module 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 Resource allocation methods.
As shown in figure 3, in one embodiment, providing a kind of resource allocation methods, comprising the following steps:
Step 310, the operating status when front and back state change occurs for the process that listens to, after determining process variation.
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.Can usually have been run on mobile terminal it is multiple into Journey, different processes can be used for executing different tasks respectively.It optionally, may include the foreground to move ahead on foreground on mobile terminal Process and background process in running background.Mobile terminal can monitor each process of operation, judge whether there is process Front and back state change occurs, wherein front and back state change, which may include process, is switched to running background from front stage operation, or from Running background is switched to front stage operation.
Optionally, mobile terminal can monitor each process being currently running by active manager, monitor Each state of a process variation of operation.When front and back state change occurs for the process that listens to, mobile terminal can determine process Operating status after variation is front stage operation or running background.In one embodiment, mobile terminal can be at regular intervals All process lists being currently running are obtained by the RunningAppProcessInfo class of active manager, for example, every 5 Second obtains all process lists being once currently running, and judges each state of a process being currently running in process list one by one It is front stage operation or running background.This operating status of process can be compared with last operating status, if into The operating status of journey last time is different from this operating status, then can determine that front and back state change occurs for the process, mobile Terminal can determine this operating status of the process.
Step 320, if the operating status after variation is front stage operation, process is assigned to first resource group.
If the operating status after process variation is front stage operation, it can illustrate that the process is switched to foreground from running background and transports Process can be assigned to first resource group by row, mobile terminal.Optionally, mobile terminal can divide different resource groups in advance, no Same resource group can configure different resource use priorities, and different resource use priorities can correspond to different resource constraints Rank, so that carrying out corresponding resource to the process that resource group is added uses limitation.In the present embodiment, mobile terminal can be preparatory First resource group and Secondary resource group are divided, can will be assigned to first resource group in the process of front stage operation, and will transport on backstage Capable process is assigned to Secondary resource group, wherein the resource use priority of process can be higher than Secondary resource in first resource group Process in group.After process is assigned to first resource group, it can configure corresponding resource use priority, compared Secondary resource Background process in group, the foreground process for being assigned to first resource group possess higher resource use priority, can be used more The system resources such as more CPU, I/O, memory and bandwidth.
Optionally, mobile terminal can divide different resource groups based on kernel Cgroup (control group) mechanism, and It file node can be used writes the mode of configuration and the resource use priority of each resource group is set, to the process in each resource group Be managed using the time of resource or ratio etc., wherein Cgroup be the one kind provided in kernel can limit, record, every Mechanism from physical resource used in process group (process groups) (such as: the resources such as CPU, memory, I/O).It is mobile Terminal can load the configuration file of Cgroup, and can record in configuration file has the resource group of division, the resource of each resource group to make With priority and resource dispatching strategy corresponding with resource use priority.Resource dispatching strategy, which may include but be not limited to process, to be made With the time of resource, resource ratio, resource identification used etc. are occupied, for example, the process of configurable Secondary resource group was at 1 minute 30 seconds cpu resources, and the cpu resource etc. that it is X using number that the process of Secondary resource group, which is only capable of, inside can be used, but be not limited to This.It, can be by repairing when needing to add new resource group, or the resource use priority and resource dispatching strategy of modification resource group Change the configuration file of Cgroup.
Step 330, if the operating status after variation is running background, process is assigned to Secondary resource group, the first money The resource use priority of process is higher than Secondary resource group in the group of source.
If the operating status after process variation is running background, it can illustrate that the process is switched to backstage from front stage operation and transports Row, and configure preset resource use priority corresponding with Secondary resource group and resource dispatching strategy.Optionally, Secondary resource The corresponding resource dispatching strategy of group may include relative to the process in first resource group using less cpu resource, using less Memory source, using less I/O resource, operation etc. using less bandwidth resources and on the CPU of small nut.After entering After the process of platform operation is divided into Secondary resource group, appearance can be reduced because the resource that background process seizes foreground process leads to foreground Situations such as application Caton, the system of operation are run slowly and mobile terminal generates heat.
In the present embodiment, when the process that listens to from running background variation be front stage operation when, process is assigned to first Resource group, when the process that listens to from front stage operation variation be running background when, process is assigned to Secondary resource group, first resource The resource use priority of process is higher than Secondary resource group in group, can carry out dynamic to the resource for the process that front and back is run and draw Point, allow the process of front stage operation to obtain more resources, optimization system performance saves power consumption.
As shown in figure 4, further including following after process is assigned to Secondary resource group by step in one embodiment Step:
Step 402, operation characteristic corresponding with process is obtained.
If mobile terminal, which listens to process, is switched to running background from front stage operation, which is assigned to Secondary resource group Afterwards, operation characteristic corresponding with the process can be obtained, and resource use priority is configured according to operation characteristic.Optionally, same It may include one or more resource use priorities under resource group, different resource use priorities can correspond to different resource tune Degree strategy, represents different resource constraint ranks, and resource use priority is higher, and resource constraint rank is lower, can be used more Resource, resource use priority is lower, and resource constraint rank is higher, and less resource can be used.It can be according still further under resource group Resource use priority is divided into one or more child resource groups, and each child resource group can correspond to different resources and use preferentially Grade.
Mobile terminal can obtain operation characteristic corresponding with process, and operation characteristic may include but be not limited to process when default Between resource service condition in section, currently the application type of front stage operation, the network data of connection, battery remaining capacity Deng.The resource service condition of process within a preset period of time may include CPU, memory, the I/O that process uses within a preset period of time And the data of the resources such as bandwidth further may refer to resource of the process in running background in preset time period and use feelings Condition, wherein preset time period can be set according to actual needs, such as 1 week, 2 weeks, 20 days, 1 month etc..Currently on foreground The application type of operation may include but be not limited to social type, audio-video type, type of play etc..The network data of connection can wrap Include WiFi (Wireless-Fidelity, Wireless Fidelity), 3G (the 3rd Generation mobile Communication, 3rd generation mobile communication technology), 4G (the 4th Generation mobile communication, Fourth generation mobile communication technology) etc..
Step 404, by preset Decision Model Analysis operation characteristic, the resource constraint rank of process is obtained.
Mobile terminal can be analyzed by preset decision model pair operation characteristic corresponding with process, determine process Resource constraint rank, wherein decision model can be constructed by machine learning.In one embodiment, mobile terminal can be pre- First obtain a large amount of sample data, sample data may include the operation characteristic of different processes, the sample data of acquisition when span The use habit of user can be embodied on degree and quantity, can be marked with corresponding resource constraint rank in each sample data.Resource Limitation rank can be set according to actual needs, such as the resource that process is occupied in running background in preset time period compared with It is more, then higher resource constraint rank can be corresponded to, the resource that process is occupied in running background in preset time period is less, then may be used Corresponding lower resource constraint rank etc., but not limited to this.Mobile terminal can be using a large amount of sample data as decision model Input, is trained by modes such as machine learning, constructs decision model.
Step 406, resource use priority corresponding with resource constraint rank is configured.
In one embodiment, when mobile terminal is trained, each sample data can be mapped to high-dimensional feature space, Training obtains representing the supporting vector collection of the resource constraint rank of each sample data, is formed each for judging in decision model The discriminant function of resource constraint rank belonging to the operation characteristic of process.Mobile terminal listens to process and is switched to from front stage operation Running background obtains the operation characteristic of process, and operation characteristic can be inputted to decision model, and decision model can map operation characteristic The corresponding resource constraint rank of operation characteristic is determined to high-dimensional feature space, and according to each discriminant function.
Process can be assigned in child resource group corresponding with resource constraint rank by mobile terminal, and to process configuration and really The corresponding resource use priority of fixed resource constraint rank, the process can be called corresponding with the resource use priority configured Resource dispatching strategy uses system resource.Optionally, mobile terminal can be made by the resource that Cgroup configuration file configures process Use priority.For example, the process is added to Secondary resource by mobile terminal after process is switched to running background from front stage operation Group.1,2,3 child resource groups can be divided again under Secondary resource group, respectively correspond frozen state, depth resource constraint state and moderate Three kinds of resource constraint ranks of resource constraint state, 1,2,3 child resource groups can respectively correspond resource use priority 1,2,3.Wherein, The process of resource use priority 1 is in frozen state, cannot use the system resources such as CPU, memory, I/O, and resource uses preferential The process of grade 2 is in depth resource constraint state, only uses the system resources such as 25% CPU, memory, I/O, and resource uses excellent The process of first grade 3 is in moderate resource constraint state, only uses system resources such as 50% CPU, memory, I/O etc., but unlimited In this.Mobile terminal can determine the resource constraint rank of process according to the operation characteristic of process, and configure and the resource constraint grade Not corresponding resource use priority, process can use system resource according to corresponding resource dispatching strategy.
In the present embodiment, after process switching to running background, resource constraint grade can be determined according to the operation characteristic of process Not, the resource prioritization of configuration can be made more accurate, advanced optimize system performance, save power consumption.
As shown in figure 5, in one embodiment, above-mentioned resource allocation methods are further comprising the steps of:
Step 502, the process type of process is obtained, and the resource category that process uses is determined according to process type.
Mobile terminal can obtain the process type of process, and process type can be used for indicating process master resource kind to be used Class, process type may include but be not limited to cpu type, type of memory, I/O type, bandwidth types etc., and process type is CPU class Type can be shown that process mainly occupies cpu resource, and process type is that type of memory can be shown that the main committed memory resource of process, process Type is that I/O type can be shown that process mainly occupies I/O resource, and process type is that bandwidth types can be shown that process mainly occupies band Wide resource etc..Optionally, process may include multiple process types, for example the process type of process is cpu type and memory class Type is not limited in one kind.
In one embodiment, mobile terminal can obtain the currently performed task of process, and according to this currently performed Business resource to be used determine the process type of process.For example, the currently performed task of process is downloading task, the then task Institute's resource to be used is bandwidth resources, then can determine that the process type of the process is bandwidth types etc., but not limited to this.One In a embodiment, mobile terminal can also obtain process in preset time period in the resource service condition on backstage, and according to the resource Service condition determines the process type of process.For example, process can be occupied in 3 days in running background 70% cpu resource and 10% memory source then can determine that the process type of the process is cpu type etc..It is to be appreciated that its other party can also be used Formula obtains the process type of process, is not limited to that.
Step 504, if process is assigned to first resource group, process is divided under first resource group and resource category Matched resource group.
After the process type of acquisition for mobile terminal process, the resource category that process uses can be determined according to process type, and The process is assigned to and the matched resource group of resource category.In the present embodiment, mobile terminal divide first resource group and After Secondary resource group, different resource groups can be divided according to resource category under first resource group and Secondary resource group.Resource Group may include but be not limited to cpu resource group, memory source group, I/O resource group and bandwidth resources group etc..Optionally, first After dividing resource group according to resource category under resource group and Secondary resource group, mobile terminal can be matched by Cgroup configuration file Set the process in each resource group resource use priority and corresponding resource dispatching strategy.Process is assigned to first Under resource group or Secondary resource group and after the matched resource group of resource category that uses, can configure corresponding resource use it is preferential Grade, and the resource under resource group is used according to resource dispatching strategy corresponding with resource use priority.For example, process is divided The cpu resource group being fitted under Secondary resource group, and configuring resource use priority is 2, and 25% cpu resource, needle only can be used To other resource categories, can configure relative to the higher resource use priority of cpu resource group.
Fig. 6 is to divide the other schematic diagram of resource group according to resource category in one embodiment.As shown in fig. 6, mobile terminal The first resource group for distributing foreground process and the Secondary resource group for distributing background process are divided.Under first resource group It may include cpu resource group, memory source group, I/O resource group and bandwidth resources group etc., may also comprise CPU money under Secondary resource group Source group, memory source group, I/O resource group and bandwidth resources group etc..
Step 506, if process is assigned to Secondary resource group, process is divided under Secondary resource group and resource category Matched resource group.
In the present embodiment, the resource category used can be determined according to the process type of process, and be divided into and resource kind In the matched resource group of class, configuration process can be facilitated in the resource use priority and scheduling of resource plan of different resource type Slightly, and the resource that process uses is isolated, makes the more flexible multiplicity of scheduling of resource, advanced optimizes system performance, saved Power consumption.
As shown in fig. 7, in one embodiment, above-mentioned resource allocation methods are further comprising the steps of:
Step 702, detect whether there is the background process for having dependence with the process of front stage operation, if so, holding Row step 704, if it is not, thening follow the steps 708.
When mobile terminal, which listens to process, is switched to front stage operation from running background, which can be assigned to the first money Source group.Mobile terminal can detect whether there is the background process for having dependence with the process of front stage operation, has dependence and closes System refers to that a process needs to wait the message of another process just can normally execute, then exists to rely between two processes and close System.Optionally, mobile terminal pre-recorded can have the process identification (PID) of dependence, can obtain currently front stage operation into Journey identifies, and has the process identification (PID) of dependence according to the process identification (PID) acquisition of the front stage operation and foreground process, can basis Each process of running background is detected one by one with process identification (PID) that foreground process has dependence, it is determined whether exist Has the background process of dependence with the process of front stage operation.
In one embodiment, mobile terminal can detect whether to exist with the process of front stage operation in the presence of after interactively communicating Platform process, can by with the process of front stage operation exist the background process that interactively communicates be determined as having with the process of front stage operation according to The background process for the relationship of relying.Optionally, interactively communicating between process may include synchronization mechanism and/or communication mechanism etc., wherein same Step mechanism may refer to the mutually coordinated common completion task of two processes, and communication mechanism refers to carrying out among varying processes Propagate or exchange information.
In one embodiment, mobile terminal can detect whether to exist with the process of front stage operation with after communication mechanism Platform process, and will can be determined as having with background process that the process of front stage operation has communication mechanism the backstage of dependence into Journey.Communication mechanism may include socket, binder, shared drive etc., wherein two programs on network are two-way by one The exchange of data is realized in communication connection, and one end of this connection is known as a socket;Binder is a kind of interprocess communication machine System, provides remote procedure call function;Shared drive is exactly that two incoherent processes is allowed to access the same logical memory, altogether Enjoying memory is to share between the process that is currently running at two and a kind of very effective mode of transmitting data, different processes it Between share memory be usually arranged for same section of physical memory.Optionally, mobile terminal can detect whether to exist and front stage operation Process the background process that there is socket and/or binder to communicate, and can by with the process of front stage operation have socket and/ Or the background process of binder communication is determined as the background process for having dependence.Mobile terminal, which also can detecte, whether there is The background process of memory sharing is carried out with the process of front stage operation, and after can carrying out memory sharing with the process of front stage operation Platform process is determined as the background process for having dependence.In one embodiment, mobile terminal can add in binder driving Add testing mechanism, and according to binder drive in the testing mechanism that adds detect whether to exist with the process of front stage operation have it is logical The background process of letter mechanism.
In one embodiment, mobile terminal can detect whether to exist with the process of front stage operation with after synchronization mechanism Platform process, and will can be determined as having with background process that the process of front stage operation has synchronization mechanism the backstage of dependence into Journey.Synchronization mechanism may include semaphore, mutual exclusion lock etc., wherein the data structure of semaphore (semaphore) is a value and one A pointer, pointer are directed toward the next process for waiting the semaphore, and mutual exclusion lock can be used to ensure that the integrality of shared data, arbitrarily Only one process of moment may have access to the object for having mutual exclusion lock.Optionally, mobile terminal can pass through futex (fast Userspace mutex, express user space mutexes) calling of system detects whether to exist and has with the process of front stage operation The background process of synchronization mechanism.The calling of futex system can be used for realizing the synchronization mechanism between process, carry out in the user space Operation is a kind of User space (user mode) and kernel state mixed mechanism, wherein User space refers to unprivileged.
In one embodiment, when mobile terminal detects the process generation lock waiting behavior of front stage operation, it may be determined that The lock resource that the process of front stage operation waits.Locking resource may include thread lock, file handle, signal etc., wherein file handle refers to Be from file read data when, the serial number that operating system function is fetched, so as to open file, file handle is for beating The file opened is unique basis of characterization.Mobile terminal can traverse all processes in running background, and detect whether exist etc. The background process with the same lock resource of the process of front stage operation is stayed in, the process etc. with front stage operation can be stayed in same lock resource Background process be determined as the background process with dependence.
Step 704, the background process that will be provided with dependence is assigned to first resource group, and configure with front stage operation into The identical resource use priority of journey.
The background process that process with front stage operation has dependence can be assigned to first resource group by mobile terminal, and Resource use priority identical with the process of front stage operation is configured, is improved after having dependence with the process of front stage operation The resource use priority of platform process, can the accelerating the background process for having dependence with the process of front stage operation of the task are held Row, to reduce the waiting time of the process of front stage operation, accelerates the operation of foreground process.
Step 706, when the process of front stage operation terminates the dependence with background process, after terminating dependence Platform process is assigned to Secondary resource group, and restores to be assigned to the resource use priority before first resource group.
The detectable process with front stage operation of mobile terminal has the background process of dependence, if terminates dependence pass System.For example, mobile terminal can detect whether background process terminates to lead to the socket and/or binder of the process of front stage operation Letter can determine that end dependence if terminating communication.Mobile terminal also can detecte stayed in the process of front stage operation etc. it is same Whether the background process of one lock resource completes task, if task is completed, can determine whether to terminate dependence, but not limited to this.It moves The background process for terminating dependence can be re-assigned to Secondary resource group by dynamic terminal, and is restored the process and be assigned to first Resource use priority before resource group again limits the resource use of background process.
Step 708, it does not deal with.
In the present embodiment, can be improved the resource of the background process for having dependence with the process of front stage operation use it is excellent First grade, guarantee foreground process can be responded in time, prevent because the resource use of background process is restricted make foreground into Journey enters waiting, and the speed of service on foreground is improved while reducing power consumption.
In one embodiment, a kind of resource allocation methods are provided, comprising the following steps:
Step (1), the operating status when front and back state change occurs for the process that listens to, after determining process variation.
Process is assigned to first resource group if the operating status after variation is front stage operation by step (2).
Optionally, after step (2), further includes: detect whether have dependence in the presence of the process with front stage operation Background process;If it exists, then the background process that will be provided with dependence is assigned to first resource group, and configuration and front stage operation The identical resource use priority of process.
Optionally, it detects whether to exist and has the background process of dependence with the process of front stage operation, comprising: detection is It is no to there is the background process that there is communication mechanism with the process of front stage operation;To there is communication mechanism with the process of front stage operation Background process is determined as the background process for having dependence.
Optionally, detect whether there is the background process that there is communication mechanism with the process of front stage operation, comprising: detection is It is no to there is the background process that with the process of front stage operation there is socket and/or binder to communicate.
Optionally, detect whether there is the background process that there is communication mechanism with the process of front stage operation, comprising: detection is It is no to there is the background process that memory sharing is carried out with the process of front stage operation.
Optionally, detect whether there is the background process for having dependence with the process of front stage operation, comprising: work as detection To front stage operation process occur lock waiting behavior when, determine wait lock resource;It detects whether to exist etc. and stays in lock resource Background process, and by etc. stay in lock resource background process be determined as the background process with dependence.
Optionally, when the process of front stage operation terminates the dependence with background process, after terminating dependence Platform process is assigned to Secondary resource group, and restores to be assigned to the resource use priority before first resource group.
Process is assigned to Secondary resource group, the first money if the operating status after variation is running background by step (3) The resource use priority of process is higher than Secondary resource group in the group of source.
Optionally, after step (3), further includes: obtain operation characteristic corresponding with process;Pass through preset decision model Type analysis operation characteristic obtains the resource constraint rank of process, wherein decision model is according to the training of the operation characteristic of different processes It obtains;Configure resource use priority corresponding with resource constraint rank.
Optionally, after step (3), further includes: obtain the process type of process, and determine process according to process type The resource category used;If process is assigned to first resource group, process is divided under first resource group and resource category Matched resource group;If process is assigned to Secondary resource group, process is divided under Secondary resource group and resource category Matched resource group.
In the present embodiment, when the process that listens to from running background variation be front stage operation when, process is assigned to first Resource group, when the process that listens to from front stage operation variation be running background when, process is assigned to Secondary resource group, first resource The resource use priority of process is higher than Secondary resource group in group, can carry out dynamic to the resource for the process that front and back is run and draw Point, allow the process of front stage operation to obtain more resources, optimization system performance saves power consumption.
Although should be understood that each step in the flow diagram of Fig. 3, Fig. 4, Fig. 5 and Fig. 7 according to the finger of arrow Show and successively show, but these steps are not that the inevitable sequence according to arrow instruction successively executes.Unless having herein clear Explanation, there is no stringent sequences to limit for the execution of these steps, these steps can execute in other order.Moreover, At least part step in Fig. 3, Fig. 4, Fig. 5 and Fig. 7 may include multiple sub-steps or multiple stages, these sub-steps or Person's stage is not necessarily to execute completion in synchronization, but can execute at different times, these sub-steps or rank The execution sequence of section, which is also not necessarily, successively to be carried out, but can be with the sub-step or stage of other steps or other steps At least part execute in turn or alternately.
As shown in figure 8, in one embodiment, providing a kind of resource allocation device 800, including monitors module 810 and divide With module 820.
Module 810 is monitored, for the operation when front and back state change occurs for the process that listens to, after determining process variation State.
Process is assigned to first resource if being front stage operation for the operating status after changing by distribution module 820 Group.
Process is assigned to Secondary resource if the operating status after being also used to change is running background by distribution module 820 Group, the resource use priority of process is higher than Secondary resource group in first resource group.
In the present embodiment, when the process that listens to from running background variation be front stage operation when, process is assigned to first Resource group, when the process that listens to from front stage operation variation be running background when, process is assigned to Secondary resource group, first resource The resource use priority of process is higher than Secondary resource group in group, can carry out dynamic to the resource for the process that front and back is run and draw Point, allow the process of front stage operation to obtain more resources, optimization system performance saves power consumption.
As shown in figure 9, in one embodiment, above-mentioned resource allocation device 800, in addition to including monitoring module 810 and dividing It further include that feature obtains module 830, analysis module 840 and configuration module 850 with module 820.
Feature obtains module 830, for obtaining operation characteristic corresponding with process.
Analysis module 840, for obtaining the resource constraint grade of process by preset Decision Model Analysis operation characteristic Not, wherein decision model is obtained according to the training of the operation characteristic of different processes.
Configuration module 850, for configuring resource use priority corresponding with resource constraint rank.
In the present embodiment, after process switching to running background, resource constraint grade can be determined according to the operation characteristic of process Not, the resource prioritization of configuration can be made more accurate, advanced optimize system performance, save power consumption.
In one embodiment, above-mentioned resource allocation device 800, in addition to include monitor module 810 and distribution module 820, Feature obtains module 830, analysis module 840 and configuration module 850, further includes type determining module.
Type determining module determines the resource that process uses for obtaining the process type of process, and according to process type Type.
Process is divided under first resource group by distribution module 820 if being also used to process is assigned to first resource group With the matched resource group of resource category.
Process is divided under Secondary resource group by distribution module 820 if being also used to process is assigned to Secondary resource group With the matched resource group of resource category.
In the present embodiment, the resource category used can be determined according to the process type of process, and be divided into and resource kind In the matched resource group of class, configuration process can be facilitated in the resource use priority and scheduling of resource plan of different resource type Slightly, and the resource that process uses is isolated, makes the more flexible multiplicity of scheduling of resource, advanced optimizes system performance, saved Power consumption.
In one embodiment, above-mentioned resource allocation device 800, in addition to include monitor module 810 and distribution module 820, Feature obtains module 830, analysis module 840, configuration module 850 and type determining module, further includes detection module
Detection module, for detecting whether having the background process of dependence in the presence of the process with front stage operation.
Optionally, detection module, including detection unit and determination unit.
Detection unit, for detecting whether in the presence of the background process with the process of front stage operation with communication mechanism.
Optionally, detection unit, be also used to detect whether to exist with the process of front stage operation have socket and/or The background process of binder communication.
Optionally, detection unit is also used to detect whether to have the backstage for carrying out memory sharing with the process of front stage operation Process.
Determination unit, for the process of front stage operation will there is the background process of communication mechanism to be determined as having dependence pass The background process of system.
Optionally, detection module is also used to determine and wait when lock waiting behavior occurs for the process for detecting front stage operation Lock resource;And detect whether exist etc. stay in lock resource background process, and by etc. stay in lock resource background process it is true It is set to the background process with dependence.
Configuration module 850, is also used to if it exists, then the background process that will be provided with dependence is assigned to first resource group, And configure resource use priority identical with the process of front stage operation.
Configuration module 850 is also used to when the process of front stage operation terminates the dependence with background process, will terminate according to The background process for the relationship of relying is assigned to Secondary resource group, and restores to be assigned to the resource use priority before first resource group.
In the present embodiment, can be improved the resource of the background process for having dependence with the process of front stage operation use it is excellent First grade, guarantee foreground process can be responded in time, prevent because the resource use of background process is restricted make foreground into Journey enters waiting, and the speed of service on foreground is improved while reducing power consumption.
The embodiment of the present application also provides a kind of mobile terminals.As shown in Figure 10, for ease of description, it illustrates only and this Apply for the relevant part of embodiment, it is disclosed by specific technical details, please refer to the embodiment of the present application method part.The movement is whole End can be include mobile phone, tablet computer, personal digital assistant (Personal Digital Assistant, PDA), sale eventually Any terminal devices such as (Point of Sales, POS), vehicle-mounted computer, wearable device are held, are by mobile phone of mobile terminal Example:
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 resource allocation methods are 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:
Operating status when front and back state change occurs for the process that listens to, after determining process variation;
If the operating status after variation is front stage operation, process is assigned to first resource group;
If the operating status after variation is running background, process is assigned to Secondary resource group, in first resource group into The resource use priority of journey is higher than Secondary resource 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 resource allocation methods 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 resource allocation methods 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 (12)

1. a kind of resource allocation methods characterized by comprising
Operating status when front and back state change occurs for the process that listens to, after determining the process variation;
If the operating status after the variation is front stage operation, the process is assigned to first resource group;
If the operating status after the variation is running background, the process is assigned to Secondary resource group, first money The resource use priority of process is higher than the Secondary resource group in the group of source.
2. the method according to claim 1, wherein it is described by the process be assigned to Secondary resource group it Afterwards, the method also includes:
Obtain operation characteristic corresponding with the process;
By operation characteristic described in preset Decision Model Analysis, the resource constraint rank of the process is obtained, wherein described to determine Plan model is obtained according to the training of the operation characteristic of different processes;
Configure resource use priority corresponding with the resource constraint rank.
3. the method according to claim 1, wherein the method also includes:
The process type of the process is obtained, and the resource category that the process uses is determined according to the process type;
If the process is assigned to first resource group, the process is divided under the first resource group and the resource The matched resource group of type;
If the process is assigned to Secondary resource group, the process is divided under the Secondary resource group and the resource The matched resource group of type.
4. the method according to claim 1, wherein it is described by the process be assigned to first resource group it Afterwards, the method also includes:
Detect whether there is the background process for having dependence with the process of front stage operation;
If it exists, then the background process for having dependence is assigned to the first resource group, and configure with it is described before The identical resource use priority of process of platform operation.
5. according to the method described in claim 4, it is characterized in that, described detect whether have in the presence of the process with front stage operation The background process of dependence, comprising:
Detect whether there is the background process that there is communication mechanism with the process of front stage operation;
With the process of the front stage operation will there is the background process of communication mechanism to be determined as the background process for having dependence.
6. according to the method described in claim 5, it is characterized in that, described detect whether have in the presence of the process with front stage operation The background process of communication mechanism, comprising:
Detect whether there is the background process that with the process of front stage operation there is socket and/or binder to communicate.
7. according to the method described in claim 5, it is characterized in that, described detect whether have in the presence of the process with front stage operation The background process of communication mechanism, comprising:
Detect whether there is the background process that memory sharing is carried out with the process of front stage operation.
8. according to the method described in claim 4, it is characterized in that, described detect whether have in the presence of the process with front stage operation The background process of dependence, comprising:
When lock waiting behavior occurs for the process for detecting front stage operation, the lock resource waited is determined;
Detect whether exist etc. stay in it is described lock resource background process, and by it is described etc. stay in it is described lock resource background process It is determined as the background process with dependence.
9. according to any method of claim 4 to 8, which is characterized in that the method also includes:
When the process of the front stage operation terminates the dependence with the background process, will terminate the backstage of dependence into Journey is assigned to Secondary resource group, and restores to be assigned to the resource use priority before the first resource group.
10. a kind of resource allocation device characterized by comprising
Module is monitored, for determining the operation shape after the process changes when front and back state change occurs for the process that listens to State;
The process is assigned to first resource if being front stage operation for the operating status after the variation by distribution module Group;
The process is assigned to the if the operating status being also used to after the variation is running background by the distribution module Two resource groups, the resource use priority of process is higher than the Secondary resource group in the first resource group.
11. a kind of mobile terminal, including memory and processor, computer program, the calculating are stored in the memory When machine program is executed by the processor, so that the processor realizes method as described in any one of claim 1 to 9.
12. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program Method as described in any one of claim 1 to 9 is realized when being executed by processor.
CN201711488967.9A 2017-12-29 2017-12-29 Resource allocation methods, device, mobile terminal and computer readable storage medium Pending CN109992400A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711488967.9A CN109992400A (en) 2017-12-29 2017-12-29 Resource allocation methods, device, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711488967.9A CN109992400A (en) 2017-12-29 2017-12-29 Resource allocation methods, device, mobile terminal and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109992400A true CN109992400A (en) 2019-07-09

Family

ID=67109990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711488967.9A Pending CN109992400A (en) 2017-12-29 2017-12-29 Resource allocation methods, device, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109992400A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704187A (en) * 2019-09-25 2020-01-17 深圳传音控股股份有限公司 Method and device for adjusting system resources and readable storage medium
CN110955498A (en) * 2019-11-21 2020-04-03 北京浪潮数据技术有限公司 Process processing method, device and equipment and computer readable storage medium
CN111046378A (en) * 2019-12-12 2020-04-21 Oppo(重庆)智能科技有限公司 Method and related device for forbidding third-party application program to set process priority
CN111831434A (en) * 2020-07-01 2020-10-27 Oppo广东移动通信有限公司 Resource allocation method, device, storage medium and electronic equipment
CN111831438A (en) * 2020-07-01 2020-10-27 Oppo广东移动通信有限公司 Resource allocation method, device, storage medium and electronic equipment
CN111831433A (en) * 2020-07-01 2020-10-27 Oppo广东移动通信有限公司 Resource allocation method, device, storage medium and electronic equipment
CN111831440A (en) * 2020-07-01 2020-10-27 Oppo广东移动通信有限公司 Memory recovery method and device, storage medium and electronic equipment
CN112527476A (en) * 2019-09-19 2021-03-19 华为技术有限公司 Resource scheduling method and electronic equipment
CN113285976A (en) * 2021-04-07 2021-08-20 上海商米科技集团股份有限公司 Cloud control process management system
US20230012021A1 (en) * 2021-07-08 2023-01-12 EMC IP Holding Company LLC Feature Resource Self-Tuning and Rebalancing
CN116055443A (en) * 2022-05-16 2023-05-02 荣耀终端有限公司 Method for identifying social scene, electronic equipment and computer readable storage medium
CN117130773A (en) * 2023-04-28 2023-11-28 荣耀终端有限公司 Resource allocation method, device and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102479108A (en) * 2010-11-26 2012-05-30 中国科学院声学研究所 Terminal resource management system for multi-application process embedded system and method
US9191417B2 (en) * 2012-06-28 2015-11-17 Microsoft Technology Licensing, Llc Cross-process media handling in a voice-over-internet protocol (VOIP) application platform
CN106569898A (en) * 2016-11-22 2017-04-19 珠海市魅族科技有限公司 Resource distribution method and mobile terminal
CN107391241A (en) * 2017-06-22 2017-11-24 努比亚技术有限公司 Using quick start method, terminal and computer-readable recording medium
CN107463403A (en) * 2017-07-31 2017-12-12 广东欧珀移动通信有限公司 Course control method, device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102479108A (en) * 2010-11-26 2012-05-30 中国科学院声学研究所 Terminal resource management system for multi-application process embedded system and method
US9191417B2 (en) * 2012-06-28 2015-11-17 Microsoft Technology Licensing, Llc Cross-process media handling in a voice-over-internet protocol (VOIP) application platform
CN106569898A (en) * 2016-11-22 2017-04-19 珠海市魅族科技有限公司 Resource distribution method and mobile terminal
CN107391241A (en) * 2017-06-22 2017-11-24 努比亚技术有限公司 Using quick start method, terminal and computer-readable recording medium
CN107463403A (en) * 2017-07-31 2017-12-12 广东欧珀移动通信有限公司 Course control method, device, storage medium and electronic equipment

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527476A (en) * 2019-09-19 2021-03-19 华为技术有限公司 Resource scheduling method and electronic equipment
CN112527476B (en) * 2019-09-19 2024-03-26 华为技术有限公司 Resource scheduling method and electronic equipment
WO2021052415A1 (en) * 2019-09-19 2021-03-25 华为技术有限公司 Resource scheduling method and electronic device
CN110704187A (en) * 2019-09-25 2020-01-17 深圳传音控股股份有限公司 Method and device for adjusting system resources and readable storage medium
CN110955498A (en) * 2019-11-21 2020-04-03 北京浪潮数据技术有限公司 Process processing method, device and equipment and computer readable storage medium
CN110955498B (en) * 2019-11-21 2022-03-22 北京浪潮数据技术有限公司 Process processing method, device and equipment and computer readable storage medium
CN111046378A (en) * 2019-12-12 2020-04-21 Oppo(重庆)智能科技有限公司 Method and related device for forbidding third-party application program to set process priority
CN111831438A (en) * 2020-07-01 2020-10-27 Oppo广东移动通信有限公司 Resource allocation method, device, storage medium and electronic equipment
CN111831440A (en) * 2020-07-01 2020-10-27 Oppo广东移动通信有限公司 Memory recovery method and device, storage medium and electronic equipment
CN111831433A (en) * 2020-07-01 2020-10-27 Oppo广东移动通信有限公司 Resource allocation method, device, storage medium and electronic equipment
CN111831434A (en) * 2020-07-01 2020-10-27 Oppo广东移动通信有限公司 Resource allocation method, device, storage medium and electronic equipment
CN113285976A (en) * 2021-04-07 2021-08-20 上海商米科技集团股份有限公司 Cloud control process management system
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
CN116055443A (en) * 2022-05-16 2023-05-02 荣耀终端有限公司 Method for identifying social scene, electronic equipment and computer readable storage medium
CN116055443B (en) * 2022-05-16 2023-11-14 荣耀终端有限公司 Method for identifying social scene, electronic equipment and computer readable storage medium
CN117130773A (en) * 2023-04-28 2023-11-28 荣耀终端有限公司 Resource allocation method, device and equipment

Similar Documents

Publication Publication Date Title
CN109992400A (en) Resource allocation methods, device, mobile terminal and computer readable storage medium
CN107220076B (en) A kind of method for recovering internal storage and device
CN109992398A (en) Method for managing resource, device, mobile terminal and computer readable storage medium
CN106874168A (en) Determine method, device and the mobile terminal of application program runnability
CN110032267A (en) Information processing method, device, mobile terminal and computer readable storage medium
CN107273036A (en) Mobile terminal and its split screen control method, computer-readable recording medium
CN110008008A (en) Applied program processing method and device, electronic equipment, computer readable storage medium
CN106776036A (en) A kind of resource allocation methods and device
CN109144232A (en) Process handling method and device, electronic equipment, computer readable storage medium
CN104363988B (en) A kind of management method and device of multi-core processor
CN110032429A (en) Information processing method, device, mobile terminal and computer readable storage medium
CN109992438A (en) Information processing method, device, computer equipment and computer readable storage medium
CN110018904A (en) Information processing method, device, computer equipment and computer readable storage medium
CN109992367A (en) Application processing method and device, electronic equipment, computer readable storage medium
CN109992399A (en) Method for managing resource, device, mobile terminal and computer readable storage medium
CN110018903A (en) Method for managing resource, device, mobile terminal and computer readable storage medium
CN110045809A (en) Information processing method, device, computer equipment and computer readable storage medium
CN106371326A (en) Storage method and apparatus of equipment work scenes
CN110032439A (en) Method for managing resource, device, mobile terminal and computer readable storage medium
CN106775680A (en) Suspend processing method, device and the mobile terminal for notifying
CN109992397A (en) Process handling method and device, electronic equipment, computer readable storage medium
CN109992375A (en) Information processing method, device, computer equipment and computer readable storage medium
CN109992425A (en) Information processing method, device, computer equipment and computer readable storage medium
CN109992360A (en) Process handling method and device, electronic equipment, computer readable storage medium
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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190709