CN116737338A - Processing methods, devices, equipment and storage media - Google Patents
Processing methods, devices, equipment and storage media Download PDFInfo
- Publication number
- CN116737338A CN116737338A CN202310689635.6A CN202310689635A CN116737338A CN 116737338 A CN116737338 A CN 116737338A CN 202310689635 A CN202310689635 A CN 202310689635A CN 116737338 A CN116737338 A CN 116737338A
- Authority
- CN
- China
- Prior art keywords
- group
- running
- processes
- processor
- priority
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title abstract description 33
- 238000000034 method Methods 0.000 claims abstract description 372
- 230000008569 process Effects 0.000 claims abstract description 350
- 238000004422 calculation algorithm Methods 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 abstract description 7
- 230000006870 function Effects 0.000 description 21
- 230000000694 effects Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000001360 synchronised effect Effects 0.000 description 5
- 230000003068 static effect Effects 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000000638 solvent extraction Methods 0.000 description 2
- 241000699670 Mus sp. Species 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000001815 facial effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/484—Precedence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5021—Priority
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本申请公开了一种处理方法、装置、设备和存储介质,属于计算机技术领域,该方法可以包括在确定电子设备处于目标场景的情况下,将第一进程的组别设置为第一组别,并将第二进程的组别设置为第二组别;其中,第一进程为处于前台运行状态且用户可见的进程,第二进程为处于前台运行状态且用户不可见的进程,第一组别中进程的运行优先级高于第二组别中进程的运行优先级。
The present application discloses a processing method, device, equipment and storage medium, belonging to the field of computer technology. The method may include setting the group of the first process as the first group when it is determined that the electronic device is in the target scene, And set the group of the second process to the second group; where the first process is a process that is running in the foreground and visible to the user, the second process is a process that is running in the foreground and is invisible to the user, and the first group The running priority of the process in the second group is higher than the running priority of the process in the second group.
Description
技术领域Technical field
本申请属于计算机技术领域,具体涉及一种处理方法、装置、设备和存储介质。This application belongs to the field of computer technology, and specifically relates to a processing method, device, equipment and storage medium.
背景技术Background technique
在电子设备的操作系统中,控制组(Control Group,Cgroup)用于管理系统资源的机制,可以将操作系统中的进程划分成不同的组,以对每个组分配不同的系统资源,从而实现资源管理和优化。In the operating system of electronic equipment, the control group (Cgroup) is a mechanism used to manage system resources. It can divide the processes in the operating system into different groups to allocate different system resources to each group, thereby achieving Resource management and optimization.
在相关技术中,可以通过进程优先级调整算法(adjust,ADJ)实现进程的分组,即定期计算操作系统中所有进程的优先级(ADJ)值,并根据ADJ值对各个进程进行分组。然而,在一些应用启动、切换、人脸或指纹解锁等场景下,通过上述方式得到的分组结果,容易导致操作系统卡顿的情况。In related technologies, process grouping can be achieved through a process priority adjustment algorithm (adjust, ADJ), that is, the priority (ADJ) values of all processes in the operating system are regularly calculated, and each process is grouped according to the ADJ value. However, in some scenarios such as application startup, switching, face or fingerprint unlocking, etc., the grouping results obtained through the above method can easily cause the operating system to freeze.
发明内容Contents of the invention
本申请实施例的目的是提供一种处理方法、装置、设备和存储介质,能够解决相关技术操作系统卡顿的问题。The purpose of the embodiments of this application is to provide a processing method, device, equipment and storage medium that can solve the problem of stuck operating systems in related technologies.
第一方面,本申请实施例提供了一种处理方法,该方法可以包括:In the first aspect, embodiments of the present application provide a processing method, which may include:
在确定电子设备处于目标场景的情况下,将第一进程的组别设置为第一组别,并将第二进程的组别设置为第二组别;When it is determined that the electronic device is in the target scene, the group of the first process is set to the first group, and the group of the second process is set to the second group;
其中,第一进程为处于前台运行状态且用户可见的进程,第二进程为处于前台运行状态且用户不可见的进程,第一组别中进程的运行优先级高于第二组别中进程的运行优先级。Among them, the first process is a process that is running in the foreground and visible to the user, and the second process is a process that is running in the foreground and is invisible to the user. The running priority of the processes in the first group is higher than that of the processes in the second group. Run priority.
第二方面,本申请实施例提供了一种处理装置,该装置可以包括:In the second aspect, embodiments of the present application provide a processing device, which may include:
设置模块,用于在确定电子设备处于目标场景的情况下,将第一进程的组别设置为第一组别,并将第二进程的组别设置为第二组别;a setting module, configured to set the group of the first process to the first group and the group of the second process to the second group when it is determined that the electronic device is in the target scene;
其中,第一进程为处于前台运行状态且用户可见的进程,第二进程为处于前台运行状态且用户不可见的进程,第一组别中进程的运行优先级高于第二组别中进程的运行优先级。Among them, the first process is a process that is running in the foreground and visible to the user, and the second process is a process that is running in the foreground and is invisible to the user. The running priority of the processes in the first group is higher than that of the processes in the second group. Run priority.
第三方面,本申请实施例提供了一种电子设备,电子设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序或指令,程序或指令被处理器执行时实现如第一方面所示的处理方法的步骤。In a third aspect, embodiments of the present application provide an electronic device. The electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the following is implemented: In one aspect the steps of the processing method are shown.
第四方面,本申请实施例提供了一种可读存储介质,可读存储介质上存储程序或指令,程序或指令被处理器执行时实现如第一方面所示的处理方法的步骤。In the fourth aspect, embodiments of the present application provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by a processor, the steps of the processing method shown in the first aspect are implemented.
第五方面,本申请实施例提供了一种芯片,芯片包括处理器和显示接口,显示接口和处理器耦合,处理器用于运行程序或指令,实现如第一方面所示的处理方法的步骤。In a fifth aspect, embodiments of the present application provide a chip. The chip includes a processor and a display interface. The display interface is coupled to the processor. The processor is used to run programs or instructions to implement the steps of the processing method shown in the first aspect.
第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所示的处理方法的步骤。In a sixth aspect, embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the processing method shown in the first aspect.
在本申请实施例中,在确定电子设备处于目标场景的情况下,将第一进程的组别设置为第一组别,并将第二进程的组别设置为第二组别;其中,第一进程为处于前台运行状态且用户可见的进程,第二进程为处于前台运行状态且用户不可见的进程,第一组别中进程的运行优先级高于第二组别中进程的运行优先级。这样,可以避免因进程分组不合理出现的操作系统卡顿的情况,提升了操作系统运行的流畅性。In the embodiment of the present application, when it is determined that the electronic device is in the target scene, the group of the first process is set as the first group, and the group of the second process is set as the second group; wherein, the One process is a process running in the foreground and visible to the user, and the second process is a process running in the foreground and invisible to the user. The running priority of the processes in the first group is higher than the running priority of the processes in the second group. . In this way, operating system lags caused by unreasonable process grouping can be avoided, and the smoothness of operating system operation can be improved.
附图说明Description of drawings
图1为本申请实施例提供的一种处理方法的流程图;Figure 1 is a flow chart of a processing method provided by an embodiment of the present application;
图2为本申请实施例提供的一种处理装置的结构示意图;Figure 2 is a schematic structural diagram of a processing device provided by an embodiment of the present application;
图3为本申请实施例提供的一种电子设备的结构示意图;Figure 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图4为本申请实施例提供的一种电子设备的硬件结构示意图。FIG. 4 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art fall within the scope of protection of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances so that the embodiments of the application can be practiced in sequences other than those illustrated or described herein, and that "first," "second," etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the related objects are in an "or" relationship.
在电子设备的操作系统中,尤其是安卓(Android)操作系统中,Cgroup通过将电子设备中的各个进程划分成不同的组,然后,以对每个组分配不同的系统资源,从而实现一个更加有效地资源管理和优化。In the operating system of electronic devices, especially in the Android operating system, Cgroup divides the various processes in the electronic device into different groups, and then allocates different system resources to each group, thereby achieving a more Effective resource management and optimization.
Cgroup可以用于限制一个应用程序(简称应用)的处理器(Central ProcessingUnit,CPU)、内存、网络等资源的使用,防止应用抢占系统资源。Cgroup的分组依赖于Android进程状态管理,如果进程状态流程中传递卡住或者不合理,就会导致分组切换过慢或错误,让本应该在处理器内核中的大核上运行的进程被限制到小核等低等级的处理器内核中。Cgroup can be used to limit the use of the processor (Central Processing Unit, CPU), memory, network and other resources of an application (referred to as the application) to prevent the application from seizing system resources. The grouping of Cgroup relies on Android process state management. If the transfer of the process state flow is stuck or unreasonable, it will cause the group switching to be too slow or wrong, and the processes that should be running on the large core of the processor core will be restricted. In low-level processor cores such as small cores.
在相关技术中,当前具有Android操作系统的电子设备通常会使用进程优先级调整算法实现进程的分组,即根据一些固定规则,定期对操作系统中的所有进程进行扫描和评估,并根据评估结果计算每个进程的ADJ值,并根据ADJ值对各个进程进行分组。然而,在一些应用启动和切换、人脸或指纹解锁等高负载场景下,通过上述方式得到的分组结果,容易导致高负载场景下前台任务的处理器算力不足,出现操作系统卡顿的情况。In related technologies, current electronic devices with Android operating systems usually use process priority adjustment algorithms to group processes, that is, all processes in the operating system are regularly scanned and evaluated according to some fixed rules, and calculations are performed based on the evaluation results. The ADJ value of each process, and groups the individual processes based on the ADJ value. However, in some high-load scenarios such as application startup and switching, face or fingerprint unlocking, etc., the grouping results obtained through the above method may easily lead to insufficient processor computing power for foreground tasks in high-load scenarios, causing the operating system to freeze. .
为了解决相关技术中的问题,下面结合附图1,通过具体的实施例及其应用场景对本申请实施例提供的处理方法进行详细地说明。In order to solve the problems in related technologies, the processing method provided by the embodiment of the present application will be described in detail through specific embodiments and application scenarios in conjunction with Figure 1 below.
首先,结合图1对本申请实施例提供的一种处理方法进行详细说明。First, a processing method provided by the embodiment of the present application will be described in detail with reference to FIG. 1 .
图1为本申请实施例提供的一种处理方法的流程图。Figure 1 is a flow chart of a processing method provided by an embodiment of the present application.
如图1所示,本申请实施例提供的处理方法可以应用于电子设备,该处理方法可以包括如下步骤:As shown in Figure 1, the processing method provided by the embodiment of the present application can be applied to electronic devices. The processing method can include the following steps:
步骤110,在确定电子设备处于目标场景的情况下,将第一进程的组别设置为第一组别,并将第二进程的组别设置为第二组别;其中,第一进程为处于前台运行状态且用户可见的进程,第二进程为处于前台运行状态且用户不可见的进程,第一组别中进程的运行优先级高于第二组别中进程的运行优先级。Step 110: When it is determined that the electronic device is in the target scene, set the group of the first process to the first group, and set the group of the second process to the second group; wherein, the first process is in A process is running in the foreground and visible to the user. The second process is a process running in the foreground and invisible to the user. The running priority of the process in the first group is higher than the running priority of the process in the second group.
这样,在电子设备处于目标场景时,将前台运行状态且用户可见的进程划分到优先级较高的第一组别,以及将前台运行状态且用户不可见的进程划分到优先级低于第一组别的第二组别,如此,可以避免目标场景下,因进程分组不合理出现的操作系统卡顿的情况,提升了操作系统运行的流畅性。In this way, when the electronic device is in the target scene, the processes running in the foreground and visible to the user are divided into the first group with a higher priority, and the processes running in the foreground and invisible to the user are divided into the first group with a lower priority. The second group of the group, in this way, can avoid operating system freezes due to unreasonable process grouping in the target scenario, and improve the smoothness of the operating system.
基于此,下面对上述步骤进行详细说明,具体如下所示。Based on this, the above steps are described in detail below, as shown below.
首先,涉及步骤110,本申请实施例中的进程(即第一进程、第二进程、第三进程)可以为下述中的至少一种:应用程序的进程、系统功能的进程。First, regarding step 110, the processes (i.e., the first process, the second process, and the third process) in the embodiment of the present application may be at least one of the following: an application process or a system function process.
本申请实施例中的第一进程为处于前台运行状态且用户可见的进程,第二进程为处于前台运行状态且用户不可见的进程,第三进程为处于后台运行状态的进程。其中,本申请实施例中的第二进程包括下述中的至少一种:常驻进程、前台广播或服务进程、与第一进程关联的进程。In the embodiment of this application, the first process is a process running in the foreground and visible to the user, the second process is a process running in the foreground and invisible to the user, and the third process is a process running in the background. The second process in the embodiment of the present application includes at least one of the following: a resident process, a foreground broadcast or service process, and a process associated with the first process.
需要说明的是,在进程为应用程序的进程时,本申请实施例中的前台运行状态且用户可见是指,该进程对应的应用程序的界面(或图标)在电子设备的上可见、且应用程序正在运行;在进程为系统功能的进程时,本申请实施例中的前台运行状态且用户可见是指,该进程对应的系统功能的界面(或图标)在电子设备的上可见、且系统功能正在运行。即本申请实施例中的前台运行状态且用户可见可理解为是与用户当前进行交互的界面的进程,该界面为应用程序的界面或为系统功能的界面,比如,正在运行的游戏应用的界面的进程、正在浏览网页的界面的进程。It should be noted that when the process is an application process, the foreground running state and visible to the user in the embodiment of the present application means that the interface (or icon) of the application program corresponding to the process is visible on the electronic device, and the application The program is running; when the process is a system function process, the foreground running state and visible to the user in the embodiment of the present application means that the interface (or icon) of the system function corresponding to the process is visible on the electronic device, and the system function running. That is, the foreground running state in the embodiment of the present application and visible to the user can be understood as the process of the interface currently interacting with the user. The interface is the interface of an application program or the interface of a system function, such as the interface of a running game application. The process of the interface that is browsing the web page.
前台运行状态且用户不可见是指,该进程对应的应用程序的界面(或图标)在电子设备的当前显示界面不可见、且应用程序正在运行;在进程为系统功能的进程时,本申请实施例中的前台运行状态且用户不可见是指,该进程对应的系统功能的界面(或图标)在电子设备的当前显示界面不可见、且系统功能正在运行,即可以理解为正在运行的应用程序或系统功能、且应用程序或系统功能的界面不是当前显示界面的进程,比如未显示导航界面但实时定位系统的进程、未显示音频播放界面的实时播放音频的音乐播放器的进程。The foreground running state and invisible to the user means that the interface (or icon) of the application program corresponding to the process is not visible on the current display interface of the electronic device and the application program is running; when the process is a system function process, this application implements In the example, the foreground running state and invisible to the user means that the interface (or icon) of the system function corresponding to the process is not visible on the current display interface of the electronic device, and the system function is running, which can be understood as a running application. or system function, and the interface of the application or system function is not a process of the currently displayed interface, such as a process that does not display the navigation interface but real-time positioning system, or a process of a music player that plays audio in real time but does not display the audio playback interface.
后台运行状态是指,该进程对应的应用程序或系统功能在关闭之后,依然可以继续轻微运行相关的服务的运行状态,比如,一些软件可以在服务端获得到用户消息后及时通知用户。The background running state refers to the running state in which the application or system function corresponding to the process can still continue to run related services lightly after the process is closed. For example, some software can notify the user in time after the server obtains the user message.
基于此,在一种或多种可能的实施例中,在步骤110之前,该方法可以包括:Based on this, in one or more possible embodiments, before step 110, the method may include:
接收用户的输入;receive user input;
响应于该输入,确定该输入是否为预设输入;In response to the input, determine whether the input is a preset input;
在确定该输入为预设输入的情况下,确定电子设备处于目标场景。When the input is determined to be the preset input, it is determined that the electronic device is in the target scene.
其中,目标场景可以为桌面动效、应用启动、相机拍照、人脸解锁、指纹解锁、显示负一屏界面、进入游戏应用等高负载场景的输入。Among them, the target scenes can be the input of high-load scenarios such as desktop animation, application startup, camera taking, face unlocking, fingerprint unlocking, displaying a negative one-screen interface, and entering game applications.
需要说明的是,本申请实施例中的高负载场景指的是电子设备中的处理器在一段时间内正在处理、等待处理器处理的进程数之和的统计信息的值大于或等于预设阈值的场景,也就是处理器使用队列的长度统计信息的值大于或等于预设阈值的场景。It should be noted that the high load scenario in the embodiment of the present application refers to the situation where the value of the statistical information of the sum of the number of processes that are being processed by the processor in the electronic device and waiting for processing by the processor within a period of time is greater than or equal to the preset threshold. scenario, that is, a scenario in which the value of the length statistics of the processor's usage queue is greater than or equal to the preset threshold.
如此,本申请实施例提供的处理方法可以提供一种根据用户的实时输入,判断是否对其实时输入对应的进程进行分组的处理方法,从而达到触发分组精准且迅速的目的,以实现优化高负载场景下前台任务的处理器算力不足导致的卡顿的问题,提升操作系统的流畅性。In this way, the processing method provided by the embodiment of the present application can provide a processing method that determines whether to group the processes corresponding to the real-time input based on the user's real-time input, so as to achieve the purpose of triggering grouping accurately and quickly, so as to optimize high load. In this scenario, the problem of lagging caused by insufficient processor power for foreground tasks is improved to improve the fluency of the operating system.
另外,在一种或多种可能的实施例中,在步骤110之前,该处理方法还可以包括:In addition, in one or more possible embodiments, before step 110, the processing method may also include:
步骤120,确定划分的第一进程和第二进程的划分策略是否满足预设划分策略。Step 120: Determine whether the partitioning strategies of the divided first process and the second process satisfy the preset partitioning strategy.
示例性地,若第一输入为桌面动效,则确定第一进程(即桌面)的组别是否为第一组别,这里,第一组别可以是最高优先级(TOP)组别,此时,也需要确定除了桌面之外的进程是否为非第一组别。For example, if the first input is a desktop animation, it is determined whether the group of the first process (ie, the desktop) is the first group. Here, the first group may be the highest priority (TOP) group, where When doing this, you also need to determine whether processes other than the desktop are in the non-first group.
若第一输入为应用启动,如启动应用A,则确定第一进程(即应用A的进程)的组别是否为第一组别,此时,也需要确定除了应用A之外的进程是否为非第一组别。If the first input is application startup, such as starting application A, determine whether the group of the first process (that is, the process of application A) is the first group. At this time, it is also necessary to determine whether the processes other than application A are. Not the first group.
若第一输入为相机拍照,则确定第一进程(即相机应用进程)的组别是否为第一组别,此时,也需要确定除了相机之外的进程是否为非第一组别。If the first input is taking a picture with the camera, it is determined whether the group of the first process (that is, the camera application process) is the first group. At this time, it is also necessary to determine whether the processes other than the camera are in the non-first group.
若第一输入为人脸解锁,则确定第一进程(即相机应用进程)的组别是否为第一组别,也需要确定与第一进程对应的第二进程,第二进程如面部交互设置进程(faceui)、系统锁屏或截屏进程(systemui)的组别是否为第一组别,此时,也需要确定与第一进程和第二进程对应算法的进程是否处于第二组别,以及,也需要确定除了前述第一进程和第二进程组成之外的进程是否为除第一组别和第二组别之外的其他组别。If the first input is face unlocking, determine whether the group of the first process (ie, camera application process) is the first group. It is also necessary to determine the second process corresponding to the first process. The second process is such as the facial interaction setting process. (faceui), system lock screen or screenshot process (systemui). Whether the group is the first group. At this time, it is also necessary to determine whether the process of the algorithm corresponding to the first process and the second process is in the second group, and, It is also necessary to determine whether processes other than the aforementioned first process and second process are groups other than the first group and the second group.
若第一输入为指纹解锁,则确定第一进程(即systemui)的组别是否为第一组别,也需要确定与第一进程对应的算法的进程是否处于第二组别,此时,也需要确定除了相机之外的进程是否为除第一组别和第二组别之外的其他组别。If the first input is fingerprint unlocking, it is necessary to determine whether the group of the first process (i.e. systemui) is the first group, and it is also necessary to determine whether the process of the algorithm corresponding to the first process is in the second group. At this time, it is also necessary to It is necessary to determine whether the process other than the camera is in a group other than the first group and the second group.
若第一输入为显示负一屏界面,则确定第一进程(即显示负一屏界面的进程)的组别是否为第一组别,此时,也需要确定除了显示负一屏界面的进程之外的进程是否为第二组别。If the first input is to display a negative one-screen interface, determine whether the group of the first process (that is, the process that displays a negative one-screen interface) is the first group. At this time, it is also necessary to determine whether the group of the first process (that is, the process that displays a negative one-screen interface) is the first group. At this time, it is also necessary to determine whether the process in addition to the process that displays a negative one-screen interface is Whether the process outside is the second group.
若第一输入为进入游戏应用,则确定第一进程(游戏应用的进程)的组别是否为第一组别,此时,也需要确定除了游戏应用的进程之外的进程是否为第二组别。If the first input is to enter the game application, it is determined whether the group of the first process (the process of the game application) is the first group. At this time, it is also necessary to determine whether the processes other than the process of the game application are the second group. Don't.
基于此,该步骤10具体可以包括:Based on this, step 10 may specifically include:
在确定电子设备处于目标场景、且确定划分的第一进程和第二进程的划分策略不满足预设划分策略的情况下,按照预设划分策略,将第一进程的组别设置为第一组别,并将第二进程的组别设置为第二组别。When it is determined that the electronic device is in the target scene and the division strategy of the first process and the second process determined to be divided does not meet the preset division strategy, the group of the first process is set to the first group according to the preset division strategy. category, and set the group of the second process to the second group.
此外,本申请实施例中的电子设备还运行第三进程,第三进程为处于后台运行状态的进程,基于此,在步骤110之后,该处理方法还可以包括:In addition, the electronic device in the embodiment of the present application also runs a third process, and the third process is a process running in the background. Based on this, after step 110, the processing method may also include:
将第三进程的组别调整为第三组别,其中,第二组别中进程的运行优先级高于第三组别中进程的运行优先级。Adjust the group of the third process to the third group, where the running priority of the process in the second group is higher than the running priority of the process in the third group.
其中,第三进程可以包括下述中的至少一种:空进程、缓存进程、备份进程、超过预设时长未运行的服务进程。The third process may include at least one of the following: an empty process, a cache process, a backup process, and a service process that has not been running for more than a preset time period.
示例性地,本申请实施例中的第一组别可以是最高优先级(TOP)组别,第二组别可以是前台分组,第三组别可以后台分组。其中,最高优先级(TOP)组别中的进程的可以为处于前台运行状态且用户可见的进程。前台分组中的进程可以为前台广播或服务、与第一进程相关、处于与前台绑定状态、属于预设常驻进程。后台分组中的进程可以为空进程、缓存进程、备份进程、超过预设时长未运行的服务进程比如超过30分钟没有活跃过的服务进程。For example, the first group in the embodiment of the present application may be the highest priority (TOP) group, the second group may be the foreground group, and the third group may be the background group. Among them, the processes in the highest priority (TOP) group may be processes running in the foreground and visible to the user. The processes in the foreground group can be foreground broadcasts or services, related to the first process, in a state bound to the foreground, and belong to the default resident process. The processes in the background group can be empty processes, cache processes, backup processes, and service processes that have not been running for more than a preset time, such as service processes that have not been active for more than 30 minutes.
也就是说,本申请实施例中提供的处理方法可以根据具体的目标场景,将用户可见、显示在当前屏幕上的界面的第一进程设置为TOP分组。将其他非可见但与第一进程相关的第二进程设置为前台分组(即当前屏幕并未显示,但在桌面任务栏显示,且可以为第一进程提供支持的进程)。将其他无关进程设置为后台分组,比如处于后台运行状态且不涉及影响第一进程的相关显示等应用的进程。That is to say, the processing method provided in the embodiment of the present application can set the first process of the interface visible to the user and displayed on the current screen as the TOP group according to the specific target scenario. Set other second processes that are not visible but related to the first process as the foreground group (that is, processes that are not displayed on the current screen but are displayed on the desktop taskbar and can provide support for the first process). Set other unrelated processes as background groups, such as processes that are running in the background and do not affect related display and other applications of the first process.
由此,通过上述步骤可以识别用户的输入是否为预设输入,在确定该输入预设输入的情况下,在运行进程之前,可以对第一进程的组别进行重新计算,将最需要资源和调度的第一进程放入TOP分组,将次级别的进程放入前台分组,将只需要在后台执行和容易抢占前台资源的进程放入后台分组。Therefore, through the above steps, it is possible to identify whether the user's input is a preset input. When it is determined that the input is a preset input, before running the process, the group of the first process can be recalculated, and the group that requires the most resources and resources can be recalculated. The first scheduled process is put into the TOP group, the sub-level processes are put into the foreground group, and the processes that only need to be executed in the background and are easy to seize foreground resources are put into the background group.
需要说明的是,本申请实施例中的第一组别中进程的运行优先级高于第二组别中进程的运行优先级,具体可以体现在如下方面。It should be noted that in the embodiment of the present application, the running priority of the processes in the first group is higher than the running priority of the processes in the second group, which can be specifically reflected in the following aspects.
在一种或多种可能的实施例中,在步骤110之后,该处理方法还可以包括:In one or more possible embodiments, after step 110, the processing method may further include:
通过与第一组别对应的第一处理器内核运行第一进程,以及通过与第二组别对应的第二处理器内核运行第二进程;running a first process through a first processor core corresponding to the first group, and running a second process through a second processor core corresponding to the second group;
其中,第一处理器内核和第二处理器内核满足如下至少一种条件:第一处理器内核的数量大于第二处理器内核的数量、第一处理器内核的运行频率大于第二处理器内核的运行频率。Wherein, the first processor core and the second processor core satisfy at least one of the following conditions: the number of the first processor core is greater than the number of the second processor core, and the operating frequency of the first processor core is greater than the second processor core. operating frequency.
示例性地,若第一处理器内核的数量为7个,则第二处理器内核的数量为5个;若第一处理器内核的运行频率为50,则第二处理器内核的运行频率为30;若第一处理器内核的数量为5个且每个第一处理器内核的运行频率为80,则第二处理器内核的数量为3个且每个第二处理器内核的运行频率为50。For example, if the number of first processor cores is 7, then the number of second processor cores is 5; if the running frequency of the first processor core is 50, then the running frequency of the second processor core is 30; if the number of first processor cores is 5 and the operating frequency of each first processor core is 80, then the number of second processor cores is 3 and the operating frequency of each second processor core is 50.
在另一种或多种可能的实施例中,第一组别中的进程和第二组别中的进程可以为同一个处理器内核运行,基于此,在步骤110之后,该处理方法还可以包括:In another or more possible embodiments, the processes in the first group and the processes in the second group may run on the same processor core. Based on this, after step 110, the processing method may also include:
通过第三处理器内核运行第一组别中的进程和第二组别中的进程;Run the processes in the first group and the processes in the second group through the third processor core;
其中,同一时间段内第三处理器内核运行第一组别中进程的运行时长大于第二组别中的进程的运行时长。In the same time period, the running time of the third processor core running the processes in the first group is longer than the running time of the processes in the second group.
示例性地,在5分钟之内,第三处理器内核运行第一组别中进程的运行时长可以为4分钟,且第三处理器内核运行第二组别中进程的运行时长可以为1分钟。For example, within 5 minutes, the running time of the third processor core running the processes in the first group may be 4 minutes, and the running time of the third processor core running the processes in the second group may be 1 minute. .
这里,由于本申请实施例中的第二组别中进程的运行优先级高于第三组别中进程的运行优先级,所以,第二组别中进程和第三组别中的进程同样适用于如上步骤,在此不再赘述。Here, since the running priority of the processes in the second group in the embodiment of the present application is higher than the running priority of the processes in the third group, the same applies to the processes in the second group and the processes in the third group. The above steps will not be repeated here.
需要说明的是,由上述内容可知,本申请实施例中的第一组别中进程的运行优先级高于第二组别中进程的运行优先级、第二组别中进程的运行优先级高于第三组别中进程的运行优先级。It should be noted that, as can be seen from the above content, in the embodiment of the present application, the running priority of the processes in the first group is higher than the running priority of the processes in the second group, and the running priority of the processes in the second group is higher. The running priority of processes in the third group.
基于此,由于电子设备中的芯片处理器通常包括8个处理器内核,8个处理器内核分别对应CPU0-CPU7,根据处理器内核的运行频率不同可分为大核和小核,运行频率低的CPU0-CPU3称为小核,运行频率高的CPU4-CPU7称为大核,一个任务在大核上运行比在小核上运行所需时间更短。Based on this, since chip processors in electronic equipment usually include 8 processor cores, and the 8 processor cores correspond to CPU0-CPU7 respectively. According to the different operating frequencies of the processor cores, they can be divided into large cores and small cores. The operating frequency is low. CPU0-CPU3 are called small cores, and CPU4-CPU7 with high running frequency are called big cores. It takes less time for a task to run on the big core than on the small core.
本申请实施例中的组别不同效果体现在允许运行的处理器内核的数量不同、同一时间片内允许运行的时间比例不同,比如,最高优先级分组和前台分组运行任务运行在CPU0-CPU7上,后台分组允许运行在小核CPU0-CPU3上,如果在一个CPU核心上同时有最高优先级分组进程、前台进程、后台进程需要进行运算时,一个时间片10ms内会分配给三者运行时间比例为5:4:1,即最高优先级分组进程会在CPU上运行5ms,前台进程运行4ms,后台进程1ms。The effects of different groups in the embodiments of this application are reflected in the different numbers of processor cores allowed to run and the different proportions of time allowed to run in the same time slice. For example, the highest priority group and foreground group running tasks run on CPU0-CPU7 , background grouping is allowed to run on small cores CPU0-CPU3. If there are the highest priority grouping process, foreground process, and background process that need to perform operations on a CPU core at the same time, a time slice of 10ms will be allocated to the three running time proportions. It is 5:4:1, that is, the highest priority group process will run on the CPU for 5ms, the foreground process will run for 4ms, and the background process will run for 1ms.
需要说明的是,本申请实施例中的最高优先级分组、前台分组可以不限制处理器内核,即CPU0-CPU7都可以运行,但后台分组仅可以在小核运行,即底层调度优先让最高优先级分组运行,其次前台分组,最后是后台分组。It should be noted that the highest priority group and foreground group in the embodiment of this application may not be restricted to the processor core, that is, all CPU0-CPU7 can run, but the background group can only run on the small core, that is, the underlying scheduling gives priority to the highest priority Level grouping runs, followed by foreground grouping, and finally background grouping.
此外,在上述涉及步骤120之后,本申请实施例提供的处理方法还可以包括:In addition, after the above-mentioned step 120, the processing method provided by the embodiment of the present application may also include:
在确定划分的第一进程和第二进程的划分策略满足预设划分策略的情况下,通过与第一组别对应的处理器内核运行第一进程。When it is determined that the division strategy of the divided first process and the second process satisfies the preset division strategy, the first process is run through the processor core corresponding to the first group.
如此,可以缩短调整时间,提高运行第一进程的速率。In this way, the adjustment time can be shortened and the speed of running the first process can be increased.
此外,本申请实施例提供的处理方法还可以通过如下两种方式,在确定退出目标场景的情况下,调整第一进程的组别的方式,具体如下所示。In addition, the processing method provided by the embodiment of the present application can also adjust the grouping of the first process in the following two ways when it is determined to exit the target scenario, as specifically shown below.
在一种或多种可能的实施例中,在步骤110之后,本申请实施例提供的处理方法还可以包括:In one or more possible embodiments, after step 110, the processing method provided by the embodiment of this application may also include:
在确定电子设备退出目标场景的情况下,通过进程优先级调整算法,计算第一进程的优先级值;When it is determined that the electronic device exits the target scene, the priority value of the first process is calculated through the process priority adjustment algorithm;
按照第一进程的优先级值,调整第一进程的组别Adjust the group of the first process according to the priority value of the first process
在另一种或多种可能的实施例中,在步骤110之后,本申请实施例提供的处理方法还可以包括:In another or more possible embodiments, after step 110, the processing method provided by the embodiment of this application may also include:
在确定电子设备退出目标场景的情况下,将第一进程的组别调整为初始组别,其中,初始组别由进程优先级调整算法计算的第一进程的优先级值确定。When it is determined that the electronic device exits the target scene, the group of the first process is adjusted to an initial group, where the initial group is determined by the priority value of the first process calculated by the process priority adjustment algorithm.
这样,可以将动态调整的进程组别进行复原,即可以避免因在操作系统负载较高时,原始的进程分组运行优先级不够,造成前台任务的处理器算力不足出现的操作系统卡顿的情况,同时,还可以保证不改变电子设备对各个进程的综合配置,实现对进程的有效资源管理。In this way, the dynamically adjusted process groups can be restored, which can avoid operating system lags caused by insufficient processor computing power for foreground tasks due to insufficient running priority of the original process group when the operating system load is high. At the same time, it can also ensure that the comprehensive configuration of each process by the electronic device is not changed, and achieve effective resource management of the process.
本申请实施例提供的处理方法,执行主体可以为处理装置。本申请实施例中以处理装置执行处理方法为例,说明本申请实施例提供的处理的装置。For the processing method provided by the embodiments of this application, the execution subject may be a processing device. In the embodiment of the present application, a processing device executing a processing method is used as an example to illustrate the processing device provided by the embodiment of the present application.
基于相同的发明构思,本申请还提供了一种处理装置。具体结合图2进行详细说明。Based on the same inventive concept, this application also provides a processing device. Detailed description will be given in conjunction with Figure 2.
图2为本申请实施例提供的一种处理装置的结构示意图。Figure 2 is a schematic structural diagram of a processing device provided by an embodiment of the present application.
如图2所示,该处理装置20具体可以包括:As shown in Figure 2, the processing device 20 may specifically include:
设置模块201,用于在确定电子设备处于目标场景的情况下,将第一进程的组别设置为第一组别,并将第二进程的组别设置为第二组别;The setting module 201 is configured to set the group of the first process to the first group and set the group of the second process to the second group when it is determined that the electronic device is in the target scene;
其中,第一进程为处于前台运行状态且用户可见的进程,第二进程为处于前台运行状态且用户不可见的进程,第一组别中进程的运行优先级高于第二组别中进程的运行优先级。Among them, the first process is a process that is running in the foreground and visible to the user, and the second process is a process that is running in the foreground and is invisible to the user. The running priority of the processes in the first group is higher than that of the processes in the second group. Run priority.
下面对该处理装置20进行详细说明,具体如下所示:The processing device 20 will be described in detail below, as follows:
在一个或者多个可能的实施例中,第二进程包括下述中的至少一种:常驻进程、前台广播或服务进程、与第一进程关联的进程。In one or more possible embodiments, the second process includes at least one of the following: a resident process, a foreground broadcast or service process, and a process associated with the first process.
在另一个或者多个可能的实施例中,设置模块201还用于,在电子设备还运行第三进程,第三进程为处于后台运行状态的进程的情况下,将第三进程的组别调整为第三组别,其中,第二组别中进程的运行优先级高于第三组别中进程的运行优先级。In another or more possible embodiments, the setting module 201 is also configured to adjust the group of the third process when the electronic device is also running a third process and the third process is a process running in the background. It is the third group, in which the running priority of the processes in the second group is higher than the running priority of the processes in the third group.
在又一个或者多个可能的实施例中,本申请实施例中的处理装置20还可以包括第一运行模块;其中,In another or more possible embodiments, the processing device 20 in the embodiment of the present application may also include a first operating module; wherein,
第一运行模块,用于通过与第一组别对应的第一处理器内核运行第一进程,以及通过与第二组别对应的第二处理器内核运行第二进程;A first running module configured to run the first process through the first processor core corresponding to the first group, and to run the second process through the second processor core corresponding to the second group;
其中,第一处理器内核和第二处理器内核满足如下至少一种条件:第一处理器内核的数量大于第二处理器内核的数量、第一处理器内核的运行频率大于第二处理器内核的运行频率。Wherein, the first processor core and the second processor core satisfy at least one of the following conditions: the number of the first processor core is greater than the number of the second processor core, and the operating frequency of the first processor core is greater than the second processor core. operating frequency.
在再一个或者多个可能的实施例中,本申请实施例中的处理装置20还可以包括第二运行模块;其中,In still one or more possible embodiments, the processing device 20 in the embodiment of the present application may also include a second operating module; wherein,
第二运行模块,用于通过第三处理器内核运行第一组别中的进程和第二组别中的进程;The second running module is used to run the processes in the first group and the processes in the second group through the third processor core;
其中,同一时间段内第三处理器内核运行第一组别中进程的运行时长大于第二组别中的进程的运行时长。In the same time period, the running time of the third processor core running the processes in the first group is longer than the running time of the processes in the second group.
在再一个或者多个可能的实施例中,本申请实施例中的处理装置20还可以包括计算模块和调整模块;其中,In still one or more possible embodiments, the processing device 20 in the embodiment of the present application may also include a calculation module and an adjustment module; wherein,
计算模块,用于在确定电子设备退出目标场景的情况下,通过进程优先级调整算法,计算第一进程的优先级值;A calculation module used to calculate the priority value of the first process through a process priority adjustment algorithm when it is determined that the electronic device exits the target scene;
调整模块,用于按照第一进程的优先级值,调整第一进程的组别。The adjustment module is used to adjust the group of the first process according to the priority value of the first process.
本申请实施例中的处理装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtualreality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personalcomputer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personalcomputer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The processing device in the embodiment of the present application may be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than the terminal. For example, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or augmented reality (AR)/virtual reality (VR) Devices, robots, wearable devices, ultra-mobile personal computers (UMPC), netbooks or personal digital assistants (PDA), etc., can also be servers, network attached storage (Network Attached Storage, NAS) , personal computer (PC), television (TV), teller machine or self-service machine, etc., the embodiments of this application are not specifically limited.
本申请实施例中的处理装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为IOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The processing device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
本申请实施例提供的处理装置能够实现图1所示的处理方法实施例实现的各个过程,达到相同的技术效果,为避免重复,这里不再赘述。The processing device provided by the embodiment of the present application can implement each process implemented by the processing method embodiment shown in Figure 1 and achieve the same technical effect. To avoid duplication, the details will not be described here.
基于此,本申请实施例提供的处理装置,在确定电子设备处于目标场景的情况下,将第一进程的组别设置为第一组别,并将第二进程的组别设置为第二组别;其中,第一进程为处于前台运行状态且用户可见的进程,第二进程为处于前台运行状态且用户不可见的进程,第一组别中进程的运行优先级高于第二组别中进程的运行优先级。这样,在电子设备处于目标场景时,将前台运行状态且用户可见的进程划分到优先级较高的第一组别,以及将前台运行状态且用户不可见的进程划分到优先级低于第一组别的第二组别,如此,可以避免目标场景下,因进程分组不合理出现的操作系统卡顿的情况,提升了操作系统运行的流畅性。Based on this, the processing device provided by the embodiment of the present application sets the group of the first process as the first group and sets the group of the second process as the second group when it is determined that the electronic device is in the target scene. categories; among them, the first process is a process that is running in the foreground and visible to the user, the second process is a process that is running in the foreground and is invisible to the user, and the running priority of the processes in the first group is higher than that in the second group. The running priority of the process. In this way, when the electronic device is in the target scene, the processes running in the foreground and visible to the user are divided into the first group with a higher priority, and the processes running in the foreground and invisible to the user are divided into the first group with a lower priority. The second group of the group, in this way, can avoid operating system freezes due to unreasonable process grouping in the target scenario, and improve the smoothness of the operating system.
可选的,如图3所示,本申请实施例还提供一种电子设备30,包括处理器301和存储器302,存储器302上存储有可在处理器301上运行的程序或指令,该程序或指令被处理器301执行时实现上述处理方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in Figure 3, this embodiment of the present application also provides an electronic device 30, including a processor 301 and a memory 302. The memory 302 stores programs or instructions that can be run on the processor 301, and the program or When the instructions are executed by the processor 301, each step of the above-mentioned processing method embodiment is implemented, and the same technical effect can be achieved. To avoid duplication, the details will not be repeated here.
需要说明的是,本申请实施例中的电子设备包括上述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
图4为本申请实施例提供的一种电子设备的硬件结构示意图。FIG. 4 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
该电子设备400包括但不限于:射频单元401、网络模块402、音频输出单元403、输入单元404、传感器405、显示单元406、用户输入单元407、接口单元408、存储器409、处理器410等部件。The electronic device 400 includes but is not limited to: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, processor 410 and other components. .
本领域技术人员可以理解,电子设备400还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器410逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图4中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 400 may also include a power supply (such as a battery) that supplies power to various components. The power supply may be logically connected to the processor 410 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions. The structure of the electronic device shown in Figure 4 does not constitute a limitation on the electronic device. The electronic device may include more or less components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
其中,在本申请实施例中,处理器410,用于在确定电子设备处于目标场景的情况下,将第一进程的组别设置为第一组别,并将第二进程的组别设置为第二组别;其中,第一进程为处于前台运行状态且用户可见的进程,第二进程为处于前台运行状态且用户不可见的进程,第一组别中进程的运行优先级高于第二组别中进程的运行优先级。In this embodiment of the present application, the processor 410 is configured to set the group of the first process to the first group and set the group of the second process to the group when it is determined that the electronic device is in the target scene. The second group; among them, the first process is a process that is running in the foreground and visible to the user, and the second process is a process that is running in the foreground and is invisible to the user. The running priority of the process in the first group is higher than that of the second group. The running priority of processes in the group.
下面对该电子设备400进行详细说明,具体如下所示:The electronic device 400 is described in detail below, as follows:
在一个或者多个可能的实施例中,第二进程包括下述中的至少一种:常驻进程、前台广播或服务进程、与第一进程关联的进程。In one or more possible embodiments, the second process includes at least one of the following: a resident process, a foreground broadcast or service process, and a process associated with the first process.
在另一个或者多个可能的实施例中,处理器410还用于,在电子设备还运行第三进程,第三进程为处于后台运行状态的进程的情况下,将第三进程的组别调整为第三组别,其中,第二组别中进程的运行优先级高于第三组别中进程的运行优先级。In another or more possible embodiments, the processor 410 is also configured to adjust the group of the third process when the electronic device is also running a third process and the third process is a process running in the background. It is the third group, in which the running priority of the processes in the second group is higher than the running priority of the processes in the third group.
在又一个或者多个可能的实施例中,处理器410还用于,通过与第一组别对应的第一处理器内核运行第一进程,以及通过与第二组别对应的第二处理器内核运行第二进程;In another or more possible embodiments, the processor 410 is further configured to run the first process through the first processor core corresponding to the first group, and through the second processor corresponding to the second group. The kernel runs the second process;
其中,第一处理器内核和第二处理器内核满足如下至少一种条件:第一处理器内核的数量大于第二处理器内核的数量、第一处理器内核的运行频率大于第二处理器内核的运行频率。Wherein, the first processor core and the second processor core satisfy at least one of the following conditions: the number of the first processor core is greater than the number of the second processor core, and the operating frequency of the first processor core is greater than the second processor core. operating frequency.
在再一个或者多个可能的实施例中,处理器410还用于,通过第三处理器内核运行第一组别中的进程和第二组别中的进程;In still one or more possible embodiments, the processor 410 is further configured to run the processes in the first group and the processes in the second group through a third processor core;
其中,同一时间段内第三处理器内核运行第一组别中进程的运行时长大于第二组别中的进程的运行时长。In the same time period, the running time of the third processor core running the processes in the first group is longer than the running time of the processes in the second group.
在再一个或者多个可能的实施例中,处理器410还用于,在确定电子设备退出目标场景的情况下,通过进程优先级调整算法,计算第一进程的优先级值;In still one or more possible embodiments, the processor 410 is further configured to, when it is determined that the electronic device exits the target scene, calculate the priority value of the first process through a process priority adjustment algorithm;
调整模块,用于按照第一进程的优先级值,调整第一进程的组别。The adjustment module is used to adjust the group of the first process according to the priority value of the first process.
应理解的是,输入单元404可以包括图形处理器(Graphics Processing Unit,GPU)4041和麦克风4042,图形处理器4041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图像或视频的图像数据进行处理。显示单元406可包括显示面板,可以采用液晶显示器、有机发光二极管等形式来配置显示面板。用户输入单元407包括触控面板4071以及其他输入设备4072中的至少一种。触控面板4071,也称为触摸屏。触控面板4071可包括触摸检测装置和触摸显示器两个部分。其他输入设备4072可以包括但不限于物理键盘、功能键(比如音量显示按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that the input unit 404 may include a graphics processing unit (GPU) 4041 and a microphone 4042. The graphics processor 4041 is responsible for static images obtained by an image capturing device (such as a camera) in a video capture mode or an image capture mode. Image data of images or videos is processed. The display unit 406 may include a display panel, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 407 includes a touch panel 4071 and at least one of other input devices 4072 . Touch panel 4071, also called touch screen. The touch panel 4071 may include two parts: a touch detection device and a touch display. Other input devices 4072 may include but are not limited to physical keyboards, function keys (such as volume display keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
存储器409可用于存储软件程序以及各种数据,存储器409可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器409可以包括易失性存储器或非易失性存储器,或者,存储器409可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器409包括但不限于这些和任意其它适合类型的存储器。The memory 409 can be used to store software programs and various data. The memory 409 can mainly include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area can store an operating system and at least one function. Required applications or instructions (such as sound playback function, image playback function, etc.), etc. Additionally, memory 409 may include volatile memory or nonvolatile memory, or memory 409 may include both volatile and nonvolatile memory. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM). Memory 409 in embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
处理器410可包括一个或多个处理单元;可选的,处理器410集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线显示信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器410中。The processor 410 may include one or more processing units; optionally, the processor 410 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless display signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 410.
本申请实施例还提供一种可读存储介质,可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application also provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the program or instructions are executed by a processor, each process of the above processing method embodiment is implemented and the same technical effect can be achieved. , to avoid repetition, will not be repeated here.
其中,处理器为上述实施例中的电子设备中的处理器。其中,可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device in the above embodiment. Among them, readable storage media include computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks or optical disks.
另外,本申请实施例另提供了一种芯片,芯片包括处理器和显示接口,显示接口和处理器耦合,处理器用于运行程序或指令,实现上述处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。In addition, embodiments of the present application provide a chip. The chip includes a processor and a display interface. The display interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above processing method embodiment, and can achieve the same The technical effects will not be repeated here to avoid repetition.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application provide a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to implement each process of the above processing method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this document, the terms "comprising", "comprises" or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device that includes a series of elements not only includes those elements, It also includes other elements not expressly listed or inherent in the process, method, article or apparatus. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or apparatus that includes that element.
此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions may be performed, for example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk , CD), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310689635.6A CN116737338A (en) | 2023-06-09 | 2023-06-09 | Processing methods, devices, equipment and storage media |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310689635.6A CN116737338A (en) | 2023-06-09 | 2023-06-09 | Processing methods, devices, equipment and storage media |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116737338A true CN116737338A (en) | 2023-09-12 |
Family
ID=87912811
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310689635.6A Pending CN116737338A (en) | 2023-06-09 | 2023-06-09 | Processing methods, devices, equipment and storage media |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116737338A (en) |
-
2023
- 2023-06-09 CN CN202310689635.6A patent/CN116737338A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111045814B (en) | Resource scheduling method and terminal equipment | |
US20110249668A1 (en) | Opportunistic Multitasking | |
US10055388B2 (en) | Declarative style rules for default touch behaviors | |
WO2024245116A1 (en) | Task processing method and apparatus, and electronic device | |
WO2024160154A1 (en) | Cpu scheduling method and apparatus, electronic device, and readable storage medium | |
CN113610699B (en) | A hardware layer rendering scheduling method, device, equipment and storage medium | |
US9383908B2 (en) | Independent hit testing | |
CN115509953A (en) | Memory recovery method and device | |
CN116302558A (en) | Thread scheduling method and device and electronic equipment | |
CN109358927B (en) | Application program display method, device and terminal device | |
WO2024245117A1 (en) | Thread scheduling method and apparatus, and electronic device and medium | |
WO2024222606A1 (en) | Cache resource adjustment method and apparatus, and electronic device and readable storage medium | |
WO2024113841A1 (en) | Screen control method, electronic device and storage medium | |
CN111831443A (en) | Processor state adjustment method, device, storage medium and electronic device | |
CN116737338A (en) | Processing methods, devices, equipment and storage media | |
CN111858395B (en) | Data management method and device | |
CN108351888B (en) | Generating deferrable data streams | |
CN115994032A (en) | Cache management method, device, electronic equipment and medium | |
CN114638742A (en) | Scene picture processing method and electronic equipment | |
CN113032290A (en) | Flash memory configuration method and device, electronic equipment and storage medium | |
CN119200810A (en) | Thread running method, device and electronic device | |
CN117217981A (en) | Cache management method, device, electronic equipment and readable storage medium | |
CN117290039A (en) | Download control method and device and electronic equipment | |
CN116795538A (en) | Compiling process management method and device and electronic equipment | |
CN117289780A (en) | Power consumption statistics method, power consumption statistics device, electronic apparatus, and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |