CN110045811B - Application program processing method and device, electronic equipment and computer readable storage medium - Google Patents

Application program processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN110045811B
CN110045811B CN201810032326.0A CN201810032326A CN110045811B CN 110045811 B CN110045811 B CN 110045811B CN 201810032326 A CN201810032326 A CN 201810032326A CN 110045811 B CN110045811 B CN 110045811B
Authority
CN
China
Prior art keywords
application
power consumption
application program
weight
resource limit
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.)
Expired - Fee Related
Application number
CN201810032326.0A
Other languages
Chinese (zh)
Other versions
CN110045811A (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.)
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 CN201810032326.0A priority Critical patent/CN110045811B/en
Publication of CN110045811A publication Critical patent/CN110045811A/en
Application granted granted Critical
Publication of CN110045811B publication Critical patent/CN110045811B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3212Monitoring battery levels, e.g. power saving mode being initiated when battery voltage goes below a certain level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/329Power saving characterised by the action undertaken by task scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/504Resource capping
    • 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)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

The application provides an application program processing method and device, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: acquiring a power consumption weight and a priority weight according to the current electric quantity value of the electronic equipment; acquiring historical power consumption data and application priorities of all application programs installed in the electronic equipment; calculating resource limit values of all application programs according to the historical power consumption data, the power consumption weight, the application priority and the priority weight; and performing resource limitation processing on the application program according to the resource limitation value. The application processing method and device, the electronic equipment and the computer readable storage medium can reduce the power consumption of the electronic equipment.

Description

Application program processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an application processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
The smart device may implement different application operations through the application program, such as purchasing goods through a shopping-like application program, viewing videos through a video-like application program, and the like. The application program can be frozen, the frozen application program can not continue to run, and processor resources in the intelligent device cannot be occupied. However, since the application program is still present in the smart device, resources such as memory and hardware in the smart device are also occupied.
Disclosure of Invention
The embodiment of the application program processing method and device, the electronic equipment and the computer readable storage medium can reduce power consumption of the electronic equipment.
An application processing method, comprising:
acquiring a power consumption weight and a priority weight according to the current electric quantity value of the electronic equipment;
acquiring historical power consumption data and application priorities of all application programs installed in the electronic equipment;
calculating resource limit values of all application programs according to the historical power consumption data, the power consumption weight, the application priority and the priority weight;
and performing resource limitation processing on the application program according to the resource limitation value.
An application processing apparatus comprising:
the weight acquisition module is used for acquiring a power consumption weight and a priority weight according to the current electric quantity value of the electronic equipment;
the data acquisition module is used for acquiring historical power consumption data and application priorities of all application programs installed in the electronic equipment;
the limit value acquisition module is used for calculating the resource limit value of each application program according to the historical power consumption data, the power consumption weight, the application priority and the priority weight;
and the application processing module is used for performing resource limitation processing on the application program according to the resource limitation value.
An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
acquiring a power consumption weight and a priority weight according to the current electric quantity value of the electronic equipment;
acquiring historical power consumption data and application priorities of all application programs installed in the electronic equipment;
calculating resource limit values of all application programs according to the historical power consumption data, the power consumption weight, the application priority and the priority weight;
and performing resource limitation processing on the application program according to the resource limitation value.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a power consumption weight and a priority weight according to the current electric quantity value of the electronic equipment;
acquiring historical power consumption data and application priorities of all application programs installed in the electronic equipment;
calculating resource limit values of all application programs according to the historical power consumption data, the power consumption weight, the application priority and the priority weight;
and performing resource limitation processing on the application program according to the resource limitation value.
According to the application program processing method and device, the electronic equipment and the computer readable storage medium, the power consumption weight and the priority weight can be obtained according to the current electric quantity value of the electronic equipment, then the historical power consumption data and the application priority of each application program are obtained, the resource limit value of each application program is calculated according to the historical power consumption data, the power consumption weight, the application priority and the priority weight, and the application program is subjected to resource limit processing according to the calculated resource limit value. When the resource limiting processing is carried out on the application program, not only can the historical power consumption condition and the application priority of the application program be considered, but also the resource limiting processing can be adjusted in real time according to the electric quantity value of the electronic equipment, so that the processing on the application program is more accurate, and meanwhile, the power consumption of the electronic equipment can be further reduced by carrying out the resource limiting processing on the application program.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of an application environment for a method for processing an application program according to an embodiment;
FIG. 2 is a schematic diagram showing an internal configuration of an electronic apparatus according to an embodiment;
FIG. 3 is a flow diagram of a method for application processing in one embodiment;
FIG. 4 is a flowchart of an application processing method in another embodiment;
FIG. 5 is a diagram illustrating a resource restriction state of an application in one embodiment;
FIG. 6 is a partial architectural diagram of an electronic device in one embodiment;
FIG. 7 is a block diagram of an application processing device in one embodiment;
FIG. 8 is a diagram showing the structure of an application processing apparatus according to another embodiment;
fig. 9 is a block diagram of a partial structure of a mobile phone related to an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client, without departing from the scope of the present application. Both the first client and the second client are clients, but they are not the same client.
FIG. 1 is a diagram illustrating an application environment of an application processing method according to an embodiment. As shown in FIG. 1, the application environment includes a client 102 and a server 104. An application may be installed on the client 102. In the running process of the application program, the client 102 may obtain the power consumption weight and the priority weight according to the current electric quantity value, and then obtain the historical power consumption data and the application priority of each application program; calculating resource limit values of all application programs according to historical power consumption data, power consumption weights, application priorities and priority weights; and performing resource limitation processing on the application program according to the resource limitation value. The server 104 may be used to push application processing algorithms to the client 102, according to which the client 102 processes the application. The client 102 is an electronic device located at the outermost periphery of the computer network and mainly used for inputting user information and outputting a processing result, and may be, for example, a personal computer, a mobile terminal, a personal digital assistant, a wearable electronic device, and the like. The server 104 is a device, such as one or more computers, for responding to service requests while providing computing services. It is understood that in other embodiments provided herein, the application environment of the application processing method may comprise only the client 102.
As shown in fig. 2, a schematic diagram of an internal structure of an electronic device is provided. The electronic device includes a processor, a memory, and a display screen connected by a system bus. Wherein, the processor is used for providing calculation and control capability and supporting the operation of the whole electronic equipment. The memory is used for storing data, programs, instruction codes and/or the like, and at least one computer program is stored on the memory, and the computer program can be executed by the processor to realize the application program processing method suitable for the electronic device provided in the embodiment of the application. The Memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random-Access-Memory (RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by a processor to implement an application processing method provided by various embodiments of the present application. The internal memory provides a cached execution environment for the operating system and computer programs in the non-volatile storage medium. The display screen may be a touch screen, such as a capacitive screen or an electronic screen, and is configured to display interface information of an application corresponding to a foreground process, and also may be configured to detect a touch operation applied to the display screen, and generate a corresponding instruction, such as a switching instruction for performing foreground and background applications.
Those skilled in the art will appreciate that the architecture shown in fig. 2 is a block diagram of only a portion of the architecture associated with the subject application, and does not constitute a limitation on the electronic devices to which the subject application may be applied, and that a particular electronic device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components. For example, the electronic device further includes a network interface connected via the system bus, where the network interface may be an ethernet card or a wireless network card, and the like, and is used for communicating with an external electronic device, such as a server.
FIG. 3 is a flow diagram that illustrates a method for processing an application in one embodiment. The application processing method in this embodiment is described by taking the application processing method running on the terminal or the server in fig. 1 as an example. As shown in fig. 3, the application processing method includes steps 302 to 308. Wherein:
step 302, obtaining a power consumption weight and a priority weight according to the current electric quantity value of the electronic device.
In one embodiment, the electronic device needs to count the electric quantity in real time during the operation process, and a user can judge the operation duration of the electronic device through the electric quantity of the electronic device. Generally, the more the electric quantity is, the longer the working time of the electronic equipment is; the less the amount of power, the shorter the operating time of the electronic device. The current electric quantity value refers to a current electric quantity remaining value of the electronic device, and the electric quantity value can be generally expressed in a percentage form. For example, the current charge value may be 50%, which means that the ratio of the current remaining charge of the battery to the maximum charge that the battery can hold is 50%.
An Application (APP) may be installed in the electronic device, where the APP refers to software written for a certain Application purpose in the electronic device, and the electronic device may implement a service required by a user through the APP. For example, a user may play games through a game-like application, may watch videos through a video-like application, may play music through a music-like application, and so on. The application program can be divided into a foreground application program and a background application program according to the running state. The foreground application program refers to an application program running in the foreground of the electronic device, and the foreground application program can be displayed on the foreground and can interact with a user. Background applications refer to applications that run in the background of an electronic device, and background applications generally cannot be displayed in the foreground and implement an interactive process with a user.
Generally, an application operation of an application program is collectively performed by one or more processes (processes), which are one-time running activities of the program in a computer on a certain data set and are basic units for resource allocation and scheduling of a system. Meanwhile, one process can correspond to one or more threads, and the threads are a single sequential control flow in a program and are relatively independent and schedulable execution units in the process. The processes may include a foreground process, i.e., a process running in the foreground of the electronic device, and a background process, i.e., a process running in the background of the electronic device. The electronic equipment can control the switching of the foreground process and the background process, the foreground process can be switched to the background process to run, and the background process can also be switched to the foreground process to run. Specifically, the management of the process may be implemented by a process pool, and process identifiers corresponding to one or more processes may be stored in the process pool. The process id is used to uniquely identify a process. The process pool may include a foreground process pool and a background process pool, the foreground process pool includes a process identifier corresponding to a foreground process, and the background process pool includes a process identifier corresponding to a background process. When detecting that the running states of the foreground process and the background process are changed, the process pool can correspondingly add or delete the process identification which is changed. For example, the process identifier of process a is "0123", and when it is detected that process a is changed from a background process to a foreground process, the process identifier of process a, which is "0123", can be removed from the background process pool and added to the foreground process pool.
The electronic device may pre-establish a correspondence between the current electric quantity value and the power consumption weight and the priority weight, and then may obtain the corresponding power consumption weight and the priority weight according to the current electric quantity value. The power consumption weight refers to a weighted value occupied by historical power consumption data of an application program when a resource limit value is calculated; the priority weight is a weight value occupied by the application priority of the application program when the resource limit value is calculated. Generally, the higher the electricity quantity value of the electronic device, the less important the electricity consumption data, the lower the corresponding electricity consumption weight, and the higher the corresponding priority weight.
Step 304, obtaining historical power consumption data and application priorities of each application program installed in the electronic equipment.
The application programs in the electronic equipment generate power consumption in the running process, then the power consumption of each application program is counted, and generally, the longer the running time of the application program is, the higher the resource occupancy rate is, and the higher the power consumption is. For example, in the Android system, there is a Service dedicated to counting the amount of electricity in the frame layer: BatteryStatsSerive. The BatteryStatsSerive service can be created in an ActivityManagerService, the ActivityManagerService can store each module data in the electronic equipment into a system directory Batterystits file, and then the electric quantity data is analyzed through a data analyzer BatteryStatsImpl, so that the statistics of the electric power consumption is realized.
Specifically, the historical power consumption data refers to the amount of power consumed by the application program in the historical operation process, and may be represented in a percentage form, so that the historical power consumption data of all the application programs in the electronic device is equal to 100% in sum. It can be understood that, when the electronic device counts the power consumption of each application program, the historical power consumption data of each application program and the application identifier are associated with each other, and the historical power consumption data corresponding to the application program can be obtained according to the application identifier. The application identifier is a unique identifier for distinguishing different application programs, and may specifically be a package name (packageaname) of an application program. For example, the package name of the application may be com.
The application priority may indicate the importance of the application program, and the user or the system may set the application priority by a certain criterion. The electronic device can establish a corresponding relation between the application identifier and the application priority, and can acquire the application priority corresponding to the application program according to the application identifier. For example, the system-level application may be set to a higher application priority and the third-party application may be set to a lower application priority. Or the application priority of the application program can be set according to the type of the application program, the application program of the instant messaging class is set to be higher in application priority, and the application program of the tool class is set to be lower in application priority.
And step 306, calculating the resource limit value of each application program according to the historical power consumption data, the power consumption weight, the application priority and the priority weight.
In the embodiment provided by the application, the resource limit value is used to identify the degree of resource limit processing performed on the application program, the power consumption weight and the priority weight are adjusted according to the current power value of the electronic device, and each application program has corresponding historical power consumption data and application priority, so that the resource limit value of each application program can be calculated according to the historical power consumption data, the power consumption weight, the application priority and the priority weight. The historical power consumption data can be expressed by percentage, and when the resource limit value is calculated, the historical power consumption data can be converted into decimal for calculation. The application priority can be divided into a plurality of different levels, and when the resource limit value is calculated, the application priority can be quantized into a decimal number for calculation.
For example, the application priorities of the applications may be divided into 1-level, 2-level, 3-level, 4-level, and 5-level in total, with increasing importance of the applications from level 1 to level 5. The more important the general application is, the lower the corresponding resource limitation level. The quantized values obtained after applying the priority quantization are 1, 0.8, 0.6, 0.4, 0.2, respectively. The obtained power consumption weights are 0.7 and 0.3 respectively, the historical power consumption data of a certain application program is 40%, and the power consumption data is 0.4 expressed by decimal numbers. The application priority is level 1, and the corresponding quantization value is 1. Then, the resource limit value can be obtained as: 0.7 × 0.4+0.3 × 1 ═ 0.58.
And 308, performing resource limitation processing on the application program according to the resource limitation value.
The resource refers to software or hardware resources that are necessary for the electronic device to process an application event, such as a Central Processing Unit (CPU), a Memory (Memory), hardware, a network resource, and an Input-Output (IO) of the electronic device. The resource restriction processing is processing for restricting a resource occupied by an application program. The resource limit value can represent the degree of resource limit processing on the application program, and the larger the resource limit value is, the deeper the degree of resource limit processing on the application program is; the smaller the resource restriction value is, the lighter the degree of resource restriction processing is performed on the application.
The resource restriction process can be, but is not limited to, controlling the application to enter a frozen state or a resource restricted state, the application in the frozen state not being shut down, but only temporarily not running. If the application program is in the frozen state, the application program does not occupy the processor resources, but still occupies the resources of the electronic device, such as the memory, the hardware and the like. The resource restriction state refers to a state in which resources of the electronic device used by the application program at runtime are restricted, and for example, the CPU occupancy rate for controlling the use of the application program at runtime cannot exceed 5%. And performing resource limitation processing on the application program to be processed according to the resource limitation strategy, so that the consumption of the background application program to be processed on the resources of the electronic equipment can be limited.
The application program processing method provided in the foregoing embodiment may obtain the power consumption weight and the priority weight according to the current electric quantity value of the electronic device, then obtain the historical power consumption data and the application priority of each application program, calculate the resource limit value of each application program according to the historical power consumption data, the power consumption weight, the application priority, and the priority weight, and perform resource limit processing on the application program according to the calculated resource limit value. When the resource limiting processing is carried out on the application program, not only can the historical power consumption condition and the application priority of the application program be considered, but also the resource limiting processing can be adjusted in real time according to the electric quantity value of the electronic equipment, so that the processing on the application program is more accurate, and meanwhile, the power consumption of the electronic equipment can be further reduced by carrying out the resource limiting processing on the application program.
Fig. 4 is a flowchart of an application processing method in another embodiment. The application processing method in this embodiment is described by taking the application processing method running on the terminal or the server in fig. 1 as an example. As shown in fig. 4, the application processing method includes steps 402 to 412. Wherein:
and 402, acquiring a power consumption weight and a priority weight according to the current electric quantity value of the electronic equipment.
The resource limit value is calculated from the historical power consumption data and the priority weight, and the sum of the power consumption weight and the priority weight may be, but is not limited to, 1. The electronic device may divide the electric quantity value into a plurality of electric quantity intervals in advance, and then establish a correspondence between each electric quantity interval and the power consumption weight and the priority weight. Generally, when the electric quantity value is relatively high, the priority weight is mainly considered in the calculation of the resource limit value; when the electric quantity value is relatively low, the calculation of the resource limit value mainly takes historical power consumption data into consideration. Therefore, generally, the higher the electric quantity value, the lower the corresponding power consumption weight, and the higher the priority weight. Specifically, a current electric quantity value of the electronic equipment is obtained, and a target electric quantity interval in which the current electric quantity value falls is determined; and acquiring a power consumption weight and a priority weight corresponding to the target electric quantity interval.
For example, the value range of the electric quantity value is 0-100%, the electric quantity value can be divided into 5 electric quantity intervals which are respectively expressed as 0, 20%]、[20%,40%]、[40%,60%]、[60%,80%]、[80%,100%]. Suppose using delta respectivelyHAnd deltaYRepresenting the power consumption weight and the priority weight, and respectively establishing the corresponding relations between the power consumption interval and the power consumption weight and the priority weight, wherein the corresponding power consumption weight and the priority weight are respectively as follows: deltaH=0.8,δY=0.2;δH=0.7,δY=0.3;δH=0.6,δY=0.4;δH=0.4,δY=0.6;δH=0.2,δY0.8. If the current electric quantity value of the electronic device is 58%, the corresponding power consumption weight and priority weight are respectively deltaH=0.6、δY=0.4。
In one embodiment, the electronic device may further preset calculation formulas of the power consumption weight and the priority weight, and then directly calculate the power consumption weight and the priority weight according to the current electric quantity value. The sum of the general power consumption weight and the priority weight is a fixed value, so that the power consumption weight can be calculated according to the current power value firstly, and then the priority weight can be calculated according to the power consumption weight. It is understood that, when calculating the resource limit value, the higher the electric quantity value of the electronic device in general, the less the historical electric consumption amount of the application program needs to be considered. Therefore, the electric quantity value and the power consumption weight can be, but are not limited to, in a negative correlation relationship. Specifically, according to the current electric quantity value of the electronic equipmentAcquiring a power consumption weight, wherein the current electric quantity value and the power consumption weight are in a negative correlation relationship; and acquiring a priority weight according to the power consumption weight. For example, D represents an electric quantity value, δHRepresenting the power consumption weight, δYIndicating a priority weight. The calculation formula of the power consumption weight may be δH=(1-D)/0.8,δY=1-δH
Step 404, obtaining historical power consumption data and application priorities of each application program installed in the electronic equipment.
It can be understood that the electronic device may establish a corresponding relationship between the application identifier of the application program and the application priority, and obtain the corresponding application high priority according to the application identifier. The application priority of the application program can be fixed or can be changed in real time. For example, if the priority is defined according to the type of the application, the application priority of the instant messaging application is high, and the application priority of the shopping application is low, the application priority is fixed. If the priority is defined according to the running state of the application program, the application priority of the application program running in the foreground is higher, and the application priority of the application program running in the background is lower, the application priority is dynamically changed.
In the embodiment provided by the application, the electronic device can acquire the historical power consumption data and the application priority of each application program in real time, and calculate the resource limit value according to the acquired historical power consumption data and the application priority. Or the historical power consumption data and the application priority of each application program may be obtained at regular time, and the resource limit value may be calculated according to the obtained historical power consumption data and the application priority, which is not specifically limited herein. In addition, when the electronic device performs the resource restriction processing on the application program, the electronic device may perform the resource restriction processing only on a part of the application programs, and does not need to perform the resource restriction processing on all the application programs.
Specifically, step 404 may specifically include: and acquiring a target application program from the application programs installed in the electronic equipment, and acquiring historical power consumption data and application priority of the target application program. For example, resource restriction may be applied only to background applications, and the target application may be referred to as a background application. Or only the resource limitation processing may be performed on the third-party application program, and then the target application program is the third-party application program, which is not limited in this application. Therefore, the acquiring the target application specifically may include at least one of the following manners: acquiring an application program running in a background from application programs installed in the electronic equipment to serve as a target application program; and acquiring a third-party application program from the application programs installed in the electronic equipment as a target application program.
Step 406, calculating a first resource limit value according to the historical power consumption data and the power consumption weight, and calculating a second resource limit value according to the application priority and the priority weight.
In calculating the resource limit value, a first resource limit value may be calculated first based on the historical power consumption data and the power consumption weight, and then a second resource limit value may be calculated based on the application priority and the priority weight. The resource limit value represents the degree of resource limit processing on the application program, the larger the general historical power consumption data is, the lower the application priority is, and the larger the resource limit value is, the deeper the degree of resource limit processing on the application program is; the smaller the historical power consumption data is, the higher the application priority is, the smaller the resource restriction value is, and the lower the degree of resource restriction processing performed on the application program is.
For example, definition H represents historical power consumption data, δHRepresenting the power consumption weight. Wherein, the value range of H is (0,100%)],δHThe value range is [0,1]]. The calculation formula of the first resource limit value may be Z1=H*δH. Definition Y denotes application priority, δYRepresenting the power consumption weight. The application priority may be quantized and the quantized application priority is denoted as ay. Then Δ Y has a value in the range of [0,1]],δYThe value range is [0,1]]. The calculation formula of the second resource limit value may be Z2=ΔY*δY
And step 408, calculating resource limit values of the application programs according to the first resource limit values and the second resource limit values.
Calculating to obtain a first limit value and a second resource limit valueThereafter, resource limit values for the respective applications may be calculated based on the first resource limit value and the second resource limit value. For example, if the sum of the first resource limit value and the second resource limit value is obtained as the resource limit value of the application, the formula for calculating the resource limit value is Z ═ Z1+Z2. Alternatively, the resource limit value of the application may be a product of the first resource limit value and the second resource limit value, and the formula for calculating the resource limit value is Z ═ Z1*Z2Therefore, the present application does not limit the calculation formula of the resource limit value.
It is understood that the electronic device does not need to perform the resource restriction process on all the applications, and step 404 may be the acquired historical power consumption data and application priority of the target application, and then step 408 may include: and calculating the resource limit value of each target application program according to the first resource limit value and the second resource limit value.
And step 410, acquiring the application program with the resource limit value larger than the first threshold value as the application program to be processed, and performing resource limit processing on the application program to be processed according to the resource limit value.
In one embodiment, after the resource limit value of the application program is calculated, the application program may be subjected to resource limit processing according to the resource limit value. Specifically, the resource limit value is compared with a first threshold, and if the resource limit value is greater than the first threshold, it is determined that the application needs to perform resource limit processing. If the resource limit value is less than or equal to the first threshold, the resource limit processing for the application program is not required. The application program with the resource limit value larger than the first threshold value can be acquired as the application program to be processed, and the resource limit processing is performed on the application program to be processed according to the resource limit value. If the historical power consumption data and the application priority of the target application program are obtained in step 404, step 410 may include: and acquiring the target application program with the resource limit value larger than the first threshold value as the application program to be processed, and performing resource limit processing on the application program to be processed according to the resource limit value.
Specifically, when the resource limit value of the application program is greater than a first threshold value, the resource limit value is compared with a second threshold value, wherein the first threshold value is smaller than the second threshold value. If the resource limit value is less than or equal to the second threshold value, controlling the application program to be processed to enter a frozen state; and if the resource limit value is larger than the second threshold value, controlling the application program to be processed to enter a resource limit state. The application program to be processed entering the frozen state can not continue to run, so that the resource occupation of the application program to be processed on the electronic equipment can be reduced. The frozen application to be processed can also be awakened, and a user or a system can set the awakening condition.
In the Android system, various methods are available for freezing and waking up the application program. Taking one of them as an example, the application can be set to the frozen state by a pm (PACKAGE manager) command, in which the application can be set to the frozen state by a freeze command pm disable [ -USER _ ID ] PACKAGE _ OR _ COMPONENT, and then the application in the frozen state can also be waken up by a unfreeze command pm enable [ -USER _ ID ] PACKAGE _ OR _ COMPONENT, and the application list in the frozen state is obtained by a freeze list query command pm list PACKAGEs-d to view the application in the frozen state. It can be understood that, in the present application, the application processing method is described by taking the Android Operating System as an example, but the application processing method of the present application is not limited to be implemented in the Android System, and may also be applied in Operating systems such as ios (iphone Operating System), saiban, Windows, and MAC OS (MAC Operating System).
And the resource occupancy rate of the application program in the resource limiting state to the electronic equipment is less than the occupancy rate threshold value when the application program runs. When the application program to be processed is in the resource restriction state, the resource occupancy rate of the application program to be processed to the electronic device cannot exceed the occupancy rate threshold value, so that the operation efficiency of the application program to be processed can be controlled, and the power consumption of the electronic device is reduced. For example, the CPU occupancy rate of the application program to be processed during running cannot exceed 5%, so as to reduce excessive consumption of the application program to be processed on the CPU and reduce dependence of the user on the mobile phone. In a mobile phone system, resource occupancy rates of a CPU, a memory, an IO, and the like of an application program to be processed may be controlled by a cgroups (control group), that is, the acquired application program to be processed is controlled to enter a resource restriction state.
When the resource limit value is greater than the second threshold, the resource limit value may be divided into different value ranges, and then the resource limit processing may be divided into different resource limit levels. And when the resource is in different resource limit levels, the occupancy rate thresholds corresponding to the application programs to be processed are different. Specifically, the corresponding relationship between the resource limit value and the resource limit level may be pre-established, and when the resource limit value is greater than the second threshold, the corresponding resource limit level is obtained according to the resource limit value, and then the application program to be processed is controlled to enter the resource limit state corresponding to the resource limit level. For example, the resource limit value has a value range of [0,1], the first threshold value is 0.2, and the second threshold value is 0.4. When the resource limit value is greater than 0.4, the resource limit value is divided into 3 different value ranges including [0.4,0.6], [0.6,0.8] and [0.8,1 ]. The 3 value ranges respectively correspond to three levels, namely a light resource limit level, a common resource limit level, a deep resource limit level and the like, and the corresponding resource limit levels can be obtained according to the resource limit values. It is to be understood that the occupancy thresholds may be different for different resources. For example, the CPU occupancy threshold may be 5% and the memory occupancy threshold may be 10%.
In step 412, if it is detected that the electronic device is in the charging state, controlling the application program to be processed to be recovered to the normal operation state.
And if the electronic equipment is detected to be in the charging state, controlling the application program to be processed to be recovered to the normal running state. And if the application program to be processed is in the resource limit state, the resource limit of the application program to be processed by the electronic equipment is released. And if the application program to be processed is in the frozen state, awakening the application program to be processed from the frozen state. After the normal operation state is recovered, the application program to be processed does not limit the use of the resources of the electronic equipment any more.
FIG. 5 is a diagram illustrating a resource restriction state of an application in one embodiment. As shown in fig. 5, the resources of the electronic device include CPU, memory, IO, network resources, and the like, and the states of the application program can be divided into a normal operation state, a resource restriction state, and a frozen state. The resource restriction state can be further divided into a light resource restriction state, a normal resource restriction state and a deep resource restriction state. In different resource restriction states, the corresponding available resource 502 and unavailable resource 504 are different. From the light resource restriction state, the normal resource restriction state to the deep resource restriction state, the available resources 502 are decremented. Under normal operating conditions, the available resources 502 for an application are 100%.
The application program processing method provided in the foregoing embodiment may obtain the power consumption weight and the priority weight according to the current electric quantity value of the electronic device, then obtain the historical power consumption data and the application priority of each application program, calculate the resource limit value of each application program according to the historical power consumption data, the power consumption weight, the application priority, and the priority weight, and perform resource limit processing on the application program according to the calculated resource limit value. And controlling the application program to be processed to be recovered to a normal operation state when the electronic equipment is detected to be in the charging state. When the resource limiting processing is carried out on the application program, not only can the historical power consumption condition and the application priority of the application program be considered, but also the resource limiting processing can be adjusted in real time according to the electric quantity value of the electronic equipment, so that the processing on the application program is more accurate, and meanwhile, the power consumption of the electronic equipment can be further reduced by carrying out the resource limiting processing on the application program. When the electronic equipment is detected to be in the charging state, resource limitation does not need to be carried out on the application program, and accurate processing of the application program is achieved.
It should be understood that although the steps in the flowcharts of fig. 3 and 4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 3 and 4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in FIG. 6, a partial architecture diagram of an electronic device is provided. The architecture system of the electronic device includes a JAVA space layer 61, a local framework layer 62, and a Kernel space layer 63. Policy applications 610 may be included on the JAVA space layer 61, and the electronic device may initiate a freeze and thaw policy for each application through the policy applications 610, so as to implement a freeze and thaw operation for each application in the electronic device. For example, the policy application 610 determines an application consuming power in the background, and initiates a freeze operation on the application consuming power in the background. The local framework layer 62 includes a resource priority and restriction management module 620 and a platform freeze management module 622. The electronic device can maintain the priority of the application program and the corresponding resource group in real time through the resource priority and restriction management module 620, and adjust the priority and the resource group of the application program according to the requirements of the upper layer, thereby achieving the effects of optimizing performance and saving power consumption. The electronic device may allocate, by using the platform freezing management module 622, the task that can be frozen in the background to the freezing layers corresponding to the preset different layers according to the length of the freezing time, where optionally, the freezing layers may include: CPU limited sleep mode, CPU frozen sleep mode, process deep frozen mode. The kernel space layer 63 includes a UID management module 630, a Cgroup module 632, a timeout freeze exit module 634, a Binder management and control module 636, and a process memory recycling module 638. The UID management module 630 may manage or freeze resources of the third-party application based on a User Identifier (UID) of the application. Compared with the Process control based on the Process Identifier (PID), the unified management of the resources of the application of one user is facilitated through the UID. The Cgroup module 632 is used to provide a complete set of resource restriction mechanisms related to Central Processing Unit (CPU), CPU set, memory, input/output (I/O) and Net. The timeout freeze exit module 634 is used to resolve the exception generated by the freeze timeout scenario. The Binder management and control module 636 is used for controlling the priority of background Binder communication. The process memory recycling module 638 is used to implement a deep freezing mode of the process, and when the third-party application program is in a frozen state for a long time, the file area of the process can be released, so as to achieve a memory-saving module and speed up the next time the application program is started. Through the above-mentioned architecture, the application processing method in the embodiments of the present application can be realized.
FIG. 7 is a block diagram of an application processing device in one embodiment. As shown in fig. 7, the application processing apparatus 700 includes a weight acquisition module 702, a data acquisition module 704, a limit value acquisition module 706, and an application processing module 708. Wherein:
the weight obtaining module 702 is configured to obtain a power consumption weight and a priority weight according to a current electric quantity value of the electronic device.
A data obtaining module 704, configured to obtain historical power consumption data and application priorities of each application installed in the electronic device.
And a limit value obtaining module 706, configured to calculate a resource limit value of each application according to the historical power consumption data, the power consumption weight, the application priority, and the priority weight.
The application processing module 708 is configured to perform resource limitation processing on the application program according to the resource limitation value.
The application processing apparatus provided in the foregoing embodiment may obtain the power consumption weight and the priority weight according to the current electric quantity value of the electronic device, then obtain the historical power consumption data and the application priority of each application, calculate the resource limit value of each application according to the historical power consumption data, the power consumption weight, the application priority, and the priority weight, and perform resource limit processing on the application according to the calculated resource limit value. When the resource limiting processing is carried out on the application program, not only can the historical power consumption condition and the application priority of the application program be considered, but also the resource limiting processing can be adjusted in real time according to the electric quantity value of the electronic equipment, so that the processing on the application program is more accurate, and meanwhile, the power consumption of the electronic equipment can be further reduced by carrying out the resource limiting processing on the application program.
Fig. 8 is a schematic structural diagram of an application processing apparatus according to another embodiment. As shown in fig. 8, the application processing apparatus 800 includes a weight acquisition module 802, a data acquisition module 804, a limit value acquisition module 806, an application processing module 808, and an application restoration module 810. Wherein:
the weight obtaining module 802 is configured to obtain a power consumption weight and a priority weight according to a current electric quantity value of the electronic device.
A data obtaining module 804, configured to obtain historical power consumption data and application priorities of each application program installed in the electronic device.
And a limit value obtaining module 806, configured to calculate a resource limit value of each application according to the historical power consumption data, the power consumption weight, the application priority, and the priority weight.
And the application processing module 808 is configured to perform resource limitation processing on the application program according to the resource limitation value.
And the application recovery module 810 is configured to control the to-be-processed application program to recover to a normal operation state if it is detected that the electronic device is in the charging state.
The application processing apparatus provided in the foregoing embodiment may obtain the power consumption weight and the priority weight according to the current electric quantity value of the electronic device, then obtain the historical power consumption data and the application priority of each application, calculate the resource limit value of each application according to the historical power consumption data, the power consumption weight, the application priority, and the priority weight, and perform resource limit processing on the application according to the calculated resource limit value. And controlling the application program to be processed to be recovered to a normal operation state when the electronic equipment is detected to be in the charging state. When the resource limiting processing is carried out on the application program, not only can the historical power consumption condition and the application priority of the application program be considered, but also the resource limiting processing can be adjusted in real time according to the electric quantity value of the electronic equipment, so that the processing on the application program is more accurate, and meanwhile, the power consumption of the electronic equipment can be further reduced by carrying out the resource limiting processing on the application program. When the electronic equipment is detected to be in the charging state, resource limitation does not need to be carried out on the application program, and accurate processing of the application program is achieved.
In one embodiment, the weight obtaining module 802 is further configured to obtain a current electric quantity value of the electronic device, and determine a target electric quantity interval in which the current electric quantity value falls; and acquiring the power consumption weight and the priority weight corresponding to the target electric quantity interval.
In one embodiment, the weight obtaining module 802 is further configured to obtain a power consumption weight according to a current power value of the electronic device, where the current power value and the power consumption weight are in a negative correlation relationship; and acquiring a priority weight according to the power consumption weight.
In one embodiment, the limit value obtaining module 806 is further configured to calculate a first resource limit value according to the historical power consumption data and the power consumption weight, and calculate a second resource limit value according to the application priority and the priority weight; and calculating the resource limit value of each application program according to the first resource limit value and the second resource limit value.
In an embodiment, the application processing module 808 is further configured to obtain the application program with the resource limit value greater than the first threshold as the application program to be processed, and perform resource limit processing on the application program to be processed according to the resource limit value.
In one embodiment, the application processing module 808 is further configured to control the application program to be processed to enter a frozen state if the resource limit value is less than or equal to a second threshold value, where the first threshold value is less than the second threshold value; and if the resource limit value is larger than a second threshold value, controlling the application program to be processed to enter a resource limit state, wherein the resource occupancy rate of the application program in the resource limit state to the electronic equipment is smaller than the occupancy rate threshold value when the application program in the resource limit state runs.
The division of the modules in the application processing apparatus is only for illustration, and in other embodiments, the application processing apparatus may be divided into different modules as needed to complete all or part of the functions of the application processing apparatus.
The implementation of each module in the application processing apparatus provided in the embodiments of the present application may be in the form of a computer program. The computer program may be run on a terminal or a server. The program modules constituted by the computer program may be stored on the memory of the terminal or the server. Which when executed by a processor, performs the steps of the method described in the embodiments of the present application.
The embodiment of the application also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the application processing methods provided by the above-described embodiments.
A computer program product containing instructions which, when run on a computer, cause the computer to perform the application processing method provided by the above embodiments.
The embodiment of the application also provides the electronic equipment. As shown in fig. 9, for convenience of explanation, only the parts related to the embodiments of the present application are shown, and details of the technology are not disclosed, please refer to the method part of the embodiments of the present application. The electronic device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking the electronic device as the mobile phone as an example:
fig. 9 is a block diagram of a partial structure of a mobile phone related to an electronic device provided in an embodiment of the present application. Referring to fig. 9, the handset includes: radio Frequency (RF) circuit 910, memory 920, input unit 930, display unit 940, sensor 950, audio circuit 960, wireless fidelity (WiFi) module 970, processor 980, and power supply 990. Those skilled in the art will appreciate that the handset configuration shown in fig. 9 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The RF circuit 910 may be used for receiving and transmitting signals during information transmission or communication, and may receive downlink information of a base station and then process the downlink information to the processor 980; the uplink data may also be transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuit 910 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE)), e-mail, Short Messaging Service (SMS), and the like.
The memory 920 may be used to store software programs and modules, and the processor 980 may execute various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 920. The memory 920 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as an application program for a sound playing function, an application program for an image playing function, and the like), and the like; the data storage area may store data (such as audio data, an address book, etc.) created according to the use of the mobile phone, and the like. Further, the memory 920 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 930 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone 900. Specifically, the input unit 930 may include a touch panel 931 and other input devices 932. The touch panel 931, which may also be referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 931 (e.g., a user operating the touch panel 931 or near the touch panel 931 by using a finger, a stylus, or any other suitable object or accessory), and drive the corresponding connection device according to a preset program. In one embodiment, the touch panel 931 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 980, and can receive and execute commands sent by the processor 980. In addition, the touch panel 931 may be implemented by various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 930 may include other input devices 932 in addition to the touch panel 931. In particular, other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), and the like.
The display unit 940 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 940 may include a display panel 941. In one embodiment, the Display panel 941 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. In one embodiment, the touch panel 931 may overlay the display panel 941, and when the touch panel 931 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 980 to determine the type of touch event, and then the processor 980 provides a corresponding visual output on the display panel 941 according to the type of touch event. Although in fig. 9, the touch panel 931 and the display panel 941 are two independent components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 931 and the display panel 941 may be integrated to implement the input and output functions of the mobile phone.
Cell phone 900 may also include at least one sensor 950, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 941 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 941 and/or backlight when the mobile phone is moved to the ear. The motion sensor can comprise an acceleration sensor, the acceleration sensor can detect the magnitude of acceleration in each direction, the magnitude and the direction of gravity can be detected when the mobile phone is static, and the motion sensor can be used for identifying the application of the gesture of the mobile phone (such as horizontal and vertical screen switching), the vibration identification related functions (such as pedometer and knocking) and the like; the mobile phone may be provided with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor.
Audio circuitry 960, speaker 961 and microphone 962 may provide an audio interface between a user and a cell phone. The audio circuit 960 may transmit the electrical signal converted from the received audio data to the speaker 961, and convert the electrical signal into a sound signal for output by the speaker 961; on the other hand, the microphone 962 converts the collected sound signal into an electrical signal, converts the electrical signal into audio data after being received by the audio circuit 960, and then outputs the audio data to the processor 980 for processing, and then the audio data can be transmitted to another mobile phone through the RF circuit 910, or the audio data can be output to the memory 920 for subsequent processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 970, and provides wireless broadband Internet access for the user. Although fig. 9 shows WiFi module 970, it is to be understood that it does not belong to the essential components of cell phone 900 and may be omitted as desired.
The processor 980 is a control center of the mobile phone, connects various parts of the entire mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 920 and calling data stored in the memory 920, thereby integrally monitoring the mobile phone. In one embodiment, processor 980 may include one or more processing units. In one embodiment, the processor 980 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, applications, and the like; the modem processor handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 980.
The handset 900 also includes a power supply 990 (e.g., a battery) for supplying power to various components, which may preferably be logically connected to the processor 980 via a power management system, such that the power management system may be used to manage charging, discharging, and power consumption.
In one embodiment, the cell phone 900 may also include a camera, a bluetooth module, and the like.
In the embodiment of the present application, when the processor 980 included in the electronic device executes the computer program stored in the memory, the steps of the application processing method provided in the above embodiment are implemented.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (12)

1. An application processing method, comprising:
acquiring a power consumption weight and a priority weight according to the current electric quantity value of the electronic equipment;
acquiring historical power consumption data and application priorities of all application programs installed in the electronic equipment;
calculating resource limit values of all application programs according to the historical power consumption data, the power consumption weight, the application priority and the priority weight;
acquiring an application program with the resource limit value larger than a first threshold value as an application program to be processed, and controlling the application program to be processed to enter a frozen state if the resource limit value is smaller than or equal to a second threshold value, wherein the first threshold value is smaller than the second threshold value;
and if the resource limit value is larger than a second threshold value, acquiring a resource limit level according to the resource limit value, and controlling the application program to be processed to enter a resource limit state corresponding to the resource limit level, wherein the resource occupancy rate of the application program in the resource limit state to the electronic equipment when running is smaller than the occupancy rate threshold value.
2. The method of claim 1, wherein obtaining the power consumption weight and the priority weight according to the current charge value of the electronic device comprises:
acquiring a current electric quantity value of the electronic equipment, and determining a target electric quantity interval in which the current electric quantity value falls;
and acquiring the power consumption weight and the priority weight corresponding to the target electric quantity interval.
3. The method of claim 1, wherein obtaining the power consumption weight and the priority weight according to the current charge value of the electronic device comprises:
acquiring a power consumption weight according to a current electric quantity value of the electronic equipment, wherein the current electric quantity value and the power consumption weight are in a negative correlation relationship;
and acquiring a priority weight according to the power consumption weight.
4. The method of claim 1, wherein calculating resource limit values for respective applications based on the historical power consumption data, power consumption weights, application priorities, and priority weights comprises:
calculating a first resource limit value according to the historical power consumption data and the power consumption weight, and calculating a second resource limit value according to the application priority and the priority weight;
and calculating the resource limit value of each application program according to the first resource limit value and the second resource limit value.
5. The method according to any one of claims 1-4, further comprising:
and if the electronic equipment is detected to be in the charging state, controlling the application program to be processed to be recovered to a normal operation state.
6. An application processing apparatus, comprising:
the weight acquisition module is used for acquiring a power consumption weight and a priority weight according to the current electric quantity value of the electronic equipment;
the data acquisition module is used for acquiring historical power consumption data and application priorities of all application programs installed in the electronic equipment;
the limit value acquisition module is used for calculating the resource limit value of each application program according to the historical power consumption data, the power consumption weight, the application priority and the priority weight;
the application processing module is used for acquiring the application program with the resource limit value larger than a first threshold value as the application program to be processed, and controlling the application program to be processed to enter a frozen state if the resource limit value is smaller than or equal to a second threshold value, wherein the first threshold value is smaller than the second threshold value; and if the resource limit value is larger than a second threshold value, acquiring a resource limit level according to the resource limit value, and controlling the application program to be processed to enter a resource limit state corresponding to the resource limit level, wherein the resource occupancy rate of the application program in the resource limit state to the electronic equipment when running is smaller than the occupancy rate threshold value.
7. The apparatus of claim 6,
the weight obtaining module is further configured to obtain a current electric quantity value of the electronic device, and determine a target electric quantity interval in which the current electric quantity value falls; and acquiring the power consumption weight and the priority weight corresponding to the target electric quantity interval.
8. The apparatus of claim 6,
the weight obtaining module is further configured to obtain a power consumption weight according to a current electric quantity value of the electronic device, where the current electric quantity value and the power consumption weight are in a negative correlation relationship;
and acquiring a priority weight according to the power consumption weight.
9. The apparatus of claim 6,
the limit value acquisition module is further used for calculating a first resource limit value according to the historical power consumption data and the power consumption weight, and calculating a second resource limit value according to the application priority and the priority weight;
and calculating the resource limit value of each application program according to the first resource limit value and the second resource limit value.
10. The apparatus according to any one of claims 6 to 9,
and the application recovery module is used for controlling the application program to be processed to recover to a normal running state if the electronic equipment is detected to be in the charging state.
11. An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 5.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201810032326.0A 2018-01-12 2018-01-12 Application program processing method and device, electronic equipment and computer readable storage medium Expired - Fee Related CN110045811B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810032326.0A CN110045811B (en) 2018-01-12 2018-01-12 Application program processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810032326.0A CN110045811B (en) 2018-01-12 2018-01-12 Application program processing method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110045811A CN110045811A (en) 2019-07-23
CN110045811B true CN110045811B (en) 2021-02-02

Family

ID=67264284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810032326.0A Expired - Fee Related CN110045811B (en) 2018-01-12 2018-01-12 Application program processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110045811B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045809A (en) * 2019-12-17 2020-04-21 Oppo广东移动通信有限公司 Application control method and device, electronic equipment and computer readable medium
CN115033304A (en) * 2022-06-27 2022-09-09 维沃移动通信有限公司 Application program control method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103037108A (en) * 2012-12-10 2013-04-10 乐蛙科技(上海)有限公司 Power saving method for smart mobile terminal
CN104635908A (en) * 2013-11-13 2015-05-20 腾讯科技(深圳)有限公司 Method and device for lowering power consumption of mobile terminal
CN107145214A (en) * 2017-04-28 2017-09-08 努比亚技术有限公司 The method and mobile terminal of application program power consumption management
CN107370877A (en) * 2017-06-30 2017-11-21 广东欧珀移动通信有限公司 Method for pushing, device, storage medium and the electronic equipment of application program
CN107491348A (en) * 2017-08-01 2017-12-19 广州三星通信技术研究有限公司 Electric terminal middle pipe ought to method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7281145B2 (en) * 2004-06-24 2007-10-09 International Business Machiness Corporation Method for managing resources in a CPU by allocating a specified percentage of CPU resources to high priority applications
CN106125896A (en) * 2016-06-29 2016-11-16 宇龙计算机通信科技(深圳)有限公司 A kind of application program freezing method and mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103037108A (en) * 2012-12-10 2013-04-10 乐蛙科技(上海)有限公司 Power saving method for smart mobile terminal
CN104635908A (en) * 2013-11-13 2015-05-20 腾讯科技(深圳)有限公司 Method and device for lowering power consumption of mobile terminal
CN107145214A (en) * 2017-04-28 2017-09-08 努比亚技术有限公司 The method and mobile terminal of application program power consumption management
CN107370877A (en) * 2017-06-30 2017-11-21 广东欧珀移动通信有限公司 Method for pushing, device, storage medium and the electronic equipment of application program
CN107491348A (en) * 2017-08-01 2017-12-19 广州三星通信技术研究有限公司 Electric terminal middle pipe ought to method and device

Also Published As

Publication number Publication date
CN110045811A (en) 2019-07-23

Similar Documents

Publication Publication Date Title
CN107391259B (en) Resource processing method and device, computer readable storage medium and mobile terminal
CN107272872B (en) Power saving control method and related product
WO2019128546A1 (en) Application program processing method, electronic device, and computer readable storage medium
US10820273B2 (en) Method for interaction between terminal and network device, and terminal
WO2019128540A1 (en) Resource management method, mobile terminal and computer readable storage medium
CN107368400B (en) CPU monitoring method and device, computer readable storage medium and mobile terminal
CN110018901B (en) Memory recovery method and device, computer equipment and computer readable storage medium
CN109144232B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN110032266B (en) Information processing method, information processing device, computer equipment and computer readable storage medium
CN107577508B (en) Application processing method and device, readable storage medium and mobile terminal
CN109992364B (en) Application freezing method and device, computer equipment and computer readable storage medium
CN108334345B (en) Application processing method and device, readable storage medium and mobile terminal
CN109992425B (en) Information processing method, information processing device, computer equipment and computer readable storage medium
CN109992380B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN109992363B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN109992309B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN109992360B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN110045811B (en) Application program processing method and device, electronic equipment and computer readable storage medium
WO2019128569A1 (en) Method and apparatus for freezing application, and storage medium and terminal
CN110018886B (en) Application state switching method and device, electronic equipment and readable storage medium
CN109992323B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN109992369B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN109375995B (en) Application freezing method and device, storage medium and electronic equipment
CN110046033B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN110045994B (en) Application program processing method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210202