CN107402808B - Process management method, device, storage medium and electronic equipment - Google Patents
Process management method, device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN107402808B CN107402808B CN201710643029.5A CN201710643029A CN107402808B CN 107402808 B CN107402808 B CN 107402808B CN 201710643029 A CN201710643029 A CN 201710643029A CN 107402808 B CN107402808 B CN 107402808B
- Authority
- CN
- China
- Prior art keywords
- priority
- background
- application
- running
- level
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 264
- 238000007726 management method Methods 0.000 title claims abstract description 46
- 230000003247 decreasing effect Effects 0.000 claims abstract description 21
- 238000012545 processing Methods 0.000 claims description 8
- 230000008014 freezing Effects 0.000 claims description 7
- 238000007710 freezing Methods 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 13
- 230000006870 function Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 2
- 238000004886 process control Methods 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000011982 device technology Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephone Function (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a process management method, a process management device, a storage medium and electronic equipment. The method is applied to the electronic equipment and comprises the following steps: when the system occupancy rate of the electronic equipment exceeds a first threshold value, acquiring a main priority of the application running in the background, and a parent process and a child process of the application running in the background; if the main priority of the application running in the background is the first-level main priority, keeping running the parent process and the child process of the application running in the background; if the main priority of the application running in the background is the second-level main priority, keeping the parent process of the application running in the background running in running, and setting the child process of the application running in the background in a non-running state; and if the main priority of the application running in the background is the third-level main priority, closing the parent process and the child process of the application running in the background, wherein the priority levels of the first-level main priority, the second-level main priority and the third-level main priority are sequentially decreased. The running speed of the system is improved, and the corresponding process can respond faster.
Description
Technical Field
The invention relates to the technical field of mobile equipment, in particular to a process management method, a process management device, a storage medium and electronic equipment.
Background
With the rapid development of electronic device technology, the functions of electronic devices are stronger and more applications are more and more.
For background running applications, the background running applications correspond to a parent process and a child process, and when a large number of parent processes and child processes run simultaneously, the problems of CPU operation blockage, slow running speed of the processes and slow response are caused.
Disclosure of Invention
The embodiment of the invention provides a process management method, a process management device, a storage medium and electronic equipment, which can effectively manage processes and improve the operation efficiency of a system.
In a first aspect, an embodiment of the present invention provides a process management method applied to an electronic device, where the method includes:
when the system occupancy rate of the electronic equipment exceeds a first threshold value, acquiring a main priority of a background running application, and a parent process and a child process of the background running application;
if the main priority of the background running application is the first-level main priority, keeping a parent process and a child process of the background running application running;
if the main priority of the background running application is the second-level main priority, keeping the parent process of the background running application running, and setting the child process of the background running application in a non-running state;
if the main priority of the application running in the background is the third-level main priority, closing the parent process and the child process of the application running in the background;
and the priority levels of the first level main priority, the second level main priority and the third level main priority are sequentially decreased.
In a second aspect, an embodiment of the present invention further provides a process management apparatus, including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring the main priority of a background running application and a parent process and a child process of the background running application when the system occupancy rate of the electronic equipment exceeds a first threshold;
the processing module is used for keeping a parent process and a child process of the background running application running if the main priority of the background running application is a first-level main priority; if the main priority of the background running application is the second-level main priority, keeping the parent process of the background running application running, and setting the child process of the background running application in a non-running state; if the main priority of the application running in the background is the third-level main priority, closing the parent process and the child process of the application running in the background; and the priority levels of the first level main priority, the second level main priority and the third level main priority are sequentially decreased.
In a third aspect, an embodiment of the present invention further provides a storage medium, where a plurality of instructions are stored, where the instructions are adapted to be loaded by a processor to execute steps of implementing any one of the process management methods provided in the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides an electronic device, including:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program codes stored in the memory to execute any process management method provided by the embodiment of the invention.
According to the process management method, the device, the storage medium and the terminal, firstly, when the system occupancy rate of the electronic equipment exceeds a first threshold value, the main priority of the application running in the background is obtained, and the parent process and the child process of the application running in the background are obtained; if the main priority of the application running in the background is the first-level main priority, keeping running the parent process and the child process of the application running in the background; if the main priority of the application running in the background is the second-level main priority, keeping the parent process of the application running in the background running in running, and setting the child process of the application running in the background in a non-running state; and if the main priority of the application running in the background is the third-level main priority, closing the parent process and the child process of the application running in the background, wherein the priority levels of the first-level main priority, the second-level main priority and the third-level main priority are sequentially decreased. The running speed of the system is improved, and the corresponding process can respond faster.
Drawings
The technical solution and other advantages of the present invention will become apparent from the following detailed description of specific embodiments of the present invention, which is to be read in connection with the accompanying drawings.
Fig. 1 is a schematic diagram of an electronic device framework according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of a parent process and a child process in the process management method according to the embodiment of the present invention.
Fig. 3 is another schematic diagram of a parent process and a child process in the process management method according to the embodiment of the present invention.
Fig. 4 is a flowchart of a process management method according to an embodiment of the present invention.
Fig. 5 is another flowchart of a process management method according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of a process management device according to an embodiment of the present invention.
Fig. 7 is another schematic structural diagram of a process management device according to an embodiment of the present invention.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Fig. 9 is another schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first" and "second", etc. in the present invention are used for distinguishing different objects, not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. A process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to the listed steps or modules but may alternatively include other steps or modules not listed or inherent to such process, method, article, or apparatus.
The embodiment of the invention provides a process management method, a process management device, a storage medium and electronic equipment.
Referring to fig. 1, fig. 1 is a schematic view of an electronic device framework according to an embodiment of the present invention. The method comprises the steps that the electronic equipment obtains system occupancy rate, and when the system occupancy rate of the electronic equipment exceeds a first threshold value, a local database obtains a main priority of a background running application and a parent process and a child process of the background running application; if the main priority of the application running in the background is the first-level main priority, keeping running the parent process and the child process of the application running in the background; if the main priority of the application running in the background is the second-level main priority, keeping the parent process of the application running in the background running in running, and setting the child process of the application running in the background in a non-running state; if the main priority of the application running in the background is the third-level main priority, closing the parent process and the child process of the application running in the background; the priority levels of the first level main priority, the second level main priority and the third level main priority are sequentially decreased. The local database is arranged in the electronic equipment, and can also be arranged in a local server and a cloud server.
Referring to fig. 2 and fig. 3, fig. 2 is a schematic diagram of a parent process and a child process in a process management method according to an embodiment of the present invention. Fig. 3 is another schematic diagram of a parent process and a child process in the process management method according to the embodiment of the present invention. As shown in the figure, the application running in the background may correspond to one parent process or a plurality of parent processes, and one parent process may correspond to one child process or a plurality of child processes.
In the embodiment of the present invention, the description will be made from the perspective of a process management apparatus, which may be integrated in an electronic device having an arithmetic capability, such as a tablet, a PC, or a mobile phone, which has a storage unit and a microprocessor.
Referring to fig. 4, fig. 4 is a flowchart of a process management method according to an embodiment of the present invention. The process management method may include:
in step S101, when the system occupancy rate of the electronic device exceeds a first threshold, a main priority of the application running in the background, and a parent process and a child process of the application running in the background are obtained.
Specifically, the system occupancy may be obtained by the electronic device in real time, that is, the current system occupancy may be obtained at intervals of a period of time, where the period of time may be a millisecond, a second, or a classification, such as 5 milliseconds, 5 seconds, 5 minutes, or the like. Therefore, the process can be well managed according to the current system occupancy rate. The system occupancy rate may be a CPU usage rate, a memory occupancy rate, or a combination of the CPU usage rate and the memory occupancy rate, for example, the CPU usage rate and the memory occupancy rate are calculated by half, or the system occupancy rate or the memory occupancy rate is set by a user.
The first threshold value can be automatically set by a system, is referred to by the system operation pause, and can also be set by a user. The first threshold may specifically be 60%, 70%, etc. The system occupancy rate may be a CPU usage rate, a memory occupancy rate, or a combination of the CPU usage rate and the memory occupancy rate, for example, the CPU usage rate and the memory occupancy rate are calculated by half, or the system occupancy rate or the memory occupancy rate is set by a user.
And acquiring the main priority of the application running in the background, and the parent process and the child process of the application running in the background. The main priority of the application running in the background can be set by the system, for example, the main priority is set according to the type of the application running in the background. And acquiring the main priority of the background running application, and acquiring all parent processes and child processes of the background running application.
In some embodiments, before step S101, the method may further comprise: the method comprises the steps of firstly acquiring user use habit data, and setting a main priority of background running application according to the user use habit data. The user use habit data comprises the use frequency, the total use duration, the last use interval, the use times in the latest time period and the like of the application running in the background, and then the main priority is set according to one or more of the use frequency, the use total duration, the last use interval, the use times in the latest time period and the like. The user usage habit data may also include user hand habits, such as right-handed, left-handed, and both hands-handed.
In some embodiments, before step S101, the method may further comprise: the method comprises the steps of obtaining system time and the current position of the electronic equipment, and setting a main priority and/or a sub-priority of a background running application according to the system time and the current position. For example, the background running application required in each time period is different, and the corresponding main priority is different in the working road on-duty time period, the working road off-duty time period, the night home rest time period, the noon company rest time period, the working company time period, the weekend home time period, and the weekend outgoing time period. The method comprises the steps of setting a main priority with a higher priority for music background running applications, game background running applications and the like in an on-duty time period and an off-duty time period, and setting a main priority with a higher priority for office software background running applications, mailbox background running applications and the like in an on-duty time period.
In step S102, if the main priority of the application running in the background is the first-level main priority, the parent process and the child process of the application running in the background are kept running. The first level master priority, with the highest priority, both parent and child processes remain running.
In step S103, if the primary priority of the application running in the background is the secondary primary priority, the parent process of the application running in the background is kept running, and the child process of the application running in the background is set in the non-running state. A second level of primary priority, one level lower than the first level of primary priority, maintains the parent process running while the child process is set to a non-running state.
Specifically, if the sub-optimal level of the application running in the background is the first-level sub-optimal level, the parent process of the application running in the background is kept running, and the child process of the application running in the background is frozen.
And if the sub-optimal level of the application running in the background is the second sub-optimal level, keeping the parent process of the application running in the background running, and clearing codes in the child process of the application running in the background to enable the child process to enter a copy-on-write state.
And if the second-level best priority of the application running in the background is the third-level second-level best priority, keeping the parent process of the application running in the background running, and closing the child process of the application running in the background, wherein the priority levels of the first-level second-level best priority, the second-level best priority and the third-level second-level best priority are sequentially decreased progressively.
Wherein the second level primary priority is further divided into a plurality of secondary priorities. The secondary priority may be set together when the primary priority is set, or may be set separately in a manner similar to the primary priority setting.
In step S104, if the main priority of the application running in the background is the third level main priority, closing the parent process and the child process of the application running in the background; the priority levels of the first level main priority, the second level main priority and the third level main priority are sequentially decreased. The third level master priority, lowest priority, parent and child processes are all closed.
In summary, first, when the system occupancy rate of the electronic device exceeds a first threshold, acquiring a main priority of the application running in the background, and a parent process and a child process of the application running in the background; if the main priority of the application running in the background is the first-level main priority, keeping running the parent process and the child process of the application running in the background; if the main priority of the application running in the background is the second-level main priority, keeping the parent process of the application running in the background running in running, and setting the child process of the application running in the background in a non-running state; and if the main priority of the application running in the background is the third-level main priority, closing the parent process and the child process of the application running in the background, wherein the priority levels of the first-level main priority, the second-level main priority and the third-level main priority are sequentially decreased. The running speed of the system is improved, and the corresponding process can respond faster.
Referring to fig. 5, fig. 5 is another flowchart of a process management method according to an embodiment of the invention. Step S201, step S202, step S203, and step S204 in fig. 5 are the same as step S101, step S102, step S103, and step S104 in fig. 3, respectively, and are not repeated herein.
In step S2021, a preset time period threshold is acquired. The preset time period threshold may be set automatically by the system or manually by the user, and may be 1 hour, half hour, or the like.
In step S2022, if the number of times of calling the background running application is less than the first preset number threshold within the preset time period threshold, and if the number of times of calling the background running application is less than 3, reducing the primary priority or the secondary priority of the background running application; if the calling times of the background running application are greater than a second preset time threshold within a preset time period threshold, if the calling times are greater than 5, the main priority or the sub-optimal priority of the background running application is improved.
Specifically, if the background running application is not called within a preset time period threshold, the main priority of the background running application is reduced; if the calling times of the application running in the background are less than a first preset time threshold within a preset time period threshold, if the calling times are less than 3, the suboptimal priority of the application running in the background is reduced; if the calling times of the background running application are greater than a second preset time threshold within a preset time period threshold, if the calling times are greater than 5 times, the sub-optimal priority of the background running application is improved, and if the calling times are the sub-optimal priority of the first level, the main priority of the background running application is improved.
It should be noted that, in some embodiments, the primary priority and the secondary priority may be a priority of the same level, and specifically, the process control method includes:
when the system occupancy rate of the electronic equipment exceeds a first threshold value, acquiring the priority of the background running application, and a parent process and a child process of the background running application;
if the priority of the application running in the background is the first-level priority, keeping running the parent process and the child process of the application running in the background;
if the priority of the background running application is the second-level priority, keeping the parent process of the background running application running, and freezing the child process of the background running application;
if the priority of the background running application is the third-level priority, keeping the parent process of the background running application running, and clearing codes in the child process of the background running application to enable the child process to enter a copy-on-write state;
if the priority of the application running in the background is the fourth-level priority, keeping the parent process of the application running in the background running, and closing the child process of the application running in the background;
and if the priority of the application running in the background is the fifth priority, closing the parent process and the child process of the application running in the background, wherein the priority levels of the first priority, the second priority, the third priority, the fourth priority and the fifth priority are sequentially decreased.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a process management device according to an embodiment of the present invention. The process management device 300 according to the embodiment of the present invention includes a first obtaining module 301 and a processing module 302.
The first obtaining module 301 is configured to obtain a main priority of the application running in the background, and a parent process and a child process of the application running in the background when the system occupancy rate of the electronic device exceeds a first threshold.
It is understood that the system occupancy may be obtained by the electronic device in real time, that is, the current system occupancy may be obtained at intervals, where the interval may be in milliseconds, seconds, or in minutes, such as 5 milliseconds, 5 seconds, 5 minutes, or the like. Therefore, the process can be well managed according to the current system occupancy rate. The system occupancy rate may be a CPU usage rate, a memory occupancy rate, or a combination of the CPU usage rate and the memory occupancy rate, for example, the CPU usage rate and the memory occupancy rate are calculated by half, or the system occupancy rate or the memory occupancy rate is set by a user.
The first threshold value can be automatically set by a system, is referred to by the system operation pause, and can also be set by a user. The first threshold may specifically be 60%, 70%, etc. The system occupancy rate may be a CPU usage rate, a memory occupancy rate, or a combination of the CPU usage rate and the memory occupancy rate, for example, the CPU usage rate and the memory occupancy rate are calculated by half, or the system occupancy rate or the memory occupancy rate is set by a user.
The first obtaining module 301 is configured to obtain a main priority of the application running in the background, and a parent process and a child process of the application running in the background. The main priority of the application running in the background can be set by the system, for example, the main priority is set according to the type of the application running in the background. And acquiring the main priority of the background running application, and acquiring all parent processes and child processes of the background running application.
In some embodiments, the apparatus may further include a third acquisition module. The third obtaining module is used for obtaining the user use habit data and setting the main priority of the background running application according to the user use habit data. The user use habit data comprises the use frequency, the total use duration, the last use interval, the use times in the latest time period and the like of the application running in the background, and then the main priority is set according to one or more of the use frequency, the use total duration, the last use interval, the use times in the latest time period and the like. The user usage habit data may also include user hand habits, such as right-handed, left-handed, and both hands-handed.
In some embodiments, the apparatus may further include a fourth acquisition module. The fourth obtaining module is used for obtaining the system time and the current position of the electronic equipment, and setting the main priority and/or the sub-priority of the background running application according to the system time and the current position. For example, the background running application required in each time period is different, and the corresponding main priority is different in the working road on-duty time period, the working road off-duty time period, the night home rest time period, the noon company rest time period, the working company time period, the weekend home time period, and the weekend outgoing time period. The method comprises the steps of setting a main priority with a higher priority for music background running applications, game background running applications and the like in an on-duty time period and an off-duty time period, and setting a main priority with a higher priority for office software background running applications, mailbox background running applications and the like in an on-duty time period.
The processing module 302 is configured to:
if the main priority of the application running in the background is the first-level main priority, keeping running the parent process and the child process of the application running in the background;
if the main priority of the application running in the background is the second-level main priority, keeping the parent process of the application running in the background running in running, and setting the child process of the application running in the background in a non-running state;
and if the main priority of the application running in the background is the third-level main priority, closing the parent process and the child process of the application running in the background, wherein the priority levels of the first-level main priority, the second-level main priority and the third-level main priority are sequentially decreased.
It should be noted that, if the primary priority of the application running in the background is the secondary primary priority, the processing module 302 is further configured to:
if the sub-optimal level of the application running in the background is the first sub-optimal level, keeping the parent process of the application running in the background running, and freezing the child process of the application running in the background;
if the sub-optimal level of the application running in the background is the second sub-optimal level, keeping the parent process of the application running in the background running in running, and clearing codes in the child process of the application running in the background to enable the child process to enter a copy-on-write state;
and if the second-level best priority of the application running in the background is the third-level second-level best priority, keeping the parent process of the application running in the background running, and closing the child process of the application running in the background, wherein the priority levels of the first-level second-level best priority, the second-level best priority and the third-level second-level best priority are sequentially decreased progressively.
Wherein the second level primary priority may be further divided into more levels of sub-priority.
Referring to fig. 7, fig. 7 is another schematic structural diagram of a process management device according to an embodiment of the present invention. In this embodiment, the apparatus further includes a time period threshold acquisition module 3021 and a priority adjustment module 3022.
The time period threshold obtaining module 3021 is configured to obtain a preset time period threshold, where the preset time period threshold may be automatically set by a system or manually set by a user, and the preset time period threshold may be 1 hour, half hour, or the like.
The priority adjusting module 3022 is configured to reduce the main priority or the sub-priority of the background running application if the number of times of calling the background running application is smaller than a first preset number threshold within a preset time period threshold, and if the number of times of calling the background running application is smaller than 3 times; if the calling times of the background running application are greater than a second preset time threshold within a preset time period threshold, if the calling times are greater than 5, the main priority or the sub-optimal priority of the background running application is improved.
Specifically, if the background running application is not called within a preset time period threshold, the main priority of the background running application is reduced; if the calling times of the application running in the background are less than a first preset time threshold within a preset time period threshold, if the calling times are less than 3, the suboptimal priority of the application running in the background is reduced; if the calling times of the background running application are greater than a second preset time threshold within a preset time period threshold, if the calling times are greater than 5 times, the sub-optimal priority of the background running application is improved, and if the sub-optimal priority of the first level is already obtained, the main priority of the background running application is improved.
It should be noted that, in some embodiments, the primary priority and the secondary priority may be a priority of the same level, and specifically, the process control apparatus includes:
the first obtaining module 301 is configured to obtain the priority of the application running in the background, and a parent process and a child process of the application running in the background when the system occupancy rate of the electronic device exceeds a first threshold.
The processing module 304 is configured to keep running the parent process and the child process of the background running application if the priority of the background running application is the first-level priority;
if the priority of the background running application is the second-level priority, keeping the parent process of the background running application running, and freezing the child process of the background running application;
if the priority of the background running application is the third-level priority, keeping the parent process of the background running application running, and clearing codes in the child process of the background running application to enable the child process to enter a copy-on-write state;
if the priority of the application running in the background is the fourth-level priority, keeping the parent process of the application running in the background running, and closing the child process of the application running in the background;
and if the priority of the application running in the background is the fifth priority, closing the parent process and the child process of the application running in the background, wherein the priority levels of the first priority, the second priority, the third priority, the fourth priority and the fifth priority are sequentially decreased.
The embodiment of the invention also provides the electronic device 400. The electronic device 400 may be a smart phone, a tablet computer, or the like. As shown in fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 400 includes: a processor 401 and a memory 402. The processor 401 is electrically connected to the memory 402.
The processor 401 is a control center of the electronic device 400, connects various parts of the whole electronic device 400 by using various interfaces and lines, performs various functions of the electronic device 400 and processes data by running or loading an application program stored in the memory 402 and calling the data stored in the memory 402, thereby performing overall monitoring of the electronic device 400.
In this embodiment, the processor 401 in the electronic device 400 loads instructions corresponding to processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 runs the application programs stored in the memory 402, thereby implementing various functions:
when the system occupancy rate of the electronic equipment exceeds a first threshold value, acquiring a main priority of the application running in the background, and a parent process and a child process of the application running in the background;
if the main priority of the application running in the background is the first-level main priority, keeping running the parent process and the child process of the application running in the background;
if the main priority of the application running in the background is the second-level main priority, keeping the parent process of the application running in the background running in running, and setting the child process of the application running in the background in a non-running state;
and if the main priority of the application running in the background is the third-level main priority, closing the parent process and the child process of the application running in the background, wherein the priority levels of the first-level main priority, the second-level main priority and the third-level main priority are sequentially decreased.
The memory 402 may be used to store applications and data. The memory 402 stores applications containing instructions executable in the processor 401. The application programs may constitute various functional modules. The processor 401 executes various functional applications and data processing by running an application program stored in the memory 402.
In some embodiments, referring to fig. 9 together, fig. 9 is another schematic structural diagram of an electronic device, and the electronic device 400 further includes: radio frequency circuit 403, display 404, control circuit 405, input unit 406, audio circuit 407, sensor 408, and power supply 409. The processor 401 is electrically connected to the radio frequency circuit 403, the display 404, the control circuit 405, the input unit 406, the audio circuit 407, the sensor 408, and the power source 409.
The radio frequency circuit 403 is used for transceiving radio frequency signals to communicate with a server or other electronic devices through a wireless communication network.
The display screen 404 may be used to display information entered by or provided to the user as well as various graphical user interfaces of the terminal, which may be comprised of images, text, icons, video, and any combination thereof.
The control circuit 405 is electrically connected to the display screen 404, and is configured to control the display screen 404 to display information.
The input unit 406 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The audio circuit 407 may provide an audio interface between the user and the terminal through a speaker, microphone.
The sensor 408 is used to collect external environmental information. The sensor 28 may include one or more of an ambient light sensor, an acceleration sensor, a gyroscope, and the like.
The power supply 409 is used to power the various components of the electronic device 400. In some embodiments, the power source 409 may be logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are implemented through the power management system.
Although not shown in fig. 9, the electronic device 400 may further include a camera, a bluetooth module, and the like, which are not described in detail herein.
As can be seen from the above, the embodiment of the present invention provides an electronic device, where when the system occupancy rate of the electronic device exceeds a first threshold, a main priority of a background running application, and a parent process and a child process of the background running application are obtained; if the main priority of the application running in the background is the first-level main priority, keeping running the parent process and the child process of the application running in the background; if the main priority of the application running in the background is the second-level main priority, keeping the parent process of the application running in the background running in running, and setting the child process of the application running in the background in a non-running state; and if the main priority of the application running in the background is the third-level main priority, closing the parent process and the child process of the application running in the background, wherein the priority levels of the first-level main priority, the second-level main priority and the third-level main priority are sequentially decreased. The running speed of the system is improved, and the corresponding process can respond faster.
The embodiment of the present invention further provides a storage medium, where a plurality of instructions are stored in the storage medium, and the instructions are suitable for being loaded by a processor to execute the process management method according to any of the above embodiments.
It should be noted that, as one of ordinary skill in the art would understand, all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a program, and the program may be stored in a computer-readable medium, which may include but is not limited to: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The above detailed description is provided for the process management method, apparatus, storage medium and electronic device according to the embodiments of the present invention, and a specific example is applied in this document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (12)
1. A process management method is applied to electronic equipment, and is characterized in that the method comprises the following steps:
setting a main priority and a sub-optimal priority of a background running application, wherein the main priority of the background running application comprises a first-level main priority, a second-level main priority and a third-level main priority, and the second-level main priority comprises the sub-optimal priorities of a plurality of different levels of the background running application;
when the system occupancy rate of the electronic equipment exceeds a first threshold value, acquiring the main priority of the background running application, and a parent process and a child process of the background running application;
acquiring a preset time period threshold;
increasing or decreasing the main priority or the sub-optimal priority of the background running application according to the calling times of the background running application within the preset time period threshold, wherein if the priority of the background application to be increased is the sub-optimal priority of the background running application with the highest level, the main priority of the background running application is increased;
if the main priority of the background running application is the first-level main priority, keeping a parent process and a child process of the background running application running;
if the main priority of the background running application is the second-level main priority, keeping the parent process of the background running application running, and freezing the child process of the background running application according to the sub-optimal priority of the background running application or emptying codes in the child process of the background running application to enable the child process to enter a copy-on-write state or close the child process of the background running application;
if the main priority of the background running application is the third-level main priority, closing the parent process and the child process of the background running application, wherein the priority levels of the first-level main priority, the second-level main priority and the third-level main priority are sequentially decreased.
2. The process management method according to claim 1, wherein if the main priority of the application running in the background is the second-level main priority, keeping a parent process of the application running in the background running, and according to the second-level main priority of the application running in the background running, freezing a child process of the application running in the background running, or emptying code in the child process of the application running in the background running to make the child process enter a copy-on-write state, or closing the child process of the application running in the background running, comprises:
if the sub-optimal level of the application running in the background is the first-level sub-optimal level, keeping the parent process of the application running in the background running, and freezing the child process of the application running in the background;
if the sub-optimal level of the application running in the background is the second sub-optimal level, keeping the parent process of the application running in the background running, and emptying codes in the child process of the application running in the background to enable the child process to enter a copy-on-write state;
and if the sub-optimal level of the application running in the background is the third-level sub-optimal level, keeping the parent process of the application running in the background running, and closing the child process of the application running in the background, wherein the priority levels of the first-level sub-optimal level, the second-level sub-optimal level and the third-level sub-optimal level are sequentially decreased.
3. The process management method according to claim 2, wherein before acquiring the master priority of the application running in the background, the method further comprises:
and acquiring user use habit data, and setting the main priority and/or the sub-priority of the background running application according to the user use habit data.
4. The process management method according to claim 2, wherein before acquiring the master priority of the application running in the background, the method further comprises:
and acquiring system time and the current position of the electronic equipment, and setting the main priority and/or the sub-priority of the background running application according to the system time and the current position.
5. The process management method according to claim 1, wherein in the step of increasing or decreasing the primary priority or the secondary priority of the background running application according to the number of times of calling the background running application within the preset time period threshold, the method further comprises:
if the calling times of the background running application are smaller than a first preset time threshold within the preset time period threshold, reducing the main priority or the sub-optimal priority of the background running application;
if the calling times of the background running application are larger than a second preset time threshold within the preset time period threshold, the main priority or the sub-optimal priority of the background running application is improved.
6. A process management device applied to electronic equipment is characterized by comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for setting a main priority and a sub-optimal priority of a background running application, the main priority of the background running application comprises a first-level main priority, a second-level main priority and a third-level main priority, and the second-level main priority comprises the sub-optimal priorities of a plurality of different levels of the background running application; when the system occupancy rate of the electronic equipment exceeds a first threshold value, acquiring the main priority of the background running application, and a parent process and a child process of the background running application; acquiring a preset time period threshold; increasing or decreasing the main priority or the sub-optimal priority of the background running application according to the calling times of the background running application within the preset time period threshold, wherein if the priority of the background application to be increased is the sub-optimal priority of the background running application with the highest level, the main priority of the background running application is increased;
the processing module is used for keeping a parent process and a child process of the background running application running if the main priority of the background running application is the first-level main priority; if the main priority of the background running application is the second-level main priority, keeping the parent process of the background running application running, and freezing the child process of the background running application according to the sub-optimal priority of the background running application or emptying codes in the child process of the background running application to enable the child process to enter a copy-on-write state or close the child process of the background running application; if the main priority of the background running application is the third-level main priority, closing the parent process and the child process of the background running application, wherein the priority levels of the first-level main priority, the second-level main priority and the third-level main priority are sequentially decreased.
7. The process management device according to claim 6, wherein the processing module is further configured to keep running a parent process of the background running application and freeze a child process of the background running application if the sub-optimal level of the background running application is the first-level sub-optimal level; if the sub-optimal level of the application running in the background is the second sub-optimal level, keeping the parent process of the application running in the background running, and emptying codes in the child process of the application running in the background to enable the child process to enter a copy-on-write state; and if the sub-optimal level of the application running in the background is the third-level sub-optimal level, keeping the parent process of the application running in the background running, and closing the child process of the application running in the background, wherein the priority levels of the first-level sub-optimal level, the second-level sub-optimal level and the third-level sub-optimal level are sequentially decreased.
8. The process management device according to claim 6, wherein said device further comprises:
and the third acquisition module is used for acquiring the user use habit data and setting the main priority and/or the sub-priority of the background running application according to the user use habit data.
9. The process management device according to claim 6, wherein said device further comprises:
and the fourth acquisition module is used for acquiring the system time and the current position of the electronic equipment and setting the main priority and/or the sub-priority of the background running application according to the system time and the current position.
10. The process management device according to claim 6, wherein said device further comprises:
the priority adjusting module is used for reducing the main priority or the sub-priority of the background running application if the calling times of the background running application are smaller than a first preset time threshold within the preset time period threshold; the priority adjusting module is further configured to increase the primary priority or the secondary priority of the background running application if the number of times of calling the background running application is greater than a second preset number threshold within the preset time period threshold.
11. A storage medium having stored therein a plurality of instructions adapted to be loaded by a processor to perform a process management method according to any one of claims 1 to 5.
12. An electronic device, comprising:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the process management method of any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710643029.5A CN107402808B (en) | 2017-07-31 | 2017-07-31 | Process management method, device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710643029.5A CN107402808B (en) | 2017-07-31 | 2017-07-31 | Process management method, device, storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107402808A CN107402808A (en) | 2017-11-28 |
CN107402808B true CN107402808B (en) | 2020-03-27 |
Family
ID=60401834
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710643029.5A Expired - Fee Related CN107402808B (en) | 2017-07-31 | 2017-07-31 | Process management method, device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107402808B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109992397A (en) * | 2017-12-29 | 2019-07-09 | 广东欧珀移动通信有限公司 | Process handling method and device, electronic equipment, computer readable storage medium |
CN109992378A (en) * | 2017-12-29 | 2019-07-09 | 广东欧珀移动通信有限公司 | Using freezing method, device, terminal and computer readable storage medium |
CN109358961B (en) * | 2018-08-14 | 2021-12-21 | 深圳市先河系统技术有限公司 | Resource scheduling method and device with storage function |
CN110069322B (en) * | 2019-03-21 | 2023-12-05 | 努比亚技术有限公司 | Background application processing method, terminal equipment and storage medium |
CN114996013B (en) * | 2022-06-09 | 2023-06-02 | 河南省肿瘤医院 | Microwave treatment equipment based on it is embedded |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7124403B2 (en) * | 2001-08-15 | 2006-10-17 | Sun Microsystems, Inc. | Methods and apparatus for managing defunct processes |
CN103984743A (en) * | 2014-05-23 | 2014-08-13 | 北京金山网络科技有限公司 | Method and device for managing memory resources |
CN104268019A (en) * | 2014-09-23 | 2015-01-07 | 广州金山网络科技有限公司 | Software operating method and device and terminal |
CN105354093A (en) * | 2015-12-09 | 2016-02-24 | 广东欧珀移动通信有限公司 | Memory management method and mobile terminal |
CN105975347A (en) * | 2016-05-26 | 2016-09-28 | 宇龙计算机通信科技(深圳)有限公司 | Application freezing method and system |
CN106951318A (en) * | 2017-03-24 | 2017-07-14 | 联想(北京)有限公司 | The management method and electronic equipment of a kind of electronic equipment background process |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9871741B2 (en) * | 2014-03-10 | 2018-01-16 | Microsoft Technology Licensing, Llc | Resource management based on device-specific or user-specific resource usage profiles |
-
2017
- 2017-07-31 CN CN201710643029.5A patent/CN107402808B/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7124403B2 (en) * | 2001-08-15 | 2006-10-17 | Sun Microsystems, Inc. | Methods and apparatus for managing defunct processes |
CN103984743A (en) * | 2014-05-23 | 2014-08-13 | 北京金山网络科技有限公司 | Method and device for managing memory resources |
CN104268019A (en) * | 2014-09-23 | 2015-01-07 | 广州金山网络科技有限公司 | Software operating method and device and terminal |
CN105354093A (en) * | 2015-12-09 | 2016-02-24 | 广东欧珀移动通信有限公司 | Memory management method and mobile terminal |
CN105975347A (en) * | 2016-05-26 | 2016-09-28 | 宇龙计算机通信科技(深圳)有限公司 | Application freezing method and system |
CN106951318A (en) * | 2017-03-24 | 2017-07-14 | 联想(北京)有限公司 | The management method and electronic equipment of a kind of electronic equipment background process |
Non-Patent Citations (1)
Title |
---|
4个理由让你不懂技术也能明白:为什么Chrome浏览器特爱吃内存;光谱;《https://www.pingwest.com/a/50569》;20150522;1-4 * |
Also Published As
Publication number | Publication date |
---|---|
CN107402808A (en) | 2017-11-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108076224B (en) | Application program control method and device, storage medium and mobile terminal | |
CN107463403B (en) | Process control method, device, storage medium and electronic equipment | |
CN107809542B (en) | Application program control method and device, storage medium and electronic equipment | |
CN107402808B (en) | Process management method, device, storage medium and electronic equipment | |
EP3502880B1 (en) | Method for preloading application, storage medium, and terminal device | |
US11403197B2 (en) | Method and device for controlling application, storage medium, and electronic device | |
CN106528745B (en) | Method and device for recommending resources on mobile terminal and mobile terminal | |
CN108337358B (en) | Application cleaning method and device, storage medium and electronic equipment | |
WO2019072200A1 (en) | Method for managing resource, and terminal device | |
CN107704070B (en) | Application cleaning method and device, storage medium and electronic equipment | |
CN107479953B (en) | Process management method, device, storage medium and electronic equipment | |
CN109324902B (en) | Method for adjusting working frequency of mobile terminal, mobile terminal and storage medium | |
CN107943534B (en) | Background application program closing method and device, storage medium and electronic equipment | |
CN106776036A (en) | A kind of resource allocation methods and device | |
CN107562539B (en) | Application program processing method and device, computer equipment and storage medium | |
CN107302633B (en) | Application control method, device, storage medium and electronic equipment | |
CN107870810B (en) | Application cleaning method and device, storage medium and electronic equipment | |
CN107748697B (en) | Application closing method and device, storage medium and electronic equipment | |
CN107943570B (en) | Application management method and device, storage medium and electronic equipment | |
WO2019024641A1 (en) | Data synchronization method and apparatus, storage medium and electronic device | |
CN106055408A (en) | Application control method and mobile terminal | |
CN105335498A (en) | Method and system for information recommendation based on voice information | |
CN107943582B (en) | Feature processing method, feature processing device, storage medium and electronic equipment | |
WO2019085749A1 (en) | Application program control method and apparatus, medium, and electronic device | |
CN107317918B (en) | Parameter setting method and related product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200327 |
|
CF01 | Termination of patent right due to non-payment of annual fee |