CN104199669B - The method and device being managed to the process of application program - Google Patents

The method and device being managed to the process of application program Download PDF

Info

Publication number
CN104199669B
CN104199669B CN201410465567.6A CN201410465567A CN104199669B CN 104199669 B CN104199669 B CN 104199669B CN 201410465567 A CN201410465567 A CN 201410465567A CN 104199669 B CN104199669 B CN 104199669B
Authority
CN
China
Prior art keywords
application program
priority
screen
dormancy
user
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.)
Active
Application number
CN201410465567.6A
Other languages
Chinese (zh)
Other versions
CN104199669A (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 Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201410465567.6A priority Critical patent/CN104199669B/en
Publication of CN104199669A publication Critical patent/CN104199669A/en
Application granted granted Critical
Publication of CN104199669B publication Critical patent/CN104199669B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses the method and device that a kind of process to application program is managed, method therein includes:Reception system broadcasts the message, and determines whether terminal is in screen closed mode;When it is determined that screen is closed, the process identification (PID) of each application program is traveled through by application call interface, finds the process significance index of each application program, according to the process significance index, it is determined that the process priority of each application program;According to preset management of process rule, resting state is closed or be arranged to the relatively low process of priority.The embodiment of the present invention is used as foundation by process priority, and the process relatively low to priority is closed or dormancy, and preferably process relatively low to priority after screen locking carries out dormancy processing, so as to save memory headroom, reduces electric quantity consumption.

Description

Method and device for managing process of application program
Technical Field
The invention relates to the technical field of mobile terminals, in particular to a method and a device for managing a process of an application program.
Background
In the using process of the android system, a large amount of background running processes and services can be generated due to the self-operation of a user or the self-starting behavior of an application program (software). Some of these background processes and services are needed by users, such as instant messaging, security protection software; other processes and services which are not necessarily available are used for helping the software to push the notification and the prompt. The processes and services can exist for a long time after the screen of the mobile phone is locked, occupy the memory of the mobile phone, consume the electric quantity of a battery and cause inconvenience for the use of the mobile phone.
Disclosure of Invention
In view of the above, the present invention has been made to provide a method and apparatus for managing a process of an application that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, there is provided a method of managing a process of an application, comprising: receiving system broadcast information, and determining whether the terminal is in a screen closing state; when the screen is determined to be in a closed state, acquiring the priority of the process corresponding to each application program through an application program calling interface; the acquiring the priority of the process corresponding to each application program comprises: traversing the process identification of each application program, finding the process importance index of each application program, and determining the process priority of each application program according to the process importance index; and closing or setting the process with lower priority to be in a dormant state according to a preset process management rule.
Preferably, the process importance index refers to a factor under a memory overflow mechanism in an operating system.
Preferably, the process importance index refers to a factor OOM _ adj in an OOM mechanism in an Android operating system.
Preferably, the process management rule includes: and after the terminal is locked for a preset time, setting the processes corresponding to the user application program and the system application program with the priority lower than the lowest priority threshold into a dormant state.
Preferably, the method further comprises the following steps: and providing a visual interface for a user and accepting manual calibration of the process management by the user.
Preferably, the manual calibration of the process management comprises: according to the priority of each process, performing the operations of temporary non-dormancy, dormancy after screen locking or direct dormancy on the process; or, according to the selection of the user, the screen locking dormancy is executed on the process of the specific application program or the background running state is kept.
Preferably, the method further comprises the following steps: and judging whether the application program corresponding to the process is contained in a preset application program white list or not, and if so, keeping the process in a running state.
Preferably, the method further comprises the following steps: and judging whether the application program corresponding to the process is contained in a preset application program blacklist, if so, setting the process to be in a dormant state.
According to an aspect of the present invention, there is provided an apparatus for managing a process of an application, comprising: a broadcast message receiving unit for receiving system broadcast messages and determining whether the terminal is in a screen-off state; the process priority acquiring unit is used for acquiring the priority of the process corresponding to each application program through the application program calling interface when the screen is determined to be in the closed state; the process priority acquiring unit is specifically configured to: finding the process importance index of each application program through the process identification of each application program, and determining the process priority of each application program according to the process importance index; and the management unit is used for closing or setting the process with lower priority to be in a dormant state according to a preset process management rule.
Preferably, the process importance index refers to a factor under a memory overflow mechanism in an operating system.
Preferably, the process importance index refers to a factor OOM _ adj in an OOM mechanism in an Android system.
Preferably, the process management rule includes: and after the terminal is locked for a preset time, setting the processes corresponding to the user application program and the system application program with the priority lower than the lowest priority threshold into a dormant state.
Preferably, the method further comprises the following steps: and the manual calibration unit is used for providing a visual interface for a user and receiving the manual calibration of the process management by the user.
Preferably, the manual calibration unit is specifically configured to: according to the priority of each process, performing the operations of temporary non-dormancy, dormancy after screen locking or direct dormancy on the process; or, according to the selection of the user, the screen locking dormancy is executed on the process of the specific application program or the background running state is kept.
Preferably, the method further comprises the following steps: and the list judgment unit is used for judging whether the application program corresponding to the process is contained in a preset application program white list or not, and if so, indicating the process management unit to keep the process in the running state.
Preferably, the method further comprises the following steps: and the list judgment unit is used for judging whether the application program corresponding to the process is contained in a preset application program blacklist or not, and if so, indicating the process management unit to set the process to be in a dormant state.
Therefore, the embodiment of the invention closes or sleeps the process with lower priority by taking the process priority as a basis, and preferably sleeps the process with lower priority after the screen is locked, so that the memory space is saved and the power consumption is reduced. In addition, under the double judgment logic of automatic intelligent identification and manual calibration of the user, the method can ensure that the useful background process required by the user is never automatically dormant and other background processes not required by the user are all automatically dormant. Therefore, the long-term low memory occupation and low power consumption of the android mobile phone system are kept.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 illustrates a flow diagram of a method of managing a process of an application in accordance with one embodiment of the present invention; and
FIG. 2 shows a schematic diagram of an apparatus for managing processes of an application according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The invention discloses a method for managing a process of an application program, which is characterized in that the running of a background process of the application program is monitored, the priority of the process is determined, and the process with lower priority is closed, so that the memory space is released, and the running environment of a terminal is optimized.
Referring to fig. 1, a flowchart of a method for managing a process of an application according to an embodiment of the present invention is shown.
The method comprises the following steps:
s101: and receiving a system broadcast message, and determining whether the terminal is in a screen-off state.
Those skilled in the art understand that an operating system includes an application layer (app layer) and a system framework layer (framework layer). In a preferred implementation manner of the present invention, the app layer and the frame layer are improved, so that the process of the application program is managed by using the cooperation of the app layer and the frame layer. Specifically, the method includes the steps that firstly, a system is registered and received, screen closing broadcast messages are closed, when the system screen is blackened, an application program layer can receive the screen closing broadcast messages of the system, and then the application program layer is called through an interface, and process priorities of all application programs are traversed.
S102: and when the screen is determined to be in a closed state, acquiring the priority of the process corresponding to each application program through the API.
Traversal of process priorities can be achieved through an API of an operating system. An API (application programming Interface) is a call Interface that an operating system leaves for an application program, and the application program makes the operating system execute a command (action) of the application program by calling the API of the operating system. An interrupt mechanism may be employed to implement snooping of the API.
In the embodiment of the present invention, the interaction between the app layer and the frame layer may be understood as: and injecting a system service program, and replacing a handle (variable) used for receiving the inter-process communication data in the system service into a false handle (variable) of the app layer, wherein the false handle (variable) is a control request from a third-party program prior to the system service, and the false handle (memory variable) executes the logic of process control when being called and can execute corresponding operation according to a rule set by a user.
Specifically, there are various ways to determine the process priority.
(1) The first mode is as follows: and searching the process importance index of each application program through the process identifier of each application program, and determining the process priority of each application program according to the process importance index.
Specifically, in the android system, a corresponding PROC/PID/oom _ adj file is found through the program PID, and a numerical value in the file is read as a standard and a threshold for judging the priority. Wherein, pid (process identifier) is the identity of each process, and the program operating system will be automatically assigned to the process as a unique one. The corresponding oom _ adj of the application can be found by the PID of the application.
Those skilled in the art understand that Android is a multitasking system, that is, multiple programs can be run simultaneously. Generally, starting a program is time consuming, so in order to speed up the running speed, when the program is exited, the Android does not kill it immediately (kill), so that the next time the program is run, the program can be started quickly. With more and more programs reserved in the system, the memory is certainly insufficient, and the low memory killer is used for clearing related programs when the memory of the system is lower than a certain value, so that the system is guaranteed to keep having a certain amount of free memory. The Low memorykiller determines the released process based on two principles, the importance of the process and the amount of free memory available to release the process. The importance of a process is determined by the importance index oom _ adj. In the out of memory (OOM) refers to the internal of the system, because of the system memory pressure, the system will choose to protect some system processes, and drop some other processes, and release the memory. The file associated with the OOM is OOM _ adj under directory/proc/pid/OOM _ adj. oom _ adj can be understood to be a factor in the range of-17 to 15. Setting to 0 means never kill, the larger the remaining case value the easier it is to kill.
Android divides programs into the following categories, for example, in order of decreasing importance:
the foreground _ APP, oom _ adj is 0, which indicates a foreground program and can be understood as a program in use;
VISIBLE _ APP, oom _ adj ═ 1, representing a program VISIBLE to the user;
SECONDARY _ SERVER, oom _ adj ═ 2, which indicates that the background service, say, QQ will run the service in the background;
HOME _ APP, oom _ adj ═ 4, which indicates HOME, which is the host interface;
HIDDEN _ APP, oom _ adj ═ 7, representing a HIDDEN program;
CONTENT _ PROVIDER, oom _ adj ═ 14, representing the CONTENT PROVIDER;
EMPTY _ APP, oom _ adj ═ 15, represents an EMPTY program, providing neither service nor content.
(2) The second way is: acquiring the process information of the application program which is running by the system, and determining the process priority of each application program according to the value of the importance attribute in the process information of the running application program.
Specifically, a running program in the android program is obtained, and the obtained RunningAppProcessInfo object is used as a standard and a threshold value for judging the priority according to the value of the import attribute.
In the android system, the constant imophortance (importance attribute) in RunningAppProcessInfo (running application process information) represents the importance of this app process, because when the system is reclaimed, the process is reclaimed according to imophortance. For example:
public static final int IMPORTANCE _ BACKGROUND 400 represents a BACKGROUND program;
public static final int IMPORTANCE _ EMPTY 500 represents an EMPTY process;
public static final int IMPORTANCE _ FOREGROUND 100 represents the program that can obtain focus at the forefront of the screen;
public static final int IMPORTANCE _ SERVICE 300 represents a program in a SERVICE;
the public static fine int initial _ VISIBLE 200 indicates a program that cannot acquire focus at the front end of the screen.
Specifically, an example of obtaining the import attribute value of the RunningAppProcessInfo object is as follows:
firstly, an object instance of the ActivityManager is acquired, and a getSystemservice (ACTIVITY _ SERVICE) is called to return an instance of the ActivityManager; after obtaining the instance, calling its getreporting appprocesses () method may return a List with the data type of activitymanager. Then, traversing the List, and obtaining the share-related information from each item RunningAppProcessInfo in the List.
For example, a ListAdap is used to bind to a ListView for display, and the implementation code is as follows:
as can be seen, the "public int opportunity" (the importance level of the process in the system) in the code is the opportunity attribute value to be acquired in the embodiment of the present invention.
S103: and closing the process with lower priority or setting the process into a dormant state according to a preset process management rule.
Among them, there are many ways for the process management rule, such as: directly closing the process with the priority lower than the lowest priority threshold; or after the terminal is locked for a preset time, setting the processes corresponding to the user application program and the system application program with the priority lower than the lowest priority threshold into a dormant state. For example, after the user locks the screen for 1 minute, the software of the user, the system software and the software of the user, which are manually set to be in the forced dormancy, all finish the process, and the memory occupation of the mobile phone and the electricity consumption during the screen locking period are greatly reduced on the premise of not influencing the important software process and service.
In addition, the embodiment of the invention can also provide a mode of manual calibration for the user to supplement the process management. Specifically, a visual interface is provided for the user to accept manual calibration of the process management by the user. Manual calibration of process management includes: according to the priority of each process, performing the operations of temporary non-dormancy, dormancy after screen locking or direct dormancy on the process; or, according to the selection of the user, the screen locking dormancy is executed on the process of the specific application program or the background running state is kept.
For example, the user can view which software is higher in priority (not dormant for the moment), which software is lower in priority (dormant after locking the screen), and which software is not running in the background (dormant). And the software which is classified into 'sleep after screen locking' because of the judgment error can neglect the sleep, so that the software is always kept in a background running state. And the software which is not classified into 'sleep after screen locking' because of the judgment error can also be forced to sleep, so that the software can be finished after each screen locking.
In addition, the scheme can be optimized in an application program white list mode and an application program black list mode. In one case, whether the application program corresponding to the process is included in a preset application program white list is judged, and if yes, the process is kept in a running state. This situation may ensure that an application that is of lower priority but is of particular interest to the user or system, such as a video-watching application, remains running, and if the user wishes to continue running after the screen is locked to complete an offline download, the application may be added to the application white list so that the application will not be dormant even if the application has a lower priority for the corresponding process. In another case, whether the application program corresponding to the process is included in a preset application program blacklist is judged, and if yes, the process is set to be in a dormant state. This may ensure that applications that may be high priority but are specifically set to sleep by a user or system do not consume memory.
Therefore, the embodiment of the invention closes or sleeps the process with lower priority by taking the process priority as a basis, and preferably sleeps the process with lower priority after the screen is locked, so that the memory space is saved and the power consumption is reduced. In addition, under the double judgment logic of automatic intelligent identification and manual calibration of the user, the method can ensure that the useful background process required by the user is never automatically dormant and other background processes not required by the user are all automatically dormant. Therefore, the long-term low memory occupation and low power consumption of the android mobile phone system are kept.
Corresponding to the method, the invention also provides a device for managing the process of the application program. The apparatus can be realized by hardware, software or a combination of hardware and software. The device may refer to a functional module inside the terminal, or may refer to the terminal itself, as long as the terminal includes a function to implement the device. The operating system of the terminal comprises a framework layer and an application program layer.
FIG. 2 shows a schematic diagram of an apparatus for managing processes of an application according to an embodiment of the invention. The device includes:
a broadcast message receiving unit 201, configured to receive a system broadcast message, and determine whether the terminal is in a screen-off state;
a process priority acquiring unit 202, configured to acquire, when it is determined that the screen is in a closed state, a priority of a process corresponding to each application program through an application program call interface;
the process management unit 203 is configured to shut down or set a process with a lower priority to a dormant state according to a preset process management rule.
Preferably, the process priority obtaining unit 202 is specifically configured to: and searching the process importance index of each application program through the process identification of each application program, and determining the process priority of each application program according to the process importance index.
Preferably, the process priority obtaining unit 202 is specifically configured to: acquiring the process information of the application program which is running by the system, and determining the process priority of each application program according to the value of the importance attribute in the running application program process information.
Preferably, the process management rule includes: and after the terminal is locked for a preset time, setting the processes corresponding to the user application program and the system application program with the priority lower than the lowest priority threshold into a dormant state.
Preferably, a manual calibration unit 204 is further included for providing a visual interface to the user and accepting manual calibration of the process management by the user.
Preferably, the manual calibration unit 204 is specifically configured to: according to the priority of each process, performing the operations of temporary non-dormancy, dormancy after screen locking or direct dormancy on the process; or, according to the selection of the user, the screen locking dormancy is executed on the process of the specific application program or the background running state is kept.
Preferably, the apparatus further comprises: the list determining unit 205 determines whether the application corresponding to the process is included in a preset application white list, and if so, instructs the process managing unit 203 to maintain the process in an operating state.
Preferably, the apparatus further comprises: a list determining unit 205, configured to determine whether an application corresponding to a process is included in a preset application blacklist, and if so, instruct the process management unit 203 to set the process in a dormant state.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of an apparatus for managing the processes of an application according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The present invention provides the following scheme:
a1, a method for managing a process of an application, comprising:
receiving system broadcast information, and determining whether the terminal is in a screen closing state;
when the screen is determined to be in a closed state, acquiring the priority of the process corresponding to each application program through an application program calling interface; the acquiring the priority of the process corresponding to each application program comprises: traversing the process identification of each application program, finding the process importance index of each application program, and determining the process priority of each application program according to the process importance index;
and closing or setting the process with lower priority to be in a dormant state according to a preset process management rule.
A2, the method according to A1, wherein the process importance index refers to a factor under a memory overflow mechanism in an operating system.
A3, the method as in A2, the process importance index refers to a factor OOM _ adj under an OOM mechanism in an Android operating system.
A4, the method of A1, the process management rule comprising: and after the terminal is locked for a preset time, setting the processes corresponding to the user application program and the system application program with the priority lower than the lowest priority threshold into a dormant state.
A5, the method of a1, further comprising: and providing a visual interface for a user and accepting manual calibration of the process management by the user.
A6, the method of A5, the manual calibration of process management comprising:
according to the priority of each process, performing the operations of temporary non-dormancy, dormancy after screen locking or direct dormancy on the process; or,
and according to the selection of the user, performing screen locking dormancy on the process of the specific application program or keeping a background running state.
A7, the method of a1, further comprising:
and judging whether the application program corresponding to the process is contained in a preset application program white list or not, and if so, keeping the process in a running state.
A8, the method of a1, further comprising:
and judging whether the application program corresponding to the process is contained in a preset application program blacklist, if so, setting the process to be in a dormant state.
B9, an apparatus for managing a process of an application, comprising:
a broadcast message receiving unit for receiving system broadcast messages and determining whether the terminal is in a screen-off state;
the process priority acquiring unit is used for acquiring the priority of the process corresponding to each application program through the application program calling interface when the screen is determined to be in the closed state; the process priority acquiring unit is specifically configured to: finding the process importance index of each application program through the process identification of each application program, and determining the process priority of each application program according to the process importance index;
and the management unit is used for closing or setting the process with lower priority to be in a dormant state according to a preset process management rule.
B10, the apparatus according to B9, wherein the process importance index refers to a factor under a memory overflow mechanism in an operating system.
B11, the apparatus according to B10, wherein the process importance index refers to a factor OOM _ adj under an OOM mechanism in an Android system.
B12, the apparatus as in B9, the process management rule comprising: and after the terminal is locked for a preset time, setting the processes corresponding to the user application program and the system application program with the priority lower than the lowest priority threshold into a dormant state.
B13, the apparatus of B9, further comprising: and the manual calibration unit is used for providing a visual interface for a user and receiving the manual calibration of the process management by the user.
B14, the device of B13, the manual calibration unit is specifically used for: according to the priority of each process, performing the operations of temporary non-dormancy, dormancy after screen locking or direct dormancy on the process; or, according to the selection of the user, the screen locking dormancy is executed on the process of the specific application program or the background running state is kept.
B15, the apparatus of B9, further comprising: and the list judgment unit is used for judging whether the application program corresponding to the process is contained in a preset application program white list or not, and if so, indicating the process management unit to keep the process in the running state.
B16, the apparatus of B9, further comprising: and the list judgment unit is used for judging whether the application program corresponding to the process is contained in a preset application program blacklist or not, and if so, indicating the process management unit to set the process to be in a dormant state.

Claims (16)

1. A method for managing the process of an application program is characterized in that an operating system of a terminal where the application program is located comprises an application program layer and a system framework layer, and a handle used for receiving interprocess communication data in a system service of the system framework layer is replaced by a false handle of the application program layer by injecting a system service program, so that the false handle is prior to the system service to execute the method, and the method comprises the following steps:
the application program layer registers and receives a system screen closing broadcast message, and determines whether the terminal is in a screen closing state;
when the screen is determined to be in a closed state, the application program layer acquires the priority of the process corresponding to each application program from the system framework layer through an application program calling interface; the acquiring the priority of the process corresponding to each application program comprises: traversing the process identification of each application program, finding the process importance index of each application program, and determining the process priority of each application program according to the process importance index;
and the application program layer closes or sets the process with lower priority to be in a dormant state according to a preset process management rule.
2. The method of claim 1, wherein the process importance index is a factor under a memory overflow mechanism in an operating system.
3. The method of claim 2, wherein the process importance index refers to a factor OOM _ adj under an OOM mechanism in an Android operating system.
4. The method of claim 1, wherein the process management rule comprises: and after the terminal is locked for a preset time, setting the processes corresponding to the user application program and the system application program with the priority lower than the lowest priority threshold into a dormant state.
5. The method of claim 1, further comprising: and providing a visual interface for a user and accepting manual calibration of the process management by the user.
6. The method of claim 5, wherein the manual calibration of process management comprises:
according to the priority of each process, performing the operations of temporary non-dormancy, dormancy after screen locking or direct dormancy on the process; or,
and according to the selection of the user, performing screen locking dormancy on the process of the specific application program or keeping a background running state.
7. The method of claim 1, further comprising:
and judging whether the application program corresponding to the process is contained in a preset application program white list or not, and if so, keeping the process in a running state.
8. The method of claim 1, further comprising:
and judging whether the application program corresponding to the process is contained in a preset application program blacklist, if so, setting the process to be in a dormant state.
9. An apparatus for managing a process of an application, wherein an operating system of a terminal where the application is located includes an application layer and a system framework layer, and a handle for receiving inter-process communication data in a system service of the system framework layer is replaced by a dummy handle of the application layer by injecting a system service program, so that the dummy handle is executed in preference to the system service, the apparatus comprising:
a broadcast message receiving unit, configured to register and receive a system off-screen broadcast message in the application layer, and determine whether the terminal is in a screen off state;
the process priority acquiring unit is used for acquiring the priority of the process corresponding to each application program through an application program calling interface in the application program layer when the screen is determined to be in the closed state; the process priority acquiring unit is specifically configured to: finding the process importance index of each application program through the process identification of each application program, and determining the process priority of each application program according to the process importance index;
and the process management unit is used for closing or setting the process with lower priority to be in a dormant state at the application program layer according to a preset process management rule.
10. The apparatus of claim 9, wherein the process importance index is a factor under a memory overflow mechanism in an operating system.
11. The apparatus of claim 10, wherein the process importance index refers to a factor OOM _ adj under an OOM mechanism in an Android system.
12. The apparatus of claim 9, wherein the process management rule comprises: and after the terminal is locked for a preset time, setting the processes corresponding to the user application program and the system application program with the priority lower than the lowest priority threshold into a dormant state.
13. The apparatus of claim 9, further comprising: and the manual calibration unit is used for providing a visual interface for a user and receiving the manual calibration of the process management by the user.
14. The apparatus of claim 13, wherein the manual calibration unit is specifically configured to: according to the priority of each process, performing the operations of temporary non-dormancy, dormancy after screen locking or direct dormancy on the process; or, according to the selection of the user, the screen locking dormancy is executed on the process of the specific application program or the background running state is kept.
15. The apparatus of claim 9, further comprising: and the list judgment unit is used for judging whether the application program corresponding to the process is contained in a preset application program white list or not, and if so, indicating the process management unit to keep the process in the running state.
16. The apparatus of claim 9, further comprising: and the list judgment unit is used for judging whether the application program corresponding to the process is contained in a preset application program blacklist or not, and if so, indicating the process management unit to set the process to be in a dormant state.
CN201410465567.6A 2014-09-12 2014-09-12 The method and device being managed to the process of application program Active CN104199669B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410465567.6A CN104199669B (en) 2014-09-12 2014-09-12 The method and device being managed to the process of application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410465567.6A CN104199669B (en) 2014-09-12 2014-09-12 The method and device being managed to the process of application program

Publications (2)

Publication Number Publication Date
CN104199669A CN104199669A (en) 2014-12-10
CN104199669B true CN104199669B (en) 2017-12-15

Family

ID=52084966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410465567.6A Active CN104199669B (en) 2014-09-12 2014-09-12 The method and device being managed to the process of application program

Country Status (1)

Country Link
CN (1) CN104199669B (en)

Families Citing this family (39)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461741B (en) * 2014-12-15 2017-05-24 北京奇虎科技有限公司 Graphics device interface based computing device optimizing method and device
CN104486510A (en) * 2014-12-16 2015-04-01 上海斐讯数据通信技术有限公司 Method for reducing power consumption of intelligent terminal, and system for reducing power consumption of intelligent terminal
CN108228321B (en) * 2014-12-16 2021-08-10 北京奇虎科技有限公司 Android system application closing method and device
CN104461725B (en) * 2014-12-30 2018-05-08 小米科技有限责任公司 The method and device for controlling application process to start
US10514950B2 (en) 2015-04-14 2019-12-24 Huawei Technologies Co., Ltd. Interface switching method, apparatus, and device
CN104866342A (en) * 2015-05-07 2015-08-26 北京数字天域科技有限责任公司 Method and device for simultaneously starting multiple same applications on intelligent terminal
CN105094945A (en) * 2015-07-01 2015-11-25 北京奇虎科技有限公司 Method, equipment and system for virtualization platform thread control
CN105159776B (en) * 2015-08-03 2019-02-19 中科创达软件股份有限公司 Process handling method and device
CN105338177B (en) * 2015-09-30 2018-10-19 小米科技有限责任公司 message delay broadcasting method and device
CN105278370B (en) * 2015-09-30 2018-03-20 小米科技有限责任公司 Energy-saving mode open method and device
CN106897125A (en) * 2015-12-18 2017-06-27 联发科技(新加坡)私人有限公司 Smart machine and its management method of service or application
CN105468426A (en) * 2016-01-05 2016-04-06 珠海市魅族科技有限公司 Application freezing method and terminal
CN105867771A (en) * 2016-04-11 2016-08-17 广东欧珀移动通信有限公司 Mobile terminal and method and device for turning off application programs
CN106095054B (en) * 2016-05-31 2019-02-12 Oppo广东移动通信有限公司 A kind of method for closing and device of application program
CN106095412B (en) * 2016-05-31 2019-07-16 Oppo广东移动通信有限公司 A kind of method for closing and device of application program
CN106155788A (en) * 2016-06-28 2016-11-23 宇龙计算机通信科技(深圳)有限公司 A kind of application program freezing method and terminal unit
CN106201674A (en) * 2016-06-28 2016-12-07 宇龙计算机通信科技(深圳)有限公司 Defreezing method, thawing apparatus and terminal
CN107577479B (en) * 2016-07-01 2021-11-02 深圳富泰宏精密工业有限公司 Electronic device and semi-sleep control method thereof
CN106250223B (en) * 2016-07-28 2020-01-10 宇龙计算机通信科技(深圳)有限公司 Background process management method and terminal equipment
CN106250163B (en) * 2016-08-15 2019-11-12 宇龙计算机通信科技(深圳)有限公司 A kind of application control method and device
CN107786601B (en) 2016-08-29 2020-03-17 腾讯科技(深圳)有限公司 Information processing method, terminal and server
CN106648855B (en) * 2016-11-21 2020-04-10 武汉斗鱼网络科技有限公司 Method and device for controlling application program of terminal
CN106850458B (en) * 2017-03-10 2019-06-07 Oppo广东移动通信有限公司 Broadcast the message the method, apparatus and terminal being lined up
CN106970696B (en) * 2017-03-24 2020-04-24 联想(北京)有限公司 Electronic equipment management method and electronic equipment
CN106951318A (en) * 2017-03-24 2017-07-14 联想(北京)有限公司 The management method and electronic equipment of a kind of electronic equipment background process
CN108804207A (en) * 2017-04-28 2018-11-13 珠海全志科技股份有限公司 A kind of process management-control method based on android system
CN107145215B (en) * 2017-05-06 2019-09-27 维沃移动通信有限公司 A kind of background application method for cleaning and mobile terminal
CN108984212B (en) * 2017-05-31 2021-06-25 腾讯科技(深圳)有限公司 Method for closing process and electronic equipment
CN107357655A (en) * 2017-06-22 2017-11-17 努比亚技术有限公司 A kind of processing method of process, terminal and computer-readable recording medium
CN107423123A (en) * 2017-07-25 2017-12-01 广东欧珀移动通信有限公司 Method for scheduling task, device, storage medium and electronic equipment
CN107479954B (en) 2017-07-31 2019-10-29 Oppo广东移动通信有限公司 Process management method, device, storage medium and electronic equipment
CN107566619A (en) * 2017-08-18 2018-01-09 深圳天珑无线科技有限公司 A kind of foreground application quickly receives the method, storage device and terminal of broadcast
CN108021220A (en) * 2017-10-25 2018-05-11 努比亚技术有限公司 A kind of terminal applies control method, terminal and computer-readable recording medium
CN108416591B (en) * 2018-02-28 2021-11-02 四川新网银行股份有限公司 Method for realizing transaction active current limiting through API (application program interface) in financial transaction
CN108509263A (en) * 2018-03-28 2018-09-07 深圳酷泰丰科技有限公司 A kind of background process management method and system
CN111666120A (en) * 2019-03-07 2020-09-15 阿里巴巴集团控股有限公司 Terminal control method and device
CN111027055A (en) * 2019-03-19 2020-04-17 哈尔滨安天科技集团股份有限公司 Method and device for hiding android system process and storage device
CN112748957A (en) * 2019-10-31 2021-05-04 北京沃东天骏信息技术有限公司 Application program processing method, device and system
CN116567132A (en) * 2022-01-28 2023-08-08 荣耀终端有限公司 Power consumption control method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092689A (en) * 2013-01-10 2013-05-08 深圳市金立通信设备有限公司 Method and terminal of process management
CN103092691A (en) * 2013-01-23 2013-05-08 广东欧珀移动通信有限公司 Process management method and management unit of Android system
CN103345397A (en) * 2013-07-11 2013-10-09 北京奇虎科技有限公司 Method and device for cleaning processes of mobile terminal
CN103781057A (en) * 2014-01-08 2014-05-07 北京奇虎科技有限公司 Method and device for silently downloading upgrade package

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092689A (en) * 2013-01-10 2013-05-08 深圳市金立通信设备有限公司 Method and terminal of process management
CN103092691A (en) * 2013-01-23 2013-05-08 广东欧珀移动通信有限公司 Process management method and management unit of Android system
CN103345397A (en) * 2013-07-11 2013-10-09 北京奇虎科技有限公司 Method and device for cleaning processes of mobile terminal
CN103781057A (en) * 2014-01-08 2014-05-07 北京奇虎科技有限公司 Method and device for silently downloading upgrade package

Also Published As

Publication number Publication date
CN104199669A (en) 2014-12-10

Similar Documents

Publication Publication Date Title
CN104199669B (en) The method and device being managed to the process of application program
CN104199731B (en) The method and device being managed to the process of application program
CN104317373B (en) A kind of method and apparatus of mobile terminal cooling
US11914446B2 (en) Electronic device control method and apparatus, and electronic device
CN104516806B (en) The testing result methods of exhibiting and system of the power consumption information of mobile terminal
CN106774786B (en) Power consumption control method and device
KR102395868B1 (en) Electronic device and applacation controlling method thereof
CN107679718B (en) List allocation method, apparatus and computer-readable storage medium
CN106844026B (en) Method and system for cleaning terminal equipment process
WO2020103017A1 (en) Power-on process control method, power-on process control apparatus and terminal device
US20170177406A1 (en) Methods for managing a service or application for a smart device and a smart device utilizing the same
WO2016028988A1 (en) Managing applications for power conservation
US9819905B1 (en) Video communication sessions between whitelisted devices
CN107943269B (en) Scheduling job control method, device, terminal equipment and storage medium
CN109656440B (en) Application icon display method, device and medium
CN107368343B (en) Terminal starting method based on android system, terminal and storage medium
CN108307236A (en) A kind of method, storage medium and the smart television of smart television memory optimization
WO2018099253A1 (en) Self-starting method and device
CN104199691A (en) Method and device for automatically starting APK in turn-on process based on Android platform
CN102480557B (en) BREW (Binary Runtime Environment for Wireless) platform-based mobile phone application program management method and system
CN105337783B (en) Monitor the method and device of communication equipment non-normal consumption flow
WO2016115762A1 (en) Power saving mode control method and device for multiple operating systems, and terminal
CN110740088B (en) Method, device, terminal and medium for recommending and adding social resources
CN106022108A (en) Synchronous management method and terminal device
CN105893087A (en) Application program starting method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220708

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co., Ltd