[go: up one dir, main page]

WO2024245116A1 - Task processing method and apparatus, and electronic device - Google Patents

Task processing method and apparatus, and electronic device Download PDF

Info

Publication number
WO2024245116A1
WO2024245116A1 PCT/CN2024/095062 CN2024095062W WO2024245116A1 WO 2024245116 A1 WO2024245116 A1 WO 2024245116A1 CN 2024095062 W CN2024095062 W CN 2024095062W WO 2024245116 A1 WO2024245116 A1 WO 2024245116A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
processor core
processor
computing power
scheduling 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
Application number
PCT/CN2024/095062
Other languages
French (fr)
Chinese (zh)
Inventor
陈文斌
李泽瀚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Publication of WO2024245116A1 publication Critical patent/WO2024245116A1/en
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

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

Definitions

  • the present application relates to the field of computer technology, and in particular to a task processing method, device and electronic equipment.
  • a multi-core central processing unit is a CPU with multiple processor cores, each of which can execute instructions independently, and multiple processor cores can execute different tasks at the same time, thereby improving the performance and efficiency of the processor.
  • current operating systems are usually multi-threaded environments, and each processor core can execute multiple threads at the same time, thereby achieving concurrent execution.
  • fair scheduling of tasks on the CPU is usually based on the Completely Fair Scheduler (CFS), where CFS is a time-based scheduling algorithm that divides the CPU time into time slices and allocates a certain time slice to each process. Each task is processed within its corresponding time slice.
  • CFS Completely Fair Scheduler
  • the embodiments of the present application provide a task processing method, device and electronic device, which can ensure the processing speed of some tasks and thus improve the fluency of these tasks.
  • an embodiment of the present application provides a task processing method, the method comprising:
  • the first task is executed on the target processor core according to the scheduling priority of the first task.
  • an embodiment of the present application provides a task processing device, the device comprising:
  • a first determination module configured to determine a scheduling priority of the first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level;
  • a first selection module configured to select a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1;
  • An execution module is used to execute the first task on the target processor core according to the scheduling priority of the first task.
  • an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps in the task processing method described in the first aspect are implemented.
  • an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored.
  • the program or instruction is executed by a processor, the steps in the task processing method described in the first aspect are implemented.
  • an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
  • an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
  • an embodiment of the present application provides an electronic device, which is configured to execute the method described in the first aspect.
  • the scheduling priority of the task is determined based on at least one of the task type and the task importance level, and the task is processed based on the scheduling priority. This can achieve priority scheduling of some tasks (for example, foreground tasks, etc.), thereby improving the processing speed of these tasks.
  • a target processor core is selected from N processor cores to process the task based on computing power demand information and scheduling priority. This is conducive to selecting more suitable processor cores (for example, processor cores with the strongest processing power or the largest remaining computing power, etc.) for processing some tasks, thereby improving the processing efficiency and fluency of these tasks.
  • FIG1 is a flow chart of a task processing method provided in an embodiment of the present application.
  • FIG2 is a schematic diagram of a multi-processor core provided in an embodiment of the present application.
  • FIG3 is a flow chart of another task processing method provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of the structure of a task processing device provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of a structure of an electronic device provided in an embodiment of the present application.
  • FIG. 6 is a second schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • first, second, etc. in the specification and claims of this application are used to distinguish similar objects, rather than to describe a specific order or precedence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first”, “second”, etc. are generally of the same type, and do not limit the number of objects.
  • the first object can be one
  • “and/or” in the specification and claims indicates at least one of the connected objects, and the character “/" generally indicates that the objects connected before and after are in an "or” relationship.
  • FIG. 1 is a flowchart of a task processing method provided in an embodiment of the present application, as shown in FIG. 1 , comprising the following steps:
  • Step 101 Determine a scheduling priority of a first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level.
  • the first task may be any task to be processed or scheduled.
  • the above task types can be reasonably set according to actual needs.
  • the above task types can include foreground tasks or background tasks, or the above task types can include multimedia tasks (for example, audio tasks, video tasks or game tasks, etc.) or non-multimedia tasks, etc.
  • the above front and back tasks can be further divided into video tasks located in the foreground, game tasks located in the foreground, tasks of small window applications located in the foreground, etc.
  • the task type can be identified based on one or more information such as the application package name, whether it is visible, whether it has focus, the state of the audio, and whether the input operation is frequent.
  • the above-mentioned task importance level is determined according to at least one of the task type, load size, computing power requirement information, etc.
  • the above-mentioned computing power requirement information can be used to indicate the computing power value required to execute the task, for example, it can be a computing power value obtained by statistics based on the computing power values consumed by executing the same task multiple times in history, or it can be pre-divided into multiple computing power levels.
  • the above-mentioned computing power requirement information can be used to indicate the computing power level corresponding to the task, for example, it can be pre-divided into a first computing power level and a second computing power level, the first computing power level is used to indicate that the required computing power is relatively large, and the second computing power level is used to indicate that the required computing power is relatively small, and the corresponding relationship between different tasks and computing power levels can be pre-established, for example, multimedia tasks (for example, audio tasks, video tasks or game tasks, etc.) correspond to the first computing power level, and non-multimedia tasks correspond to the second computing power level.
  • multimedia tasks for example, audio tasks, video tasks or game tasks, etc.
  • task types may be divided first, and for tasks of the same task type, the task importance level of each task may be further determined.
  • tasks may be divided into foreground tasks and background tasks.
  • the task importance level of each foreground task may be further determined.
  • the task importance level of multimedia foreground tasks e.g., audio tasks, video tasks, or game tasks, etc.
  • the task importance level of non-multimedia foreground tasks is greater than the task importance level of non-multimedia foreground tasks.
  • the above scheduling priorities can be used to indicate the order in which tasks are scheduled, wherein a task with a higher scheduling priority is scheduled first.
  • the scheduling priority of task a is scheduling priority a1
  • the scheduling priority of task b is scheduling priority b1. If scheduling priority a1 is higher than scheduling priority b1, task a is scheduled before task b.
  • the scheduling priority of the first task can be determined according to the task type of the first task. For example, a corresponding relationship between the task type and the scheduling priority can be pre-established. For example, the foreground task corresponds to the scheduling priority a1, the background task corresponds to the second scheduling priority b1, and the first scheduling priority Level a1 is higher than the second scheduling priority b1, and thus the scheduling priority of the first task can be quickly determined based on the above correspondence and the task type of the first task.
  • the scheduling priority of the first task can be determined according to the task importance level of the first task.
  • a correspondence between the task importance level and the scheduling priority can be established in advance. For example, a task with a higher task importance level has a higher corresponding scheduling priority.
  • the scheduling priority of the first task can be quickly determined based on the above correspondence and the task importance level of the first task.
  • the scheduling priority of the first task can be determined according to the task type and task importance level of the first task.
  • a correspondence between task type, task importance level and scheduling priority can be established.
  • the foreground task with task importance level a corresponds to scheduling priority a11
  • the foreground task with task importance level b corresponds to scheduling priority a12
  • the background task corresponds to scheduling priority a2. If a is greater than b, the scheduling priority a11 is higher than the scheduling priority a12, and the scheduling priority a12 is higher than the scheduling priority a2. Therefore, the scheduling priority of the first task can be quickly determined based on the above-mentioned correspondence and the task type and task importance level of the first task.
  • Step 102 Select a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1.
  • the above computing power demand information and scheduling priority can refer to the above-mentioned related instructions and will not be repeated here.
  • each of the N processor cores may be the same; or, the N processor cores may include at least two types of processor cores with different processing capabilities.
  • the N processor cores may include a first type of processor core, a second type of processor core, and a third type of processor core, wherein the processing capability of the first type of processor core is stronger than that of the second type of processor core, and the processing capability of the second type of processor core is stronger than that of the third type of processor core.
  • the measurement index of the processing capability of the processor core may include but is not limited to the total computing power value of the processor core, that is, the larger the total computing power value, the stronger the processing capability, wherein the measurement index of the total computing power value may include but is not limited to the computing speed, cache size, etc.
  • the processor core selection range of the first task can be determined from N processor cores based on the computing power requirement information of the first task, and the target processor core is selected from the processor core selection range; alternatively, the target load of each processor core can be calculated based on the scheduling priority of the first task, wherein the above-mentioned target load can be the sum of the loads of all tasks on the processor core whose scheduling priorities meet preset conditions, and the target processor core is selected from the N processor cores based on the computing power requirement information of the first task and the target load of each processor core.
  • the processor core selection range of the first task can be determined from N processor cores based on the computing power requirement information of the first task, and the processor core with the smallest target load can be selected as the target processor core from the processor core selection range.
  • Step 103 Execute the first task on the target processor core according to the scheduling priority of the first task.
  • the target processor core schedules the tasks with higher scheduling priorities with higher priority.
  • the target processor core includes a foreground task a and a background task b, and the scheduling priority of the foreground task a is higher than the scheduling priority of the background task b. Then the target processor core schedules the foreground task a first, and schedules the background task b after processing all the foreground tasks a. It should be noted that for tasks with the same scheduling priority, they can be scheduled in sequence based on the order of the tasks in the task queue.
  • the task processing method provided in the embodiment of the present application determines the scheduling priority of the task according to at least one of the task type and the task importance level, and processes the task based on the scheduling priority, so that priority scheduling of some tasks (for example, foreground tasks, etc.) can be achieved, thereby improving the processing speed of these tasks.
  • the embodiment of the present application selects a target processor core from N processor cores to process the task according to computing power demand information and scheduling priority, which is conducive to selecting more suitable processor cores (for example, processor cores with the strongest processing power or the largest remaining computing power, etc.) for processing some tasks, thereby improving the processing efficiency and fluency of these tasks.
  • selecting a target processor core from N processor cores according to the second parameter information of the first task includes:
  • the first remaining computing power value of the processor core is the difference between the total computing power value of the processor core and the first computing power value, and the first computing power value is the sum of the computing power values required for the load of all tasks in the processor core whose scheduling priority is higher than or equal to the scheduling priority of the first task;
  • a target processor core is determined according to the computing power requirement information of the first task and a first remaining computing power value of each processor core of the N processor cores.
  • the sum of the load required computing power values of all tasks with a scheduling priority higher than or equal to the scheduling priority of the first task in each processor core can be calculated respectively, that is, the first computing power value of each processor core, and then the difference between the total computing power value of each processor core and the first computing power value is used as the first remaining computing power value of the processor core.
  • the target processor core can be determined based on the computing power requirement information of the first task and the first remaining computing power value of each of the N processor cores. For example, a processor core can be selected as the target processor core from the processor cores whose first remaining computing power values can meet the computing power requirement information of the first task.
  • processor core selection is performed based on the first remaining computing power value of each processor core, which is conducive to preferentially selecting a processor core with a stronger processing capability to process tasks with a higher scheduling priority, thereby improving the processing speed and fluency of tasks with a higher scheduling priority; when the processing capabilities of the N processor cores are all the same, the processor core selection is performed based on the first remaining computing power value of each processor core, thereby preferentially selecting a processor core with a stronger processing capability to process tasks with a higher scheduling priority; Performing processor core selection based on the first remaining computing power value of each processor core is beneficial to reducing the impact of tasks with lower scheduling priorities on tasks with higher scheduling priorities, and improving the processing speed of tasks with higher scheduling priorities.
  • determining the target processor core according to the computing power requirement information of the first task and the first remaining computing power value of each processor core of the N processor cores includes:
  • the N processor cores include at least two types of processor cores, different types of processor cores in the at least two types of processor cores have different processing capabilities, and the first processor core selection range includes at least two processor cores in the N processor cores;
  • the target processor core is determined according to the first remaining computing power values of the processor cores within the first processor core selection range.
  • each type of processor core may include one or more processor cores.
  • processing capabilities of the multiple processor cores included in each type of processor core may be the same, or the difference between the processing capabilities of the multiple processor cores included in each type of processor core is within a preset range. It should also be noted that the structures or models of the multiple processor cores included in each type of processor core may be the same or different.
  • the computing power requirement information of each task can be pre-statisticed through experimental simulation and other methods, and then a correspondence between the computing power requirement information and the processor core selection range can be established based on the computing power requirement information of each task, wherein the computing power of the processor core within the above processor core selection range can meet the computing power requirement information of the corresponding task.
  • a correspondence between the computing power level and the processor core selection range can be established, wherein different computing power levels correspond to different processor core selection ranges, and the higher the computing power level (that is, the more computing power required), the stronger the processing capability of the processor core within the corresponding processor core selection range. This is conducive to preferentially selecting processor cores with stronger processing capabilities to process tasks requiring greater computing power.
  • the above-mentioned N processor cores include 8 processor cores, namely CPU-0 to CPU-7, among which CPU-7 is a large processor core, CPU-4 to CPU-6 are all medium processor cores, and CPU-0 to CPU-3 are all small processor cores, among which the processing power of the large processor core is stronger than that of the medium processor core, and the processing power of the medium processor core is stronger than that of the small processor core.
  • Task A is a task of a small window application (for example, a small window task of a video application or a small window task that should be included in instant messaging, etc.), which requires less computing power, and the corresponding processor core selection range is CPU-0 to CPU-6, that is, Task A can select a processor core from CPU-0 to CPU-6;
  • Task B is a game task, which requires more computing power, and the corresponding processor core selection range is CPU-0 to CPU-7, that is, Task B can select a processor core from CPU-0 to CPU-7.
  • the selection range of the processor cores corresponding to each task can be determined based on the computing power requirement information of each task, and the selection range of the processor cores corresponding to each task can be determined respectively.
  • the processor core corresponding to each task is selected within the selection range of the processor core corresponding to the task. This can reduce the situation where multiple tasks with the same scheduling priority but different computing power requirements select the same processor core. This can not only reduce the mutual influence between the above-mentioned multiple tasks, but also reduce the overhead of migrating tasks on different processor cores.
  • the first processor core selection range can be determined based on the computing power requirement information of the first task, and then the first remaining computing power value of each processor core within the first processor core selection range can be calculated based on the scheduling priority of the first task, and the target processor core can be determined based on the first remaining computing power value of each processor core within the first processor core selection range. This can reduce the calculation of the remaining computing power of the processor core and save system resources.
  • determining the target processor core according to the first remaining computing power value of each processor core within the first processor core selection range includes:
  • a processor core with the largest first remaining computing power value among target class processor cores within the first processor core selection range is determined as a target processor core, wherein the target class processor core is a class of processor cores with the strongest processing capability within the first processor core selection range.
  • the processor core with the largest first remaining computing power value within the first processor core selection range is determined as the target processor core, which can ensure that the first task can be processed as quickly as possible, thereby improving the timeliness of the first task processing.
  • selecting a processor core with the largest first residual computing power value from a class of processor cores with the strongest processing capabilities can ensure that the first task is processed by the processor core with the strongest processing capabilities. This can not only improve the processing speed of the first task, but also improve the fluency of the first task.
  • the processor core of the type with the strongest processing capability in the first processor core selection range may be, for example, a processor core of the type with the largest total computing power value in the first processor core selection range.
  • selecting a target processor core from N processor cores according to the second parameter information of the first task includes:
  • the first condition includes any one of the following: the task type is a foreground task, the task importance level is greater than a preset level, and the scheduling priority is greater than a preset priority.
  • the processor core selection method provided in the embodiment of the present application can be used to select a processor core for the first task only when the first task meets the first condition.
  • the first computing power value of each of the N processor cores is calculated according to the scheduling priority of the first task, wherein the first computing power value is the sum of the computing power values required for the load of all tasks in the processor core whose scheduling priority is higher than or equal to the scheduling priority of the first task, and the first remaining computing power value of each processor core in the N processor cores is determined according to the first computing power value of each processor core in the N processor cores and the total computing power value, and the processor core used to execute the first task is determined according to the computing power requirement information of the first task and the first remaining computing power value of each processor core in the N processor cores.
  • the existing processor core selection method can be used. For example, the load computing power value corresponding to each processor core in the above-mentioned N processor cores is calculated separately.
  • the load computing power value is the sum of the computing power values required for all loads in the processor core, and the processor core with the smallest load computing power value can be selected as the processor core for executing the above-mentioned first task.
  • the target processor core is selected from N processor cores according to the second parameter information of the first task. This can not only ensure the processing effect of foreground tasks or some more important tasks, such as processing efficiency and fluency, but also reduce the complexity of processor core selection for tasks that do not meet the first condition (for example, background tasks or some less important tasks, etc.), thereby reducing system resource overhead.
  • the first parameter information includes the task type, and the task type includes a foreground task or a background task;
  • determining the scheduling priority of the first task to be a first scheduling priority
  • determining the scheduling priority of the first task to be a second scheduling priority
  • the first scheduling priority is higher than the second scheduling priority.
  • a task can be distinguished as a foreground task or an acquired task based on whether there is a visible interface for the task, whether there are foreground services and services that the foreground depends on are being executed, whether there is a broadcast being executed, whether there is a database that the foreground depends on is being executed, etc. For example, if a task has no visible interface, no foreground services and services that the foreground depends on are being executed, no broadcast being executed, and no database that the foreground depends on is being executed, then the task is determined to be a background task; otherwise, the task is determined to be a foreground task.
  • the scheduling priority of the foreground task is higher than the scheduling priority of the background task, which can ensure that the foreground task can be scheduled before the background task, thereby reducing the jamming of the foreground task and improving the fluency of the foreground task.
  • Step 201 scene recognition.
  • the scene recognition module can be used to identify the scenes of multiple foreground applications, and the highest scheduling priority is set for the foreground process (i.e., task). Otherwise, under unfair scheduling, low-priority foreground applications are easily affected by high-priority foreground applications, which can easily cause lag.
  • application A switches to the foreground, triggering a scene change notification to the scene recognition module
  • application B switches to the foreground, triggering a scene change notification to the scene recognition module.
  • Step 202 determine whether there are multiple foreground applications.
  • the scene recognition module determines the foreground processes of application A and application B. If both application A and application B are foreground applications, then it belongs to a multi-foreground application scene. In this step, if there are multiple foreground applications, step 203 can be executed.
  • Step 203 calculate the computing power value required by each foreground application (ie, the computing power requirement information mentioned above).
  • the CPU computing power requirement of each foreground process can be evaluated according to the type of foreground process (i.e., task) to allocate CPU resources.
  • the usage scenario e.g., playing games, listening to music, sliding small windows, etc.
  • the application package name can be identified according to information such as the application package name, whether it is visible, whether it has focus, the audio status, and whether the input operation is frequent, and the computing power requirement of the application process can be determined.
  • game processes that require high computing power can be run on large and medium processor cores first.
  • Foreground processes that require slightly lower computing power (such as small window application processes) can be run on other medium or small processor cores. This can reduce the additional system overhead caused by frequent migration of different foreground processes running on the same processor core.
  • the scheduling system can only manage the scheduling of processes without caring about the type of application, computing power requirements and other information. Therefore, the above process can be completed through the above-mentioned scene recognition module.
  • Step 204 If the scene recognition module determines that application A has a high demand for CPU computing power, the processor core selection range of application A (such as a game application) can be determined to be CPU-0 to CPU-7.
  • CPU-7 is a large processor core
  • CPU-4 to CPU-6 are all medium processor cores
  • CPU-0 to CPU-3 are all small processor cores, wherein the processing capability of the large processor core is stronger than that of the medium processor core, and the processing capability of the medium processor core is stronger than that of the small processor core.
  • each application process can be tested through experimental simulation to see how much computing power is required to avoid frame drops and sound jams, etc., and then the range of processor core selection corresponding to each application process can be determined.
  • Step 205 Select processor cores through unfair scheduling, and give priority to selecting processor cores CPU-7 and CPU-6 for application A.
  • application A is a process with high scheduling priority, there is no restriction on the CPU cores on which it can run, and it can run on CPU-7 and CPU-6. According to the unfair scheduling load core selection logic, it will be scheduled to CPU-7 and CPU-6 first, because CPU-7 and CPU-6 have strong computing power and there is no other process with high scheduling priority running, so there is a lot of remaining capacity.
  • application A when application A is a foreground process and has a high demand for CPU computing power, application A can be preferentially scheduled to large processor cores and medium processor cores through unfair scheduling.
  • application A is identified as a game application (such as determined as a game application based on the application package name) and is in the foreground (for example, it is known that it is in a battle scene based on the game's software development kit (sdk))
  • the scheduling priority of application A can be set to the highest scheduling priority, for example, set its scheduling priority to 3, which is the highest scheduling priority, and prioritize application A to CPU-7 and CPU-6.
  • Step 206 If the scene recognition module determines that application B has a lower demand for CPU computing power, the processor core selection range of application B (such as a small window application) can be determined to be CPU-0 to CPU-5.
  • Step 207 Select processor cores through unfair scheduling, and give priority to selecting processor cores CPU-5 and CPU-4 for application B.
  • application B can only run on CPU-0 to CPU-5, it will be scheduled to CPU-5 and CPU-4 first according to the unfair scheduling load core selection logic. Because application B is selected from CPU-0 to CPU-5, CPU-5 and CPU-4 have strong processing capabilities and more surplus computing capacity, so it is easier to run on CPU-5 and CPU-4, and there are not many application processes with high scheduling priority running on CPU-5 and CPU-4.
  • application B (such as a video window application) occupies CPU-4 to CPU-5 at most, and can avoid competing with application A (such as a game application) for CPU-6 and CPU-7.
  • application A such as a game application
  • both application A and application B have the highest scheduling priority.
  • priority the highest priority is guaranteed for scheduling on each processor core, which can ensure the smoothness of each application.
  • the processor core selected by the process with high scheduling priority will ignore the load of the low scheduling priority process on each processor core, and calculate the remaining computing power value on each processor core (that is, the first remaining computing power value mentioned above), and then select the processor core with the largest remaining computing power value.
  • their scheduling priority can be set to a low scheduling priority for unfair scheduling, for example, their scheduling priority can be set to 0.
  • the task processing method provided in the embodiment of the present application can be executed by a task processing device.
  • the task processing device provided in the embodiment of the present application is described by taking the task processing method executed by the task processing device as an example.
  • FIG. 4 is a schematic diagram of the structure of a task processing device provided in an embodiment of the present application.
  • the task processing device 400 includes:
  • a first determination module 401 is used to determine the scheduling priority of the first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level;
  • a first selection module 402 configured to select a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1;
  • the execution module 403 is configured to execute the first task on the target processor core according to the scheduling priority of the first task.
  • the second parameter information includes computing power requirement information and scheduling priority
  • the first selection module comprises:
  • a calculation unit configured to calculate a first remaining computing power value of each of the N processor cores according to the scheduling priority of the first task, the first remaining computing power value of the processor core being a difference between a total computing power value of the processor core and a first computing power value, the first computing power value being a sum of computing power values required for a load of all tasks in the processor core whose scheduling priority is higher than or equal to the scheduling priority of the first task;
  • a determination unit is used to determine a target processor core according to the computing power requirement information of the first task and a first remaining computing power value of each processor core in the N processor cores.
  • the determining unit is specifically configured to:
  • the N processor cores include at least two types of processor cores, different types of processor cores in the at least two types of processor cores have different processing capabilities, and the first processor core selection range includes at least two processor cores in the N processor cores;
  • the target processor core is determined according to the first remaining computing power values of the processor cores within the first processor core selection range.
  • the determining unit is specifically configured to:
  • a processor core with the largest first remaining computing power value among target class processor cores within the first processor core selection range is determined as a target processor core, wherein the target class processor core is a class of processor cores with the strongest processing capability within the first processor core selection range.
  • the first selection module is specifically used to:
  • the first condition includes any one of the following: the task type is a foreground task, the task importance level is greater than a preset level, and the scheduling priority is greater than a preset priority.
  • the first parameter information includes the task type, and the task type includes a foreground task or a background task;
  • the first determining module is specifically used for:
  • determining the scheduling priority of the first task to be a first scheduling priority
  • determining the scheduling priority of the first task to be a second scheduling priority
  • the first scheduling priority is higher than the second scheduling priority.
  • the task processing device in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip.
  • the electronic device can be a terminal or other devices other than a terminal.
  • the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc.
  • It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
  • Network Attached Storage NAS
  • PC personal computer
  • TV television
  • teller machine a self-service machine
  • the task processing device in the embodiment of the present application may be a device having 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 embodiment of the present application.
  • the task processing device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.
  • an embodiment of the present application also provides an electronic device 500, including a processor 501 and a memory 502, and the memory 502 stores a program or instruction that can be executed on the processor 501.
  • the program or instruction is executed by the processor 501, the various steps of the above-mentioned task processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
  • the electronic devices in the embodiments of the present application include mobile electronic devices and non-mobile electronic devices.
  • FIG. 6 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610.
  • the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, so that the power management system can manage charging, discharging, and power consumption.
  • a power source such as a battery
  • the electronic device structure shown in FIG6 does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange components differently, which will not be described in detail here.
  • the processor 610 is configured to determine a scheduling priority of the first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level;
  • the processor 610 is further configured to select a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1;
  • the processor 610 is further configured to execute the first task on the target processor core according to the scheduling priority of the first task.
  • the second parameter information includes computing power requirement information and scheduling priority
  • the processor 610 is specifically configured to:
  • the first computing power value being the sum of computing power values required for the load of all tasks in the processor core whose scheduling priority is higher than or equal to the scheduling priority of the first task;
  • a target processor core is determined according to the computing power requirement information of the first task and a first remaining computing power value of each processor core of the N processor cores.
  • the processor 610 is specifically configured to:
  • the N processor cores include at least two types of processor cores, different types of processor cores in the at least two types of processor cores have different processing capabilities, and the first processor core selection range includes at least two processor cores in the N processor cores;
  • the target processor core is determined according to the first remaining computing power values of the processor cores within the first processor core selection range.
  • the processor 610 is specifically configured to:
  • a processor core with the largest first remaining computing power value among target class processor cores within the first processor core selection range is determined as a target processor core, wherein the target class processor core is a class of processor cores with the strongest processing capability within the first processor core selection range.
  • the processor 610 is specifically configured to:
  • the first condition includes any one of the following: the task type is a foreground task, the task importance level is greater than a preset level, and the scheduling priority is greater than a preset priority.
  • the first parameter information includes the task type, and the task type includes a foreground task or a background task;
  • the processor 610 is specifically configured to:
  • determining the scheduling priority of the first task to be a first scheduling priority
  • determining the scheduling priority of the first task to be a second scheduling priority
  • the first scheduling priority is higher than the second scheduling priority.
  • the input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode.
  • the display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc.
  • the user input unit 607 includes a touch panel 6071 and at least one of other input devices 6072.
  • the touch panel 6071 is also called a touch screen.
  • the touch panel 6071 may include two parts: a touch detection device and a touch controller.
  • Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
  • the memory 609 can be used to store software programs and various data.
  • the memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
  • the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both volatile and non-volatile memories.
  • the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
  • the volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory
  • RAM random access memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • the memory 609 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
  • the processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 610.
  • An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored.
  • a program or instruction is stored.
  • each process of the above-mentioned task processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
  • the processor is the processor in the electronic device described in the above embodiment.
  • the readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
  • An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned task processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
  • the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
  • An embodiment of the present application provides a computer program product, which is stored in a storage medium.
  • the program product is executed by at least one processor to implement the various processes of the above-mentioned task processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
  • the disclosed part may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present application.
  • a storage medium such as ROM/RAM, magnetic disk, optical disk

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Multi Processors (AREA)

Abstract

The present application relates to the technical field of computers. Provided are a task processing method and apparatus, and an electronic device. The method comprises: according to first parameter information of a first task, determining a scheduling priority of the first task, wherein the first parameter information comprises at least one of a task type and a task importance level; according to second parameter information of the first task, selecting a target processor core from among N processor cores, wherein the second parameter information comprises computing power demand information and the scheduling priority, with N being an integer greater than 1; and according to the scheduling priority of the first task, executing the first task on the target processor core.

Description

任务处理方法、装置及电子设备Task processing method, device and electronic equipment

相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS

本申请要求在2023年5月30日提交中国专利局、申请号为202310626134.3、名称为“任务处理方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on May 30, 2023, with application number 202310626134.3 and title “Task processing method, device and electronic device”, the entire contents of which are incorporated by reference in this application.

技术领域Technical Field

本申请涉及计算机技术领域,尤其涉及一种任务处理方法、装置及电子设备。The present application relates to the field of computer technology, and in particular to a task processing method, device and electronic equipment.

背景技术Background Art

多核中央处理器(Central Processing Unit,CPU)是一种具有多个处理器核的CPU,其中,每个处理器核都可以独立执行指令,并且多个处理器核可以同时执行不同的任务,从而提高处理器的性能和效率。此外,现在的操作系统通常是多线程环境,每个处理器核可以同时执行多个线程,从而实现并发执行。目前,通常是基于公平调度算法(Completely Fair Scheduler,CFS)在CPU上实现任务的公平调度,其中CFS是一种基于时间的调度算法,它将CPU的时间分成时间片,并分别为每个进程分配一定的时间片,各个任务在其对应的时间片内被处理,然而,这种公平调度方式难以保证一些任务的处理效果。A multi-core central processing unit (CPU) is a CPU with multiple processor cores, each of which can execute instructions independently, and multiple processor cores can execute different tasks at the same time, thereby improving the performance and efficiency of the processor. In addition, current operating systems are usually multi-threaded environments, and each processor core can execute multiple threads at the same time, thereby achieving concurrent execution. At present, fair scheduling of tasks on the CPU is usually based on the Completely Fair Scheduler (CFS), where CFS is a time-based scheduling algorithm that divides the CPU time into time slices and allocates a certain time slice to each process. Each task is processed within its corresponding time slice. However, this fair scheduling method is difficult to guarantee the processing effect of some tasks.

发明内容Summary of the invention

本申请实施例提供一种任务处理方法、装置及电子设备,能够保证一些任务的处理速度,进而提高这些任务的流畅性。The embodiments of the present application provide a task processing method, device and electronic device, which can ensure the processing speed of some tasks and thus improve the fluency of these tasks.

第一方面,本申请实施例提供了一种任务处理方法,所述方法包括:In a first aspect, an embodiment of the present application provides a task processing method, the method comprising:

根据第一任务的第一参数信息确定所述第一任务的调度优先级,其中,所述第一参数信息包括任务类型和任务重要等级中的至少一项;Determining a scheduling priority of the first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level;

根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核,其中,所述第二参数信息包括算力需求信息和调度优先级,N为大于1的整数;Selecting a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1;

根据所述第一任务的调度优先级在所述目标处理器核上执行所述第一任务。The first task is executed on the target processor core according to the scheduling priority of the first task.

第二方面,本申请实施例提供了一种任务处理装置,所述装置包括:In a second aspect, an embodiment of the present application provides a task processing device, the device comprising:

第一确定模块,用于根据第一任务的第一参数信息确定所述第一任务的调度优先级,其中,所述第一参数信息包括任务类型和任务重要等级中的至少一项;A first determination module, configured to determine a scheduling priority of the first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level;

第一选择模块,用于根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核,其中,所述第二参数信息包括算力需求信息和调度优先级,N为大于1的整数;A first selection module, configured to select a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1;

执行模块,用于根据所述第一任务的调度优先级在所述目标处理器核上执行所述第一任务。 An execution module is used to execute the first task on the target processor core according to the scheduling priority of the first task.

第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的任务处理方法中的步骤。In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps in the task processing method described in the first aspect are implemented.

第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的任务处理方法中的步骤。In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps in the task processing method described in the first aspect are implemented.

第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述的方法。In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

第七方面,本申请实施例提供一种电子设备,所述电子设备被配置成用于执行如第一方面所述的方法。In a seventh aspect, an embodiment of the present application provides an electronic device, which is configured to execute the method described in the first aspect.

本申请实施例中,根据任务的任务类型和任务重要等级中的至少一项确定任务的调度优先级,并基于调度优先级对任务进行处理,这样可以实现对一些任务(例如,前台任务等)的优先调度,进而可以提高这些任务的处理速度,此外,本申请实施例根据算力需求信息和调度优先级从N个处理器核中选择目标处理器核以对任务进行处理,这样有利于为一些任务选择到更为合适的处理器核(例如,处理能力最强或者剩余算力最大的处理器核等)进行处理,进而可以提高这些任务的处理效率和流畅性。In an embodiment of the present application, the scheduling priority of the task is determined based on at least one of the task type and the task importance level, and the task is processed based on the scheduling priority. This can achieve priority scheduling of some tasks (for example, foreground tasks, etc.), thereby improving the processing speed of these tasks. In addition, in an embodiment of the present application, a target processor core is selected from N processor cores to process the task based on computing power demand information and scheduling priority. This is conducive to selecting more suitable processor cores (for example, processor cores with the strongest processing power or the largest remaining computing power, etc.) for processing some tasks, thereby improving the processing efficiency and fluency of these tasks.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本申请实施例提供的一种任务处理方法的流程图;FIG1 is a flow chart of a task processing method provided in an embodiment of the present application;

图2是本申请实施例提供的多处理器核的示意图;FIG2 is a schematic diagram of a multi-processor core provided in an embodiment of the present application;

图3是本申请实施例提供的另一种任务处理方法的流程图;FIG3 is a flow chart of another task processing method provided in an embodiment of the present application;

图4是本申请实施例提供的一种任务处理装置的结构示意图;FIG4 is a schematic diagram of the structure of a task processing device provided in an embodiment of the present application;

图5是本申请实施例提供的一种电子设备的结构示意图之一;FIG5 is a schematic diagram of a structure of an electronic device provided in an embodiment of the present application;

图6是本申请实施例提供的一种电子设备的结构示意图之二。FIG. 6 is a second schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

具体实施例Specific embodiments

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个, 也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, rather than to describe a specific order or precedence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and do not limit the number of objects. For example, the first object can be one, In addition, "and/or" in the specification and claims indicates at least one of the connected objects, and the character "/" generally indicates that the objects connected before and after are in an "or" relationship.

下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的任务处理方法、装置及电子设备进行详细地说明。The task processing method, device and electronic device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

参见图1,图1是本申请实施例提供的一种任务处理方法的流程图,如图1所示,包括以下步骤:Referring to FIG. 1 , FIG. 1 is a flowchart of a task processing method provided in an embodiment of the present application, as shown in FIG. 1 , comprising the following steps:

步骤101、根据第一任务的第一参数信息确定所述第一任务的调度优先级,其中,所述第一参数信息包括任务类型和任务重要等级中的至少一项。Step 101: Determine a scheduling priority of a first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level.

本实施例中,上述第一任务可以为任意待处理或者待调度的任务。In this embodiment, the first task may be any task to be processed or scheduled.

上述任务类型可以根据实际需求进行合理设置,例如,上述任务类型可以包括前台任务或者后台任务,或者,上述任务类型可以包括多媒体类任务(例如,音频任务、视频任务或者游戏任务等)或者非多媒体类任务等。在一些可选的实施例中,上述前后任务可以进一步划分为位于前台的视频任务、位于前台的游戏任务、位于前台的小窗口应用的任务等。示例性的,可以基于应用包名、是否可见、是否有焦点、音频的状态和输入操作是否频繁等一项或多项信息识别任务类型。The above task types can be reasonably set according to actual needs. For example, the above task types can include foreground tasks or background tasks, or the above task types can include multimedia tasks (for example, audio tasks, video tasks or game tasks, etc.) or non-multimedia tasks, etc. In some optional embodiments, the above front and back tasks can be further divided into video tasks located in the foreground, game tasks located in the foreground, tasks of small window applications located in the foreground, etc. Exemplarily, the task type can be identified based on one or more information such as the application package name, whether it is visible, whether it has focus, the state of the audio, and whether the input operation is frequent.

上述任务重要等级以根据任务的任务类型、负载大小、算力需求信息等中的至少一项确定任务的重要等级。上述算力需求信息可以用于指示执行任务所需的算力值,例如,可以是基于历史多次执行相同任务消耗的算力值所统计得到的算力值,或者,可以预先划分多个算力等级,上述算力需求信息可以用于指示任务对应的算力等级,例如,预先划分有第一算力等级和第二算力等级,第一算力等级用于指示所需算力相对较大,第二算力等级用于指示所需算力相对较小,并可以预先建立不同任务与算力等级之间的对应关系,例如,多媒体类任务(例如,音频任务、视频任务或者游戏任务等)对应第一算力等级,非多媒体类任务对应第二算力等级。The above-mentioned task importance level is determined according to at least one of the task type, load size, computing power requirement information, etc. The above-mentioned computing power requirement information can be used to indicate the computing power value required to execute the task, for example, it can be a computing power value obtained by statistics based on the computing power values consumed by executing the same task multiple times in history, or it can be pre-divided into multiple computing power levels. The above-mentioned computing power requirement information can be used to indicate the computing power level corresponding to the task, for example, it can be pre-divided into a first computing power level and a second computing power level, the first computing power level is used to indicate that the required computing power is relatively large, and the second computing power level is used to indicate that the required computing power is relatively small, and the corresponding relationship between different tasks and computing power levels can be pre-established, for example, multimedia tasks (for example, audio tasks, video tasks or game tasks, etc.) correspond to the first computing power level, and non-multimedia tasks correspond to the second computing power level.

在一些可选的实施例中,可以先划分任务类型,对于同一任务类型的任务,可以进一步确定各任务的任务重要等级,例如,可以将任务划分为前台任务和后台任务两类,对于前台任务,可以进一步确定各个前台任务的任务重要等级,例如,多媒体类的前台任务(例如,音频任务、视频任务或者游戏任务等)的任务重要等级大于非多媒体类的前台任务的任务重要等级。In some optional embodiments, task types may be divided first, and for tasks of the same task type, the task importance level of each task may be further determined. For example, tasks may be divided into foreground tasks and background tasks. For foreground tasks, the task importance level of each foreground task may be further determined. For example, the task importance level of multimedia foreground tasks (e.g., audio tasks, video tasks, or game tasks, etc.) is greater than the task importance level of non-multimedia foreground tasks.

上述调度优先级可以用于指示任务被调度的先后顺序,其中调度优先级越高的任务越被优先调度,例如,在同一处理器核中任务a的调度优先级为调度优先级a1,任务b的调度优先级为调度优先级b1,若调度优先级a1高于调度优先级b1,则任务a优先于任务b被调度。The above scheduling priorities can be used to indicate the order in which tasks are scheduled, wherein a task with a higher scheduling priority is scheduled first. For example, in the same processor core, the scheduling priority of task a is scheduling priority a1, and the scheduling priority of task b is scheduling priority b1. If scheduling priority a1 is higher than scheduling priority b1, task a is scheduled before task b.

在一实施方式中,若第一参数信息包括任务类型,则可以根据第一任务的任务类型确定第一任务的调度优先级,示例性的,可以预先建立任务类型与调度优先级之间的对应关系,例如,前台任务对应调度优先级a1,后台任务对应第二调度优先级b1,第一调度优先 级a1高于第二调度优先级b1,进而可以基于上述对应关系和第一任务的任务类型快速确定第一任务的调度优先级。In one embodiment, if the first parameter information includes a task type, the scheduling priority of the first task can be determined according to the task type of the first task. For example, a corresponding relationship between the task type and the scheduling priority can be pre-established. For example, the foreground task corresponds to the scheduling priority a1, the background task corresponds to the second scheduling priority b1, and the first scheduling priority Level a1 is higher than the second scheduling priority b1, and thus the scheduling priority of the first task can be quickly determined based on the above correspondence and the task type of the first task.

在另一实施方式中,若第一参数信息包括任务重要等级,则可以根据第一任务的任务重要等级确定第一任务的调度优先级,示例性的,可以预先建立任务重要等级与调度优先级之间的对应关系,例如,任务重要等级越高的任务对应的调度优先级越高,进而可以基于上述对应关系和第一任务的任务重要等级快速确定第一任务的调度优先级。In another embodiment, if the first parameter information includes the task importance level, the scheduling priority of the first task can be determined according to the task importance level of the first task. Exemplarily, a correspondence between the task importance level and the scheduling priority can be established in advance. For example, a task with a higher task importance level has a higher corresponding scheduling priority. Furthermore, the scheduling priority of the first task can be quickly determined based on the above correspondence and the task importance level of the first task.

在又一实施方式中,若第一参数信息包括任务类型和任务重要等级,则可以根据第一任务的任务类型和任务重要等级确定第一任务的调度优先级,示例性的,可以建立任务类型、任务重要等级与调度优先级之间的对应关系,例如,任务重要等级为a的前台任务且对应调度优先级a11,任务重要等级为b的前台任务对应调度优先级a12,后台任务对应调度优先级a2,若a大于b,则调度优先级a11高于调度优先级a12,且调度优先级a12高于调度优先级a2,进而可以基于上述对应关系以及第一任务的任务类型和任务重要等级快速确定第一任务的调度优先级。In another embodiment, if the first parameter information includes task type and task importance level, the scheduling priority of the first task can be determined according to the task type and task importance level of the first task. Exemplarily, a correspondence between task type, task importance level and scheduling priority can be established. For example, the foreground task with task importance level a corresponds to scheduling priority a11, the foreground task with task importance level b corresponds to scheduling priority a12, and the background task corresponds to scheduling priority a2. If a is greater than b, the scheduling priority a11 is higher than the scheduling priority a12, and the scheduling priority a12 is higher than the scheduling priority a2. Therefore, the scheduling priority of the first task can be quickly determined based on the above-mentioned correspondence and the task type and task importance level of the first task.

步骤102、根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核,其中,所述第二参数信息包括算力需求信息和调度优先级,N为大于1的整数。Step 102: Select a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1.

本实施例中,上述算力需求信息和调度优先级可以参见前述相关说明,在此不做赘述。In this embodiment, the above computing power demand information and scheduling priority can refer to the above-mentioned related instructions and will not be repeated here.

上述N个处理器核的各个处理器核的处理能力可以均相同;或者,上述N个处理器核可以包括处理能力不同的至少两类处理器核,例如,上述N个处理器核可以包括第一类处理器核、第二类处理器核和第三类处理器核,其中,第一类处理器核的处理能力强于第二类处理器核的处理能力,且第二类处理器核的处理能力强于第三类处理器核的处理能力。示例性的,如图2所示,包括1个大处理器核、4个中处理器核和3个小处理器核,其中,不同大小的处理器核对应不同的处理能力,例如,大处理器核的能力可以是小处理器核的处理能力的3倍甚至是4倍以上。其中,上述处理器核的处理能力的衡量指标可以包括但不限于处理器核的总算力值,也即总算力值越大,处理能力越强,其中,上述总算力值的衡量指标可以包括但不限于运算速度、缓存大小等。The processing capabilities of each of the N processor cores may be the same; or, the N processor cores may include at least two types of processor cores with different processing capabilities. For example, the N processor cores may include a first type of processor core, a second type of processor core, and a third type of processor core, wherein the processing capability of the first type of processor core is stronger than that of the second type of processor core, and the processing capability of the second type of processor core is stronger than that of the third type of processor core. Exemplarily, as shown in FIG2 , it includes 1 large processor core, 4 medium processor cores, and 3 small processor cores, wherein processor cores of different sizes correspond to different processing capabilities, for example, the capability of a large processor core may be 3 times or even 4 times greater than that of a small processor core. Among them, the measurement index of the processing capability of the processor core may include but is not limited to the total computing power value of the processor core, that is, the larger the total computing power value, the stronger the processing capability, wherein the measurement index of the total computing power value may include but is not limited to the computing speed, cache size, etc.

示例性的,可以在第一任务的调度优先级高于预设优先级的情况下,根据第一任务的算力需求信息从N个处理器核中确定第一任务的处理器核选择范围,并从该处理器核选择范围内选择目标处理器核;或者,可以根据第一任务的调度优先级计算各个处理器核的目标负载,其中,上述目标负载可以为处理器核上调度优先级满足预设条件的所有任务的负载之和,并根据第一任务的算力需求信息和各个处理器核的目标负载从N个处理器核中选择目标处理器核,例如,可以根据第一任务的算力需求信息从N个处理器核中确定第一任务的处理器核选择范围,并可以从该处理器核选择范围中选择目标负载最小的处理器核作为目标处理器核。Exemplarily, when the scheduling priority of the first task is higher than the preset priority, the processor core selection range of the first task can be determined from N processor cores based on the computing power requirement information of the first task, and the target processor core is selected from the processor core selection range; alternatively, the target load of each processor core can be calculated based on the scheduling priority of the first task, wherein the above-mentioned target load can be the sum of the loads of all tasks on the processor core whose scheduling priorities meet preset conditions, and the target processor core is selected from the N processor cores based on the computing power requirement information of the first task and the target load of each processor core. For example, the processor core selection range of the first task can be determined from N processor cores based on the computing power requirement information of the first task, and the processor core with the smallest target load can be selected as the target processor core from the processor core selection range.

步骤103、根据所述第一任务的调度优先级在所述目标处理器核上执行所述第一任务。 Step 103: Execute the first task on the target processor core according to the scheduling priority of the first task.

本实施例中,调度优先级越高的任务被目标处理器核越优先调度。例如,目标处理器核包括前台任务a和后台任务b,前台任务a的调度优先级高于后台任务b的调度优先级,则目标处理器核优先调度前台任务a,并在处理完所有的前台任务a之后调度后台任务b。需要说明的是,对于相同调度优先级的任务,可以基于各个任务在任务队列的先后顺序依次调度。In this embodiment, the target processor core schedules the tasks with higher scheduling priorities with higher priority. For example, the target processor core includes a foreground task a and a background task b, and the scheduling priority of the foreground task a is higher than the scheduling priority of the background task b. Then the target processor core schedules the foreground task a first, and schedules the background task b after processing all the foreground tasks a. It should be noted that for tasks with the same scheduling priority, they can be scheduled in sequence based on the order of the tasks in the task queue.

本申请实施例提供的任务处理方法,根据任务的任务类型和任务重要等级中的至少一项确定任务的调度优先级,并基于调度优先级对任务进行处理,这样可以实现对一些任务(例如,前台任务等)的优先调度,进而可以提高这些任务的处理速度,此外,本申请实施例根据算力需求信息和调度优先级从N个处理器核中选择目标处理器核以对任务进行处理,这样有利于为一些任务选择到更为合适的处理器核(例如,处理能力最强或者剩余算力最大的处理器核等)进行处理,进而可以提高这些任务的处理效率和流畅性。The task processing method provided in the embodiment of the present application determines the scheduling priority of the task according to at least one of the task type and the task importance level, and processes the task based on the scheduling priority, so that priority scheduling of some tasks (for example, foreground tasks, etc.) can be achieved, thereby improving the processing speed of these tasks. In addition, the embodiment of the present application selects a target processor core from N processor cores to process the task according to computing power demand information and scheduling priority, which is conducive to selecting more suitable processor cores (for example, processor cores with the strongest processing power or the largest remaining computing power, etc.) for processing some tasks, thereby improving the processing efficiency and fluency of these tasks.

可选的,所述根据第一任务的第二参数信息从N个处理器核中选择目标处理器核,包括:Optionally, selecting a target processor core from N processor cores according to the second parameter information of the first task includes:

根据所述第一任务的调度优先级分别计算所述N个处理器核中的每个处理器核的第一剩余算力值,所述处理器核的第一剩余算力值为所述处理器核的总算力值与第一算力值的差值,所述第一算力值为所述处理器核中调度优先级高于或等于所述第一任务的调度优先级的所有任务的负载所需算力值之和;Calculate a first remaining computing power value of each processor core of the N processor cores according to the scheduling priority of the first task, the first remaining computing power value of the processor core is the difference between the total computing power value of the processor core and the first computing power value, and the first computing power value is the sum of the computing power values required for the load of all tasks in the processor core whose scheduling priority is higher than or equal to the scheduling priority of the first task;

根据所述第一任务的算力需求信息和所述N个处理器核中的每个处理器核的第一剩余算力值确定目标处理器核。A target processor core is determined according to the computing power requirement information of the first task and a first remaining computing power value of each processor core of the N processor cores.

上述算力需求信息、调度优先级和N个处理器核可以参见前述实施例的相关说明,在此不做赘述。The above-mentioned computing power requirement information, scheduling priority and N processor cores can be found in the relevant description of the aforementioned embodiment and will not be elaborated here.

本实施例中,可以分别计算各个处理器核中调度优先级高于或等于第一任务的调度优先级的所有任务的负载所需算力值之和,即各个处理器核的第一算力值,再分别将每个处理器核的总算力值与第一算力值之间的差值作为该处理器核的第一剩余算力值。例如,第一任务的调度优先级为3,对于处理器核CPU-7,可以计算CPU-7中调度优先级高于或等于3的所有任务的负载所需算力值load-7,并可以根据CPU-7的总算力值cap-7计算第一剩余算力值free-7,即free-7=cap-7–load-7。In this embodiment, the sum of the load required computing power values of all tasks with a scheduling priority higher than or equal to the scheduling priority of the first task in each processor core can be calculated respectively, that is, the first computing power value of each processor core, and then the difference between the total computing power value of each processor core and the first computing power value is used as the first remaining computing power value of the processor core. For example, the scheduling priority of the first task is 3, and for the processor core CPU-7, the load required computing power value load-7 of all tasks with a scheduling priority higher than or equal to 3 in CPU-7 can be calculated, and the first remaining computing power value free-7 can be calculated based on the total computing power value cap-7 of CPU-7, that is, free-7 = cap-7–load-7.

在得到N个处理器核中的每个处理器核的第一剩余算力值之后,可以根据第一任务的算力需求信息和所述N个处理器核中的每个处理器核的第一剩余算力值确定目标处理器核,例如,可以从第一剩余算力值能够满足第一任务的算力需求信息的处理器核中选择一处理器核作为目标处理器核。After obtaining the first remaining computing power value of each of the N processor cores, the target processor core can be determined based on the computing power requirement information of the first task and the first remaining computing power value of each of the N processor cores. For example, a processor core can be selected as the target processor core from the processor cores whose first remaining computing power values can meet the computing power requirement information of the first task.

本实施例中,在上述N个处理器核包括处理能力不同的至少两类处理器核的情况下,基于各个处理器核的第一剩余算力值进行处理器核选择,有利于优先选到处理能力较强的处理器核对调度优先级较高的任务进行处理,这样可以提高调度优先级较高的任务的处理速度和流畅性;在上述N个处理器核的各个处理器核的处理能力可以均相同的情况下,基 于各个处理器核的第一剩余算力值进行处理器核选择,有利于减少调度优先级较低的任务对调度优先级较高的任务的影响,提高调度优先级较高的任务的处理速度。In this embodiment, when the N processor cores include at least two types of processor cores with different processing capabilities, processor core selection is performed based on the first remaining computing power value of each processor core, which is conducive to preferentially selecting a processor core with a stronger processing capability to process tasks with a higher scheduling priority, thereby improving the processing speed and fluency of tasks with a higher scheduling priority; when the processing capabilities of the N processor cores are all the same, the processor core selection is performed based on the first remaining computing power value of each processor core, thereby preferentially selecting a processor core with a stronger processing capability to process tasks with a higher scheduling priority; Performing processor core selection based on the first remaining computing power value of each processor core is beneficial to reducing the impact of tasks with lower scheduling priorities on tasks with higher scheduling priorities, and improving the processing speed of tasks with higher scheduling priorities.

可选的,所述根据所述第一任务的算力需求信息和所述N个处理器核中的每个处理器核的第一剩余算力值确定目标处理器核,包括:Optionally, determining the target processor core according to the computing power requirement information of the first task and the first remaining computing power value of each processor core of the N processor cores includes:

根据所述第一任务的算力需求信息确定第一处理器核选择范围,其中,所述N个处理器核包括至少两类处理器核,所述至少两类处理器核中不同类别的处理器核的处理能力不同,所述第一处理器核选择范围包括所述N个处理器核中的至少两个处理器核;Determining a first processor core selection range according to the computing power requirement information of the first task, wherein the N processor cores include at least two types of processor cores, different types of processor cores in the at least two types of processor cores have different processing capabilities, and the first processor core selection range includes at least two processor cores in the N processor cores;

根据所述第一处理器核选择范围内的各个处理器核的第一剩余算力值确定目标处理器核。The target processor core is determined according to the first remaining computing power values of the processor cores within the first processor core selection range.

本实施例中,上述每类处理器核可以包括一个或多个处理器核。例如,上述N个处理器核可以包括第一类处理器核和第二类处理器核,其中,第一类处理器核包括L个处理器核,第二类处理器核包括K个处理器核,L+K=N,且第一类处理器核的处理能力强于第二类处理器核的处理能力,则可以从上述L个处理器核中选择第一负载最小的处理器核作为第一处理器核。In this embodiment, each type of processor core may include one or more processor cores. For example, the N processor cores may include a first type of processor core and a second type of processor core, wherein the first type of processor core includes L processor cores, the second type of processor core includes K processor cores, L+K=N, and the processing capability of the first type of processor core is stronger than that of the second type of processor core, then the processor core with the smallest first load may be selected from the L processor cores as the first processor core.

需要说明的是,上述每类处理器核包括的多个处理器核的处理能力可以均相同,或者,上述每类处理器核包括的多个处理器核的处理能力之间的差值位于预设范围内。还需要说明的是,上述每类处理器核包括的多个处理器核的结构或型号等可以相同,也可以不相同。It should be noted that the processing capabilities of the multiple processor cores included in each type of processor core may be the same, or the difference between the processing capabilities of the multiple processor cores included in each type of processor core is within a preset range. It should also be noted that the structures or models of the multiple processor cores included in each type of processor core may be the same or different.

实际应用中,可以预先通过实验仿真等方式预先统计各个任务的算力需求信息,进而可以基于各个任务的算力需求信息建立算力需求信息与处理器核选择范围之间的对应关系,其中,上述处理器核选择范围内的处理器核的算力可以满足对应任务的算力需求信息。In practical applications, the computing power requirement information of each task can be pre-statisticed through experimental simulation and other methods, and then a correspondence between the computing power requirement information and the processor core selection range can be established based on the computing power requirement information of each task, wherein the computing power of the processor core within the above processor core selection range can meet the computing power requirement information of the corresponding task.

在一些可选的实施例中,在上述算力需求信息为算力等级的情况下,可以建立算力等级与处理器核选择范围之间的对应关系,其中,不同的算力等级对应不同的处理器核选择范围,且算力等级越高(也即所需算力越多),对应的处理器核选择范围内的处理器核的处理能力越强,这样有利于优选选择处理能力较强的处理器核对所需算力较大的任务进行处理。In some optional embodiments, when the above-mentioned computing power requirement information is the computing power level, a correspondence between the computing power level and the processor core selection range can be established, wherein different computing power levels correspond to different processor core selection ranges, and the higher the computing power level (that is, the more computing power required), the stronger the processing capability of the processor core within the corresponding processor core selection range. This is conducive to preferentially selecting processor cores with stronger processing capabilities to process tasks requiring greater computing power.

例如,上述N个处理器核包括8个处理器核,也即CPU-0至CPU-7,其中,CPU-7为大处理器核,CPU-4至CPU-6均为中处理器核,CPU-0至CPU-3均为小处理器核,其中,大处理器核的处理能力强于中处理器核的处理能力,中处理器核的处理能力强于小处理器核的处理能力,A任务是小窗应用的任务(例如,视频应用的小窗任务或者即时通讯类应有的小窗任务等),所需算力较少,对应的处理器核选择范围为CPU-0至CPU-6,也即A任务可以从CPU-0至CPU-6中选择处理器核;B任务是游戏任务,所需算力较多,对应的处理器核选择范围为CPU-0至CPU-7,也即B任务可以从CPU-0至CPU-7中选择处理器核。For example, the above-mentioned N processor cores include 8 processor cores, namely CPU-0 to CPU-7, among which CPU-7 is a large processor core, CPU-4 to CPU-6 are all medium processor cores, and CPU-0 to CPU-3 are all small processor cores, among which the processing power of the large processor core is stronger than that of the medium processor core, and the processing power of the medium processor core is stronger than that of the small processor core. Task A is a task of a small window application (for example, a small window task of a video application or a small window task that should be included in instant messaging, etc.), which requires less computing power, and the corresponding processor core selection range is CPU-0 to CPU-6, that is, Task A can select a processor core from CPU-0 to CPU-6; Task B is a game task, which requires more computing power, and the corresponding processor core selection range is CPU-0 to CPU-7, that is, Task B can select a processor core from CPU-0 to CPU-7.

本实施例中,在存在调度优先级相同的多个任务(例如,多个前台任务)的情况下,可以基于各个任务的算力需求信息确定各个任务对应的处理器核选择范围,并可以分别从 各个任务对应的处理器核选择范围内选择该任务对应的处理器核,这样可以减少调度优先级相同但算力需求不同的多个任务选到同一处理器核的情况发生,不仅可以减少上述多个任务之间的相互影响,还可以减少任务在不同处理器核上迁移的开销。In this embodiment, when there are multiple tasks with the same scheduling priority (for example, multiple foreground tasks), the selection range of the processor cores corresponding to each task can be determined based on the computing power requirement information of each task, and the selection range of the processor cores corresponding to each task can be determined respectively. The processor core corresponding to each task is selected within the selection range of the processor core corresponding to the task. This can reduce the situation where multiple tasks with the same scheduling priority but different computing power requirements select the same processor core. This can not only reduce the mutual influence between the above-mentioned multiple tasks, but also reduce the overhead of migrating tasks on different processor cores.

在一些可选的实施例中,可以先根据所述第一任务的算力需求信息确定第一处理器核选择范围,再基于第一任务的调度优先级计算第一处理器核选择范围内的各个处理器核的第一剩余算力值,并根据第一处理器核选择范围内的各个处理器核的第一剩余算力值确定目标处理器核,这样可以减少处理器核的剩余算力的计算,节约系统资源。In some optional embodiments, the first processor core selection range can be determined based on the computing power requirement information of the first task, and then the first remaining computing power value of each processor core within the first processor core selection range can be calculated based on the scheduling priority of the first task, and the target processor core can be determined based on the first remaining computing power value of each processor core within the first processor core selection range. This can reduce the calculation of the remaining computing power of the processor core and save system resources.

可选的,所述根据所述第一处理器核选择范围内的各个处理器核的第一剩余算力值确定目标处理器核,包括:Optionally, determining the target processor core according to the first remaining computing power value of each processor core within the first processor core selection range includes:

将所述第一处理器核选择范围内第一剩余算力值最大的处理器核确定为目标处理器核;Determine the processor core with the largest first remaining computing power value within the first processor core selection range as the target processor core;

或者,or,

将所述第一处理器核选择范围内的目标类处理器核中第一剩余算力值最大的处理器核确定为目标处理器核,其中,所述目标类处理器核为所述第一处理器核选择范围中处理能力最强的一类处理器核。A processor core with the largest first remaining computing power value among target class processor cores within the first processor core selection range is determined as a target processor core, wherein the target class processor core is a class of processor cores with the strongest processing capability within the first processor core selection range.

在一实施方式中,将第一处理器核选择范围内第一剩余算力值最大的处理器核确定为目标处理器核,这样可以保证第一任务可以被尽快处理,提高第一任务处理的及时性。In one implementation, the processor core with the largest first remaining computing power value within the first processor core selection range is determined as the target processor core, which can ensure that the first task can be processed as quickly as possible, thereby improving the timeliness of the first task processing.

在另一实施方式中,从处理能力最强的一类处理器核中选择第一剩余算力值最大的处理器核,可以保证通过处理能力最强的处理器核对第一任务进行处理,这样不仅可以提高第一任务的处理速度,还可以提高第一任务的流畅度。In another embodiment, selecting a processor core with the largest first residual computing power value from a class of processor cores with the strongest processing capabilities can ensure that the first task is processed by the processor core with the strongest processing capabilities. This can not only improve the processing speed of the first task, but also improve the fluency of the first task.

其中,上述第一处理器核选择范围中处理能力最强的一类处理器核,例如,可以是第一处理器核选择范围中总算力值最大的一类处理器核。The processor core of the type with the strongest processing capability in the first processor core selection range may be, for example, a processor core of the type with the largest total computing power value in the first processor core selection range.

可选的,所述根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核包括:Optionally, selecting a target processor core from N processor cores according to the second parameter information of the first task includes:

在所述第一任务满足第一条件的情况下,根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核;When the first task satisfies the first condition, selecting a target processor core from the N processor cores according to the second parameter information of the first task;

其中,所述第一条件包括如下任一项:任务类型为前台任务,任务重要等级大于预设等级,调度优先级大于预设优先级。The first condition includes any one of the following: the task type is a foreground task, the task importance level is greater than a preset level, and the scheduling priority is greater than a preset priority.

上述预设等级、预设优先级可以根据实际需求进行合理设置,本实施例对此不做限定。The above preset levels and preset priorities can be reasonably set according to actual needs, and this embodiment does not limit this.

具体的,可以在第一任务满足第一条件的情况下才采用本申请实施例提供的处理器核选择方式为第一任务选择处理器核,例如,根据所述第一任务的调度优先级分别计算所述N个处理器核中每个处理器核的第一算力值,其中,所述第一算力值为所述处理器核中调度优先级高于或等于所述第一任务的调度优先级的所有任务的负载所需算力值之和,分别根据所述N个处理器核中每个处理器核的第一算力值和总算力值确定所述N个处理器核中每个处理器核的第一剩余算力值,并根据所述第一任务的算力需求信息和所述N个处理器核中的每个处理器核的第一剩余算力值确定用于执行第一任务的处理器核。 Specifically, the processor core selection method provided in the embodiment of the present application can be used to select a processor core for the first task only when the first task meets the first condition. For example, the first computing power value of each of the N processor cores is calculated according to the scheduling priority of the first task, wherein the first computing power value is the sum of the computing power values required for the load of all tasks in the processor core whose scheduling priority is higher than or equal to the scheduling priority of the first task, and the first remaining computing power value of each processor core in the N processor cores is determined according to the first computing power value of each processor core in the N processor cores and the total computing power value, and the processor core used to execute the first task is determined according to the computing power requirement information of the first task and the first remaining computing power value of each processor core in the N processor cores.

在第一任务不满足第一条件的情况下可以采用现有的处理器核选择方式,例如,分别计算上述N个处理器核中每个处理器核对应的负载算力值,负载算力值为处理器核中所有负载所需算力值之和,并可选择负载算力值最小的处理器核作为执行上述第一任务的处理器核。When the first task does not meet the first condition, the existing processor core selection method can be used. For example, the load computing power value corresponding to each processor core in the above-mentioned N processor cores is calculated separately. The load computing power value is the sum of the computing power values required for all loads in the processor core, and the processor core with the smallest load computing power value can be selected as the processor core for executing the above-mentioned first task.

本实施例在满足第一条件的情况下根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核,这样不仅可以保证前台任务或者一些较为重要的任务等的处理效果,例如,处理效率、流畅度等,还可以降低不满足第一条件的任务(例如,后台任务或者一些重要程度较低的任务等)的处理器核选择的复杂度,进而可以减少系统资源开销。In this embodiment, when the first condition is met, the target processor core is selected from N processor cores according to the second parameter information of the first task. This can not only ensure the processing effect of foreground tasks or some more important tasks, such as processing efficiency and fluency, but also reduce the complexity of processor core selection for tasks that do not meet the first condition (for example, background tasks or some less important tasks, etc.), thereby reducing system resource overhead.

可选的,所述第一参数信息包括所述任务类型,所述任务类型包括前台任务或者后台任务;Optionally, the first parameter information includes the task type, and the task type includes a foreground task or a background task;

所述根据第一任务的第一参数信息确定所述第一任务的调度优先级包括:The determining the scheduling priority of the first task according to the first parameter information of the first task includes:

在所述第一任务的任务类型为前台任务的情况下,确定所述第一任务的调度优先级为第一调度优先级;In a case where the task type of the first task is a foreground task, determining the scheduling priority of the first task to be a first scheduling priority;

在所述第一任务的任务类型为后台任务的情况下,确定所述第一任务的调度优先级为第二调度优先级;When the task type of the first task is a background task, determining the scheduling priority of the first task to be a second scheduling priority;

其中,所述第一调度优先级高于所述第二调度优先级。The first scheduling priority is higher than the second scheduling priority.

示例性的,可以根据某一任务是否存在可见界面、是否存在前台服务和被前台依赖的服务在执行、是否存在广播在执行、是否存在被前台依赖的数据库在执行等区分任务为前台任务还是后天任务,例如,若某一任务不存在可见界面、不存在前台服务和被前台依赖的服务在执行、不存在广播在执行以及不存在被前台依赖的数据库在执行,则确定该任务为后台任务,否则确定该任务为前台任务。Exemplarily, a task can be distinguished as a foreground task or an acquired task based on whether there is a visible interface for the task, whether there are foreground services and services that the foreground depends on are being executed, whether there is a broadcast being executed, whether there is a database that the foreground depends on is being executed, etc. For example, if a task has no visible interface, no foreground services and services that the foreground depends on are being executed, no broadcast being executed, and no database that the foreground depends on is being executed, then the task is determined to be a background task; otherwise, the task is determined to be a foreground task.

本实施例中前台任务的调度优先级高于后台任务的调度优先级,这样可以保证前台任务可以优先于后台任务被调度,进而可以减少前台任务的卡顿,提高前台任务的流畅性。In this embodiment, the scheduling priority of the foreground task is higher than the scheduling priority of the background task, which can ensure that the foreground task can be scheduled before the background task, thereby reducing the jamming of the foreground task and improving the fluency of the foreground task.

以下结合图3对本申请实施例进行举例说明。The embodiment of the present application is described below with reference to FIG3 .

步骤201,场景识别。Step 201: scene recognition.

本实施例中可以通过场景识别模块识别多个前台应用的场景,对前台进程(即任务)都设置最高调度优先级,否则在不公平调度下,低优先级的前台应用容易被高优先级的前台影响,容易导致卡顿。In this embodiment, the scene recognition module can be used to identify the scenes of multiple foreground applications, and the highest scheduling priority is set for the foreground process (i.e., task). Otherwise, under unfair scheduling, low-priority foreground applications are easily affected by high-priority foreground applications, which can easily cause lag.

例如,应用A切换到前台,触发场景变化通知到场景识别模块,应用B切换到前台,触发场景变化通知到场景识别模块。For example, application A switches to the foreground, triggering a scene change notification to the scene recognition module, and application B switches to the foreground, triggering a scene change notification to the scene recognition module.

步骤202,判断是否存在多个前台应用。Step 202, determine whether there are multiple foreground applications.

例如,场景识别模块对应用A和应用B进行前台进程的判断,若A应用和B应用都是前台应用,那么就属于多前台应用场景。在该步骤中,若存在多个前台应用,可以执行步骤203。For example, the scene recognition module determines the foreground processes of application A and application B. If both application A and application B are foreground applications, then it belongs to a multi-foreground application scene. In this step, if there are multiple foreground applications, step 203 can be executed.

步骤203,计算各个前台应用所需的算力值(即上述的算力需求信息)。 Step 203, calculate the computing power value required by each foreground application (ie, the computing power requirement information mentioned above).

示例性的,可以根据前台进程(即任务)的类型,评估出每个前台进程对CPU算力的需求,以进行CPU资源分配。例如,可以根据应用包名、是否可见、是否有焦点、音频的状态、输入操作是否频繁等信息识别使用场景(例如玩游戏,听音乐,滑动小窗等等),而且判断出该应用进程对算力的需求。For example, the CPU computing power requirement of each foreground process (i.e., task) can be evaluated according to the type of foreground process (i.e., task) to allocate CPU resources. For example, the usage scenario (e.g., playing games, listening to music, sliding small windows, etc.) can be identified according to information such as the application package name, whether it is visible, whether it has focus, the audio status, and whether the input operation is frequent, and the computing power requirement of the application process can be determined.

例如,游戏进程要求算力高,可以优先跑到大处理器核上和中处理器核上,对算力要求稍低的前台进程(例如小窗应用进程)可以跑到其他的中处理器核或者小处理器核上,这样可以减少不同前台进程跑在同一个处理器核上而频繁迁移带来额外的系统开销。For example, game processes that require high computing power can be run on large and medium processor cores first. Foreground processes that require slightly lower computing power (such as small window application processes) can be run on other medium or small processor cores. This can reduce the additional system overhead caused by frequent migration of different foreground processes running on the same processor core.

需要说明的是,调度系统可以只对进程的调度管理,而不去关心应用的类型,算力需求等信息,因此可以通过上述场景识别模块来完成上述过程。It should be noted that the scheduling system can only manage the scheduling of processes without caring about the type of application, computing power requirements and other information. Therefore, the above process can be completed through the above-mentioned scene recognition module.

步骤204、若场景识别模块判断A应用对CPU算力需求较高,则可以确定A应用(如游戏应用)的处理器核选择范围为CPU-0至CPU-7。Step 204: If the scene recognition module determines that application A has a high demand for CPU computing power, the processor core selection range of application A (such as a game application) can be determined to be CPU-0 to CPU-7.

示例性的,CPU-7为大处理器核,CPU-4至CPU-6均为中处理器核,CPU-0至CPU-3均为小处理器核,其中,大处理器核的处理能力强于中处理器核的处理能力,中处理器核的处理能力强于小处理器核的处理能力For example, CPU-7 is a large processor core, CPU-4 to CPU-6 are all medium processor cores, and CPU-0 to CPU-3 are all small processor cores, wherein the processing capability of the large processor core is stronger than that of the medium processor core, and the processing capability of the medium processor core is stronger than that of the small processor core.

需要说明的是,可以预先通过实验模拟的方式确定各个应用进程所需的算力,例如,可以通过实验模拟的方式测试各个应用进程,多少算力能满足不掉帧、不卡音等,进而可以确定各个应用进程对应的处理器核选择范围。It should be noted that the computing power required for each application process can be determined in advance through experimental simulation. For example, each application process can be tested through experimental simulation to see how much computing power is required to avoid frame drops and sound jams, etc., and then the range of processor core selection corresponding to each application process can be determined.

步骤205、通过不公平调度选处理器核,优先为A应用选择处理器核CPU-7和CPU-6。Step 205: Select processor cores through unfair scheduling, and give priority to selecting processor cores CPU-7 and CPU-6 for application A.

因为A应用属于高调度优先级的进程,没有限制CPU的跑核,可以跑到CPU-7、CPU-6上,那么按照不公平调度的负载选核逻辑,就会优先调度到CPU-7和CPU-6上,因为CPU-7和CPU-6的算力强,而且没有其他调度优先级高的进程跑,剩余能力多。Because application A is a process with high scheduling priority, there is no restriction on the CPU cores on which it can run, and it can run on CPU-7 and CPU-6. According to the unfair scheduling load core selection logic, it will be scheduled to CPU-7 and CPU-6 first, because CPU-7 and CPU-6 have strong computing power and there is no other process with high scheduling priority running, so there is a lot of remaining capacity.

示例性的,在A应用是前台进程且对CPU算力需求较高的情况下,可以通过不公平调度将A应用优先调度到大处理器核和中处理器核。例如,识别出A应用为游戏应用(如根据应用包名确定为游戏应用),且位于前台(例如根据游戏的软件开发工具(sdk)得知是在对战场景),则可以把A应用进程的调度优先级设置为最高调度优先级,例如,设置其调度优先级为3,3为最高调度优先级,并优先将A应用进程调度到CPU-7和CPU-6上。For example, when application A is a foreground process and has a high demand for CPU computing power, application A can be preferentially scheduled to large processor cores and medium processor cores through unfair scheduling. For example, if application A is identified as a game application (such as determined as a game application based on the application package name) and is in the foreground (for example, it is known that it is in a battle scene based on the game's software development kit (sdk)), the scheduling priority of application A can be set to the highest scheduling priority, for example, set its scheduling priority to 3, which is the highest scheduling priority, and prioritize application A to CPU-7 and CPU-6.

步骤206、若场景识别模块判断B应用对CPU算力需求较低,则可以确定B应用(如小窗应用)的处理器核选择范围为CPU-0至CPU-5。Step 206: If the scene recognition module determines that application B has a lower demand for CPU computing power, the processor core selection range of application B (such as a small window application) can be determined to be CPU-0 to CPU-5.

步骤207、通过不公平调度选处理器核,优先为B应用选择处理器核CPU-5和CPU-4。Step 207: Select processor cores through unfair scheduling, and give priority to selecting processor cores CPU-5 and CPU-4 for application B.

因为B应用只能跑CPU-0~CPU-5,那么根据不公平调度的负载选核逻辑,会优先调度到CPU-5和CPU-4上,因为B应用从CPU-0~CPU-5上去选择,CPU-5和CPU-4的处理能力强,计算的剩余能力多,所以比较容易跑到CPU-5和CPU-4上,而且跑在CPU-5和CPU-4的高调度优先级的应用进程并不多。Because application B can only run on CPU-0 to CPU-5, it will be scheduled to CPU-5 and CPU-4 first according to the unfair scheduling load core selection logic. Because application B is selected from CPU-0 to CPU-5, CPU-5 and CPU-4 have strong processing capabilities and more surplus computing capacity, so it is easier to run on CPU-5 and CPU-4, and there are not many application processes with high scheduling priority running on CPU-5 and CPU-4.

由上可知,在示例中B应用(如视频小窗应用)最多占用CPU-4~CPU-5,可以避免和A应用(如游戏应用)抢占CPU-6和CPU-7,这样在A应用和B应用都是最高调度优 先级的情况下,在各个处理器核上来保证最高优先级来调度,这样可以保证各个应用的流畅性。As can be seen from the above, in the example, application B (such as a video window application) occupies CPU-4 to CPU-5 at most, and can avoid competing with application A (such as a game application) for CPU-6 and CPU-7. In this way, both application A and application B have the highest scheduling priority. In the case of priority, the highest priority is guaranteed for scheduling on each processor core, which can ensure the smoothness of each application.

需要说明的是,在本示例的不公平调度选处理器核方式中,高调度优先级的进程选处理器核会忽略在每个处理器核上的低调度优先级进程的负载,并计算每个处理器核上的剩余算力值(即上述的第一剩余算力值),然后选择剩余算力值最多的处理器核,例如,在为调度优先级为3的A应用进程选处理器核的情况下,由于可以允许选择CPU-7~CPU-0,因此在计算CPU-7的剩余算力值的情况下,会计算该CPU-7上任务队列中大于等于3的进程的负载,而不会计算小于3的进程的负载(因为优先级2和优先级1的进程负载不会影响优先级3的进程,其中,调度优先级顺序为:3高于2,2高于1。It should be noted that in the unfair scheduling processor core selection method of this example, the processor core selected by the process with high scheduling priority will ignore the load of the low scheduling priority process on each processor core, and calculate the remaining computing power value on each processor core (that is, the first remaining computing power value mentioned above), and then select the processor core with the largest remaining computing power value. For example, when selecting a processor core for application process A with a scheduling priority of 3, since CPU-7 to CPU-0 can be selected, when calculating the remaining computing power value of CPU-7, the load of processes greater than or equal to 3 in the task queue on CPU-7 will be calculated, and the load of processes less than 3 will not be calculated (because the load of processes with priority 2 and priority 1 will not affect the process with priority 3, where the scheduling priority order is: 3 is higher than 2, and 2 is higher than 1).

还需要说明的是,对于后台任务,可以设置其调度优先级为不公平调度的低调度优先级,例如,设置其调度优先级为0。It should also be noted that, for background tasks, their scheduling priority can be set to a low scheduling priority for unfair scheduling, for example, their scheduling priority can be set to 0.

本申请实施例提供的任务处理方法,执行主体可以为任务处理装置。本申请实施例中以任务处理装置执行任务处理方法为例,说明本申请实施例提供的任务处理装置。The task processing method provided in the embodiment of the present application can be executed by a task processing device. In the embodiment of the present application, the task processing device provided in the embodiment of the present application is described by taking the task processing method executed by the task processing device as an example.

参见图4,图4是本申请实施例提供的一种任务处理装置的结构示意图,如图4所示,所述任务处理装置400包括:Referring to FIG. 4 , FIG. 4 is a schematic diagram of the structure of a task processing device provided in an embodiment of the present application. As shown in FIG. 4 , the task processing device 400 includes:

第一确定模块401,用于根据第一任务的第一参数信息确定所述第一任务的调度优先级,其中,所述第一参数信息包括任务类型和任务重要等级中的至少一项;A first determination module 401 is used to determine the scheduling priority of the first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level;

第一选择模块402,用于根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核,其中,所述第二参数信息包括算力需求信息和调度优先级,N为大于1的整数;A first selection module 402, configured to select a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1;

执行模块403,用于根据所述第一任务的调度优先级在所述目标处理器核上执行所述第一任务。The execution module 403 is configured to execute the first task on the target processor core according to the scheduling priority of the first task.

可选的,所述第二参数信息包括算力需求信息和调度优先级;Optionally, the second parameter information includes computing power requirement information and scheduling priority;

所述第一选择模块包括:The first selection module comprises:

计算单元,用于根据所述第一任务的调度优先级分别计算所述N个处理器核中的每个处理器核的第一剩余算力值,所述处理器核的第一剩余算力值为所述处理器核的总算力值与第一算力值的差值,所述第一算力值为所述处理器核中调度优先级高于或等于所述第一任务的调度优先级的所有任务的负载所需算力值之和;a calculation unit, configured to calculate a first remaining computing power value of each of the N processor cores according to the scheduling priority of the first task, the first remaining computing power value of the processor core being a difference between a total computing power value of the processor core and a first computing power value, the first computing power value being a sum of computing power values required for a load of all tasks in the processor core whose scheduling priority is higher than or equal to the scheduling priority of the first task;

确定单元,用于根据所述第一任务的算力需求信息和所述N个处理器核中的每个处理器核的第一剩余算力值确定目标处理器核。A determination unit is used to determine a target processor core according to the computing power requirement information of the first task and a first remaining computing power value of each processor core in the N processor cores.

可选的,所述确定单元具体用于:Optionally, the determining unit is specifically configured to:

根据所述第一任务的算力需求信息确定第一处理器核选择范围,其中,所述N个处理器核包括至少两类处理器核,所述至少两类处理器核中不同类别的处理器核的处理能力不同,所述第一处理器核选择范围包括所述N个处理器核中的至少两个处理器核; Determining a first processor core selection range according to the computing power requirement information of the first task, wherein the N processor cores include at least two types of processor cores, different types of processor cores in the at least two types of processor cores have different processing capabilities, and the first processor core selection range includes at least two processor cores in the N processor cores;

根据所述第一处理器核选择范围内的各个处理器核的第一剩余算力值确定目标处理器核。The target processor core is determined according to the first remaining computing power values of the processor cores within the first processor core selection range.

可选的,所述确定单元具体用于:Optionally, the determining unit is specifically configured to:

将所述第一处理器核选择范围内第一剩余算力值最大的处理器核确定为目标处理器核;Determine the processor core with the largest first remaining computing power value within the first processor core selection range as the target processor core;

或者,or,

将所述第一处理器核选择范围内的目标类处理器核中第一剩余算力值最大的处理器核确定为目标处理器核,其中,所述目标类处理器核为所述第一处理器核选择范围中处理能力最强的一类处理器核。A processor core with the largest first remaining computing power value among target class processor cores within the first processor core selection range is determined as a target processor core, wherein the target class processor core is a class of processor cores with the strongest processing capability within the first processor core selection range.

可选的,所述第一选择模块具体用于:Optionally, the first selection module is specifically used to:

在所述第一任务满足第一条件的情况下,根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核;When the first task satisfies the first condition, selecting a target processor core from the N processor cores according to the second parameter information of the first task;

其中,所述第一条件包括如下任一项:任务类型为前台任务,任务重要等级大于预设等级,调度优先级大于预设优先级。The first condition includes any one of the following: the task type is a foreground task, the task importance level is greater than a preset level, and the scheduling priority is greater than a preset priority.

可选的,所述第一参数信息包括所述任务类型,所述任务类型包括前台任务或者后台任务;Optionally, the first parameter information includes the task type, and the task type includes a foreground task or a background task;

所述第一确定模块具体用于:The first determining module is specifically used for:

在所述第一任务的任务类型为前台任务的情况下,确定所述第一任务的调度优先级为第一调度优先级;In a case where the task type of the first task is a foreground task, determining the scheduling priority of the first task to be a first scheduling priority;

在所述第一任务的任务类型为后台任务的情况下,确定所述第一任务的调度优先级为第二调度优先级;When the task type of the first task is a background task, determining the scheduling priority of the first task to be a second scheduling priority;

其中,所述第一调度优先级高于所述第二调度优先级。The first scheduling priority is higher than the second scheduling priority.

本申请实施例中的任务处理装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The task processing device in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.

本申请实施例中的任务处理装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The task processing device in the embodiment of the present application may be a device having 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 embodiment of the present application.

本申请实施例提供的任务处理装置能够实现上述方法实施例实现的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。 The task processing device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

可选的,如图5所示,本申请实施例还提供一种电子设备500,包括处理器501和存储器502,存储器502上存储有可在所述处理器501上运行的程序或指令,该程序或指令被处理器501执行时实现上述任务处理方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in Figure 5, an embodiment of the present application also provides an electronic device 500, including a processor 501 and a memory 502, and the memory 502 stores a program or instruction that can be executed on the processor 501. When the program or instruction is executed by the processor 501, the various steps of the above-mentioned task processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

需要说明的是,本申请实施例中的电子设备包括移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include mobile electronic devices and non-mobile electronic devices.

图6为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 6 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.

该电子设备600包括但不限于:射频单元601、网络模块602、音频输出单元603、输入单元604、传感器605、显示单元606、用户输入单元607、接口单元608、存储器609、以及处理器610等部件。The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610.

本领域技术人员可以理解,电子设备600还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器610逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图6中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art will appreciate that the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The electronic device structure shown in FIG6 does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange components differently, which will not be described in detail here.

其中,所述处理器610,用于根据第一任务的第一参数信息确定所述第一任务的调度优先级,其中,所述第一参数信息包括任务类型和任务重要等级中的至少一项;The processor 610 is configured to determine a scheduling priority of the first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level;

所述处理器610,还用于根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核,其中,所述第二参数信息包括算力需求信息和调度优先级,N为大于1的整数;The processor 610 is further configured to select a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1;

所述处理器610,还用于根据所述第一任务的调度优先级在所述目标处理器核上执行所述第一任务。The processor 610 is further configured to execute the first task on the target processor core according to the scheduling priority of the first task.

可选的,所述第二参数信息包括算力需求信息和调度优先级;Optionally, the second parameter information includes computing power requirement information and scheduling priority;

所述处理器610具体用于:The processor 610 is specifically configured to:

根据所述第一任务的调度优先级分别计算所述N个处理器核中的每个处理器核的第一剩余算力值,所述第一算力值为所述处理器核中调度优先级高于或等于所述第一任务的调度优先级的所有任务的负载所需算力值之和;Calculate a first remaining computing power value of each processor core in the N processor cores according to the scheduling priority of the first task, the first computing power value being the sum of computing power values required for the load of all tasks in the processor core whose scheduling priority is higher than or equal to the scheduling priority of the first task;

根据所述第一任务的算力需求信息和所述N个处理器核中的每个处理器核的第一剩余算力值确定目标处理器核。A target processor core is determined according to the computing power requirement information of the first task and a first remaining computing power value of each processor core of the N processor cores.

可选的,所述处理器610具体用于:Optionally, the processor 610 is specifically configured to:

根据所述第一任务的算力需求信息确定第一处理器核选择范围,其中,所述N个处理器核包括至少两类处理器核,所述至少两类处理器核中不同类别的处理器核的处理能力不同,所述第一处理器核选择范围包括所述N个处理器核中的至少两个处理器核;Determining a first processor core selection range according to the computing power requirement information of the first task, wherein the N processor cores include at least two types of processor cores, different types of processor cores in the at least two types of processor cores have different processing capabilities, and the first processor core selection range includes at least two processor cores in the N processor cores;

根据所述第一处理器核选择范围内的各个处理器核的第一剩余算力值确定目标处理器核。The target processor core is determined according to the first remaining computing power values of the processor cores within the first processor core selection range.

可选的,所述处理器610具体用于: Optionally, the processor 610 is specifically configured to:

将所述第一处理器核选择范围内第一剩余算力值最大的处理器核确定为目标处理器核;Determine the processor core with the largest first remaining computing power value within the first processor core selection range as the target processor core;

或者,or,

将所述第一处理器核选择范围内的目标类处理器核中第一剩余算力值最大的处理器核确定为目标处理器核,其中,所述目标类处理器核为所述第一处理器核选择范围中处理能力最强的一类处理器核。A processor core with the largest first remaining computing power value among target class processor cores within the first processor core selection range is determined as a target processor core, wherein the target class processor core is a class of processor cores with the strongest processing capability within the first processor core selection range.

可选的,所述处理器610具体用于:Optionally, the processor 610 is specifically configured to:

在所述第一任务满足第一条件的情况下,根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核;When the first task satisfies the first condition, selecting a target processor core from the N processor cores according to the second parameter information of the first task;

其中,所述第一条件包括如下任一项:任务类型为前台任务,任务重要等级大于预设等级,调度优先级大于预设优先级。The first condition includes any one of the following: the task type is a foreground task, the task importance level is greater than a preset level, and the scheduling priority is greater than a preset priority.

可选的,所述第一参数信息包括所述任务类型,所述任务类型包括前台任务或者后台任务;Optionally, the first parameter information includes the task type, and the task type includes a foreground task or a background task;

所述处理器610具体用于:The processor 610 is specifically configured to:

在所述第一任务的任务类型为前台任务的情况下,确定所述第一任务的调度优先级为第一调度优先级;In a case where the task type of the first task is a foreground task, determining the scheduling priority of the first task to be a first scheduling priority;

在所述第一任务的任务类型为后台任务的情况下,确定所述第一任务的调度优先级为第二调度优先级;When the task type of the first task is a background task, determining the scheduling priority of the first task to be a second scheduling priority;

其中,所述第一调度优先级高于所述第二调度优先级。The first scheduling priority is higher than the second scheduling priority.

应理解的是,本申请实施例中,输入单元604可以包括图形处理器(Graphics Processing Unit,GPU)6041和麦克风6042,图形处理器6041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元606可包括显示面板6061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板6061。用户输入单元607包括触控面板6071以及其他输入设备6072中的至少一种。触控面板6071,也称为触摸屏。触控面板6071可包括触摸检测装置和触摸控制器两个部分。其他输入设备6072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that in the embodiment of the present application, the input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes a touch panel 6071 and at least one of other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

存储器609可用于存储软件程序以及各种数据。存储器609可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器609可以包括易失性存储器或非易失性存储器,或者,存储器609可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(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)。本申请实施例中的存储器609包括但不限于这些和任意其它适合类型的存储器。The memory 609 can be used to store software programs and various data. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory The memory 609 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

处理器610可包括一个或多个处理单元;可选的,处理器610集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器610中。The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 610.

本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述任务处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned task processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述任务处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned task processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述任务处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned task processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the 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, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡 献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the above description of the implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, or by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application essentially or in other words contributes to the prior art. The disclosed part may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。 The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims (17)

一种任务处理方法,所述方法包括:A task processing method, the method comprising: 根据第一任务的第一参数信息确定所述第一任务的调度优先级,其中,所述第一参数信息包括任务类型和任务重要等级中的至少一项;Determining a scheduling priority of the first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level; 根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核,其中,所述第二参数信息包括算力需求信息和调度优先级,N为大于1的整数;Selecting a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1; 根据所述第一任务的调度优先级在所述目标处理器核上执行所述第一任务。The first task is executed on the target processor core according to the scheduling priority of the first task. 根据权利要求1所述的方法,其中,所述根据第一任务的第二参数信息从N个处理器核中选择目标处理器核,包括:The method according to claim 1, wherein the selecting a target processor core from N processor cores according to the second parameter information of the first task comprises: 根据所述第一任务的调度优先级分别计算所述N个处理器核中的每个处理器核的第一剩余算力值,所述处理器核的第一剩余算力值为所述处理器核的总算力值与第一算力值的差值,所述第一算力值为所述处理器核中调度优先级高于或等于所述第一任务的调度优先级的所有任务的负载所需算力值之和;Calculate a first remaining computing power value of each processor core of the N processor cores according to the scheduling priority of the first task, the first remaining computing power value of the processor core is the difference between the total computing power value of the processor core and the first computing power value, and the first computing power value is the sum of the computing power values required for the load of all tasks in the processor core whose scheduling priority is higher than or equal to the scheduling priority of the first task; 根据所述第一任务的算力需求信息和所述N个处理器核中的每个处理器核的第一剩余算力值确定目标处理器核。A target processor core is determined according to the computing power requirement information of the first task and a first remaining computing power value of each processor core of the N processor cores. 根据权利要求2所述的方法,其中,所述根据所述第一任务的算力需求信息和所述N个处理器核中的每个处理器核的第一剩余算力值确定目标处理器核,包括:The method according to claim 2, wherein the determining the target processor core according to the computing power requirement information of the first task and the first remaining computing power value of each processor core of the N processor cores comprises: 根据所述第一任务的算力需求信息确定第一处理器核选择范围,其中,所述N个处理器核包括至少两类处理器核,所述至少两类处理器核中不同类别的处理器核的处理能力不同,所述第一处理器核选择范围包括所述N个处理器核中的至少两个处理器核;Determining a first processor core selection range according to the computing power requirement information of the first task, wherein the N processor cores include at least two types of processor cores, different types of processor cores in the at least two types of processor cores have different processing capabilities, and the first processor core selection range includes at least two processor cores in the N processor cores; 根据所述第一处理器核选择范围内的各个处理器核的第一剩余算力值确定目标处理器核。The target processor core is determined according to the first remaining computing power values of the processor cores within the first processor core selection range. 根据权利要求3所述的方法,其中,所述根据所述第一处理器核选择范围内的各个处理器核的第一剩余算力值确定目标处理器核,包括:The method according to claim 3, wherein determining the target processor core according to the first remaining computing power value of each processor core within the first processor core selection range comprises: 将所述第一处理器核选择范围内第一剩余算力值最大的处理器核确定为目标处理器核;Determine the processor core with the largest first remaining computing power value within the first processor core selection range as the target processor core; 或者,or, 将所述第一处理器核选择范围内的目标类处理器核中第一剩余算力值最大的处理器核确定为目标处理器核,其中,所述目标类处理器核为所述第一处理器核选择范围中处理能力最强的一类处理器核。A processor core with the largest first remaining computing power value among target class processor cores within the first processor core selection range is determined as a target processor core, wherein the target class processor core is a class of processor cores with the strongest processing capability within the first processor core selection range. 根据权利要求1至4中任一项所述的方法,其中,所述根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核包括:The method according to any one of claims 1 to 4, wherein the selecting a target processor core from N processor cores according to the second parameter information of the first task comprises: 在所述第一任务满足第一条件的情况下,根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核; When the first task satisfies the first condition, selecting a target processor core from the N processor cores according to the second parameter information of the first task; 其中,所述第一条件包括如下任一项:任务类型为前台任务,任务重要等级大于预设等级,调度优先级大于预设优先级。The first condition includes any one of the following: the task type is a foreground task, the task importance level is greater than a preset level, and the scheduling priority is greater than a preset priority. 根据权利要求1至4中任一项所述的方法,其中,所述第一参数信息包括所述任务类型,所述任务类型包括前台任务或者后台任务;The method according to any one of claims 1 to 4, wherein the first parameter information includes the task type, and the task type includes a foreground task or a background task; 所述根据第一任务的第一参数信息确定所述第一任务的调度优先级包括:The determining the scheduling priority of the first task according to the first parameter information of the first task includes: 在所述第一任务的任务类型为前台任务的情况下,确定所述第一任务的调度优先级为第一调度优先级;In a case where the task type of the first task is a foreground task, determining the scheduling priority of the first task to be a first scheduling priority; 在所述第一任务的任务类型为后台任务的情况下,确定所述第一任务的调度优先级为第二调度优先级;When the task type of the first task is a background task, determining the scheduling priority of the first task to be a second scheduling priority; 其中,所述第一调度优先级高于所述第二调度优先级。The first scheduling priority is higher than the second scheduling priority. 一种任务处理装置,所述装置包括:A task processing device, comprising: 第一确定模块,用于根据第一任务的第一参数信息确定所述第一任务的调度优先级,其中,所述第一参数信息包括任务类型和任务重要等级中的至少一项;A first determination module, configured to determine a scheduling priority of the first task according to first parameter information of the first task, wherein the first parameter information includes at least one of a task type and a task importance level; 第一选择模块,用于根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核,其中,所述第二参数信息包括算力需求信息和调度优先级,N为大于1的整数;A first selection module, configured to select a target processor core from N processor cores according to second parameter information of the first task, wherein the second parameter information includes computing power requirement information and scheduling priority, and N is an integer greater than 1; 执行模块,用于根据所述第一任务的调度优先级在所述目标处理器核上执行所述第一任务。An execution module is used to execute the first task on the target processor core according to the scheduling priority of the first task. 根据权利要求7所述的装置,其中,所述第一选择模块包括:The apparatus according to claim 7, wherein the first selection module comprises: 计算单元,用于根据所述第一任务的调度优先级分别计算所述N个处理器核中的每个处理器核的第一剩余算力值,所述处理器核的第一剩余算力值为所述处理器核的总算力值与第一算力值的差值,所述第一算力值为所述处理器核中调度优先级高于或等于所述第一任务的调度优先级的所有任务的负载所需算力值之和;a calculation unit, configured to calculate a first remaining computing power value of each of the N processor cores according to the scheduling priority of the first task, the first remaining computing power value of the processor core being a difference between a total computing power value of the processor core and a first computing power value, the first computing power value being a sum of computing power values required for a load of all tasks in the processor core whose scheduling priority is higher than or equal to the scheduling priority of the first task; 确定单元,用于根据所述第一任务的算力需求信息和所述N个处理器核中的每个处理器核的第一剩余算力值确定目标处理器核。A determination unit is used to determine a target processor core according to the computing power requirement information of the first task and a first remaining computing power value of each processor core in the N processor cores. 根据权利要求8所述的装置,其中,所述确定单元具体用于:The apparatus according to claim 8, wherein the determining unit is specifically configured to: 根据所述第一任务的算力需求信息确定第一处理器核选择范围,其中,所述N个处理器核包括至少两类处理器核,所述至少两类处理器核中不同类别的处理器核的处理能力不同,所述第一处理器核选择范围包括所述N个处理器核中的至少两个处理器核;Determining a first processor core selection range according to the computing power requirement information of the first task, wherein the N processor cores include at least two types of processor cores, different types of processor cores in the at least two types of processor cores have different processing capabilities, and the first processor core selection range includes at least two processor cores in the N processor cores; 根据所述第一处理器核选择范围内的各个处理器核的第一剩余算力值确定目标处理器核。The target processor core is determined according to the first remaining computing power values of the processor cores within the first processor core selection range. 根据权利要求9所述的装置,其中,所述确定单元具体用于:The apparatus according to claim 9, wherein the determining unit is specifically configured to: 将所述第一处理器核选择范围内第一剩余算力值最大的处理器核确定为目标处理器核;Determine the processor core with the largest first remaining computing power value within the first processor core selection range as the target processor core; 或者, or, 将所述第一处理器核选择范围内的目标类处理器核中第一剩余算力值最大的处理器核确定为目标处理器核,其中,所述目标类处理器核为所述第一处理器核选择范围中处理能力最强的一类处理器核。A processor core with the largest first remaining computing power value among target class processor cores within the first processor core selection range is determined as a target processor core, wherein the target class processor core is a class of processor cores with the strongest processing capability within the first processor core selection range. 根据权利要求7至10中任一项所述的装置,其中,所述第一选择模块具体用于:The device according to any one of claims 7 to 10, wherein the first selection module is specifically configured to: 在所述第一任务满足第一条件的情况下,根据所述第一任务的第二参数信息从N个处理器核中选择目标处理器核;When the first task satisfies the first condition, selecting a target processor core from the N processor cores according to the second parameter information of the first task; 其中,所述第一条件包括如下任一项:任务类型为前台任务,任务重要等级大于预设等级,调度优先级大于预设优先级。The first condition includes any one of the following: the task type is a foreground task, the task importance level is greater than a preset level, and the scheduling priority is greater than a preset priority. 根据权利要求7至10中任一项所述的装置,其中,所述第一参数信息包括所述任务类型,所述任务类型包括前台任务或者后台任务;The device according to any one of claims 7 to 10, wherein the first parameter information includes the task type, and the task type includes a foreground task or a background task; 所述第一确定模块具体用于:The first determining module is specifically used for: 在所述第一任务的任务类型为前台任务的情况下,确定所述第一任务的调度优先级为第一调度优先级;In a case where the task type of the first task is a foreground task, determining the scheduling priority of the first task to be a first scheduling priority; 在所述第一任务的任务类型为后台任务的情况下,确定所述第一任务的调度优先级为第二调度优先级;When the task type of the first task is a background task, determining the scheduling priority of the first task to be a second scheduling priority; 其中,所述第一调度优先级高于所述第二调度优先级。The first scheduling priority is higher than the second scheduling priority. 一种电子设备,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-6中任一项所述的任务处理方法的步骤。An electronic device comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the task processing method as described in any one of claims 1 to 6 are implemented. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-6中任一项所述的任务处理方法的步骤。A readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the task processing method according to any one of claims 1 to 6 are implemented. 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1-6任一项所述的任务处理方法的步骤。A chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the task processing method according to any one of claims 1 to 6. 一种计算机程序产品,所述计算机程序产品被至少一个处理器执行以实现如权利要求1-6任一项所述的任务处理方法的步骤。A computer program product, wherein the computer program product is executed by at least one processor to implement the steps of the task processing method according to any one of claims 1 to 6. 一种电子设备,所述电子设备被配置成用于执行如权利要求1-6任一项所述的任务处理方法的步骤。 An electronic device, wherein the electronic device is configured to execute the steps of the task processing method as described in any one of claims 1 to 6.
PCT/CN2024/095062 2023-05-30 2024-05-24 Task processing method and apparatus, and electronic device Pending WO2024245116A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310626134.3A CN116661964A (en) 2023-05-30 2023-05-30 Task processing method, device and electronic device
CN202310626134.3 2023-05-30

Publications (1)

Publication Number Publication Date
WO2024245116A1 true WO2024245116A1 (en) 2024-12-05

Family

ID=87723612

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/095062 Pending WO2024245116A1 (en) 2023-05-30 2024-05-24 Task processing method and apparatus, and electronic device

Country Status (2)

Country Link
CN (1) CN116661964A (en)
WO (1) WO2024245116A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119440854A (en) * 2025-01-07 2025-02-14 杭州宇泛智能科技股份有限公司 A model selection method and system for complex scene tasks
CN121094489A (en) * 2025-11-10 2025-12-09 邯郸市友发钢管有限公司 Flexible conveying and scheduling method and system for steel pipes

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116661964A (en) * 2023-05-30 2023-08-29 维沃移动通信有限公司 Task processing method, device and electronic device
CN119960951A (en) * 2023-11-07 2025-05-09 成都华为技术有限公司 Scheduling method, device and electronic equipment
CN117389711B (en) * 2023-12-11 2024-04-09 腾讯科技(深圳)有限公司 Scheduling method and device for terminal resources, terminal and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150121387A1 (en) * 2013-10-30 2015-04-30 Mediatek Inc. Task scheduling method for dispatching tasks based on computing power of different processor cores in heterogeneous multi-core system and related non-transitory computer readable medium
CN112925616A (en) * 2019-12-06 2021-06-08 Oppo广东移动通信有限公司 Task allocation method and device, storage medium and electronic equipment
CN113867907A (en) * 2021-08-09 2021-12-31 唐维昌 CPU resource-based scheduling system and optimization algorithm in engineering field
CN114461355A (en) * 2021-12-21 2022-05-10 奇安信科技集团股份有限公司 Unified management method, device, electronic device and storage medium for heterogeneous computing cluster
CN116661964A (en) * 2023-05-30 2023-08-29 维沃移动通信有限公司 Task processing method, device and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150121387A1 (en) * 2013-10-30 2015-04-30 Mediatek Inc. Task scheduling method for dispatching tasks based on computing power of different processor cores in heterogeneous multi-core system and related non-transitory computer readable medium
CN112925616A (en) * 2019-12-06 2021-06-08 Oppo广东移动通信有限公司 Task allocation method and device, storage medium and electronic equipment
CN113867907A (en) * 2021-08-09 2021-12-31 唐维昌 CPU resource-based scheduling system and optimization algorithm in engineering field
CN114461355A (en) * 2021-12-21 2022-05-10 奇安信科技集团股份有限公司 Unified management method, device, electronic device and storage medium for heterogeneous computing cluster
CN116661964A (en) * 2023-05-30 2023-08-29 维沃移动通信有限公司 Task processing method, device and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119440854A (en) * 2025-01-07 2025-02-14 杭州宇泛智能科技股份有限公司 A model selection method and system for complex scene tasks
CN121094489A (en) * 2025-11-10 2025-12-09 邯郸市友发钢管有限公司 Flexible conveying and scheduling method and system for steel pipes

Also Published As

Publication number Publication date
CN116661964A (en) 2023-08-29

Similar Documents

Publication Publication Date Title
WO2024245116A1 (en) Task processing method and apparatus, and electronic device
Yi et al. Heimdall: mobile GPU coordination platform for augmented reality applications
US20230413304A1 (en) Resource Scheduling Method and Terminal Device
CN109409513B (en) Task processing method based on neural network and related equipment
US9626295B2 (en) Systems and methods for scheduling tasks in a heterogeneous processor cluster architecture using cache demand monitoring
US20190258514A1 (en) I/O Request Scheduling Method and Apparatus
CN110968415B (en) Scheduling method and device of multi-core processor and terminal
CN113495780B (en) Task scheduling method and device, storage medium and electronic equipment
CN111831437B (en) Device management method and device, storage medium and electronic device
US11422857B2 (en) Multi-level scheduling
CN111831436B (en) IO request scheduling method and device, storage medium and electronic equipment
US20160019089A1 (en) Method and system for scheduling computing
CN111831434A (en) Resource allocation method, device, storage medium and electronic device
CN116302485B (en) CPU scheduling methods, apparatus, electronic devices, and readable storage media
CN111124668A (en) Memory release method, device, storage medium and terminal
US9274827B2 (en) Data processing apparatus, transmitting apparatus, transmission control method, scheduling method, and computer product
CN116302558A (en) Thread scheduling method, device and electronic equipment
CN113138909A (en) Load statistical method, device, storage medium and electronic equipment
CN116737338A (en) Processing methods, devices, equipment and storage media
CN114860455B (en) A request processing method, device, equipment and storage medium
CN118051313A (en) Process scheduling method and device, computer readable storage medium and terminal
JP5713973B2 (en) Information processing apparatus and parallel processing method
US10908962B1 (en) System and method to share GPU resources
CN118193197B (en) Information processing method and device, resource allocation method and device, and electronic equipment
CN116360953A (en) Task processing method, device and electronic device

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: 24814315

Country of ref document: EP

Kind code of ref document: A1