WO2019024642A1 - Process control method and apparatus, storage medium, and electronic device - Google Patents

Process control method and apparatus, storage medium, and electronic device Download PDF

Info

Publication number
WO2019024642A1
WO2019024642A1 PCT/CN2018/094251 CN2018094251W WO2019024642A1 WO 2019024642 A1 WO2019024642 A1 WO 2019024642A1 CN 2018094251 W CN2018094251 W CN 2018094251W WO 2019024642 A1 WO2019024642 A1 WO 2019024642A1
Authority
WO
WIPO (PCT)
Prior art keywords
priority
background
current
foreground
current background
Prior art date
Application number
PCT/CN2018/094251
Other languages
French (fr)
Chinese (zh)
Inventor
杜冰
张俊
林志泳
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019024642A1 publication Critical patent/WO2019024642A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/329Power saving characterised by the action undertaken by task scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

A process control method and apparatus, a storage medium, and an electronic device, comprising: acquiring current front-end processes, current back-end processes, and the priority levels of the current back-end processes; on the basis of the number of the current back-end processes, determining a shutdown quantity; acquiring an associated process set corresponding to the current front-end processes; on the basis of the associated process set, adjusting the priority levels of the current back-end processes; and, on the basis of the adjusted priority levels and the shutdown quantity, controlling the startup and shutdown of the current back-end processes.

Description

进程控制方法、装置、存储介质以及电子设备Process control method, device, storage medium, and electronic device
本申请要求于2017年7月31日提交中国专利局、申请号为201710643030.8、发明名称为“进程控制方法、装置、存储介质以及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on July 31, 2017, the Chinese Patent Application No. 201710643030.8, entitled "Process Control Method, Apparatus, Storage Media, and Electronic Equipment", the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种进程控制方法、装置、存储介质以及电子设备。The present application relates to the field of computer technologies, and in particular, to a process control method, apparatus, storage medium, and electronic device.
背景技术Background technique
目前,多数终端设备都可以运行多用户多进程的操作系统。于后台程序而言,对不同的程序进行拉起动作时,通常会按照一定的优先级进行拉起,当前现有的应用程序的优先级往往是固定的,用户在不清楚的情况下也无法实现有限级的调整,且往往部分服务进程与应用程序绑定在一起,如果应用程序的优先级较高,服务进程即便没有在运行时往往因为绑定在一起而继续运行,耗费终端的电量。Currently, most terminal devices can run multi-user multi-process operating systems. In the case of a background program, when a different program is pulled up, it is usually pulled up according to a certain priority. The current existing application is often fixed in priority, and the user cannot be unclear. A finite level of adjustment is implemented, and often part of the service process is bound to the application. If the application has a higher priority, the service process continues to run because it is bound together, even if it is not running, and consumes the power of the terminal.
发明内容Summary of the invention
本申请实施例提供一种进程控制方法、装置、存储介质以及电子设备,可以有效管控后台进程、减少终端电量的浪费。The embodiment of the present invention provides a process control method, device, storage medium, and electronic device, which can effectively control background processes and reduce waste of terminal power.
本申请实施例提供了一种进程控制方法,应用于电子设备,包括:The embodiment of the present application provides a process control method, which is applied to an electronic device, and includes:
获取所述电子设备中的当前前台进程、当前后台进程、以及所述当前后台进程的优先级;Obtaining a current foreground process, a current background process, and a priority of the current background process in the electronic device;
根据所述当前后台进程的数量确定关闭数量;Determining the number of shutdowns according to the number of current background processes;
获取与所述当前前台进程对应的关联进程集;Obtaining an associated process set corresponding to the current foreground process;
根据所述关联进程集对所述当前后台进程的优先级进行调整;Adjusting the priority of the current background process according to the associated process set;
根据调整后优先级和关闭数量控制所述当前后台进程的开启与关闭。Controlling the opening and closing of the current background process according to the adjusted priority and the number of shutdowns.
本申请实施例还提供了一种进程控制装置,应用于电子设备,包括:The embodiment of the present application further provides a process control apparatus, which is applied to an electronic device, and includes:
第一获取模块,用于获取所述电子设备中的当前前台进程、当前后台进程、以及所述当前后台进程的优先级;a first acquiring module, configured to acquire a current foreground process, a current background process, and a priority of the current background process in the electronic device;
确定模块,用于根据所述当前后台进程的数量确定关闭数量;a determining module, configured to determine a number of shutdowns according to the number of the current background processes;
第二获取模块,用于获取与所述当前前台进程对应的关联进程集;a second acquiring module, configured to acquire an associated process set corresponding to the current foreground process;
调整模块,用于根据所述关联进程集对所述当前后台进程的优先级进行调整;An adjustment module, configured to adjust a priority of the current background process according to the associated process set;
控制模块,用于根据调整后优先级和所述关闭数量控制所述当前后台进程的开启与关闭。And a control module, configured to control opening and closing of the current background process according to the adjusted priority and the closed quantity.
本申请实施例还提供了一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述任一项进程控制方法。The embodiment of the present application further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute any one of the foregoing process control methods.
本申请实施例还提供了一种电子设备,包括处理器和存储器,所述处理器与所述存储器电性连接,所述存储器用于存储指令和数据,所述处理器用于执行上述任一项进程控制方法。The embodiment of the present application further provides an electronic device, including a processor and a memory, the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is configured to execute any one of the foregoing Process control method.
附图说明DRAWINGS
下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其它有益效果显而易见。The technical solutions and other advantageous effects of the present application will be apparent from the detailed description of the embodiments of the present application.
图1为本申请实施例提供的进程控制系统的应用场景示意图。FIG. 1 is a schematic diagram of an application scenario of a process control system according to an embodiment of the present disclosure.
图2为本申请实施例提供的进程控制方法的流程示意图。FIG. 2 is a schematic flowchart diagram of a process control method according to an embodiment of the present application.
图3为本申请实施例提供的进程控制方法的另一流程示意图。FIG. 3 is another schematic flowchart of a process control method according to an embodiment of the present application.
图4为本申请实施例提供的当前后台进程的界面示意图。FIG. 4 is a schematic diagram of an interface of a current background process according to an embodiment of the present application.
图5为本申请实施例提供的进程控制装置的结构示意图。FIG. 5 is a schematic structural diagram of a process control apparatus according to an embodiment of the present application.
图6为本申请实施例提供的第三获取模块的结构示意图。FIG. 6 is a schematic structural diagram of a third acquiring module according to an embodiment of the present disclosure.
图7为本申请实施例提供的调整模块的结构示意图。FIG. 7 is a schematic structural diagram of an adjustment module according to an embodiment of the present application.
图8为本申请实施例提供的控制模块的结构示意图。FIG. 8 is a schematic structural diagram of a control module according to an embodiment of the present application.
图9为本申请实施例提供的电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present application without creative efforts are within the scope of the present application.
本申请实施例提供一种进程控制方法、装置、存储介质、电子设备以及系统。Embodiments of the present application provide a process control method, apparatus, storage medium, electronic device, and system.
请参阅图1,图1为进程控制系统的应用场景图,该进程控制系统可以包括本申请提供的任一种电子设备。Please refer to FIG. 1. FIG. 1 is an application scenario diagram of a process control system, which may include any of the electronic devices provided by the present application.
其中,电子设备可以获取当前前台进程、当前后台进程、以及该当前后台进程的优先级,并根据该当前后台进程的数量确定关闭数量,接着,获取与该当前前台进程对应的关联进程集,并根据该关联进程集对该当前后台进程的优先级进行调整,之后,根据调整后优先级和关闭数量控制该当前后台进程的开启与关闭。The electronic device can obtain the priority of the current foreground process, the current background process, and the current background process, and determine the number of shutdowns according to the number of the current background processes, and then acquire the associated process set corresponding to the current foreground process, and The priority of the current background process is adjusted according to the associated process set, and then the current background process is controlled to be turned on and off according to the adjusted priority and the closed quantity.
比如,电子设备获取的当前前台进程可以为Q、当前后台进程可以为{H1、H2…Hn},则该当前后台进程的总数为n,根据数量n确定的关闭数量可以为i,通过获取当前前台进程Q对应的关联进程集,并根据该关联进程集对该当前后台进程的优先级进行调整,这样,可以从{H1、H2…Hn}中选择调整后优先级最低的i个前后台进程进行关闭。For example, the current foreground process obtained by the electronic device may be Q, and the current background process may be {H1, H2...Hn}, then the total number of the current background processes is n, and the number of shutdowns determined according to the quantity n may be i, by obtaining the current The associated process set corresponding to the foreground process Q, and adjusting the priority of the current background process according to the associated process set, so that the i preceding background processes with the lowest adjusted priority can be selected from {H1, H2...Hn} Close it.
本实施例将从进程控制装置的角度进行描述,该进程控制装置具体可以作为独立的实体来实现,也可以集成在电子设备,比如终端中来实现,该终端可以包括手机、平板电脑以及个人计算机等。This embodiment is described from the perspective of a process control device, which may be implemented as an independent entity or integrated in an electronic device, such as a terminal. The terminal may include a mobile phone, a tablet computer, and a personal computer. Wait.
本申请实施例提供一种进程控制方法,包括以下步骤:The embodiment of the present application provides a process control method, including the following steps:
获取该电子设备中的当前前台进程、当前后台进程、以及该当前后台进程的优先级;Obtaining a current foreground process, a current background process, and a priority of the current background process in the electronic device;
根据该当前后台进程的数量确定关闭数量;Determine the number of shutdowns based on the number of current background processes;
获取与该当前前台进程对应的关联进程集;Obtaining an associated process set corresponding to the current foreground process;
根据该关联进程集对该当前后台进程的优先级进行调整;Adjusting the priority of the current background process according to the associated process set;
根据调整后优先级和该关闭数量控制该当前后台进程的开启与关闭。The current background process is turned on and off according to the adjusted priority and the closed number.
在一些实施例中,该根据该关联进程集对该当前后台进程的优先级进行调整,包括:In some embodiments, the priority of the current background process is adjusted according to the associated process set, including:
获取与该关联进程集中关联进程相同的当前后台进程,作为第一进程;Obtaining the current background process that is the same as the associated process in the associated process set as the first process;
获取该第一进程在后台的运行时长;Get the running time of the first process in the background;
根据该运行时长提高该第一进程的优先级。The priority of the first process is increased according to the runtime.
在一些实施例中,该根据该运行时长提高该第一进程的优先级,包括:In some embodiments, the priority of the first process is increased according to the runtime, including:
根据该运行时长确定对应第一进程的提高幅度;Determining an increase range corresponding to the first process according to the running time length;
根据该提高幅度提高该第一进程的优先级。The priority of the first process is increased according to the increase.
在一些实施例中,该根据该关联进程集对该当前后台进程的优先级进行调整,还包括:In some embodiments, the adjusting the priority of the current background process according to the associated process set further includes:
获取除该第一进程之外的当前后台进程,作为第二进程;Obtaining a current background process other than the first process as a second process;
获取该第二进程的资源占用率;Obtaining the resource occupancy rate of the second process;
根据该资源占用率降低该第二进程的优先级。The priority of the second process is lowered according to the resource occupancy rate.
在一些实施例中,该根据该资源占用率降低该第二进程的优先级,包括:In some embodiments, the lowering the priority of the second process according to the resource occupancy rate includes:
根据该资源占用率确定对应第二进程的降低幅度;Determining a reduction range corresponding to the second process according to the resource occupancy rate;
根据该降低幅度降低该第二进程的优先级。The priority of the second process is lowered according to the reduction.
在一些实施例中,该根据该当前后台进程的数量确定关闭数量,包括:In some embodiments, the determining the number of shutdowns based on the number of current background processes includes:
获取设定的关闭比例;Get the set closure ratio;
根据该关闭比例和当前后台进程的数量计算出关闭数量。The number of shutdowns is calculated based on the shutdown ratio and the number of current background processes.
在一些实施例中,该根据调整后优先级和该关闭数量控制该当前后台进程的开启与关闭,包括:In some embodiments, the controlling the opening and closing of the current background process according to the adjusted priority and the number of the closing includes:
获取调整后优先级最低的该关闭数量的当前后台进程,作为目标进程;Obtaining the current background process of the closed number with the lowest priority after adjustment as the target process;
检测是否存在正在进行数据收发操作的目标进程;Detecting whether there is a target process that is performing data transceiving operations;
若是,则提高该正在进行数据收发操作的目标进程的优先级,并返回执行该获取调整后优先级最低的该关闭数量的当前后台进程的步骤;If yes, the priority of the target process that is performing the data transceiving operation is increased, and the step of executing the current background process of the closed number with the lowest priority after the obtaining adjustment is returned;
若否,则关闭该目标进程。If no, the target process is closed.
在一些实施例中,在获取与该当前前台进程对应的关联进程集之前,还包括:In some embodiments, before acquiring the associated process set corresponding to the current foreground process, the method further includes:
获取历史时段内该电子设备中运行的前台进程;Obtaining a foreground process running in the electronic device during the historical time period;
获取每一前台进程对应的后台进程、以及每一后台进程的切换次数和连续两次切换之间的间隔时长,该切换次数为该后台进程切换至前台进程的次数;Obtaining a background process corresponding to each foreground process, and a number of times of switching between each background process and an interval between two consecutive handovers, where the number of handovers is the number of times the background process switches to the foreground process;
根据该切换次数和间隔时长从该后台进程中确定对应前台进程的关联进程集。The associated process set corresponding to the foreground process is determined from the background process according to the number of times of switching and the interval duration.
在一些实施例中,该根据该切换次数和间隔时长从该后台进程中确定对应前台进程的关联进程集,包括:In some embodiments, the determining the associated process set of the corresponding foreground process from the background process according to the number of times of the switch and the interval duration includes:
根据该切换次数和间隔时长计算对应后台进程的切换频率;Calculating a switching frequency of the corresponding background process according to the number of switching times and the interval duration;
获取该切换频率高于预设频率的后台进程,或者,获取该切换频率最高的预设位后台进程,作为对应前台进程的关联进程,并添入关联进程集中。Obtain the background process whose switching frequency is higher than the preset frequency, or obtain the preset background process with the highest switching frequency as the associated process corresponding to the foreground process, and add it to the associated process set.
如图2所示,该进程控制方法可以应用于电子设备,其具体流程可以如下:As shown in FIG. 2, the process control method can be applied to an electronic device, and the specific process can be as follows:
S101、获取该电子设备中的当前前台进程、当前后台进程、以及该当前后台进程的优先级。S101. Obtain a current foreground process, a current background process, and a priority of the current background process in the electronic device.
本实施例中,该优先级可以是根据每个进程的属性信息提前设定好的,比如系统进程的优先级可以高于非系统进程的优先级,即时通讯进程的优先级可以高于购物进程的优先级,等等。In this embodiment, the priority may be set in advance according to the attribute information of each process. For example, the priority of the system process may be higher than the priority of the non-system process, and the priority of the instant messaging process may be higher than the shopping process. Priority, and so on.
由于进程的运行会影响电子设备的电量、CPU占用率以及运行速度等,故该进程控制指令的触发条件可以根据电量、CPU占用率以及运行速度而定,比如,当电量或运行速度低于一定值,或者CPU占用率高于一定值时,电子设备可以进行后台进程清理操作,也即可以触发执行步骤S101。Since the running of the process affects the power consumption, CPU usage, and running speed of the electronic device, the trigger condition of the process control command may be determined according to the power, the CPU usage, and the running speed. For example, when the power or running speed is lower than a certain value. When the value, or the CPU usage is higher than a certain value, the electronic device may perform a background process cleaning operation, that is, the step S101 may be triggered.
S102、根据该当前后台进程的数量确定关闭数量。S102. Determine a number of shutdowns according to the number of current background processes.
本实施例中,该关闭数量可以是提前设定好的,其可以是直接根据前后台进程的数量确定的,比如提前将不同的后台进程数量设置不同的关闭数量,也可以是间接确定的,比如可以人为设定一个关闭比例,然后根据关闭比例和当前后台进程的数量计算出关闭数量。In this embodiment, the number of shutdowns may be set in advance, which may be determined directly according to the number of front and back processes, for example, the number of different background processes is set differently in advance, or may be determined indirectly. For example, you can manually set a close ratio, and then calculate the number of closes based on the close ratio and the number of current background processes.
S103、获取与该当前前台进程对应的关联进程集。S103. Acquire an associated process set corresponding to the current foreground process.
本实施例中,该关联进程集中包括至少一个关联进程,该关联进程是指与当前前台进程有关的进程,通常,不同的前台进程对应不同的关联进程集。需要说明的是,该关联进程集应当是提前设置好的,也即,在上述步骤S103之前,该进程控制方法还可以包括:In this embodiment, the association process includes at least one associated process, and the associated process refers to a process related to the current foreground process. Generally, different foreground processes correspond to different associated process sets. It should be noted that the association process set should be set in advance, that is, before the step S103, the process control method may further include:
获取历史时段内该电子设备中运行的前台进程;Obtaining a foreground process running in the electronic device during the historical time period;
获取每一前台进程对应的后台进程、以及每一后台进程的切换次数和连续两次切换之间的间隔时长,该切换次数为该后台进程切换至前台进程的次数;Obtaining a background process corresponding to each foreground process, and a number of times of switching between each background process and an interval between two consecutive handovers, where the number of handovers is the number of times the background process switches to the foreground process;
根据该切换次数和间隔时长从该后台进程中确定对应前台进程的关联进程集。The associated process set corresponding to the foreground process is determined from the background process according to the number of times of switching and the interval duration.
例如,上述步骤“根据该切换次数和间隔时长从该后台进程中确定对应前台进程的关联进程集”具体可以包括:For example, the foregoing step may include: determining the associated process set corresponding to the foreground process from the background process according to the number of times of the switch and the interval duration.
根据该切换次数和间隔时长计算对应后台进程的切换频率;Calculating a switching frequency of the corresponding background process according to the number of switching times and the interval duration;
获取该切换频率高于预设频率的后台进程,或者,获取该切换频率最高的预设位后台进程,作为对应前台进程的关联进程,并添入关联进程集中。Obtain the background process whose switching frequency is higher than the preset frequency, or obtain the preset background process with the highest switching frequency as the associated process corresponding to the foreground process, and add it to the associated process set.
本实施例中,该历史时段、预设频率和预设位均可以人为提前设定好。具体的,可以根据该切换次数和间隔时长计算切换频率,比如可以将所有间隔时长相加计算总时长,根据该总时长和切换次数之间的商值确定切换频率,通常,切换频率越高的后台进程,越可能尽快从后台切换至前台,从而可以根据切换频率确定出最容易与前台进程发生切换操作的后台进程,作为关联进程。In this embodiment, the historical time period, the preset frequency, and the preset position can be manually set in advance. Specifically, the switching frequency can be calculated according to the switching times and the interval duration. For example, all the interval durations can be added to calculate the total duration, and the switching frequency is determined according to the quotient between the total duration and the number of switching times. Generally, the switching frequency is higher. The background process, the more likely it is to switch from the background to the foreground as soon as possible, so that the background process that is the easiest to switch operation with the foreground process can be determined according to the switching frequency as the associated process.
需要说明的时,上述步骤S102和S103之间没有明显的先后执行之分,其可以同时进行。When it is to be noted, there is no obvious sequential execution between the above steps S102 and S103, which can be performed simultaneously.
S104、根据该关联进程集对该当前后台进程的优先级进行调整。S104. Adjust the priority of the current background process according to the associated process set.
本实施例中,该调整操作可以包括提高和降低,不同的对象可以采取不同的调整操作。In this embodiment, the adjustment operation may include raising and lowering, and different objects may adopt different adjustment operations.
例如,上述步骤S104具体可以包括:For example, the foregoing step S104 may specifically include:
获取与该关联进程集中关联进程相同的当前后台进程,作为第一进程。Gets the current background process that is the same as the associated process in the associated process set as the first process.
获取该第一进程在后台的运行时长。Get the running time of the first process in the background.
根据该运行时长提高该第一进程的优先级。The priority of the first process is increased according to the runtime.
本实施例中,由于每一关联进程都是最有可能与当前前台进程发生切换的进程,也即是在后续使用过程中用户最可能用到的进程,故这些进程对用户的重要性明显要高于其他进程,为避免这些进程被清理掉,可以提高它们的优先级,具体的,可以根据它们在后台的运行时长来确定每一进程的提高幅度,通常,考虑到在后台的运行时长越长的进程,说明被用户忽略的时间越长,用户再次切换至前台使用的几率也越小,从而可以将在后台运行时长越长的进程的提高幅度设置的小一点,运行时长越短的进程的提高幅度设置的大一点。In this embodiment, since each associated process is the process most likely to switch with the current foreground process, that is, the process most likely to be used by the user in subsequent use, the importance of these processes to the user is obviously Higher than other processes, in order to avoid these processes being cleaned up, you can increase their priority. Specifically, you can determine the improvement of each process based on their running time in the background. Usually, considering the running time in the background, the more The long process indicates that the longer the time that is ignored by the user, the smaller the chance that the user will switch to the foreground again, so that the longer the running time in the background can be set smaller, the shorter the running time is. The increase in the setting is a bit larger.
例如,上述步骤S104还可以包括:For example, the above step S104 may further include:
获取除该第一进程之外的当前后台进程,作为第二进程;Obtaining a current background process other than the first process as a second process;
获取该第二进程的资源占用率;Obtaining the resource occupancy rate of the second process;
根据该资源占用率降低该第二进程的优先级。The priority of the second process is lowered according to the resource occupancy rate.
本实施例中,该资源占用率可以包括缓存占用率、CPU占用率等。由于根据用户的历史使用习惯来看,那些不属于关联进程集的当前后台进程在短时间内切换至前台使用的几率极小,说明这些进程此时对用户的重要性明显较低,故可以降低这些进程的优先级,使其优先被清理掉,而在降低优先级的过程中,考虑到不同的进程对电子设备的资源占用情况不同,可以优先清理那些资源占用多的进程,也即可以将资源占用率高的进程的降低幅度设置的大一点,将资源占用率低的进程的降低幅度设置的小一点。In this embodiment, the resource occupancy rate may include a cache occupancy rate, a CPU usage rate, and the like. According to the user's historical usage habits, the current background processes that are not part of the associated process set have a very low chance of switching to the foreground in a short period of time, indicating that these processes are significantly less important to users at this time, so they can be reduced. The priority of these processes is prioritized to be cleaned up. In the process of lowering the priority, considering that different processes have different resource occupations of electronic devices, it is possible to preferentially clean processes that occupy more resources, that is, The reduction in the process with a high resource occupancy rate is set larger, and the reduction in the process with a lower resource occupancy rate is set smaller.
S105、根据调整后优先级和该关闭数量控制该当前后台进程的开启与关闭。S105. Control, according to the adjusted priority and the closed quantity, the opening and closing of the current background process.
例如,上述步骤S105具体可以包括:For example, the foregoing step S105 may specifically include:
获取调整后优先级最低的该关闭数量的当前后台进程,作为目标进程;Obtaining the current background process of the closed number with the lowest priority after adjustment as the target process;
检测是否存在正在进行数据收发操作的目标进程;Detecting whether there is a target process that is performing data transceiving operations;
若是,则提高该正在进行数据收发操作的目标进程的优先级,并返回执行上述获取调整后优先级最低的该关闭数量的当前后台进程的步骤;If yes, the priority of the target process that is performing the data transceiving operation is increased, and the step of executing the current background process of the closed number with the lowest priority after the obtaining adjustment is returned;
若否,则关闭该目标进程。If no, the target process is closed.
本实施例中,对于正在进行数据交互的当前后台进程,说明用户此时正在使用该进程,比如利用该进程进行下载操作,为保证该数据交互能完整进行,可以通过调高优先级的方 式确保该进程暂时不会被清理掉。In this embodiment, for the current background process that is performing data interaction, it is indicated that the user is using the process at this time, for example, using the process to perform the download operation, and to ensure that the data interaction can be completely performed, the priority can be ensured by adjusting the priority. The process will not be cleared for the time being.
由上述可知,本实施例提供的进程控制方法,应用于电子设备,通过获取当前前台进程、当前后台进程、以及该当前后台进程的优先级,并根据该当前后台进程的数量确定关闭数量,接着,获取与该当前前台进程对应的关联进程集,并根据该关联进程集对该当前后台进程的优先级进行调整,之后,根据调整后优先级和关闭数量控制该当前后台进程的开启与关闭,从而能结合前台进程灵活管控后台进程,方法简单,有利于节省终端电量,提高终端运行效率。The process control method provided in this embodiment is applied to an electronic device, and the priority of the current foreground process, the current background process, and the current background process is obtained, and the number of shutdowns is determined according to the number of the current background processes, and then And obtaining an associated process set corresponding to the current foreground process, and adjusting the priority of the current background process according to the associated process set, and then controlling the opening and closing of the current background process according to the adjusted priority and the closed quantity, Therefore, the background process can be flexibly controlled and controlled in combination with the foreground process, and the method is simple, which is beneficial to saving terminal power and improving terminal operation efficiency.
在本实施例中,将以该进程控制装置具体集成在电子设备中为例进行详细说明。In this embodiment, the process control device is specifically integrated into the electronic device as an example for detailed description.
请参见图3,一种进程控制方法,具体流程可以如下:Please refer to FIG. 3, a process control method, and the specific process can be as follows:
S201、电子设备获取历史时段内该电子设备中运行的前台进程、每一前台进程对应的后台进程、以及每一后台进程的切换次数和连续两次切换之间的间隔时长,该切换次数为该后台进程切换至前台进程的次数。S201: The electronic device acquires a foreground process running in the electronic device, a background process corresponding to each foreground process, and a number of times of switching between each background process and an interval between two consecutive handovers, where the number of handovers is The number of times the background process switches to the foreground process.
譬如,该历史时段可以是人为设定的过去一个月、或者半年等。正常情况下,在每一前台进程运行的时候,通常都有与其同时运行的至少一个后台进程。For example, the historical period may be an artificially set past month, or half a year, and the like. Under normal circumstances, when each foreground process runs, there is usually at least one background process running at the same time.
S202、电子设备根据该切换次数和间隔时长计算对应后台进程的切换频率。S202. The electronic device calculates a switching frequency of the corresponding background process according to the number of switching times and the interval duration.
譬如,电子设备可以将所有间隔时长相加计算总时长,然后根据该总时长和切换次数之间的商值确定切换频率。For example, the electronic device can add all the interval durations to calculate the total duration, and then determine the switching frequency according to the quotient between the total duration and the number of handovers.
S203、电子设备获取该切换频率高于预设频率的后台进程,或者,获取该切换频率最高的预设位后台进程,作为对应前台进程的关联进程,并添入关联进程集中。S203. The electronic device acquires the background process whose switching frequency is higher than the preset frequency, or acquires the preset background process with the highest switching frequency as the associated process corresponding to the foreground process, and adds the associated process set.
譬如,该预设位可以是人为设定的,比如5或6,由于切换频率越高的后台进程,越可能尽快从后台切换至前台,从而可以根据切换频率确定出最容易与前台进程发生切换操作的后台进程,作为关联进程。For example, the preset bit can be artificially set, such as 5 or 6, because the background process with higher switching frequency is more likely to switch from the background to the foreground as soon as possible, so that the switching frequency can be determined to be the easiest to switch with the foreground process. The background process of the operation, as an associated process.
S204、电子设备获取当前前台进程、当前后台进程、以及该当前后台进程的优先级。S204. The electronic device acquires a current foreground process, a current background process, and a priority of the current background process.
譬如,电子设备可以在电量或运行速度低于一定值,或者CPU占用率高于一定值,或者进程数量超过一定值时,进行当前前台进程和当前后台进程的获取操作,请参见图4,该当前后台进程可以包括{H1、H2…H10}。For example, when the power consumption or the running speed is lower than a certain value, or the CPU usage rate is higher than a certain value, or the number of processes exceeds a certain value, the current foreground process and the current background process are acquired, as shown in FIG. 4, The current background process can include {H1, H2...H10}.
S205、电子设备根据该当前后台进程的数量确定关闭数量,并获取与该当前前台进程对应的该关联进程集。S205. The electronic device determines the number of shutdowns according to the number of the current background processes, and acquires the associated process set corresponding to the current foreground process.
譬如,可以根据指定关闭比例确定关闭数量,比如若该关闭比例是40%,则计算出的关闭数量为4,当然,也会存在关闭数量为非整数的情况,比如3.2,此时,可以通过四舍五入确定为3。For example, the number of closures can be determined according to the specified closure ratio. For example, if the closure ratio is 40%, the calculated number of closures is 4. Of course, there are cases where the number of closures is a non-integer, such as 3.2. Rounding is determined to be 3.
S206、电子设备获取与该关联进程集中关联进程相同的当前后台进程,作为第一进程,并获取该第一进程在后台的运行时长。S206: The electronic device acquires the current background process that is the same as the associated process in the associated process, and serves as the first process, and acquires the running time of the first process in the background.
本实施例中,该第一进程可以包括H1、H3、H4和H8。In this embodiment, the first process may include H1, H3, H4, and H8.
S207、电子设备根据该运行时长提高该第一进程的优先级。S207. The electronic device increases the priority of the first process according to the running time.
譬如,可以将在后台运行时长越长的进程的提高幅度设置的小一点,运行时长越短的进程的提高幅度设置的大一点,此时,该第一进程按照调整后优先级从高到低的顺序可以为{H1、H8、H3、H4}。For example, you can set the increase in the length of the process running in the background to be smaller, and the process with the shorter run time to set a larger increase. At this time, the first process follows the adjusted priority from high to low. The order can be {H1, H8, H3, H4}.
S208、电子设备获取与该关联进程集中关联进程不相同的当前后台进程,作为第二进程,并获取该第二进程的资源占用率。S208: The electronic device acquires a current background process that is different from the associated process in the associated process, and obtains a resource usage rate of the second process.
譬如,该第二进程可以包括H2、H5、H6、H7、H9和H10。For example, the second process can include H2, H5, H6, H7, H9, and H10.
S209、电子设备根据该资源占用率降低该第二进程的优先级。S209. The electronic device reduces the priority of the second process according to the resource occupancy rate.
譬如,可以将资源占用率高的进程的降低幅度设置的大一点,将资源占用率低的进程的降低幅度设置的小一点,此时,该第二进程按照调整后优先级从高到低的顺序可以为{H2、 H9、H6、H7、H5、H10}。For example, the reduction of the process with high resource occupancy rate can be set larger, and the reduction of the process with low resource occupancy rate can be set smaller. At this time, the second process is adjusted according to the adjusted priority from high to low. The order can be {H2, H9, H6, H7, H5, H10}.
需要说明的是,上述步骤S206-S207与S208-S209之间没有明显的先后执行顺序,其可以同时进行,也可以先后进行。It should be noted that there is no obvious sequential execution sequence between the above steps S206-S207 and S208-S209, which may be performed simultaneously or sequentially.
S210、电子设备获取调整后优先级最低的该关闭数量的当前后台进程,作为目标进程,并检测是否存在正在进行数据收发操作的目标进程,若是,则执行下述步骤S211,若否,则可以关闭该目标进程。S210: The electronic device obtains the current background process of the closed number with the lowest priority, and the target process is detected, and detects whether there is a target process in which the data transmission and reception operation is being performed. If yes, the following step S211 is performed, and if not, Close the target process.
譬如,对于所有当前后台进程,按照调整后优先级从高到低的顺序可以依次为{H1、H8、H2、H9、H3、H4、H6、H7、H5、H10},此时,该目标进程可以为H6、H7、H5和H10,需要进一步检测其数据收发情况。For example, for all current background processes, the order of the adjusted priorities from high to low may be {H1, H8, H2, H9, H3, H4, H6, H7, H5, H10}, at this time, the target process It can be H6, H7, H5 and H10, and further data transmission and reception needs to be detected.
S211、电子设备提高该正在进行数据收发操作的目标进程的优先级。S211. The electronic device increases a priority of the target process that is performing the data transceiving operation.
譬如,若正在进行数据收发操作的目标进程为H6,则可以以一定的提升幅度对H6的优先级进行处理,该提升幅度可以是人为设定的,比如2个等级或3个等级,此时,对于处理后的所有当前后台进程,按照调整后优先级从高到低的顺序可以依次为{H1、H8、H2、H9、H6、H3、H4、H7、H5、H10},则需要进行关闭的进程更新为H4、H7、H5和H10。For example, if the target process of the data transmission and reception operation is H6, the priority of H6 can be processed with a certain increase range, which can be artificially set, such as 2 levels or 3 levels. For all current background processes after processing, according to the order of the adjusted priorities from high to low, they can be {H1, H8, H2, H9, H6, H3, H4, H7, H5, H10}, and then need to be closed. The process is updated to H4, H7, H5, and H10.
由上述可知,本实施例提供的进程控制方法,其中电子设备可以获取历史时段内该电子设备中运行的前台进程、每一前台进程对应的后台进程、以及每一后台进程的切换次数和连续两次切换之间的间隔时长,该切换次数为该后台进程切换至前台进程的次数,接着,根据该切换次数和间隔时长计算对应后台进程的切换频率,接着,获取该切换频率高于预设频率的后台进程,或者,获取该切换频率最高的预设位后台进程,作为对应前台进程的关联进程,并添入关联进程集中,之后,当需要进行进程清理时,电子设备获取当前前台进程、当前后台进程、以及该当前后台进程的优先级,之后,根据该当前后台进程的数量确定关闭数量,并获取与该当前前台进程对应的该关联进程集,接着,获取与该关联进程集中关联进程相同的当前后台进程,作为第一进程,并获取该第一进程在后台的运行时长,接着,根据该运行时长提高该第一进程的优先级,与此同时,获取与该关联进程集中关联进程不相同的当前后台进程,作为第二进程,并获取该第二进程的资源占用率,并根据该资源占用率降低该第二进程的优先级,之后,获取调整后优先级最低的该关闭数量的当前后台进程,作为目标进程,并检测是否存在正在进行数据收发操作的目标进程,若是,则提高该正在进行数据收发操作的目标进程的优先级,若否,则可以关闭该目标进程,从而能结合前台进程灵活管控后台进程,方法简单,有利于节省终端电量,提高终端运行效率。According to the above, the process control method provided in this embodiment, wherein the electronic device can acquire the foreground process running in the electronic device, the background process corresponding to each foreground process, and the number of switching times of each background process in the historical period. The interval between the sub-switches is the number of times the background process switches to the foreground process. Then, the switching frequency of the corresponding background process is calculated according to the switching times and the interval duration, and then the switching frequency is higher than the preset frequency. The background process, or the preset background process with the highest switching frequency, is used as an associated process corresponding to the foreground process, and is added to the associated process set. After that, when the process cleanup is required, the electronic device obtains the current foreground process and current a background process, and a priority of the current background process, after which the number of shutdowns is determined according to the number of the current background processes, and the associated process set corresponding to the current foreground process is obtained, and then the same as the associated process in the associated process set is acquired. Current background process as the first process And obtaining the running time of the first process in the background, and then increasing the priority of the first process according to the running time, and simultaneously acquiring the current background process that is different from the associated process in the associated process set, as the second process Obtaining the resource occupancy rate of the second process, and lowering the priority of the second process according to the resource occupancy rate, and then acquiring the current background process of the closed number with the lowest adjusted priority as the target process, and detecting Whether there is a target process in which data transmission and reception operations are being performed, and if so, the priority of the target process in which the data transmission and reception operation is being performed is increased, and if not, the target process can be closed, so that the background process can be flexibly controlled in combination with the foreground process, and the method is simple It is beneficial to save terminal power and improve terminal operation efficiency.
根据上述实施例所描述的方法,本实施例将从进程控制装置的角度进一步进行描述,该进程控制装置可以集成在电子设备中。According to the method described in the above embodiments, the present embodiment will be further described from the perspective of a process control device which can be integrated in an electronic device.
本申请实施例提供一种进程控制装置,包括:An embodiment of the present application provides a process control apparatus, including:
第一获取模块,用于获取该电子设备中的当前前台进程、当前后台进程、以及该当前后台进程的优先级;a first acquiring module, configured to acquire a current foreground process, a current background process, and a priority of the current background process in the electronic device;
确定模块,用于根据该当前后台进程的数量确定关闭数量;a determining module, configured to determine the number of shutdowns according to the number of current background processes;
第二获取模块,用于获取与该当前前台进程对应的关联进程集;a second acquiring module, configured to acquire an associated process set corresponding to the current foreground process;
调整模块,用于根据该关联进程集对该当前后台进程的优先级进行调整;An adjustment module, configured to adjust a priority of the current background process according to the associated process set;
控制模块,用于根据调整后优先级和该关闭数量控制该当前后台进程的开启与关闭。The control module is configured to control the opening and closing of the current background process according to the adjusted priority and the closed quantity.
在一些实施例中,该调整模块具体包括:In some embodiments, the adjusting module specifically includes:
第一获取单元,用于获取与该关联进程集中关联进程相同的当前后台进程,作为第一进程;用于获取该第一进程在后台的运行时长;a first obtaining unit, configured to acquire a current background process that is the same as the associated process in the associated process set, as a first process; and used to obtain a running time of the first process in the background;
提高单元,用于根据该运行时长提高该第一进程的优先级。The raising unit is configured to increase the priority of the first process according to the running time.
在一些实施例中,该提高单元具体用于:In some embodiments, the boosting unit is specifically configured to:
根据该运行时长确定对应第一进程的提高幅度;Determining an increase range corresponding to the first process according to the running time length;
根据该提高幅度提高该第一进程的优先级。The priority of the first process is increased according to the increase.
在一些实施例中,该调整模块还包括:In some embodiments, the adjustment module further includes:
第二获取单元,用于获取除该第一进程之外的当前后台进程,作为第二进程;获取该第二进程的资源占用率;a second acquiring unit, configured to acquire a current background process other than the first process, as a second process, and acquire a resource occupancy rate of the second process;
降低单元,用于根据该资源占用率降低该第二进程的优先级。And a lowering unit, configured to lower the priority of the second process according to the resource occupancy rate.
在一些实施例中,该降低单元具体用于:In some embodiments, the reducing unit is specifically configured to:
根据该资源占用率确定对应第二进程的降低幅度;Determining a reduction range corresponding to the second process according to the resource occupancy rate;
根据该降低幅度降低该第二进程的优先级。The priority of the second process is lowered according to the reduction.
在一些实施例中,该控制模块具体包括:In some embodiments, the control module specifically includes:
第三获取单元,用于获取调整后优先级最低的该关闭数量的当前后台进程,作为目标进程;a third acquiring unit, configured to obtain the current background process of the closed number with the lowest priority after the adjustment, as the target process;
检测单元,用于检测是否存在正在进行数据收发操作的目标进程;a detecting unit, configured to detect whether there is a target process that is performing a data transceiving operation;
关闭单元,用于若是,则提高该正在进行数据收发操作的目标进程的优先级,并返回触发该第三获取单元执行获取调整后优先级最低的该关闭数量的当前后台进程的步骤;若否,则关闭该目标进程。And closing the unit, if yes, increasing the priority of the target process that is performing the data transceiving operation, and returning to the step of triggering the third obtaining unit to perform the current background process with the lowest priority after the adjustment is obtained; , then close the target process.
在一些实施例中,还包括第三获取模块,该第三获取模块具体包括:In some embodiments, the third obtaining module further includes:
第四获取单元,用于获取历史时段内该电子设备中运行的前台进程;获取每一前台进程对应的后台进程、以及每一后台进程的切换次数和连续两次切换之间的间隔时长,该切换次数为该后台进程切换至前台进程的次数;a fourth acquiring unit, configured to acquire a foreground process running in the electronic device in a historical period; obtain a background process corresponding to each foreground process, and a switching duration of each background process and an interval duration between consecutive two switchings, where The number of times of switching is the number of times the background process switches to the foreground process;
确定单元,用于根据该切换次数和间隔时长从该后台进程中确定对应前台进程的关联进程集。And a determining unit, configured to determine, according to the number of switching times and the interval duration, an associated process set corresponding to the foreground process from the background process.
在一些实施例中,该确定单元具体用于:In some embodiments, the determining unit is specifically configured to:
根据该切换次数和间隔时长计算对应后台进程的切换频率;Calculating a switching frequency of the corresponding background process according to the number of switching times and the interval duration;
获取该切换频率高于预设频率的后台进程,或者,获取该切换频率最高的预设位后台进程,作为对应前台进程的关联进程,并添入关联进程集中。Obtain the background process whose switching frequency is higher than the preset frequency, or obtain the preset background process with the highest switching frequency as the associated process corresponding to the foreground process, and add it to the associated process set.
请参阅图5,图5具体描述了本申请实施例提供的进程控制装置,应用于电子设备,其可以包括:第一获取模块10、确定模块20、第二获取模块30、调整模块40和控制模块50,其中:Referring to FIG. 5 , FIG. 5 specifically describes a process control apparatus according to an embodiment of the present application, which is applied to an electronic device, and may include: a first acquiring module 10, a determining module 20, a second acquiring module 30, an adjusting module 40, and a control. Module 50, wherein:
(1)第一获取模块10(1) First acquisition module 10
第一获取模块10,用于获取该电子设备中的当前前台进程、当前后台进程、以及该当前后台进程的优先级。The first obtaining module 10 is configured to acquire a current foreground process, a current background process, and a priority of the current background process in the electronic device.
本实施例中,该优先级可以是根据每个进程的属性信息提前设定好的,比如系统进程的优先级可以高于非系统进程的优先级,即时通讯进程的优先级可以高于购物进程的优先级,等等。In this embodiment, the priority may be set in advance according to the attribute information of each process. For example, the priority of the system process may be higher than the priority of the non-system process, and the priority of the instant messaging process may be higher than the shopping process. Priority, and so on.
由于进程的运行会影响电子设备的电量、CPU占用率以及运行速度等,故该进程控制指令的触发条件可以根据电量、CPU占用率以及运行速度而定,比如,当电量或运行速度低于一定值,或者CPU占用率高于一定值时,电子设备可以进行后台进程清理操作,也即可以触发第一获取模块10进行获取操作。Since the running of the process affects the power consumption, CPU usage, and running speed of the electronic device, the trigger condition of the process control command may be determined according to the power, the CPU usage, and the running speed. For example, when the power or running speed is lower than a certain value. When the value, or the CPU usage is higher than a certain value, the electronic device may perform a background process cleaning operation, that is, the first obtaining module 10 may be triggered to perform the obtaining operation.
(2)确定模块20(2) Determination module 20
确定模块20,用于根据该当前后台进程的数量确定关闭数量。The determining module 20 is configured to determine the number of shutdowns according to the number of current background processes.
本实施例中,该关闭数量可以是提前设定好的,其可以是直接根据前后台进程的数量确定的,比如提前将不同的后台进程数量设置不同的关闭数量,也可以是间接确定的,比如可以人为设定一个关闭比例,然后根据关闭比例和前后台进程的数量计算出关闭数量。In this embodiment, the number of shutdowns may be set in advance, which may be determined directly according to the number of front and back processes, for example, the number of different background processes is set differently in advance, or may be determined indirectly. For example, you can manually set a close ratio, and then calculate the number of closes based on the close ratio and the number of front and back processes.
(3)第二获取模块30(3) Second acquisition module 30
第二获取模块30,用于获取与该当前前台进程对应的关联进程集。The second obtaining module 30 is configured to acquire an associated process set corresponding to the current foreground process.
本实施例中,该关联进程集中包括至少一个关联进程,该关联进程是指与当前前台进程有关的进程,通常,不同的前台进程对应不同的关联进程集。需要说明的是,该关联进程集应当是提前设置好的,也即,请参见图6,该进程控制装置还可以包括第三获取模块60,该第三获取模块60具体可以包括:In this embodiment, the association process includes at least one associated process, and the associated process refers to a process related to the current foreground process. Generally, different foreground processes correspond to different associated process sets. It should be noted that the association process set should be set in advance, that is, the process control apparatus may further include a third obtaining module 60, and the third obtaining module 60 may specifically include:
第四获取单元61,用于获取历史时段内该电子设备中运行的前台进程;获取每一前台进程对应的后台进程、以及每一后台进程的切换次数和连续两次切换之间的间隔时长,该切换次数为该后台进程切换至前台进程的次数;The fourth obtaining unit 61 is configured to acquire a foreground process running in the electronic device during the historical time period; obtain a background process corresponding to each foreground process, and a number of times of switching between each background process and an interval between consecutive two handovers, The number of times of switching is the number of times the background process switches to the foreground process;
确定单元62,用于根据该切换次数和间隔时长从该后台进程中确定对应前台进程的关联进程集。The determining unit 62 is configured to determine, according to the number of switching times and the interval duration, an associated process set corresponding to the foreground process from the background process.
例如,该确定单元62具体可以用于:For example, the determining unit 62 can be specifically configured to:
根据该切换次数和间隔时长计算对应后台进程的切换频率;Calculating a switching frequency of the corresponding background process according to the number of switching times and the interval duration;
获取该切换频率高于预设频率的后台进程,或者,获取该切换频率最高的预设位后台进程,作为对应前台进程的关联进程,并添入关联进程集中。Obtain the background process whose switching frequency is higher than the preset frequency, or obtain the preset background process with the highest switching frequency as the associated process corresponding to the foreground process, and add it to the associated process set.
本实施例中,该历史时段、预设频率和预设位均可以人为提前设定好。具体的,确定单元62可以根据该切换次数和间隔时长计算切换频率,比如可以将所有间隔时长相加计算总时长,根据该总时长和切换次数之间的商值确定切换频率,通常,切换频率越高的后台进程,越可能尽快从后台切换至前台,从而可以根据切换频率确定出最容易与前台进程发生切换操作的后台进程,作为关联进程。In this embodiment, the historical time period, the preset frequency, and the preset position can be manually set in advance. Specifically, the determining unit 62 may calculate the switching frequency according to the switching times and the interval duration. For example, all the interval durations may be added to calculate the total duration, and the switching frequency is determined according to the quotient between the total duration and the number of switching times. Generally, the switching frequency is The higher the background process, the more likely it is to switch from the background to the foreground as soon as possible, so that the background process that is the easiest to switch operation with the foreground process can be determined according to the switching frequency as the associated process.
(4)调整模块40(4) Adjustment module 40
调整模块40,用于根据该关联进程集对该当前后台进程的优先级进行调整。The adjusting module 40 is configured to adjust the priority of the current background process according to the associated process set.
本实施例中,该调整操作可以包括提高和降低,不同的对象可以采取不同的调整操作。In this embodiment, the adjustment operation may include raising and lowering, and different objects may adopt different adjustment operations.
例如,请参见图7,该调整模块40具体可以包括:For example, referring to FIG. 7, the adjustment module 40 may specifically include:
第一获取单元41,用于获取与该关联进程集中关联进程相同的当前后台进程,作为第一进程;用于获取该第一进程在后台的运行时长;a first obtaining unit 41, configured to acquire a current background process that is the same as the associated process in the associated process set, as a first process; and used to obtain a running time of the first process in the background;
提高单元42,用于根据该运行时长提高该第一进程的优先级。The raising unit 42 is configured to increase the priority of the first process according to the running time.
本实施例中,由于每一关联进程都是最有可能与当前前台进程发生切换的进程,也即是在后续使用过程中用户最可能用到的进程,故这些进程对用户的重要性明显要高于其他进程,为避免这些进程被清理掉,可以提高它们的优先级,具体的,该调整模块40可以根据它们在后台的运行时长来确定每一进程的提高幅度,通常,考虑到在后台的运行时长越长的进程,说明被用户忽略的时间越长,用户再次切换至前台使用的几率也越小,从而可以将在后台运行时长越长的进程的提高幅度设置的小一点,运行时长越短的进程的提高幅度设置的大一点。In this embodiment, since each associated process is the process most likely to switch with the current foreground process, that is, the process most likely to be used by the user in subsequent use, the importance of these processes to the user is obviously Higher than other processes, in order to avoid these processes being cleaned up, their priority can be increased. Specifically, the adjustment module 40 can determine the improvement range of each process according to their running time in the background, usually, considering the background. The longer the running time, the longer the time that is ignored by the user, the smaller the chance that the user will switch to the foreground again, so that the longer the running time in the background can be set smaller, the running time is longer. The shorter the process, the larger the increase.
例如,该调整模块40还可以包括:For example, the adjustment module 40 may further include:
第二获取单元43,用于获取除该第一进程之外的当前后台进程,作为第二进程;获取该第二进程的资源占用率;The second obtaining unit 43 is configured to acquire a current background process other than the first process, as a second process, and acquire a resource occupancy rate of the second process.
降低单元44,用于根据该资源占用率降低该第二进程的优先级。The lowering unit 44 is configured to lower the priority of the second process according to the resource occupancy rate.
本实施例中,该资源占用率可以包括缓存占用率、CPU占用率等。由于根据用户的历史使用习惯来看,那些不属于关联进程集的当前后台进程在短时间内切换至前台使用的几率极小,说明这些进程此时对用户的重要性明显较低,故可以降低这些进程的优先级,使其优先被清理掉,而在降低优先级的过程中,考虑到不同的进程对电子设备的资源占用情况不同,可以优先清理那些资源占用多的进程,也即可以将资源占用率高的进程的降低幅度设置的大一点,将资源占用率低的进程的降低幅度设置的小一点。In this embodiment, the resource occupancy rate may include a cache occupancy rate, a CPU usage rate, and the like. According to the user's historical usage habits, the current background processes that are not part of the associated process set have a very low chance of switching to the foreground in a short period of time, indicating that these processes are significantly less important to users at this time, so they can be reduced. The priority of these processes is prioritized to be cleaned up. In the process of lowering the priority, considering that different processes have different resource occupations of electronic devices, it is possible to preferentially clean processes that occupy more resources, that is, The reduction in the process with a high resource occupancy rate is set larger, and the reduction in the process with a lower resource occupancy rate is set smaller.
(5)控制模块50(5) Control module 50
控制模块50,用于根据调整后优先级和该关闭数量控制该当前后台进程的开启与关闭。The control module 50 is configured to control the opening and closing of the current background process according to the adjusted priority and the closed quantity.
例如,请参见图8,该控制模块50具体可以包括:For example, referring to FIG. 8, the control module 50 may specifically include:
第三获取单元51,用于获取调整后优先级最低的该关闭数量的当前后台进程,作为目标进程;The third obtaining unit 51 is configured to obtain the current background process of the closed number with the lowest priority after the adjustment as the target process;
检测单元52,用于检测是否存在正在进行数据收发操作的目标进程;The detecting unit 52 is configured to detect whether there is a target process that is performing a data transceiving operation;
关闭单元53,用于若是,则提高该正在进行数据收发操作的目标进程的优先级,并返回触发该第三获取单元执行获取调整后优先级最低的该关闭数量的当前后台进程的步骤;若否,则关闭该目标进程。The closing unit 53 is configured to: if yes, increase the priority of the target process that is performing the data transceiving operation, and return to the step of triggering the third obtaining unit to perform the current background process with the lowest priority after acquiring the adjusted priority; No, the target process is closed.
本实施例中,对于正在进行数据交互的当前后台进程,说明用户此时正在使用该进程,比如利用该进程进行下载操作,为保证该数据交互能完整进行,可以通过调高优先级的方式确保该进程暂时不会被清理掉。In this embodiment, for the current background process that is performing data interaction, it is indicated that the user is using the process at this time, for example, using the process to perform the download operation, and to ensure that the data interaction can be completely performed, the priority can be ensured by adjusting the priority. The process will not be cleared for the time being.
具体实施时,以上各个单元可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单元的具体实施可参见前面的方法实施例,在此不再赘述。In the specific implementation, the foregoing units may be implemented as a separate entity, or may be implemented in any combination, and may be implemented as the same or a plurality of entities. For the specific implementation of the foregoing, refer to the foregoing method embodiments, and details are not described herein.
由上述可知,本实施例提供的进程控制装置应用于电子设备,通过第一获取模块10获取当前前台进程、当前后台进程、以及该当前后台进程的优先级,确定模块20根据该当前后台进程的数量确定关闭数量,接着,第二获取模块30获取与该当前前台进程对应的关联进程集,调整模块40根据该关联进程集对该当前后台进程的优先级进行调整,之后,控制模块50根据调整后优先级和关闭数量控制该当前后台进程的开启与关闭,从而能结合前台进程灵活管控后台进程,方法简单,有利于节省终端电量,提高终端运行效率。It can be seen from the above that the process control device provided in this embodiment is applied to the electronic device, and the current foreground process, the current background process, and the priority of the current background process are obtained by the first obtaining module 10, and the determining module 20 is configured according to the current background process. The quantity determines the number of shutdowns. Then, the second obtaining module 30 acquires the associated process set corresponding to the current foreground process, and the adjusting module 40 adjusts the priority of the current background process according to the associated process set, and then the control module 50 adjusts according to the adjustment. The post-priority and the number of shutdowns control the opening and closing of the current background process, so that the background process can be flexibly controlled and controlled in combination with the foreground process, and the method is simple, which is beneficial to saving terminal power and improving terminal operating efficiency.
此外,本申请实施例还提供了一种存储介质,其中,该存储介质中存储有多条指令,该指令适于由处理器加载以执行上述任一实施例所描述的进程控制方法。In addition, an embodiment of the present application further provides a storage medium, wherein the storage medium stores a plurality of instructions, the instructions being adapted to be loaded by a processor to execute the process control method described in any one of the foregoing embodiments.
另外,本申请实施例还提供了一种电子设备,该电子设备可以是智能手机、平板电脑等设备。图9所示,电子设备700包括处理器701、存储器702、显示屏703以及控制电路704。其中,处理器701分别与存储器702、显示屏703、控制电路704电性连接。In addition, the embodiment of the present application further provides an electronic device, which may be a device such as a smart phone or a tablet computer. As shown in FIG. 9, the electronic device 700 includes a processor 701, a memory 702, a display screen 703, and a control circuit 704. The processor 701 is electrically connected to the memory 702, the display screen 703, and the control circuit 704, respectively.
处理器701是电子设备700的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器702内的应用程序,以及调用存储在存储器702内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。The processor 701 is a control center of the electronic device 700, which connects various parts of the entire electronic device using various interfaces and lines, executes the electronic by running or loading an application stored in the memory 702, and calling data stored in the memory 702. The various functions and processing data of the device enable overall monitoring of the electronic device.
在本实施例中,电子设备700中的处理器701会按照如下的步骤,将一个或一个以上的应用程序的进程对应的指令加载到存储器702中,并由处理器701来运行存储在存储器702中的应用程序,从而实现各种功能:In this embodiment, the processor 701 in the electronic device 700 loads the instructions corresponding to the process of one or more applications into the memory 702 according to the following steps, and is stored in the memory 702 by the processor 701. In the application, thus implementing various functions:
获取该电子设备中的当前前台进程、当前后台进程、以及该当前后台进程的优先级;Obtaining a current foreground process, a current background process, and a priority of the current background process in the electronic device;
根据该当前后台进程的数量确定关闭数量;Determine the number of shutdowns based on the number of current background processes;
获取与该当前前台进程对应的关联进程集;Obtaining an associated process set corresponding to the current foreground process;
根据该关联进程集对该当前后台进程的优先级进行调整;Adjusting the priority of the current background process according to the associated process set;
根据调整后优先级和该关闭数量控制该当前后台进程的开启与关闭。The current background process is turned on and off according to the adjusted priority and the closed number.
在一些实施例中,在根据该关联进程集对该当前后台进程的优先级进行调整时,该处理器用于执行以下步骤:In some embodiments, when the priority of the current background process is adjusted according to the associated process set, the processor is configured to perform the following steps:
获取与该关联进程集中关联进程相同的当前后台进程,作为第一进程;Obtaining the current background process that is the same as the associated process in the associated process set as the first process;
获取该第一进程在后台的运行时长;Get the running time of the first process in the background;
根据该运行时长提高该第一进程的优先级。The priority of the first process is increased according to the runtime.
在一些实施例中,在根据该运行时长提高该第一进程的优先级时,该处理器用于执行以下步骤:In some embodiments, the processor is configured to perform the following steps when the priority of the first process is increased according to the runtime:
根据该运行时长确定对应第一进程的提高幅度;Determining an increase range corresponding to the first process according to the running time length;
根据该提高幅度提高该第一进程的优先级。The priority of the first process is increased according to the increase.
在一些实施例中,在根据该关联进程集对该当前后台进程的优先级进行调整时,该处理器还用于执行以下步骤:In some embodiments, when the priority of the current background process is adjusted according to the associated process set, the processor is further configured to perform the following steps:
获取除该第一进程之外的当前后台进程,作为第二进程;Obtaining a current background process other than the first process as a second process;
获取该第二进程的资源占用率;Obtaining the resource occupancy rate of the second process;
根据该资源占用率降低该第二进程的优先级。The priority of the second process is lowered according to the resource occupancy rate.
在一些实施例中,在根据该资源占用率降低该第二进程的优先级时,该处理器用于执行以下步骤:In some embodiments, the processor is configured to perform the following steps when the priority of the second process is lowered according to the resource occupancy rate:
根据该资源占用率确定对应第二进程的降低幅度;Determining a reduction range corresponding to the second process according to the resource occupancy rate;
根据该降低幅度降低该第二进程的优先级。The priority of the second process is lowered according to the reduction.
在一些实施例中,在根据该当前后台进程的数量确定关闭数量时,该处理器用于执行以下步骤:In some embodiments, the processor is configured to perform the following steps when determining the number of shutdowns based on the number of current background processes:
获取设定的关闭比例;Get the set closure ratio;
根据该关闭比例和当前后台进程的数量计算出关闭数量。在一些实施例中,在根据调整后优先级和该关闭数量控制该当前后台进程的开启与关闭时,该处理器用于执行以下步骤:The number of shutdowns is calculated based on the shutdown ratio and the number of current background processes. In some embodiments, the processor is configured to perform the following steps when controlling the opening and closing of the current background process according to the adjusted priority and the number of closures:
获取调整后优先级最低的该关闭数量的当前后台进程,作为目标进程;Obtaining the current background process of the closed number with the lowest priority after adjustment as the target process;
检测是否存在正在进行数据收发操作的目标进程;Detecting whether there is a target process that is performing data transceiving operations;
若是,则提高该正在进行数据收发操作的目标进程的优先级,并返回执行该获取调整后优先级最低的该关闭数量的当前后台进程的步骤;If yes, the priority of the target process that is performing the data transceiving operation is increased, and the step of executing the current background process of the closed number with the lowest priority after the obtaining adjustment is returned;
若否,则关闭该目标进程。If no, the target process is closed.
在一些实施例中,在获取与该当前前台进程对应的关联进程集之前,该处理器还用于执行以下步骤:In some embodiments, the processor is further configured to perform the following steps before acquiring the associated process set corresponding to the current foreground process:
获取历史时段内该电子设备中运行的前台进程;Obtaining a foreground process running in the electronic device during the historical time period;
获取每一前台进程对应的后台进程、以及每一后台进程的切换次数和连续两次切换之间的间隔时长,该切换次数为该后台进程切换至前台进程的次数;Obtaining a background process corresponding to each foreground process, and a number of times of switching between each background process and an interval between two consecutive handovers, where the number of handovers is the number of times the background process switches to the foreground process;
根据该切换次数和间隔时长从该后台进程中确定对应前台进程的关联进程集。The associated process set corresponding to the foreground process is determined from the background process according to the number of times of switching and the interval duration.
在一些实施例中,在根据该切换次数和间隔时长从该后台进程中确定对应前台进程的关联进程集时,该处理器用于执行以下步骤:In some embodiments, when determining the associated process set of the corresponding foreground process from the background process according to the number of times of switching and the interval duration, the processor is configured to perform the following steps:
根据该切换次数和间隔时长计算对应后台进程的切换频率;Calculating a switching frequency of the corresponding background process according to the number of switching times and the interval duration;
获取该切换频率高于预设频率的后台进程,或者,获取该切换频率最高的预设位后台进程,作为对应前台进程的关联进程,并添入关联进程集中。Obtain the background process whose switching frequency is higher than the preset frequency, or obtain the preset background process with the highest switching frequency as the associated process corresponding to the foreground process, and add it to the associated process set.
存储器702可用于存储应用程序和数据。存储器702存储的应用程序中包含有可在处理器中执行的指令。应用程序可以组成各种功能模块。处理器701通过运行存储在存储器702的应用程序,从而执行各种功能应用以及数据处理。 Memory 702 can be used to store applications and data. The application stored in the memory 702 contains instructions executable in the processor. Applications can form various functional modules. The processor 701 executes various functional applications and data processing by running an application stored in the memory 702.
显示屏703可用于显示由用户输入的信息或提供给用户的信息以及终端的各种图形用户接口,这些图形用户接口可以由图像、文本、图标、视频和其任意组合来构成。The display screen 703 can be used to display information entered by the user or information provided to the user as well as various graphical user interfaces of the terminal, which can be composed of images, text, icons, video, and any combination thereof.
控制电路704与显示屏703电性连接,用于控制显示屏703显示信息。The control circuit 704 is electrically connected to the display screen 703 for controlling the display screen 703 to display information.
在一些实施例中,如图9所示,电子设备700还包括:射频电路705、输入单元706、音频电路707、传感器708以及电源709。其中,处理器701分别与射频电路705、输入单元706、音频电路707、传感器708以及电源709电性连接。In some embodiments, as shown in FIG. 9, the electronic device 700 further includes a radio frequency circuit 705, an input unit 706, an audio circuit 707, a sensor 708, and a power source 709. The processor 701 is electrically connected to the radio frequency circuit 705, the input unit 706, the audio circuit 707, the sensor 708, and the power source 709, respectively.
射频电路705用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。The radio frequency circuit 705 is configured to transmit and receive radio frequency signals to establish wireless communication with a network device or other electronic device through wireless communication, and to transmit and receive signals with the network device or other electronic devices.
输入单元706可用于接收输入的数字、字符信息或用户特征信息(例如指纹),以及产 生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。其中,输入单元706可以包括指纹识别模组。 Input unit 706 can be used to receive input numbers, character information or user characteristic information (e. g., fingerprints), as well as keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls. The input unit 706 can include a fingerprint identification module.
音频电路707可通过扬声器、传声器提供用户与终端之间的音频接口。The audio circuit 707 can provide an audio interface between the user and the terminal through a speaker and a microphone.
电子设备700还可以包括至少一种传感器708,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在终端移动到耳边时,关闭显示面板和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。 Electronic device 700 may also include at least one type of sensor 708, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may close the display panel and/or the backlight when the terminal moves to the ear. . As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for the terminal can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, no longer Narration.
电源709用于给电子设备700的各个部件供电。在一些实施例中,电源709可以通过电源管理系统与处理器701逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。 Power source 709 is used to power various components of electronic device 700. In some embodiments, the power supply 709 can be logically coupled to the processor 701 through a power management system to enable functions such as managing charging, discharging, and power management through the power management system.
尽管图9中未示出,电子设备700还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 9, the electronic device 700 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
本申请实施例提供的电子设备和存储介质,通过获取当前前台进程、当前后台进程、以及该当前后台进程的优先级,并根据该当前后台进程的数量确定关闭数量,接着,获取与该当前前台进程对应的关联进程集,并根据该关联进程集对该当前后台进程的优先级进行调整,之后,根据调整后优先级和关闭数量控制该当前后台进程的开启与关闭,从而能结合前台进程灵活管控后台进程,方法简单,有利于节省终端电量,提高终端运行效率。The electronic device and the storage medium provided by the embodiment of the present application obtain the priority of the current foreground process, the current background process, and the current background process, and determine the number of shutdowns according to the number of the current background processes, and then acquire the current foreground. The associated process set corresponding to the process, and adjusts the priority of the current background process according to the associated process set, and then controls the opening and closing of the current background process according to the adjusted priority and the closed quantity, thereby being flexible in combination with the foreground process. Controlling the background process, the method is simple, which is conducive to saving terminal power and improving terminal operation efficiency.
需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。It should be noted that those skilled in the art can understand that all or part of the steps of the foregoing embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium. The storage medium may include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like.
综上所述,虽然本申请已以优选实施例揭露如上,但上述优选实施例并非用以限制本申请,本领域的普通技术人员,在不脱离本申请的精神和范围内,均可作各种更动与润饰,因此本申请的保护范围以权利要求界定的范围为准。In the above, although the present application has been disclosed in the above preferred embodiments, the preferred embodiments are not intended to limit the application, and those skilled in the art can make various modifications without departing from the spirit and scope of the application. The invention is modified and retouched, and the scope of protection of the present application is determined by the scope defined by the claims.

Claims (20)

  1. 一种进程控制方法,应用于电子设备,其包括:A process control method for an electronic device, comprising:
    获取所述电子设备中的当前前台进程、当前后台进程、以及所述当前后台进程的优先级;Obtaining a current foreground process, a current background process, and a priority of the current background process in the electronic device;
    根据所述当前后台进程的数量确定关闭数量;Determining the number of shutdowns according to the number of current background processes;
    获取与所述当前前台进程对应的关联进程集;Obtaining an associated process set corresponding to the current foreground process;
    根据所述关联进程集对所述当前后台进程的优先级进行调整;Adjusting the priority of the current background process according to the associated process set;
    根据调整后优先级和所述关闭数量控制所述当前后台进程的开启与关闭。The opening and closing of the current background process is controlled according to the adjusted priority level and the closed quantity.
  2. 根据权利要求1所述的进程控制方法,其中,所述根据所述关联进程集对所述当前后台进程的优先级进行调整,包括:The process control method according to claim 1, wherein the adjusting the priority of the current background process according to the associated process set comprises:
    获取与所述关联进程集中关联进程相同的当前后台进程,作为第一进程;Obtaining the current background process that is the same as the associated process in the associated process set, as the first process;
    获取所述第一进程在后台的运行时长;Obtaining a running time of the first process in the background;
    根据所述运行时长提高所述第一进程的优先级。The priority of the first process is increased according to the running time.
  3. 根据权利要求2所述的进程控制方法,其中,所述根据所述运行时长提高所述第一进程的优先级,包括:The process control method according to claim 2, wherein the increasing the priority of the first process according to the running time length comprises:
    根据所述运行时长确定对应第一进程的提高幅度;Determining an increase range of the corresponding first process according to the running time length;
    根据所述提高幅度提高所述第一进程的优先级。The priority of the first process is increased according to the increase range.
  4. 根据权利要求2所述的进程控制方法,其中,所述根据所述关联进程集对所述当前后台进程的优先级进行调整,还包括:The process control method according to claim 2, wherein the adjusting the priority of the current background process according to the associated process set further includes:
    获取除所述第一进程之外的当前后台进程,作为第二进程;Obtaining a current background process other than the first process as a second process;
    获取所述第二进程的资源占用率;Obtaining a resource occupancy rate of the second process;
    根据所述资源占用率降低所述第二进程的优先级。The priority of the second process is lowered according to the resource occupancy rate.
  5. 根据权利要求4所述的进程控制方法,其中,所述根据所述资源占用率降低所述第二进程的优先级,包括:The process control method according to claim 4, wherein the reducing the priority of the second process according to the resource occupancy rate comprises:
    根据所述资源占用率确定对应第二进程的降低幅度;Determining a reduction range corresponding to the second process according to the resource occupancy rate;
    根据所述降低幅度降低所述第二进程的优先级。The priority of the second process is reduced according to the reduction.
  6. 根据权利要求1所述的进程控制方法,其中,所述根据所述当前后台进程的数量确定关闭数量,包括:The process control method according to claim 1, wherein the determining the number of shutdowns according to the number of the current background processes comprises:
    获取设定的关闭比例;Get the set closure ratio;
    根据所述关闭比例和当前后台进程的数量计算出关闭数量。The number of shutdowns is calculated based on the shutdown ratio and the number of current background processes.
  7. 根据权利要求1所述的进程控制方法,其中,所述根据调整后优先级和所述关闭数量控制所述当前后台进程的开启与关闭,包括:The process control method according to claim 1, wherein the controlling the opening and closing of the current background process according to the adjusted priority and the number of shutdowns comprises:
    获取调整后优先级最低的所述关闭数量的当前后台进程,作为目标进程;Obtaining the current background process of the closed number with the lowest priority after adjustment as a target process;
    检测是否存在正在进行数据收发操作的目标进程;Detecting whether there is a target process that is performing data transceiving operations;
    若是,则提高所述正在进行数据收发操作的目标进程的优先级,并返回执行所述获取调整后优先级最低的所述关闭数量的当前后台进程的步骤;If yes, the priority of the target process that is performing the data transceiving operation is increased, and the step of performing the current background process of the closed number with the lowest priority after the acquisition adjustment is performed;
    若否,则关闭所述目标进程。If no, the target process is closed.
  8. 根据权利要求1所述的进程控制方法,其中,在获取与所述当前前台进程对应的关联进程集之前,还包括:The process control method according to claim 1, wherein before acquiring the associated process set corresponding to the current foreground process, the method further includes:
    获取历史时段内所述电子设备中运行的前台进程;Obtaining a foreground process running in the electronic device during a historical time period;
    获取每一前台进程对应的后台进程、以及每一后台进程的切换次数和连续两次切换之间的间隔时长,所述切换次数为所述后台进程切换至前台进程的次数;Obtaining a background process corresponding to each foreground process, and a number of times of switching between each background process and an interval between two consecutive handovers, where the number of handovers is the number of times the background process switches to the foreground process;
    根据所述切换次数和间隔时长从所述后台进程中确定对应前台进程的关联进程集。And determining, according to the number of switching times and the interval duration, an associated process set corresponding to the foreground process from the background process.
  9. 根据权利要求8所述的进程控制方法,其中,所述根据所述切换次数和间隔时长从所述后台进程中确定对应前台进程的关联进程集,包括:The process control method according to claim 8, wherein the determining the associated process set of the corresponding foreground process from the background process according to the number of times of the switch and the interval duration includes:
    根据所述切换次数和间隔时长计算对应后台进程的切换频率;Calculating a switching frequency of the corresponding background process according to the switching times and the interval duration;
    获取所述切换频率高于预设频率的后台进程,或者,获取所述切换频率最高的预设位后台进程,作为对应前台进程的关联进程,并添入关联进程集中。Obtaining the background process whose switching frequency is higher than the preset frequency, or acquiring the preset background process with the highest switching frequency as the associated process corresponding to the foreground process, and adding the associated process set.
  10. 一种进程控制装置,应用于电子设备,其包括:A process control device is applied to an electronic device, including:
    第一获取模块,用于获取所述电子设备中的当前前台进程、当前后台进程、以及所述当前后台进程的优先级;a first acquiring module, configured to acquire a current foreground process, a current background process, and a priority of the current background process in the electronic device;
    确定模块,用于根据所述当前后台进程的数量确定关闭数量;a determining module, configured to determine a number of shutdowns according to the number of the current background processes;
    第二获取模块,用于获取与所述当前前台进程对应的关联进程集;a second acquiring module, configured to acquire an associated process set corresponding to the current foreground process;
    调整模块,用于根据所述关联进程集对所述当前后台进程的优先级进行调整;An adjustment module, configured to adjust a priority of the current background process according to the associated process set;
    控制模块,用于根据调整后优先级和所述关闭数量控制所述当前后台进程的开启与关闭。And a control module, configured to control opening and closing of the current background process according to the adjusted priority and the closed quantity.
  11. 根据权利要求10所述的进程控制装置,其中,所述调整模块具体包括:The process control device of claim 10, wherein the adjusting module specifically comprises:
    第一获取单元,用于获取与所述关联进程集中关联进程相同的当前后台进程,作为第一进程;用于获取所述第一进程在后台的运行时长;a first acquiring unit, configured to acquire a current background process that is the same as the associated process in the associated process, as a first process, and configured to acquire a running time of the first process in the background;
    提高单元,用于根据所述运行时长提高所述第一进程的优先级。And an improvement unit, configured to increase a priority of the first process according to the running time.
  12. 根据权利要求11所述的进程控制装置,其中,所述提高单元具体用于:The process control device according to claim 11, wherein the improvement unit is specifically configured to:
    根据所述运行时长确定对应第一进程的提高幅度;Determining an increase range of the corresponding first process according to the running time length;
    根据所述提高幅度提高所述第一进程的优先级。The priority of the first process is increased according to the increase range.
  13. 根据权利要求11所述的进程控制装置,其中,所述调整模块还包括:The process control device of claim 11, wherein the adjustment module further comprises:
    第二获取单元,用于获取除所述第一进程之外的当前后台进程,作为第二进程;获取所述第二进程的资源占用率;a second acquiring unit, configured to acquire a current background process other than the first process, as a second process, and acquire a resource occupancy rate of the second process;
    降低单元,用于根据所述资源占用率降低所述第二进程的优先级。And a lowering unit, configured to reduce a priority of the second process according to the resource occupancy rate.
  14. 根据权利要求13所述的进程控制装置,其中,所述降低单元具体用于:The process control device according to claim 13, wherein the reducing unit is specifically configured to:
    根据所述资源占用率确定对应第二进程的降低幅度;Determining a reduction range corresponding to the second process according to the resource occupancy rate;
    根据所述降低幅度降低所述第二进程的优先级。The priority of the second process is reduced according to the reduction.
  15. 根据权利要求10所述的进程控制装置,其中,所述控制模块具体包括:The process control device according to claim 10, wherein the control module specifically comprises:
    第三获取单元,用于获取调整后优先级最低的所述关闭数量的当前后台进程,作为目标进程;a third acquiring unit, configured to obtain the current background process of the closed number with the lowest priority after adjustment as a target process;
    检测单元,用于检测是否存在正在进行数据收发操作的目标进程;a detecting unit, configured to detect whether there is a target process that is performing a data transceiving operation;
    关闭单元,用于若是,则提高所述正在进行数据收发操作的目标进程的优先级,并返回触发所述第三获取单元执行获取调整后优先级最低的所述关闭数量的当前后台进程的步骤;若否,则关闭所述目标进程。And closing the unit, if yes, increasing the priority of the target process that is performing the data transceiving operation, and returning to the step of triggering the third acquiring unit to perform the acquiring the adjusted minimum number of the current background process with the lowest priority If not, the target process is closed.
  16. 根据权利要求10所述的进程控制装置,其中,还包括第三获取模块,所述第三获取模块具体包括:The process control device of claim 10, further comprising a third obtaining module, the third acquiring module specifically comprising:
    第四获取单元,用于获取历史时段内所述电子设备中运行的前台进程;获取每一前台进程对应的后台进程、以及每一后台进程的切换次数和连续两次切换之间的间隔时长,所述切换次数为所述后台进程切换至前台进程的次数;a fourth acquiring unit, configured to acquire a foreground process running in the electronic device in a historical period; obtain a background process corresponding to each foreground process, and a switching duration of each background process and an interval duration between consecutive two switching operations, The number of times of switching is the number of times the background process switches to the foreground process;
    确定单元,用于根据所述切换次数和间隔时长从所述后台进程中确定对应前台进程的关联进程集。And a determining unit, configured to determine, according to the number of switching times and the interval duration, an associated process set corresponding to the foreground process from the background process.
  17. 根据权利要求16所述的进程控制装置,其中,所述确定单元具体用于:The process control device according to claim 16, wherein the determining unit is specifically configured to:
    根据所述切换次数和间隔时长计算对应后台进程的切换频率;Calculating a switching frequency of the corresponding background process according to the switching times and the interval duration;
    获取所述切换频率高于预设频率的后台进程,或者,获取所述切换频率最高的预设位 后台进程,作为对应前台进程的关联进程,并添入关联进程集中。Obtaining the background process whose switching frequency is higher than the preset frequency, or acquiring the preset background process with the highest switching frequency as the associated process corresponding to the foreground process, and adding the associated process set.
  18. 一种存储介质,其中,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行权利要求1所述的进程控制方法。A storage medium, wherein the storage medium stores a plurality of instructions adapted to be loaded by a processor to perform the process control method of claim 1.
  19. 一种电子设备,其包括处理器和存储器,所述处理器与所述存储器电性连接,所述存储器用于存储指令和数据,所述处理器用于调用所述存储指令以执行权利要求1所述的进程控制方法。An electronic device comprising a processor and a memory, the processor being electrically connected to the memory, the memory for storing instructions and data, the processor for calling the storage instruction to perform the claim 1 The process control method described.
  20. 根据权利要求19所述的电子设备,其中,所述处理器用于执行以下步骤:The electronic device of claim 19, wherein the processor is operative to perform the following steps:
    获取与所述关联进程集中关联进程相同的当前后台进程,作为第一进程;Obtaining the current background process that is the same as the associated process in the associated process set, as the first process;
    获取所述第一进程在后台的运行时长;Obtaining a running time of the first process in the background;
    根据所述运行时长提高所述第一进程的优先级。The priority of the first process is increased according to the running time.
PCT/CN2018/094251 2017-07-31 2018-07-03 Process control method and apparatus, storage medium, and electronic device WO2019024642A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710643030.8A CN107463403B (en) 2017-07-31 2017-07-31 Process control method, device, storage medium and electronic equipment
CN201710643030.8 2017-07-31

Publications (1)

Publication Number Publication Date
WO2019024642A1 true WO2019024642A1 (en) 2019-02-07

Family

ID=60548126

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/094251 WO2019024642A1 (en) 2017-07-31 2018-07-03 Process control method and apparatus, storage medium, and electronic device

Country Status (2)

Country Link
CN (2) CN111309400A (en)
WO (1) WO2019024642A1 (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111309400A (en) * 2017-07-31 2020-06-19 Oppo广东移动通信有限公司 Process control method, device, storage medium and electronic equipment
CN109992397A (en) * 2017-12-29 2019-07-09 广东欧珀移动通信有限公司 Process handling method and device, electronic equipment, computer readable storage medium
CN109992393A (en) * 2017-12-29 2019-07-09 广东欧珀移动通信有限公司 Application processing method and device, electronic equipment, computer readable storage medium
CN109992400A (en) * 2017-12-29 2019-07-09 广东欧珀移动通信有限公司 Resource allocation methods, device, mobile terminal and computer readable storage medium
CN110032429B (en) * 2018-01-10 2022-03-18 Oppo广东移动通信有限公司 Information processing method and device, mobile terminal and computer readable storage medium
CN110046031B (en) * 2018-01-12 2021-11-09 Oppo广东移动通信有限公司 Application processing method and device, electronic equipment and computer readable storage medium
CN110633134A (en) * 2018-06-22 2019-12-31 中兴通讯股份有限公司 Application program management method and device, mobile terminal and storage medium
CN109388491A (en) * 2018-08-23 2019-02-26 深圳点猫科技有限公司 A kind of method and system for the picture fluency improving education operating system
CN109324883A (en) * 2018-08-29 2019-02-12 烽火通信科技股份有限公司 The EMS memory management process and system of intelligent terminal
CN112835689A (en) * 2019-11-25 2021-05-25 航天信息股份有限公司 Method and device for controlling application process
CN111008079B (en) * 2019-12-10 2022-10-21 Oppo(重庆)智能科技有限公司 Process management method, device, storage medium and electronic equipment
CN111221650A (en) * 2019-12-31 2020-06-02 青岛海尔科技有限公司 System resource recovery method and device based on process type association
CN113535250A (en) * 2020-04-13 2021-10-22 华为技术有限公司 Application keep-alive method and device and electronic equipment
CN111611020A (en) * 2020-04-14 2020-09-01 上海卓易科技股份有限公司 Application process searching and killing method and device for application program
CN111651261B (en) * 2020-07-07 2023-04-07 Oppo(重庆)智能科技有限公司 Process management method and device, terminal equipment and computer readable storage medium
CN111857513B (en) * 2020-07-17 2022-04-29 维沃移动通信有限公司 Background program control method and device and electronic equipment
CN112231090A (en) * 2020-11-04 2021-01-15 Oppo广东移动通信有限公司 Application process management method and device and terminal equipment
CN115016631B (en) * 2021-11-22 2023-07-18 荣耀终端有限公司 Process scheduling method and terminal equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103500121A (en) * 2013-09-29 2014-01-08 深圳Tcl新技术有限公司 Process managing method and device
US20140013331A1 (en) * 2011-03-19 2014-01-09 Fujitsu Limited Terminal device, process management method, and recording medium
CN105843650A (en) * 2016-03-31 2016-08-10 青岛海信移动通信技术股份有限公司 Application program management method and device in intelligent terminal
CN106325990A (en) * 2016-08-19 2017-01-11 宇龙计算机通信科技(深圳)有限公司 Control method of application program, control device and terminal
CN107463403A (en) * 2017-07-31 2017-12-12 广东欧珀移动通信有限公司 Course control method, device, storage medium and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7987160B2 (en) * 2006-01-30 2011-07-26 Microsoft Corporation Status tool to expose metadata read and write queues
CN105279098B (en) * 2014-07-22 2019-02-12 中兴通讯股份有限公司 The method for cleaning and device of memory
CN106201821A (en) * 2016-06-29 2016-12-07 宇龙计算机通信科技(深圳)有限公司 Terminal control method, terminal control mechanism and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140013331A1 (en) * 2011-03-19 2014-01-09 Fujitsu Limited Terminal device, process management method, and recording medium
CN103500121A (en) * 2013-09-29 2014-01-08 深圳Tcl新技术有限公司 Process managing method and device
CN105843650A (en) * 2016-03-31 2016-08-10 青岛海信移动通信技术股份有限公司 Application program management method and device in intelligent terminal
CN106325990A (en) * 2016-08-19 2017-01-11 宇龙计算机通信科技(深圳)有限公司 Control method of application program, control device and terminal
CN107463403A (en) * 2017-07-31 2017-12-12 广东欧珀移动通信有限公司 Course control method, device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN107463403B (en) 2020-04-21
CN107463403A (en) 2017-12-12
CN111309400A (en) 2020-06-19

Similar Documents

Publication Publication Date Title
WO2019024642A1 (en) Process control method and apparatus, storage medium, and electronic device
US10783364B2 (en) Method, apparatus and device for waking up voice interaction function based on gesture, and computer readable medium
CN106055097B (en) Bright screen control method and device and electronic equipment
CN106020670B (en) Screen lighting control method and device and electronic equipment
WO2018214885A1 (en) Radio frequency interference processing method and electronic device
KR20160001964A (en) Operating Method For Microphones and Electronic Device supporting the same
WO2019024641A1 (en) Data synchronization method and apparatus, storage medium and electronic device
CN107302633B (en) Application control method, device, storage medium and electronic equipment
CN110392298B (en) Volume adjusting method, device, equipment and medium
CN108073458B (en) Memory recovery method, mobile terminal and computer-readable storage medium
KR102151135B1 (en) Method for managing power and electronic device thereof
WO2019024640A1 (en) Process control method, apparatus, storage medium, and electronic device
EP2922212A2 (en) Method, apparatus and system for controlling emission
CN108196482B (en) Power consumption control method and device, storage medium and electronic equipment
CN108924375B (en) Ringtone volume processing method and device, storage medium and terminal
WO2014180138A1 (en) Method and device for video processing
CN107402808B (en) Process management method, device, storage medium and electronic equipment
EP3015983A1 (en) Method and device for optimizing memory
KR20150107448A (en) Task Migration Method and Apparatus
CN108984066B (en) Application icon display method and mobile terminal
CN110362185B (en) Control method for screen brightness adjustment, terminal and computer readable storage medium
US9678868B2 (en) Method and device for optimizing memory
JP7272694B2 (en) Method and terminal for reducing power consumption of terminal
CN111443803A (en) Mode switching method, device, storage medium and mobile terminal
CN107291213B (en) Mode selection method, device, terminal and computer readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18841104

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18841104

Country of ref document: EP

Kind code of ref document: A1