CN107797645A - Resource control method and device - Google Patents

Resource control method and device Download PDF

Info

Publication number
CN107797645A
CN107797645A CN201710949290.8A CN201710949290A CN107797645A CN 107797645 A CN107797645 A CN 107797645A CN 201710949290 A CN201710949290 A CN 201710949290A CN 107797645 A CN107797645 A CN 107797645A
Authority
CN
China
Prior art keywords
application
resource
type
resource request
timer
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.)
Granted
Application number
CN201710949290.8A
Other languages
Chinese (zh)
Other versions
CN107797645B (en
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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201710949290.8A priority Critical patent/CN107797645B/en
Publication of CN107797645A publication Critical patent/CN107797645A/en
Application granted granted Critical
Publication of CN107797645B publication Critical patent/CN107797645B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3237Power saving characterised by the action undertaken by disabling clock generation or distribution
    • 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/3287Power saving characterised by the action undertaken by switching off individual functional units in the computer system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • 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
    • 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/5044Allocation 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 hardware capabilities
    • 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)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Telephone Function (AREA)

Abstract

The disclosure is directed to resource control method and device.This method includes:Receive the resource request of application;Obtain the running status of application;Wherein, the running status of application includes front stage operation state or background operation state;According to the running status of application, the type of application and default application type, the system resource corresponding to the resource request of application is controlled.The random misuse of system resources of application that the disclosure can avoid being installed in terminal and cause terminal power consumption too fast, power consumption can be saved, improve terminal standby time, avoid privacy leakage, it is possible to increase Consumer's Experience.

Description

Resource control method and device
Technical field
This disclosure relates to field of terminal technology, more particularly to resource control method and device.
Background technology
With the popularization of mobile Internet, mobile phone is increasingly becoming the communication tool that can not be lacked in many people's lives.Mobile phone In application installation it is more and more, these colourful applications bring convenience to user's live and work.
However, in correlation technique, there is the problem of allowing misuse of system resources without user in some applications, for example, have Using in order to orient advertisement, it is necessary in the continuous positional information for collecting user in backstage, this will cause the whole world of mobile phone to determine Position system (GPS, Global Positioning System) is constantly in working condition, and power consumption is accelerated, and leakage user be present The risk of privacy;Some applications frequently carry out bluetooth scanning, power consumption is larger, Yong Huxu to detect the bluetooth equipment of surrounding Frequently to be charged for mobile phone, some puzzlements are brought to user.
The content of the invention
To overcome problem present in correlation technique, the embodiment of the present disclosure provides a kind of resource control method and device.Institute It is as follows to state technical scheme:
According to the first aspect of the embodiment of the present disclosure, there is provided a kind of resource control method, including:
Receive the resource request of application;
Obtain the running status of the application;Wherein, the running status of the application includes front stage operation state or backstage Running status;
According to the running status of the application, the type of the application and default application type, to the resource of the application The corresponding system resource of request is controlled.
In one embodiment, it is described according to the running status of the application, the type of the application and default to apply class Type, the system resource corresponding to the resource request of the application is controlled, including:
When the application is in the type of background operation state and the application with default application type mismatch, screen State the resource request of application in covert;Or
When the type that the application is in background operation state and the application matches with default application type, response In the resource request of the application, the system resource corresponding to the resource request of the application is distributed for the application.
In one embodiment, it is described according to the running status of the application, the type of the application and default to apply class Type, the system resource corresponding to the resource request of the application is controlled, including:
When the application is in front stage operation state, in response to the resource request of the application, distributed for the application System resource corresponding to the resource request of the application.
In one embodiment, it is described according to the running status of the application, the type of the application and default to apply class Type, the system resource corresponding to the resource request of the application is controlled, including:
, please in response to the resource of the application when the application is switched to background operation state from foreground running status Ask, distribute the system resource corresponding to the resource request of the application for the application, and start the first timer;
Reach the type of the first preset duration and the application and default application type in the timing of first timer During matching, in response to the resource request of the application, the system corresponding to the resource request of the application is distributed for the application Resource;Or
Reach the type of the first preset duration and the application and default application type in the timing of first timer During mismatch, refuse to distribute peripheral resources for the application, and start the second timer;Reached in the timing of second timer During to the second preset duration, refuse to distribute peripheral resources and processor resource for the application, and start the 3rd timer;Institute When stating the timing of the 3rd timer and reaching three preset durations, shielding the application please for the resource of any kind system resource Ask.
In one embodiment, when the timing in second timer reaches the second preset duration, refuse as institute State includes using distribution peripheral resources and processor resource:
The processor occupancy for reaching the second preset duration and the application in the timing of second timer is less than in advance If during threshold value, refuse to distribute peripheral resources and processor resource for the application;Or
The processor occupancy for reaching the second preset duration and the application in the timing of second timer is more than etc. When the predetermined threshold value, refuse to distribute peripheral resources for the application, and please for the resource of the application distribution application Seek corresponding processor resource.
In one embodiment, the default application type comprises at least following any type or combination:
System application, the application in white list, the application that desktop plug-ins be present on terminal foreground, the function currently run are The application of preset function.
According to the second aspect of the embodiment of the present disclosure, there is provided a kind of resource control, including:
Receiving module, for receiving the resource request of application;
Acquisition module, for obtaining the running status of the application;Wherein, the running status of the application is transported including foreground Row state or background operation state;
Resource controlled block, for the running status according to the application, the type of the application and default application type, System resource corresponding to the resource request of the application is controlled.
In one embodiment, the resource controlled block, including:
Submodule is shielded, for being in the type of background operation state and the application and default application in the application When type mismatches, the resource request of the application is shielded;
Resource allocation submodule, for being in the type of background operation state and the application in the application with presetting When application type matches, in response to the resource request of the application, the resource request that the application is distributed for the application is right The system resource answered.
In one embodiment, the resource controlled block is when the application is in front stage operation state, in response to institute The resource request of application is stated, the system resource corresponding to the resource request of the application is distributed for the application.
In one embodiment, the resource controlled block:
, please in response to the resource of the application when the application is switched to background operation state from foreground running status Ask, distribute the system resource corresponding to the resource request of the application for the application, and start the first timer;
Reach the type of the first preset duration and the application and default application type in the timing of first timer During matching, in response to the resource request of the application, the system corresponding to the resource request of the application is distributed for the application Resource;
Reach the type of the first preset duration and the application and default application type in the timing of first timer During mismatch, refuse to distribute peripheral resources for the application, and start the second timer;Reached in the timing of second timer During to the second preset duration, refuse to distribute peripheral resources and processor resource for the application, and start the 3rd timer;Institute When stating the timing of the 3rd timer and reaching three preset durations, shielding the application please for the resource of any kind system resource Ask.
In one embodiment, the resource controlled block:
The processor occupancy for reaching the second preset duration and the application in the timing of second timer is less than in advance If during threshold value, refuse to distribute peripheral resources and processor resource for the application;
The processor occupancy for reaching the second preset duration and the application in the timing of second timer is more than etc. When the predetermined threshold value, refuse to distribute peripheral resources for the application, and please for the resource of the application distribution application Seek corresponding processor resource.
According to the third aspect of the embodiment of the present disclosure, there is provided a kind of resource control, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Receive the resource request of application;
Obtain the running status of the application;Wherein, the running status of the application includes front stage operation state or backstage Running status;
According to the running status of the application, the type of the application and default application type, to the resource of the application The corresponding system resource of request is controlled.
According to the fourth aspect of the embodiment of the present disclosure, there is provided a kind of computer-readable recording medium, be stored thereon with calculating The step of machine instructs, and above-mentioned first aspect methods described is realized in the instruction when being executed by processor.
The technical scheme provided by this disclosed embodiment can include the following benefits:The technical scheme is according to application Running status and type control the system resource used using current request, avoid being installed on the application in terminal and arbitrarily abuse System resource and cause terminal power consumption too fast, can save power consumption, improve terminal standby time, by being controlled to system resource System can avoid some apply from obtaining privacy of user on the premise of allowing without user, avoid privacy leakage, it is possible to increase use Experience at family.
It should be appreciated that the general description and following detailed description of the above are only exemplary and explanatory, not The disclosure can be limited.
Brief description of the drawings
Accompanying drawing herein is merged in specification and forms the part of this specification, shows the implementation for meeting the disclosure Example, and be used to together with specification to explain the principle of the disclosure.
Fig. 1 is the flow chart of the resource control method according to an exemplary embodiment.
Fig. 2 is the flow chart of the resource control method according to an exemplary embodiment.
Fig. 3 is the block diagram of the resource control according to an exemplary embodiment.
Fig. 4 is the block diagram of the resource control according to an exemplary embodiment.
Fig. 5 is the block diagram of the resource control according to an exemplary embodiment.
Fig. 6 is the block diagram of the resource control according to an exemplary embodiment.
Fig. 7 is the block diagram of the resource control according to an exemplary embodiment.
Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the disclosure.On the contrary, they be only with it is such as appended The example of the consistent apparatus and method of some aspects be described in detail in claims, the disclosure.
In correlation technique, terminal, by taking mobile phone as an example, some applications in mobile phone are present allows abuse system to provide without user The problem of source, for example, some applications, in order to orient advertisement, it is necessary in the continuous positional information for collecting user in backstage, this is just The GPS of mobile phone can be caused to be constantly in working condition, power consumption is accelerated, and the risk of leakage privacy of user be present;Some applications are Bluetooth equipment around detection, bluetooth scanning frequently being carried out, power consumption is larger, and user needs frequently to charge for mobile phone, so as to Some puzzlements are brought to user, cause Consumer's Experience poor.
In order to solve the above problems, the embodiment of the present disclosure provides a kind of resource control method, and this method includes:Receiving should Resource request;Obtain the running status of application;Wherein, the running status of application includes front stage operation state or running background State;According to the running status of application, the type of application and default application type, to the system corresponding to the resource request of application Resource is controlled.
In the resource control method that the embodiment of the present disclosure provides, worked as according to the running status of application and type to control to apply The preceding system resource for asking to use, avoids being installed on the random misuse of system resources of the application in terminal and causes terminal power consumption mistake Hurry up, can save power consumption, improve terminal standby time, by system resource is controlled can avoid it is some apply without User obtains privacy of user on the premise of allowing, and avoids privacy leakage, it is possible to increase Consumer's Experience.
Based on above-mentioned analysis, following specific embodiment is proposed.
Fig. 1 is a kind of flow chart of resource control method according to an exemplary embodiment, the execution master of this method Body can be terminal, and terminal is, for example, mobile phone, tablet personal computer, desktop computer, notebook computer or wearable device etc.;Such as Fig. 1 institutes Show, this method comprises the following steps 101-103:
In a step 101, the resource request of application is received;
In a step 102, the running status of application is obtained;Wherein, the running status of application include front stage operation state or Background operation state;
Example, apply and front stage operation state is in front stage operation;Apply and running background is in running background State;Using can between front stage operation state and background operation state switchover operation state.
In step 103, according to the running status of application, the type of application and default application type, to the resource of application The corresponding system resource of request is controlled.
Example, system resource includes peripheral resources and processor (CPU) resource, peripheral resources such as mixed-media network modules mixed-media, passes The hardware resource of the terminals such as sensor, locating module and bluetooth scan module.Default application type comprises at least following any kind Type or combination:System application, the application in white list, desktop plug-ins (widget) application, current fortune on terminal foreground be present Capable function is the application of preset function.System applies such as input method;User can set white list, white list in the terminal In application such as social software, applying in white list will continue to remain on after backstage is switched to from foreground, and terminal will There is provided for application using required system resource;The function of currently running is the application of preset function, is referred to using being currently running Play the preset function that the users such as music, navigation or download allow.
Example, according to the running status of application, the type of application and default application type in step 103, to application The mode that system resource corresponding to resource request is controlled can include:
1st, when application is in front stage operation state, in response to the resource request of application, for the resource of application distribution application The corresponding system resource of request.
Specifically, apply in front stage operation, in foreground use state, application can be used corresponding to resource request System resource, without being restricted.
2nd, when type of the application in background operation state and application mismatches with default application type, shielding application Resource request;Wherein, when shielding refers to that terminal receives the resource request of application, the resource request of application is not rung Should.
3rd, when type of the application in background operation state and application matches with default application type, in response to application Resource request, for application distribution application resource request corresponding to system resource.
The technical scheme provided by this disclosed embodiment, asked according to the running status of application and type to control using current The system resource used is sought, avoids being installed on the random misuse of system resources of the application in terminal and causes terminal power consumption too fast, energy Power consumption is enough saved, terminal standby time is improved, some apply without user can be avoided by being controlled to system resource Privacy of user is obtained on the premise of permission, avoids privacy leakage, it is possible to increase Consumer's Experience.
Fig. 2 is a kind of flow chart of resource control method according to an exemplary embodiment.As shown in Fig. 2 in Fig. 1 On the basis of illustrated embodiment, this disclosure relates to resource control method may comprise steps of 201-208:
In step 201, the resource request of application is received.
In step 202, the running status of application is obtained;Wherein, the running status of application include front stage operation state or Background operation state.
It should be noted that step 201-202 executive mode may refer in embodiment illustrated in fig. 1 for step 101- 102 explanation, will not be repeated here.
In step 203, when application is switched to background operation state from foreground running status, in response to the resource of application Request, for the system resource corresponding to the resource request of application distribution application, and the first timer of startup.
Example, when application is in front stage operation state, in response to the resource request of application, terminal is that application distribution should System resource corresponding to resource request;When application is switched to background operation state from foreground running status, using still The system resource corresponding to the resource request of application can so be used;In application running background shape is switched to from foreground running status During state, start the first timer.
In step 204, when the timing of the first timer reaches the first preset duration, judge the type of application with presetting Whether application type matches;When the type of application matches with default application type, step 205 is gone to;Application type with When default application type mismatches, step 206 is gone to.
Example, when the timing of the first timer reaches the first preset duration, judge the type of application and default application Whether type matches;For example, check application whether in white list;Check whether application is what terminal operating system was used Using, such as input method etc.;Check whether application has widget in desktop;Check whether application is currently running play music, lead The preset function that the user such as boat or download allows or known;If the type of application matches with default application type, applying can be with It is continuing with system resource;If the type of application mismatches with default application type, step 206 is gone to, is refused as application point With peripheral resources.
In step 205, the type of the first preset duration and application and default application are reached in the timing of the first timer During type matching, in response to the resource request of application, for the system resource corresponding to the resource request of application distribution application;Flow Terminate.
In step 206, the type of the first preset duration and application and default application are reached in the timing of the first timer When type mismatches, refuse to distribute peripheral resources for application, and start the second timer.
Example, the hardware of peripheral resources terminal such as mixed-media network modules mixed-media, sensor, locating module and bluetooth scan module Resource.
In step 207, when the timing of the second timer reaches the second preset duration, refuse as application distribution peripheral hardware money Source and processor resource, and start the 3rd timer.
Example, the processor occupancy that the second preset duration and application are reached in the timing of the second timer is less than in advance If during threshold value, refuse as application distribution peripheral resources and processor resource;Or to reach second pre- in the timing of the second timer If the duration and processor occupancy of application is when being more than or equal to predetermined threshold value, refuse as application distribution peripheral resources, now, can Think the processor resource corresponding to using the resource request of distribution application.
In a step 208, when the timing of the 3rd timer reaches three preset durations, shielding application is for any type System resource resource request.
Example, for convenience of description, in the present embodiment by the running status of application be subdivided into including:Foreground use state, Backstage active state, from the background slight disabled state, backstage moderate disabled state, backstage severe disabled state;Foreground makes With state, from the background backstage active state, slight disabled state, backstage moderate disabled state and backstage severe disabled state Representing the activity of application successively constantly reduces.Each state is respectively described below below:
1) foreground use state namely front stage operation state, during using in foreground use state, using any system Resource of uniting is unrestricted.
2) when application is switched to background operation state from foreground running status, using in backstage active state, and open Dynamic first timer;It is not up in the timing of the first timer in the period of the first preset duration, using still can using System resource corresponding to the resource request of application;When the timing of the first timer reaches the first preset duration, judge to apply Type whether matched with default application type;If the type of application matches with default application type, application remains in Backstage active state, application can be continuing with system resource;If the type of application mismatches with default application type, apply The slight disabled state in backstage will be entered.
3) when application is in the slight disabled state in backstage, refuse to distribute peripheral resources for application, to mixed-media network modules mixed-media, pass The peripheral resources such as sensor, locating module and bluetooth scan module are controlled, and start the second timer;In the second timer When timing reaches the second preset duration, judge whether the processor occupancy of application is less than predetermined threshold value;If the processor of application When occupancy is not less than predetermined threshold value, it is application distribution peripheral resources to continue refusal;The processor occupancy of application is less than default During threshold value, it may be said that bright to represent that application enter the inactive shape of backstage moderate currently without important function, then application is run State.
4) when application is in backstage moderate disabled state, refuse to distribute peripheral resources and processor resource for application, On the basis of 3), further scheduler (jobScheduler), broadcast (broadcast), alarm clock (alarm), dormancy are locked (wakelock), background service (bgService) these system resources are controlled, and start the 3rd timer;In the 3rd meter When device timing when reaching three preset durations, application will enter backstage severe disabled state;
5) when application is in backstage severe disabled state, resource request of the shielding application for any kind resource; Frozen will be applied, using cpu resource can not be obtained again, reduces the power consumption of application to greatest extent;In application in backstage weight When spending disabled state, any resource is not distributed for application, but be not turned off applying, facilitate user to reopen application, saved Save opening time.
It should be noted that when application is in background operation state, once user reopens application, that is, apply from rear At the time of platform switches to foreground, using front stage operation state has been put into, using all permissions that can reuse terminal again System resource.
The technical scheme provided by this disclosed embodiment, by the way that the running status of application is classified, to different fortune Row state, the distribution to system resource carry out the control of differentiation, so as to reach the mesh for preventing using abuse resource, saving power consumption 's.Because the limitation to system resource is progressively carried out, power consumption thus is saved on the premise of Consumer's Experience is not influenceed, Preferably balance Consumer's Experience and power consumption of terminal control.
Following is embodiment of the present disclosure, can be used for performing embodiments of the present disclosure.
Fig. 3 is a kind of block diagram of resource control according to an exemplary embodiment, and the device can use each Kind of mode is implemented, such as all components of implementation in the terminal, or, in end side implementation in a coupled manner In component;The device can by software, hardware or both be implemented in combination with it is above-mentioned this disclosure relates to method, such as Fig. 3 Shown, the resource control includes:Receiving module 301, acquisition module 302 and resource controlled block 303, wherein:
Receiving module 301 is configured as receiving the resource request of application;
Acquisition module 302 is configured as obtaining the running status of application;Wherein, the running status of application includes front stage operation State or background operation state;
Resource controlled block 303 is configured as the running status according to application, the type of application and default application type, right System resource corresponding to the resource request of application is controlled.
The device that the embodiment of the present disclosure provides can be used in performing the technical scheme of embodiment illustrated in fig. 1, its executive mode Similar with beneficial effect, here is omitted.
In a kind of possible embodiment, as shown in figure 4, the resource control shown in Fig. 3 can also be included money Source control module 303 is configured to include:Submodule 401 and resource allocation submodule 402 are shielded, wherein:
Shielding submodule 401 is configured as applying class with default in type of the application in background operation state and application When type mismatches, shielding resource request;
Resource allocation submodule 402 is configured as should with presetting in type of the application in background operation state and application During with type matching, in response to the resource request of application, for the system resource corresponding to the resource request of application distribution application.
Example, resource controlled block 303 is when application is in front stage operation state, in response to the resource request of application, For the system resource corresponding to the resource request of application distribution application.
Example, resource controlled block 303 application be switched to background operation state from foreground running status when, in response to The resource request of application, for the system resource corresponding to the resource request of application distribution application, and the first timer of startup;
Resource controlled block 303 reaches the type of the first preset duration and application with presetting in the timing of the first timer When application type matches, in response to the resource request of application, for the system resource corresponding to the resource request of application distribution application;
Resource controlled block 303 reaches the type of the first preset duration and application with presetting in the timing of the first timer When application type mismatches, refuse to distribute peripheral resources for application, and start the second timer;
Resource controlled block 303 is refused outside for application distribution when the timing of the second timer reaches the second preset duration If resource and processor resource, and start the 3rd timer;
For resource controlled block 303 when the timing of the 3rd timer reaches three preset durations, shielding application is for any The resource request of the system resource of type.
Example, resource controlled block 303 reaches the processing of the second preset duration and application in the timing of the second timer When device occupancy is less than predetermined threshold value, refuse as application distribution peripheral resources and processor resource;Resource controlled block 303 is The timing of two timers reaches the processor occupancy of the second preset duration and application when being more than or equal to predetermined threshold value, refuse be Using distribution peripheral resources, and it is the processor resource corresponding to the resource request of application distribution application.
Fig. 5 is a kind of block diagram of resource control 500 according to an exemplary embodiment, resource control 500 are applied to terminal, and resource control 500 includes:
Processor 501;
For storing the memory 502 of processor-executable instruction;
Wherein, processor 501 is configured as:
Receive the resource request of application;
Obtain the running status of application;Wherein, the running status of application includes front stage operation state or background operation state;
According to the running status of application, the type of application and default application type, to corresponding to the resource request of application System resource is controlled.
In one embodiment, above-mentioned processor 501 is also configured to:According to the running status of application, the class of application Type and default application type, are controlled to the system resource corresponding to the resource request of application, including:
It is shielding when type of the application in background operation state and application mismatches with default application type Resource request;Or
When type of the application in background operation state and application matches with default application type, in response to application Resource request, for the system resource corresponding to the resource request of application distribution application.
In one embodiment, above-mentioned processor 501 is also configured to:According to the running status of application, the class of application Type and default application type, are controlled to the system resource corresponding to the resource request of application, including:
When application is in front stage operation state, in response to the resource request of application, the resource for application distribution application please Seek corresponding system resource.
In one embodiment, above-mentioned processor 501 is also configured to:According to the running status of application, the class of application Type and default application type, are controlled to the system resource corresponding to the resource request of application, including:
When application is switched to background operation state from foreground running status, in response to the resource request of application, for application The system resource corresponding to the resource request of application is distributed, and starts the first timer;
When the type that the timing of the first timer reaches the first preset duration and applied matches with default application type, In response to the resource request of application, for the system resource corresponding to the resource request of application distribution application;Or
The type for reaching the first preset duration and application in the timing of the first timer mismatches with default application type When, refuse to distribute peripheral resources for application, and start the second timer;
When the timing of the second timer reaches the second preset duration, refuse as application distribution peripheral resources and processor money Source, and start the 3rd timer;
When the timing of the 3rd timer reaches three preset durations, money of the shielding application for any kind system resource Ask in source.
In one embodiment, above-mentioned processor 501 is also configured to:It is pre- to reach second in the timing of the second timer If during duration, refuse to include for application distribution peripheral resources and processor resource:
The processor occupancy for reaching the second preset duration and application in the timing of the second timer is less than predetermined threshold value When, refuse as application distribution peripheral resources and processor resource;Or
The processor occupancy for reaching the second preset duration and application in the timing of the second timer is more than or equal to default threshold During value, refuse to distribute peripheral resources for application, and be the processor resource corresponding to the resource request of application distribution application.
In one embodiment, above-mentioned processor 501 is also configured to:Default application type comprises at least following any Type or combination:
System application, the application in white list, the application that desktop plug-ins be present on terminal foreground, the function currently run are The application of preset function.
On the device in above-described embodiment, wherein modules perform the concrete mode of operation in relevant this method Embodiment in be described in detail, explanation will be not set forth in detail herein.
Fig. 6 is a kind of block diagram of resource control according to an exemplary embodiment;Resource control 600 is suitable For terminal;Resource control 600 can include following one or more assemblies:Processing component 602, memory 604, power supply Component 606, multimedia groupware 608, audio-frequency assembly 610, the interface 612 of input/output (I/O), sensor cluster 614, and Communication component 616.
Processing component 602 generally controls the integrated operation of resource control 600, such as with display, call, data The operation that communication, camera operation and record operation are associated.Processing component 602 can include one or more processors 620 Execute instruction, to complete all or part of step of above-mentioned method.In addition, processing component 602 can include one or more Module, the interaction being easy between processing component 602 and other assemblies.For example, processing component 602 can include multi-media module, To facilitate the interaction between multimedia groupware 608 and processing component 602.
Memory 604 is configured as storing various types of data to support the operation in resource control 600.These The example of data includes the instruction of any application program or method for being operated on resource control 600, contacts number According to, telephone book data, message, picture, video etc..Memory 604 can be by any kind of volatibility or non-volatile memories Equipment or combinations thereof are realized, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), read-only storage (ROM), magnetic memory, flash memory, disk or CD.
Power supply module 606 provides electric power for the various assemblies of resource control 600.Power supply module 606 can include electricity Management system, one or more power supplys, and other generate with for resource control 600, manage and to distribute electric power associated Component.
Multimedia groupware 608 is included in the screen of one output interface of offer between resource control 600 and user. In certain embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch surface Plate, screen may be implemented as touch-screen, to receive the input signal from user.Touch panel includes one or more touch Sensor is with the gesture on sensing touch, slip and touch panel.Touch sensor can not only sensing touch or sliding action Border, but also detect and touch or the related duration and pressure of slide.In certain embodiments, multimedia group Part 608 includes a front camera and/or rear camera.When resource control 600 is in operator scheme, mould is such as shot When formula or video mode, front camera and/or rear camera can receive outside multi-medium data.Each preposition shooting Head and rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio-frequency assembly 610 is configured as output and/or input audio signal.For example, audio-frequency assembly 610 includes a Mike Wind (MIC), when resource control 600 is in operator scheme, during such as call model, logging mode and speech recognition mode, wheat Gram wind is configured as receiving external audio signal.The audio signal received can be further stored in memory 604 or warp Sent by communication component 616.In certain embodiments, audio-frequency assembly 610 also includes a loudspeaker, for exporting audio letter Number.
I/O interfaces 612 provide interface between processing component 602 and peripheral interface module, and above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock Determine button.
Sensor cluster 614 includes one or more sensors, for providing various aspects for resource control 600 State estimation.For example, sensor cluster 614 can detect opening/closed mode of resource control 600, the phase of component To positioning, such as the display and keypad that component is resource control 600, sensor cluster 614 can also detect resource The position of 600 1 components of control device 600 or resource control changes, and user deposits with what resource control 600 contacted Or be not present, the orientation of resource control 600 or acceleration/deceleration and the temperature change of resource control 600.Sensor group Part 614 can include proximity transducer, be configured to detect the presence of object nearby in no any physical contact.Pass Sensor component 614 can also include optical sensor, such as CMOS or ccd image sensor, for being used in imaging applications.One In a little embodiments, the sensor cluster 614 can also include acceleration transducer, gyro sensor, Magnetic Sensor, pressure biography Sensor or temperature sensor.
Communication component 616 is configured to facilitate wired or wireless way between resource control 600 and other equipment Communication.Resource control 600 can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or their group Close.In one exemplary embodiment, communication component 616 receives the broadcast from external broadcasting management system via broadcast channel Signal or broadcast related information.In one exemplary embodiment, communication component 616 also includes near-field communication (NFC) module, with Promote junction service.For example, radio frequency identification (RFID) technology can be based in NFC module, Infrared Data Association (IrDA) technology, surpass Broadband (UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, resource control 600 can be by one or more application specific integrated circuits (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), PLD (PLD), scene can Program gate array (FPGA), controller, microcontroller, microprocessor or other electronic building bricks to realize, for performing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instructing, example are additionally provided Such as include the memory 604 of instruction, above-mentioned instruction can be performed by the processor 620 of resource control 600 to complete above-mentioned side Method.For example, non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, Floppy disk and optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in storage medium is by resource control 600 During computing device so that resource control 600 is able to carry out following resource control method, and method includes:
Receive the resource request of application;
Obtain the running status of application;Wherein, the running status of application includes front stage operation state or background operation state;
According to the running status of application, the type of application and default application type, to corresponding to the resource request of application System resource is controlled.
Fig. 7 is a kind of block diagram of resource control according to an exemplary embodiment.For example, resource control 700 may be provided in a server.Resource control 700 includes processing component 702, and it further comprises one or more Processor, and as the memory resource representated by memory 703, for store can by the instruction of the execution of processing component 702, Such as application program.The application program stored in memory 703 can include it is one or more each correspond to one The module of group instruction.In addition, processing component 702 is configured as execute instruction, to perform the above method.
Resource control 700 can also include a power supply module 706 and be configured as performing resource control 700 Power management, a wired or wireless network interface 705 are configured as resource control 700 being connected to network, and one Input and output (I/O) interface 707.Resource control 700 can be operated based on the operating system for being stored in memory 703, example Such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
Those skilled in the art will readily occur to the disclosure its after considering specification and putting into practice disclosure disclosed herein Its embodiment.The application is intended to any modification, purposes or the adaptations of the disclosure, these modifications, purposes or Person's adaptations follow the general principle of the disclosure and including the undocumented common knowledges in the art of the disclosure Or conventional techniques.Description and embodiments are considered only as exemplary, and the true scope of the disclosure and spirit are by following Claim is pointed out.
It should be appreciated that the precision architecture that the disclosure is not limited to be described above and is shown in the drawings, and And various modifications and changes can be being carried out without departing from the scope.The scope of the present disclosure is only limited by appended claim.

Claims (13)

  1. A kind of 1. resource control method, it is characterised in that including:
    Receive the resource request of application;
    Obtain the running status of the application;Wherein, the running status of the application includes front stage operation state or running background State;
    According to the running status of the application, the type of the application and default application type, to the resource request of the application Corresponding system resource is controlled.
  2. 2. according to the method for claim 1, it is characterised in that the running status according to the application, the application Type and default application type, the system resource corresponding to the resource request of the application is controlled, including:
    When the application is in the type of background operation state and the application with default application type mismatch, institute is shielded State the resource request of application;Or
    When the type that the application is in background operation state and the application matches with default application type, in response to institute The resource request of application is stated, the system resource corresponding to the resource request of the application is distributed for the application.
  3. 3. according to the method for claim 1, it is characterised in that the running status according to the application, the application Type and default application type, the system resource corresponding to the resource request of the application is controlled, including:
    When the application is in front stage operation state, in response to the resource request of the application, for described in application distribution System resource corresponding to the resource request of application.
  4. 4. according to the method for claim 1, it is characterised in that the running status according to the application, the application Type and default application type, the system resource corresponding to the resource request of the application is controlled, including:
    When the application is switched to background operation state from foreground running status, in response to the resource request of the application, it is The application distributes the system resource corresponding to the resource request of the application, and starts the first timer;
    The type for reaching the first preset duration and the application in the timing of first timer matches with default application type When, in response to the resource request of the application, the system resource corresponding to the resource request of the application is distributed for the application; Or
    The type of the first preset duration and the application and default application type are not reached not in the timing of first timer Timing, refuse to distribute peripheral resources for the application, and start the second timer;Reach in the timing of second timer During two preset durations, refuse to distribute peripheral resources and processor resource for the application, and start the 3rd timer;Described When the timing of three timers reaches three preset durations, resource request of the application for any kind system resource is shielded.
  5. 5. according to the method for claim 4, it is characterised in that it is pre- that the timing in second timer reaches second If during duration, refuse to include for application distribution peripheral resources and processor resource:
    The processor occupancy for reaching the second preset duration and the application in the timing of second timer is less than default threshold During value, refuse to distribute peripheral resources and processor resource for the application;Or
    The processor occupancy for reaching the second preset duration and the application in the timing of second timer is more than or equal to institute When stating predetermined threshold value, refuse to distribute peripheral resources for the application, and distribute the resource request institute of the application for the application Corresponding processor resource.
  6. 6. according to the method for claim 1, it is characterised in that the default application type comprises at least following any kind Type or combination:
    System application, the application in white list, the application that desktop plug-ins be present on terminal foreground, the function currently run are default The application of function.
  7. A kind of 7. resource control, it is characterised in that including:
    Receiving module, for receiving the resource request of application;
    Acquisition module, for obtaining the running status of the application;Wherein, the running status of the application includes front stage operation shape State or background operation state;
    Resource controlled block, for the running status according to the application, the type of the application and default application type, to institute The system resource corresponding to the resource request of application is stated to be controlled.
  8. 8. device according to claim 7, it is characterised in that the resource controlled block, including:
    Submodule is shielded, for being in the type of background operation state and the application and default application type in the application During mismatch, the resource request of the application is shielded;
    Resource allocation submodule, for being in the type of background operation state and the application and default application in the application During type matching, in response to the resource request of the application, distributed for the application corresponding to the resource request of the application System resource.
  9. 9. device according to claim 7, it is characterised in that the resource controlled block is in foreground fortune in the application During row state, in response to the resource request of the application, to be corresponding to the resource request of the application distribution application System resource.
  10. 10. device according to claim 7, it is characterised in that the resource controlled block:
    When the application is switched to background operation state from foreground running status, in response to the resource request of the application, it is The application distributes the system resource corresponding to the resource request of the application, and starts the first timer;
    The type for reaching the first preset duration and the application in the timing of first timer matches with default application type When, in response to the resource request of the application, the system resource corresponding to the resource request of the application is distributed for the application;
    The type of the first preset duration and the application and default application type are not reached not in the timing of first timer Timing, refuse to distribute peripheral resources for the application, and start the second timer;Reach in the timing of second timer During two preset durations, refuse to distribute peripheral resources and processor resource for the application, and start the 3rd timer;Described When the timing of three timers reaches three preset durations, resource request of the application for any kind system resource is shielded.
  11. 11. device according to claim 10, it is characterised in that the resource controlled block:
    The processor occupancy for reaching the second preset duration and the application in the timing of second timer is less than default threshold During value, refuse to distribute peripheral resources and processor resource for the application;
    The processor occupancy for reaching the second preset duration and the application in the timing of second timer is more than or equal to institute When stating predetermined threshold value, refuse to distribute peripheral resources for the application, and distribute the resource request institute of the application for the application Corresponding processor resource.
  12. A kind of 12. resource control, it is characterised in that including:
    Processor;
    For storing the memory of processor-executable instruction;
    Wherein, the processor is configured as:
    Receive the resource request of application;
    Obtain the running status of the application;Wherein, the running status of the application includes front stage operation state or running background State;
    According to the running status of the application, the type of the application and default application type, to the resource request of the application Corresponding system resource is controlled.
  13. 13. a kind of computer-readable recording medium, is stored thereon with computer instruction, it is characterised in that the instruction is by processor The step of method any one of claim 1-6 is realized during execution.
CN201710949290.8A 2017-10-12 2017-10-12 Resource control method and device Active CN107797645B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710949290.8A CN107797645B (en) 2017-10-12 2017-10-12 Resource control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710949290.8A CN107797645B (en) 2017-10-12 2017-10-12 Resource control method and device

Publications (2)

Publication Number Publication Date
CN107797645A true CN107797645A (en) 2018-03-13
CN107797645B CN107797645B (en) 2020-12-04

Family

ID=61532691

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710949290.8A Active CN107797645B (en) 2017-10-12 2017-10-12 Resource control method and device

Country Status (1)

Country Link
CN (1) CN107797645B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144728A (en) * 2018-08-22 2019-01-04 Oppo广东移动通信有限公司 The occupancy control method and device of camera applications

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101573691A (en) * 2006-12-28 2009-11-04 微软公司 Time based permissioning
CN103108074A (en) * 2011-08-24 2013-05-15 株式会社泛泰 Apparatus and method for securing mobile terminal
CN103885763A (en) * 2012-12-21 2014-06-25 腾讯科技(深圳)有限公司 Operating system resource access method and system
CN104516783A (en) * 2013-09-27 2015-04-15 华为终端有限公司 Authority control method and device
CN105550587A (en) * 2015-12-11 2016-05-04 北京元心科技有限公司 Method and device for controlling system resource access in multi-system terminal equipment
CN105607979A (en) * 2015-12-18 2016-05-25 小米科技有限责任公司 Network interconnection control method and device
CN105631270A (en) * 2015-12-30 2016-06-01 浙江德景电子科技有限公司 Double-system resource management method and system
CN105653323A (en) * 2015-12-28 2016-06-08 小米科技有限责任公司 Application program management method and device
CN105868624A (en) * 2016-03-23 2016-08-17 北京小米移动软件有限公司 Application program authority management method and device
CN105955441A (en) * 2016-04-21 2016-09-21 北京小米移动软件有限公司 Method and device for application management
CN105975344A (en) * 2016-05-10 2016-09-28 北京小米移动软件有限公司 Control method and device preventing application from excessively using sensor
CN106445063A (en) * 2015-08-12 2017-02-22 三星电子株式会社 Method of managing application and electronic device therefor
CN106845174A (en) * 2015-12-03 2017-06-13 福州瑞芯微电子股份有限公司 A kind of application rights management method and system under security system
CN107147648A (en) * 2017-05-11 2017-09-08 北京奇虎科技有限公司 Processing method, client, server and the system of resource request

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101573691A (en) * 2006-12-28 2009-11-04 微软公司 Time based permissioning
CN103108074A (en) * 2011-08-24 2013-05-15 株式会社泛泰 Apparatus and method for securing mobile terminal
CN103885763A (en) * 2012-12-21 2014-06-25 腾讯科技(深圳)有限公司 Operating system resource access method and system
CN104516783A (en) * 2013-09-27 2015-04-15 华为终端有限公司 Authority control method and device
CN106445063A (en) * 2015-08-12 2017-02-22 三星电子株式会社 Method of managing application and electronic device therefor
CN106845174A (en) * 2015-12-03 2017-06-13 福州瑞芯微电子股份有限公司 A kind of application rights management method and system under security system
CN105550587A (en) * 2015-12-11 2016-05-04 北京元心科技有限公司 Method and device for controlling system resource access in multi-system terminal equipment
CN105607979A (en) * 2015-12-18 2016-05-25 小米科技有限责任公司 Network interconnection control method and device
CN105653323A (en) * 2015-12-28 2016-06-08 小米科技有限责任公司 Application program management method and device
CN105631270A (en) * 2015-12-30 2016-06-01 浙江德景电子科技有限公司 Double-system resource management method and system
CN105868624A (en) * 2016-03-23 2016-08-17 北京小米移动软件有限公司 Application program authority management method and device
CN105955441A (en) * 2016-04-21 2016-09-21 北京小米移动软件有限公司 Method and device for application management
CN105975344A (en) * 2016-05-10 2016-09-28 北京小米移动软件有限公司 Control method and device preventing application from excessively using sensor
CN107147648A (en) * 2017-05-11 2017-09-08 北京奇虎科技有限公司 Processing method, client, server and the system of resource request

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144728A (en) * 2018-08-22 2019-01-04 Oppo广东移动通信有限公司 The occupancy control method and device of camera applications
EP3825852A4 (en) * 2018-08-22 2021-09-22 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Occupation control method and apparatus for camera application
US11419055B2 (en) 2018-08-22 2022-08-16 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Occupation control method for camera application based on operating state of device and camera data requests

Also Published As

Publication number Publication date
CN107797645B (en) 2020-12-04

Similar Documents

Publication Publication Date Title
US20160226674A1 (en) Method and apparatus for controlling smart device
CN106375604A (en) Terminal electric quantity controlling method and device
CN105677460A (en) Application processing method and apparatus
CN109658927A (en) Wake-up processing method, device and the management equipment of smart machine
CN105807873A (en) Temperature control method and device
CN105528055A (en) Running object processing method and device
CN105607834A (en) Screen control method and apparatus as well as terminal
CN103916468B (en) Method for upgrading system, terminal, server and upgrade-system
CN106354242A (en) Mode switching method and device
CN104376239A (en) Terminal unlocking method and device
CN107464253A (en) eyebrow location method and device
CN107783715A (en) Using startup method and device
CN105807894A (en) Processing method and device of lock holding of application
CN106648730A (en) Processing method and device of abnormal application
CN106535191A (en) Network connection establishing method and device
CN106021072A (en) Information display method and device
CN108874450B (en) Method and device for waking up voice assistant
CN106455002A (en) Wireless search method and device, and terminal
CN106774802A (en) The reminding method of terminal power, device and terminal
CN105867592A (en) Method and device for managing electric quantity consumption
CN105786561B (en) Method and device for calling process
CN107436782A (en) Application program silence installation method and device
CN106791169A (en) Screen control method and device
CN107797645A (en) Resource control method and device
CN111580911A (en) Operation prompting method and device for terminal, storage medium and terminal

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
GR01 Patent grant
GR01 Patent grant