CN111722919A - Method and device for running background application program, storage medium and electronic equipment - Google Patents

Method and device for running background application program, storage medium and electronic equipment Download PDF

Info

Publication number
CN111722919A
CN111722919A CN201910218703.4A CN201910218703A CN111722919A CN 111722919 A CN111722919 A CN 111722919A CN 201910218703 A CN201910218703 A CN 201910218703A CN 111722919 A CN111722919 A CN 111722919A
Authority
CN
China
Prior art keywords
cpu
application program
target application
usage time
background
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
CN201910218703.4A
Other languages
Chinese (zh)
Other versions
CN111722919B (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 CN201910218703.4A priority Critical patent/CN111722919B/en
Priority claimed from CN201910218703.4A external-priority patent/CN111722919B/en
Publication of CN111722919A publication Critical patent/CN111722919A/en
Application granted granted Critical
Publication of CN111722919B publication Critical patent/CN111722919B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure relates to a method, an apparatus, a storage medium, and an electronic device for running an application, the method comprising: determining a target application program operated in a foreground; monitoring whether the target application program is switched from foreground operation to background operation; and when the target application program is switched from the foreground operation to the background operation, limiting the service time of the target application program to a Central Processing Unit (CPU) so as to improve the service time of the foreground operation application program to the CPU.

Description

Method and device for running background application program, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for running a background application, a storage medium, and an electronic device.
Background
At present, an application program in an electronic device enters a background of the electronic device when not being used, but maintaining normal operation of the background application program needs to consume a Central Processing Unit (CPU) resource, which may cause problems of stuttering of a foreground program, excessive power consumption, and the like.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a method, an apparatus, a storage medium, and an electronic device for running a background application.
According to a first aspect of the embodiments of the present disclosure, a method for running a background application is provided, which includes determining a target application running in a foreground; monitoring whether the target application program is switched from foreground operation to background operation; and when the target application program is switched from the foreground operation to the background operation, limiting the service time of the target application program to a Central Processing Unit (CPU) so as to improve the service time of the foreground operation application program to the CPU.
Optionally, the limiting the usage time of the CPU by the target application includes: acquiring a preset background application group, wherein a first usage time occupancy rate of all application programs in the background application group to the usage time of the CPU is less than or equal to a first preset occupancy rate threshold; the first usage time occupancy rate is the ratio of the sum of the usage time of each application program to the CPU to the total usage time of the CPU in the background application group; adding the target application to the background application group.
Optionally, the limiting the usage time of the CPU by the target application includes: and controlling a second usage time occupancy rate of the target application program to the CPU to be less than or equal to a second preset occupancy rate threshold value, wherein the second usage time occupancy rate is a ratio of the usage time of the target application program to the CPU to the total usage time of the CPU.
Optionally, before limiting the usage time of the CPU by the target application, the method further includes: determining whether the target application program is a preset trusted application program; the limiting the use time of the target application program on the CPU comprises the following steps: limiting the usage time of the CPU by the target application program when the target application program is determined not to be the trusted application program.
Optionally, after limiting the usage time of the CPU by the target application, the method further includes: and when the target application program is switched from the background operation to the foreground operation, canceling the limitation of the target application program on the use time of the CPU.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for running an application, including a target determination module configured to determine a target application running in a foreground; the monitoring module is configured to monitor whether the target application program is switched from foreground running to background running; and the processing module is configured to limit the use time of the target application program to a Central Processing Unit (CPU) when the target application program is switched from the foreground operation to the background operation, so as to improve the use time of the foreground operation application program to the CPU.
Optionally, the processing module is configured to: when the target application program is switched from the foreground operation to the background operation, acquiring a preset background application group, wherein the first usage time occupancy rate of all application programs in the background application group to the usage time of the CPU is smaller than or equal to a first preset occupancy rate threshold value; the first usage time occupancy rate is the ratio of the sum of the usage time of each application program to the CPU to the total usage time of the CPU in the background application group; adding the target application to the background application group.
Optionally, the processing module is configured to: and when the target application program is switched from the foreground operation to the background operation, controlling a second usage time occupancy rate of the target application program to the CPU to be less than or equal to a second preset occupancy rate threshold value, wherein the second usage time occupancy rate is the ratio of the usage time of the target application program to the CPU to the total usage time of the CPU.
Optionally, the apparatus further comprises: a trust determination module configured to determine whether the target application is a preset trusted application; the processing module is configured to limit the use time of the target application program on the CPU when the target application program is determined not to be the trusted application program when the target application program is switched from the foreground operation to the background operation.
Optionally, the apparatus further comprises: and the limitation canceling module is configured to cancel the limitation of the target application program on the use time of the CPU when the target application program is switched from the background running to the foreground running.
According to a third aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the method of running an application provided by the first aspect of the present disclosure.
According to a fourth aspect of the embodiments of the present disclosure, an electronic device is provided, which includes the apparatus for running an application program provided in the second aspect of the present disclosure.
The technical scheme provided by the embodiment of the disclosure can limit the use of the background application program to the CPU when the application program enters the background, thereby reducing the consumption of the background application program to the CPU power, improving the use of the application program operated by the foreground to the CPU, and increasing the operation performance of the foreground application program.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of running an application in accordance with an exemplary embodiment.
Fig. 2 is a flowchart illustrating a method of running an application according to another exemplary embodiment.
Fig. 3 is a flowchart illustrating a method of running an application according to another exemplary embodiment.
Fig. 4 is a block diagram illustrating an apparatus for running an application according to an example embodiment.
Fig. 5 is a block diagram illustrating an apparatus for running an application according to another exemplary embodiment.
Fig. 6 is a block diagram illustrating an apparatus for running an application according to another exemplary embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a method of running a background application, which may be applied to an electronic device, as shown in fig. 1, according to an exemplary embodiment, and includes the following steps.
In step S101, a target application running in the foreground is determined.
In step S102, it is monitored whether the target application program is switched from foreground operation to background operation.
When the target application program is opened and used by a user, the target application program runs in the foreground, the operation page of the target application program is displayed in the foreground, and when the operation page of the target application program is exited but the target application program is not closed, the target application program runs in the background.
In this embodiment, the target application may be run on the electronic device, and the electronic device may be a mobile phone with different operating systems, such as an Android (Android) mobile phone, an apple mobile phone, and the like.
When the electronic equipment is an Android mobile phone, the mobile phone can register a monitor based on a component management service provided by an Android system, and monitors the switching state of the foreground and the background of the current application program through the monitor.
Of course, the specific monitoring process of the application running in the foreground and background may refer to monitoring of the application running in the foreground and background in the prior art, and details are not described here.
In step S103, when the target application program is switched from the foreground operation to the background operation, the usage time of the target application program to the CPU of the central processing unit is limited, so as to increase the usage time of the foreground operation application program to the CPU.
In this step, the usage time of the target application program to the central processing unit CPU can be limited by any one of the following two implementation manners:
in the first mode, a preset background application group is obtained, and the target application program is added to the background application group.
The first usage time occupancy rate of all application programs in the background application group to the usage time of the CPU is smaller than or equal to a first preset occupancy rate threshold value; the first usage time occupancy rate is a ratio of a sum of usage times of each application program in the background application group to the CPU to a total usage time of the CPU. The first usage time occupancy rate can be realized by modifying a CPU time occupancy value in a cpu.shares file of a background application group, the CPU time occupancy value in the cpu.shares file of the background application group can represent the usage time of all application programs in the background application group for the CPU, when the CPU time occupancy value is larger, it represents that the time for all application programs in the background application group to use the CPU is longer, a default value of the CPU time occupancy value is 1024, and a ratio of the CPU time occupancy value to the default value is the usage time occupancy rate of the CPU.
For example, when the target application program is switched from the foreground operation to the background operation, the target application program is added to the background application group, and the first preset occupancy threshold may be 5%, the CPU time occupancy value in the CPU's files of the background application group may be preset to 52, that is, the CPU usage time of the background application group is 5% of the total CPU usage time (52 ÷ 1024 × 100% > -5%); when there is one target application in the background application group, the CPU usage time of the target application is 5% of the total CPU usage time, and when there are two target applications in the background application group, the CPU usage time of the two target applications (i.e., all applications in the background application group) is 5% of the total CPU usage time.
And controlling a second usage time occupancy rate of the target application program to the CPU to be less than or equal to a second preset occupancy rate threshold value, wherein the second usage time occupancy rate is a ratio of the usage time of the target application program to the CPU to the total usage time of the CPU. Similarly, the second usage time occupancy may also be implemented by modifying a CPU time occupancy value in a CPU files of an application program, and similarly, the CPU time occupancy value of the application program may represent the usage time of the application program for the CPU, and when the CPU time occupancy value is larger, it indicates that the time for the application program to use the CPU is longer, and a default value of the CPU time occupancy value is 1024.
For example, the second preset occupancy threshold may be 2.5%, when the target application is switched from the foreground operation to the background operation, the CPU time occupancy value of the target application may be set to 25, and then the second usage time occupancy is 25/1024, that is, 2.4%, the CPU usage time of the application is 2.4% of the total CPU usage time, and the CPU usage time of the application may be limited without closing the application.
It should be noted that the difference between the first and second manners is that the first manner limits the total usage time of the CPU by all the applications running in the background, and the second manner limits the usage time of the CPU by each application running in the background.
In a possible implementation manner, when the target application program is switched from the background operation to the foreground operation, the limitation of the target application program on the use time of the CPU is cancelled. Correspondingly, when the usage mode I limits the usage time of the target application program to the CPU, the target application program can be removed from the background grouping when the target application program is switched from the background operation to the foreground operation; when the second usage mode limits the CPU usage time of the target application program, the modification of the CPU time occupation value of the target application program can be restored when the target application program is switched from background operation to foreground operation.
By the method, when the application program enters the background, the use of the background application program to the CPU is limited, so that the consumption of the background application program to the CPU power is reduced, the use of the foreground running application program to the CPU is improved, and the running performance of the foreground application program is improved.
FIG. 2 is a flow chart illustrating a method of running a background application in accordance with another exemplary embodiment. Referring to fig. 2, the method includes the following steps.
In step S201, a target application running in the foreground is determined.
In step S202, it is monitored whether the target application program is switched from foreground operation to background operation.
When the target application program is opened and used by a user, the target application program runs in the foreground, the operation page of the target application program is displayed in the foreground, and when the operation page of the target application program is exited but the target application program is not closed, the target application program runs in the background.
In this embodiment, the target application may be run on an electronic device, and the electronic device may be a mobile phone with different operating systems, such as an Android (Android) mobile phone, an apple mobile phone, and the like.
When the electronic equipment is an Android mobile phone, the mobile phone can register a monitor based on a component management service provided by an Android system, and monitors the switching state of the foreground and the background of the current application program through the monitor.
Of course, the specific monitoring process of the application running in the foreground and background may refer to monitoring of the application running in the foreground and background in the prior art, and details are not described here.
When the target application program is not switched from the foreground operation to the background operation, the use time occupancy rate of the target application program to the CPU is not limited.
When the target application program is switched from the foreground operation to the background operation, step S203 is executed.
In step S203, it is determined whether the target application is a preset trusted application.
In this step, a list of trusted applications may be obtained, and it may be determined whether the target application is in the list of trusted applications. When the target application is in the list of trusted applications, the target application may be determined to be a trusted application, and when the target application is not in the list of trusted applications, the target application may be determined not to be the trusted application.
And when the target application program is determined to be a trusted application program, the utilization time occupancy rate of the target application program to the CPU is not limited.
When it is determined that the target application is not the trusted application, step S204 is performed.
In step 204, a preset background application group is obtained, wherein the sum of the occupancy rates of all the application programs in the background application group to the CPU is less than or equal to a preset occupancy threshold.
The sum of the occupation ratios of all the application programs in the background application group to the CPU is the ratio of the sum of the use times of all the application programs in the background application group to the CPU to the total use time of the CPU. By limiting the CPU usage time of the background application group, the CPU usage time of the application programs in the group can be limited, so that the ratio of the total usage time of all the application programs in the background application group to the CPU to the total usage time of the CPU is smaller than or equal to the preset occupancy rate threshold. The usage time occupancy rate can be realized by modifying a CPU time occupancy value in a cpu.shares file of the background application packet, the CPU time occupancy value in the cpu.shares file of the background application packet can represent the usage time of all the application programs in the background application packet for the CPU, when the CPU time occupancy value is larger, it represents that the time for all the application programs in the background application packet to use the CPU is longer, a default value of the CPU time occupancy value is 1024, and a ratio of the CPU time occupancy value to the default value is the usage time occupancy rate of the CPU.
For example, the preset occupancy threshold may be 5%, the CPU time occupancy value in the shares file of the background application group may be preset to 52, that is, the CPU usage time of the background application group is 5% (52 ÷ 1024 × 100% ═ 5%) of the total CPU usage time; when there is one target application in the background application group, the CPU usage time of the target application is 5% of the total CPU usage time, and when there are two target applications in the background application group, the CPU usage time of the two target applications (i.e., all applications in the background application group) is 5% of the total CPU usage time.
In step S205, the target application is added to the background application group.
After the target application is added to the background application group, the CPU usage time of the target application is limited because the CPU usage time of all applications in the background application group is limited to the total CPU usage time. For example, when the CPU usage time occupancy of the background application group is 5%, the maximum CPU usage time occupancy of the target application program is 5%, and when there are other target application programs in the background application group, the maximum CPU usage time occupancy of the target application program and the other target application programs to the CPU is 5%.
In step S206, when the target application program is switched from the background operation to the foreground operation, the target application program is removed from the background application group.
When the target application program is switched from background operation to foreground operation, the target application program can be removed from the background application group, and after the target application program leaves the background application group, the use time of the target application program to the CPU is not limited by the use time of the background application group to the CPU.
By the method, when the application program enters the background, the use of the background application program to the CPU is limited, so that the consumption of the background application program to the CPU power is reduced, the use of the foreground running application program to the CPU is improved, and the running performance of the foreground application program is improved.
FIG. 3 is a flow chart illustrating a method of running a background application in accordance with another exemplary embodiment. Referring to fig. 3, the method includes the following steps.
In step S301, a target application running in the foreground is determined.
In step S302, it is monitored whether the target application program is switched from foreground operation to background operation.
When the target application program is opened and used by a user, the target application program runs in the foreground, the operation page of the target application program is displayed in the foreground, and when the operation page of the target application program is exited but the target application program is not closed, the target application program runs in the background.
In this embodiment, the target application may be run on an electronic device, and the electronic device may be a mobile phone with different operating systems, such as an Android (Android) mobile phone, an apple mobile phone, and the like.
When the electronic equipment is an Android mobile phone, the mobile phone can register a monitor based on a component management service provided by an Android system, and monitors the switching state of the foreground and the background of the current application program through the monitor.
Of course, the specific monitoring process of the application running in the foreground and background may refer to monitoring of the application running in the foreground and background in the prior art, and details are not described here.
When the target application program is not switched from the foreground operation to the background operation, the use time occupancy rate of the target application program to the CPU is not limited.
When the target application program is switched from the foreground operation to the background operation, step S303 is executed.
In step S303, it is determined whether the target application is a preset trusted application.
In this step, a list of trusted applications may be obtained, and it may be determined whether the target application is in the list of trusted applications. When the target application is in the list of trusted applications, the target application may be determined to be a trusted application, and when the target application is not in the list of trusted applications, the target application may be determined not to be the trusted application.
And when the target application program is determined to be a trusted application program, the utilization time occupancy rate of the target application program to the CPU is not limited.
When it is determined that the target application is not the trusted application, step S304 is performed.
In step S304, the usage time occupancy of the CPU by the target application is controlled to be less than or equal to a preset occupancy threshold.
In this step, the usage time occupancy rate is a ratio of the usage time of the target application program to the CPU to the total usage time of the CPU. The usage time occupancy rate can be realized by modifying a CPU time occupancy value in a cpu.shares file of an application program, the CPU time occupancy value in the cpu.shares file of the background application packet can represent the usage time of all application programs in the background application packet for the CPU, when the CPU time occupancy value is larger, it represents that the time for all application programs in the background application packet to use the CPU is longer, a default value of the CPU time occupancy value is 1024, and a ratio of the CPU time occupancy value to the default value is the usage time occupancy rate of the CPU.
For example, the preset occupancy threshold may be 2.5%, when the target application switches from the foreground operation to the background operation, the CPU time occupancy value may be set to 25, and then the preset occupancy is 25/1024, that is, 2.4%, the CPU usage time of the application is 2.4% of the total CPU usage time, and the CPU usage time of the application may be limited without closing the application.
In step S305, when the target application is switched from the background operation to the foreground operation, the limitation of the target application on the CPU usage time occupancy rate is cancelled.
In this step, the modification of the CPU time occupation value can be realized by restoring.
By the method, when the application program enters the background, the use of the background application program to the CPU is limited, so that the consumption of the background application program to the CPU power is reduced, the use of the foreground running application program to the CPU is improved, and the running performance of the foreground application program is improved.
FIG. 4 is a block diagram illustrating an apparatus for running an application in accordance with an exemplary embodiment. Referring to fig. 4, the apparatus 400 includes an object determination module 401, a monitoring module 402 and a processing module 403.
The target determination module 401 is configured to determine a target application running in the foreground.
The monitoring module 402 is configured to monitor whether the target application is switched from foreground running to background running.
The processing module 403 is configured to limit the usage time of the target application program to the CPU when the target application program is switched from the foreground operation to the background operation, so as to increase the usage time of the CPU by the application program running in the foreground.
Optionally, the processing module 403 is configured to obtain a preset background application group when the target application program is switched from the foreground operation to the background operation, where a first usage time occupancy rate of all application programs in the background application group to the usage time of the CPU is less than or equal to a first preset occupancy rate threshold; the first usage time occupancy rate is a ratio of a sum of usage times of each application program to the CPU to a total usage time of the CPU in the background application group, and the target application program is added to the background application group.
Optionally, the processing module 403 is configured to control a second usage time occupancy rate of the target application program to the CPU to be less than or equal to a second preset occupancy rate threshold when the target application program is switched from the foreground operation to the background operation, where the second usage time occupancy rate is a ratio of the usage time of the target application program to the CPU to the total usage time of the CPU.
Optionally, as shown in fig. 5, the apparatus 400 further comprises a trust determination module 404.
The trust determination module 404 is configured to determine whether the target application is a pre-provisioned trusted application.
The processing module 403 is configured to limit the usage time of the CPU by the target application when the target application is determined not to be the trusted application when the target application is switched from the foreground operation to the background operation.
Optionally, as shown in fig. 6, the apparatus 400 further comprises a restriction cancellation module 405.
The cancellation restriction module 405 is configured to cancel the restriction of the usage time of the CPU by the target application when the target application is switched from the background operation to the foreground operation.
By adopting the device, when the application program enters the background, the use of the background application program to the CPU is limited, so that the consumption of the background application program to the CPU power is reduced, the use of the foreground running application program to the CPU is improved, and the running performance of the foreground application program is improved.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The present disclosure also provides a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the method of running an application provided by the present disclosure.
Fig. 7 is a block diagram illustrating an electronic device 700 running an application according to an example embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the electronic device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to perform all or part of the steps of a method of running an application. Further, the processing component 702 may include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operations at the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power component 706 provides power to the various components of the electronic device 700. The power components 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 700.
The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 700 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 may detect an open/closed state of the electronic device 700, the relative positioning of components, such as a display and keypad of the electronic device 700, the sensor assembly 714 may also detect a change in the position of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, orientation or acceleration/deceleration of the electronic device 700, and a change in the temperature of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing a method of running an application program.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 704 comprising instructions, executable by the processor 720 of the electronic device 700 to perform a method of running an application program is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (12)

1. A method of running an application, comprising:
determining a target application program operated in a foreground;
monitoring whether the target application program is switched from foreground operation to background operation;
and when the target application program is switched from the foreground operation to the background operation, limiting the service time of the target application program to a Central Processing Unit (CPU) so as to improve the service time of the foreground operation application program to the CPU.
2. The method of claim 1, wherein the limiting the usage time of the CPU by the target application comprises:
acquiring a preset background application group, wherein a first usage time occupancy rate of all application programs in the background application group to the usage time of the CPU is less than or equal to a first preset occupancy rate threshold; the first usage time occupancy rate is the ratio of the sum of the usage time of each application program to the CPU to the total usage time of the CPU in the background application group;
adding the target application to the background application group.
3. The method of claim 1, wherein the limiting the usage time of the CPU by the target application comprises:
and controlling a second usage time occupancy rate of the target application program to the CPU to be less than or equal to a second preset occupancy rate threshold value, wherein the second usage time occupancy rate is a ratio of the usage time of the target application program to the CPU to the total usage time of the CPU.
4. The method of claim 1, wherein before limiting the CPU usage time of the target application, the method further comprises:
determining whether the target application program is a preset trusted application program;
the limiting the use time of the target application program on the CPU comprises the following steps:
limiting the usage time of the CPU by the target application program when the target application program is determined not to be the trusted application program.
5. The method of any of claims 1 to 4, wherein after limiting the CPU usage time of the target application, the method further comprises:
and when the target application program is switched from the background operation to the foreground operation, canceling the limitation of the target application program on the use time of the CPU.
6. An apparatus for running an application, comprising:
a target determination module configured to determine a target application running in the foreground;
the monitoring module is configured to monitor whether the target application program is switched from foreground running to background running;
and the processing module is configured to limit the use time of the target application program to a Central Processing Unit (CPU) when the target application program is switched from the foreground operation to the background operation, so as to improve the use time of the foreground operation application program to the CPU.
7. The apparatus of claim 6, wherein the processing module is configured to:
when the target application program is switched from the foreground operation to the background operation, acquiring a preset background application group, wherein the first usage time occupancy rate of all application programs in the background application group to the usage time of the CPU is smaller than or equal to a first preset occupancy rate threshold value; the first usage time occupancy rate is the ratio of the sum of the usage time of each application program to the CPU to the total usage time of the CPU in the background application group;
adding the target application to the background application group.
8. The apparatus of claim 6, wherein the processing module is configured to:
and when the target application program is switched from the foreground operation to the background operation, controlling a second usage time occupancy rate of the target application program to the CPU to be less than or equal to a second preset occupancy rate threshold value, wherein the second usage time occupancy rate is the ratio of the usage time of the target application program to the CPU to the total usage time of the CPU.
9. The apparatus of claim 6, further comprising:
a trust determination module configured to determine whether the target application is a preset trusted application;
the processing module is configured to limit the use time of the target application program on the CPU when the target application program is determined not to be the trusted application program when the target application program is switched from the foreground operation to the background operation.
10. The apparatus of any of claims 6 to 9, further comprising:
and the limitation canceling module is configured to cancel the limitation of the target application program on the use time of the CPU when the target application program is switched from the background running to the foreground running.
11. A computer-readable storage medium, on which computer program instructions are stored, which program instructions, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 5.
12. An electronic device, characterized in that it comprises the apparatus of any of claims 6 to 10.
CN201910218703.4A 2019-03-21 Method and device for running background application program, storage medium and electronic equipment Active CN111722919B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910218703.4A CN111722919B (en) 2019-03-21 Method and device for running background application program, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910218703.4A CN111722919B (en) 2019-03-21 Method and device for running background application program, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111722919A true CN111722919A (en) 2020-09-29
CN111722919B CN111722919B (en) 2024-06-04

Family

ID=

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022100009A1 (en) * 2020-11-13 2022-05-19 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and system for dynamic categorization of applications in user devices

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101788926A (en) * 2009-12-28 2010-07-28 中兴通讯股份有限公司 Resource allocation method and device for switching J2ME (Java 2 Micro Edition) application platform
CN105573896A (en) * 2015-12-21 2016-05-11 魅族科技(中国)有限公司 Running reminding method and device for application program
CN106648032A (en) * 2016-12-30 2017-05-10 维沃移动通信有限公司 Control method for application program operating in background and mobile terminal
CN107526637A (en) * 2017-08-01 2017-12-29 广东欧珀移动通信有限公司 Applied program processing method, device, mobile terminal and storage medium
CN107526638A (en) * 2017-08-01 2017-12-29 广东欧珀移动通信有限公司 Applied program processing method, device, mobile terminal and storage medium
CN107634867A (en) * 2017-10-25 2018-01-26 广东欧珀移动通信有限公司 Network management and Related product
US20180032368A1 (en) * 2016-07-29 2018-02-01 Samsung Electronics Co., Ltd. Electronic device and method for operating the same
CN107729125A (en) * 2017-10-31 2018-02-23 努比亚技术有限公司 Application program resides the management method and mobile terminal on backstage

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101788926A (en) * 2009-12-28 2010-07-28 中兴通讯股份有限公司 Resource allocation method and device for switching J2ME (Java 2 Micro Edition) application platform
CN105573896A (en) * 2015-12-21 2016-05-11 魅族科技(中国)有限公司 Running reminding method and device for application program
US20180032368A1 (en) * 2016-07-29 2018-02-01 Samsung Electronics Co., Ltd. Electronic device and method for operating the same
CN107665038A (en) * 2016-07-29 2018-02-06 三星电子株式会社 Electronic equipment and the method for operating the electronic equipment
CN106648032A (en) * 2016-12-30 2017-05-10 维沃移动通信有限公司 Control method for application program operating in background and mobile terminal
CN107526637A (en) * 2017-08-01 2017-12-29 广东欧珀移动通信有限公司 Applied program processing method, device, mobile terminal and storage medium
CN107526638A (en) * 2017-08-01 2017-12-29 广东欧珀移动通信有限公司 Applied program processing method, device, mobile terminal and storage medium
CN107634867A (en) * 2017-10-25 2018-01-26 广东欧珀移动通信有限公司 Network management and Related product
CN107729125A (en) * 2017-10-31 2018-02-23 努比亚技术有限公司 Application program resides the management method and mobile terminal on backstage

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
MEMON, MH等: "Power Management for Android Platform by Set CPU", 《PROCEEDINGS OF THE 10TH INDIACOM - 2016 3RD INTERNATIONAL CONFERENCE ON COMPUTING FOR SUSTAINABLE GLOBAL DEVELOPMENT》, 4 January 2017 (2017-01-04) *
宋博;陈明宇;樊建平;: "一种基于进程执行行为分析的图形界面交互系统性能评测方法", 计算机学报, no. 07, 15 July 2009 (2009-07-15) *
方浩: "安卓平台下优化大师软件的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 December 2018 (2018-12-15) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022100009A1 (en) * 2020-11-13 2022-05-19 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and system for dynamic categorization of applications in user devices

Similar Documents

Publication Publication Date Title
CN106961526B (en) Notification message display method and device and electronic equipment
EP2993584B1 (en) Method and device for controlling background application
EP3188066B1 (en) A method and an apparatus for managing an application
US9860844B2 (en) Method and apparatus of temperature control
CN107040591B (en) Method and device for controlling client
US20170300211A1 (en) Method and apparatus for displaying status information of application
CN106792892B (en) Access control method and device for application program
CN109062625B (en) Application program loading method and device and readable storage medium
CN105227426B (en) Application interface switching method and device and terminal equipment
CN110941321A (en) Power supply method and device for electronic equipment and intelligent equipment
CN105653903B (en) The management method and device of application program permission
CN108037987B (en) Application program control method, device and storage medium
CN107436782B (en) Application silent installation method and device
CN111506234B (en) Method and device for preventing false touch of edge of touch screen, storage medium and electronic equipment
CN110603847B (en) Cell reselection method and device, electronic equipment and computer readable storage medium
CN110311692B (en) User equipment, control method and storage medium
CN111526573A (en) Communication data processing method and device, electronic equipment and storage medium
CN111290843A (en) Process management method and device
CN109922203B (en) Terminal, screen off method and device
CN106060104B (en) Application management method and device
CN105873154B (en) Network access method and device
CN111722919B (en) Method and device for running background application program, storage medium and electronic equipment
CN110704197B (en) Method, apparatus and medium for processing memory access overhead
CN112187326A (en) Antenna control method, device, equipment and storage medium
CN111722919A (en) Method and device for running background application program, storage medium and electronic equipment

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