Task scheduling method, electronic device and computer-readable storage medium
By assigning priority scheduling queues to windows on electronic devices, the frame rate and smoothness issues of windows of interest to users in multi-window environments are resolved, resulting in a better user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2026-04-02
AI Technical Summary
When multiple windows are running simultaneously on an electronic device, the frame rate of the window that the user is more concerned about may decrease due to uneven allocation of GPU resources, resulting in stuttering or lag and affecting the user experience.
By assigning priorities to each window, graphics processing tasks for high-priority windows are prioritized into the high-priority scheduling queue, while tasks for low-priority windows are prioritized into the low-priority queue. This ensures that the GPU prioritizes high-priority tasks, improving the frame rate and smoothness of the windows that the user is focused on.
It improved the frame rate and smoothness of the user-focused window, enhanced the user experience, and resolved the stuttering and latency issues caused by uneven resource allocation.
Smart Images

Figure CN2025104087_02042026_PF_FP_ABST
Abstract
Description
Task scheduling method, electronic device and computer readable storage medium
[0001] The present application claims priority to the Chinese patent application No. 202411377664.X, filed on September 29, 2024, and entitled "Task scheduling method, electronic device and computer readable storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application belongs to the technical field of terminals, and particularly relates to a task scheduling method, an electronic device and a computer readable storage medium. BACKGROUND
[0003] An electronic device generally includes a graphics processing unit (GPU). The GPU can be used for graphics rendering, for example, for rendering a picture required to be displayed by a window. When the time length for the GPU to process a single frame of picture is shorter, the frame rate (i.e., the number of pictures displayed per second, FPS) obtained is higher. When the frame rate is higher, i.e., the number of pictures displayed per second is more, the displayed picture will be smoother, and the user experience will be better.
[0004] At present, an electronic device can generally run multiple windows simultaneously. When the electronic device runs multiple windows simultaneously, the multiple windows generally equally call the GPU to perform picture rendering. However, when the electronic device runs multiple windows simultaneously, the user generally pays more attention to some of the windows. At this time, all windows equally call the GPU to perform picture processing, which reduces the occupation of the GPU by the windows to which the user pays more attention, resulting in a decrease in the frame rate of the windows to which the user pays more attention, thereby causing problems such as freezing or delay of the windows to which the user pays more attention, and affecting the user experience. SUMMARY
[0005] Embodiments of the present application provide a task scheduling method, an electronic device and a computer readable storage medium, which can improve the picture frame rate of a window to which a user pays more attention, improve the picture smoothness of the window to which the user pays more attention, and improve the user experience.
[0006] In a first aspect, embodiments of the present application provide a task scheduling method applied to an electronic device, wherein the electronic device includes a graphics processing unit (GPU), and the method includes:
[0007] running a first window and a second window by the electronic device;
[0008] The electronic device schedules the graphic processing task in the first scheduling queue and the graphic processing task in the second scheduling queue to the GPU according to the priority of the first scheduling queue and the priority of the second scheduling queue; the first scheduling queue includes the graphic processing task corresponding to the first window, the second scheduling queue includes the graphic processing task corresponding to the second window, the priority of the first scheduling queue is higher than the priority of the second scheduling queue, and the priority of the graphic processing task corresponding to the first window is higher than the priority of the graphic processing task corresponding to the second window.
[0009] It should be understood that the higher the priority of the graphic processing task corresponding to the window, the higher the attention of the user to the window. The lower the priority of the graphic processing task corresponding to the window, the lower the attention of the user to the window.
[0010] In the task scheduling method provided above, when the electronic device runs multiple windows at the same time, the electronic device can determine the priority of the graphic processing task corresponding to each window, and can put the graphic processing task with high priority into a high-priority scheduling queue and the graphic processing task with low priority into a low-priority scheduling queue based on the priority of the graphic processing task, so that the GPU can preferentially execute the graphic processing task in the high-priority scheduling queue, i.e., the graphic processing task corresponding to the window that the user pays more attention to can be preferentially executed, the proportion of the graphic processing task with high priority to the GPU can be ensured, the frame rate of the window that the user pays more attention to can be improved, the smoothness of the window that the user pays more attention to can be improved, and the user experience can be improved.
[0011] In some embodiments, the priority of the graphic processing task corresponding to the window is determined according to at least one of the area of the first region corresponding to the window, the first proportion corresponding to the window, the area of the window, the second proportion corresponding to the window, the offset distance corresponding to the window, and the offset distance ratio corresponding to the window.
[0012] The area of the first region corresponding to the window includes the area of the region currently displayed by the window in the display interface, the first proportion corresponding to the window is the ratio between the area of the first region corresponding to the window and the area of the window, the second proportion corresponding to the window is the ratio between the area of the window and the area of the display interface, the offset distance corresponding to the window is the distance between the center point of the window and the center point of the display interface, and the offset distance ratio corresponding to the window is the ratio between the offset distance corresponding to the window and the diagonal length of the display interface.
[0013] It should be understood that when the electronic device is running multiple windows simultaneously, the window with higher user attention is generally the window with a larger or more complete visible area (i.e., the first area). Alternatively, the window with higher user attention is generally the window with a larger window. Alternatively, the window with higher user attention is generally the window closer to the center position of the display interface.
[0014] In the task scheduling method provided in this embodiment, the electronic device can determine the user attention to each window according to one or more of the visible area size (i.e., the area of the first area) corresponding to each window, the visible area ratio (i.e., the first ratio, which can be used to represent the completeness of the visible area), the window size, the screen ratio (i.e., the second ratio, which can be used to represent the size of the window), the offset distance between the center point of the window and the center point of the display interface, and the offset distance ratio, so as to determine the priority of the graphical processing task corresponding to each window. Among them, for the window with higher user attention, the priority of the graphical processing task corresponding to the window can be determined to be higher; for the window with lower user attention, the priority of the graphical processing task corresponding to the window can be determined to be lower, so that the graphical processing task corresponding to the window with higher user attention can be executed by the GPU in priority, the frame rate of the window with higher user attention is improved, and the picture fluency of the window with higher user attention is improved.
[0015] In some embodiments, the area of the first area corresponding to the first window is greater than the area of the first area corresponding to the second window, or the first ratio corresponding to the first window is greater than the first ratio corresponding to the second window, or the area of the first window is greater than the area of the second window, or the second ratio corresponding to the first window is greater than the second ratio corresponding to the second window, or the offset distance corresponding to the first window is less than the offset distance corresponding to the second window, or the offset distance ratio corresponding to the first window is less than the offset distance ratio corresponding to the second window.
[0016] In some embodiments, the electronic device schedules the graphical processing tasks in the first scheduling queue and the graphical processing tasks in the second scheduling queue to the GPU for execution according to the priority of the first scheduling queue and the priority of the second scheduling queue, comprising:
[0017] The electronic device schedules the graphical processing tasks in the first scheduling queue and the graphical processing tasks in the second scheduling queue to the GPU for execution according to the preset scheduling ratio, the priority of the first scheduling queue, and the priority of the second scheduling queue.
[0018] The preset scheduling ratio is a ratio of a time length for executing the graphic processing task in the first scheduling queue to a time length for executing the graphic processing task in the second scheduling queue, or a ratio of scheduling the graphic processing task in the first scheduling queue to scheduling the graphic processing task in the second scheduling queue.
[0019] It should be understood that when the preset scheduling ratio is a ratio of time lengths for executing the graphic processing task in each scheduling queue, the time length for executing the graphic processing task in the scheduling queue will be longer when the priority of the scheduling queue is higher, and the time length for executing the graphic processing task in the scheduling queue will be shorter when the priority of the scheduling queue is lower, so as to increase the time length for executing the graphic processing task in the scheduling queue with high priority, so that the GPU can have more time to execute the graphic processing task with high priority, thereby improving the speed and efficiency of executing the graphic processing task in the scheduling queue with high priority, improving the frame rate and picture fluency of the window with high user attention, and improving the viewing experience of the user for the window with high attention.
[0020] Similarly, when the preset scheduling ratio can be a ratio of scheduling the graphic processing task in each scheduling queue, that is, a ratio of the number of times of scheduling the graphic processing task in each scheduling queue, the number of times of scheduling the graphic processing task in the scheduling queue will be more when the priority of the scheduling queue is higher, and the number of times of scheduling the graphic processing task in the scheduling queue will be less when the priority of the scheduling queue is lower, so as to increase the number of times of scheduling the graphic processing task in the scheduling queue with high priority by the GPU, and improve the speed and efficiency of executing the graphic processing task in the scheduling queue with high priority, thereby improving the frame rate and picture fluency of the window with high user attention, and improving the viewing experience of the user for the window with high attention.
[0021] In a possible implementation, the GPU includes a first processing core and a second processing core, and the preset scheduling ratio includes a first preset scheduling ratio and a second preset scheduling ratio.
[0022] The first processing core executes the graphic processing task in the first scheduling queue and the graphic processing task in the second scheduling queue according to the first preset scheduling ratio.
[0023] The second processing core executes the graphic processing task in the first scheduling queue and the graphic processing task in the second scheduling queue according to the second preset scheduling ratio.
[0024] It should be understood that the first preset scheduling ratio and the second preset scheduling ratio can be the same or different. That is, when the GPU includes multiple cores, each core of the GPU can execute the graphics processing tasks in each scheduling queue with the same preset scheduling ratio. Alternatively, each core of the GPU can execute the graphics processing tasks in each scheduling queue with different preset scheduling ratios.
[0025] In another possible implementation, the GPU includes a first processing core and a second processing core.
[0026] The first processing core executes the graphics processing tasks in the first scheduling queue.
[0027] The second processing core executes the graphics processing tasks in the first scheduling queue and the graphics processing tasks in the second scheduling queue according to the preset scheduling ratio.
[0028] In the task scheduling method provided by this implementation, when the GPU includes multiple cores, a part of the cores of the GPU can be dedicated to executing the graphics processing tasks in the scheduling queue with higher priority, another part of the cores of the GPU can execute the graphics processing tasks in each scheduling queue according to a preset scheduling ratio, or another part of the cores of the GPU can execute the graphics processing tasks in other scheduling queues according to a preset scheduling ratio, so that the graphics processing tasks in the scheduling queue with higher priority can be executed in time by the part of the cores of the GPU dedicated to executing the graphics processing tasks in the scheduling queue with higher priority, thereby improving the frame rate and the smoothness of the window with higher user attention and improving the user experience.
[0029] For example, the preset scheduling ratio is preset or determined according to the current load of the GPU.
[0030] It should be understood that when the preset scheduling ratio is determined according to the current load of the GPU, when the current load of the GPU is large, the electronic device can determine a larger preset scheduling ratio, so that the time length for executing the graphics processing tasks in the scheduling queue with higher priority is longer than the time length for executing the graphics processing tasks in the scheduling queue with lower priority, or the number of times for scheduling the graphics processing tasks in the scheduling queue with higher priority is larger than the number of times for scheduling the graphics processing tasks in the scheduling queue with lower priority, so that the graphics processing tasks in the scheduling queue with higher priority can be executed preferentially when the load of the GPU is large, thereby improving the frame rate and the smoothness of the window with higher user attention and ensuring the viewing experience of the user on the window with higher user attention.
[0031] In one possible implementation, the load of the GPU is greater than or equal to a first preset load.
[0032] It should be noted that the first preset load can be used to indicate whether the GPU is overloaded. It should be understood that when the load of the GPU is greater than or equal to the first preset load, it can be determined that the GPU is overloaded, that is, it can be determined that the GPU cannot currently meet the task processing requirements of all windows. When the load of the GPU is less than the first preset load, it can be determined that the GPU is not overloaded, that is, it can be determined that the GPU can currently meet the task processing requirements of all windows.
[0033] In the task scheduling method provided in this implementation, when it is determined that the GPU is overloaded, that is, it is determined that the GPU cannot meet the task processing requirements of all current windows, the electronic device can determine the priorities of the graphics processing tasks corresponding to the windows, and can divide the graphics processing tasks corresponding to the windows into scheduling queues of different priorities according to the priorities of the graphics processing tasks corresponding to the windows. For example, high-priority graphics processing tasks can be divided into high-priority scheduling queues, and low-priority graphics processing tasks can be divided into low-priority scheduling queues, so that when the GPU is overloaded, that is, when the GPU resources are tight, the GPU can preferentially execute the graphics processing tasks corresponding to the windows with high user attention, ensuring the frame rate and smoothness of the windows with high user attention, and improving the viewing experience of the user for the windows with high attention.
[0034] In some embodiments, the electronic device also runs a third window, and the method further includes:
[0035] When the load of the GPU is less than the second preset load, the graphics processing task corresponding to the third window is divided into the first scheduling queue, and the priority of the graphics processing task corresponding to the first window is higher than the priority of the graphics processing task corresponding to the third window.
[0036] In the task scheduling method provided in this embodiment, the electronic device can divide the graphic processing tasks corresponding to each window into the corresponding scheduling queue based on the load of the GPU. For example, when the load of the GPU is greater than or equal to the second preset load, the electronic device can divide the graphic processing tasks of high priority into the scheduling queue of high priority, and can divide the graphic processing tasks of low priority into the scheduling queue of low priority. When the load of the GPU is less than the second preset load, the electronic device can divide the graphic processing tasks of high priority and part of the graphic processing tasks of low priority into the scheduling queue of high priority, and can divide another part of the graphic processing tasks of low priority into the scheduling queue of low priority. That is, when the load of the GPU is large, the graphic processing tasks of high priority can be preferentially scheduled to the GPU for execution. When the load of the GPU is small, in addition to preferentially scheduling the graphic processing tasks of high priority to the GPU for execution, part of the graphic processing tasks of low priority can also be preferentially scheduled to the GPU for execution, so that the graphic processing tasks of low priority can also be preferentially executed when the load of the GPU is small, that is, when the resources of the GPU are sufficient.
[0037] It should be understood that the second preset load can be the same as or different from the first preset load, and can be determined according to actual scenarios.
[0038] In some embodiments, the first window and the second window are windows of the same application.
[0039] It should be understood that the multiple windows running simultaneously on the electronic device can be windows of the same application or windows of different applications.
[0040] In other embodiments, the first window is a focus window, and the second window is a non-focus window.
[0041] In the task scheduling method provided in this embodiment, when the electronic device runs multiple windows, since the user generally pays the highest attention to the focus window, in order to ensure the frame rate of the focus window, improve the smoothness of the focus window, and improve the viewing experience of the user on the focus window, the priority of the graphic processing task corresponding to the focus window can be determined to be higher than the priority of the graphic processing task corresponding to the non-focus window, and the priority of the graphic processing task corresponding to the focus window can be put into the scheduling queue with the highest priority, so that the GPU can preferentially execute the graphic processing task corresponding to the focus window.
[0042] In a second aspect, an embodiment of the present application provides a task scheduling apparatus applied to an electronic device, wherein the electronic device includes a graphic processing unit (GPU), and the apparatus includes:
[0043] a window running module configured to run a first window and a second window;
[0044] a task scheduling module, configured to schedule the graphic processing tasks in the first scheduling queue and the graphic processing tasks in the second scheduling queue to the GPU according to a priority of the first scheduling queue and a priority of the second scheduling queue; the first scheduling queue comprises the graphic processing tasks corresponding to the first window, the second scheduling queue comprises the graphic processing tasks corresponding to the second window, the priority of the first scheduling queue is higher than the priority of the second scheduling queue, and the priority of the graphic processing tasks corresponding to the first window is higher than the priority of the graphic processing tasks corresponding to the second window.
[0045] In some embodiments, the priority of the graphic processing tasks corresponding to the window is determined according to at least one of an area of a first region corresponding to the window, a first proportion corresponding to the window, an area of the window, a second proportion corresponding to the window, an offset distance corresponding to the window, and a ratio of the offset distance corresponding to the window.
[0046] The area of the first region corresponding to the window comprises an area of a region currently displayed by the window in the display interface, the first proportion corresponding to the window is a ratio between the area of the first region corresponding to the window and the area of the window, the second proportion corresponding to the window is a ratio between the area of the window and an area of the display interface, the offset distance corresponding to the window is a distance between a center point of the window and a center point of the display interface, and the ratio of the offset distance corresponding to the window is a ratio between the offset distance corresponding to the window and a diagonal length of the display interface.
[0047] In other embodiments, the area of the first region corresponding to the first window is greater than the area of the first region corresponding to the second window, or the first proportion corresponding to the first window is greater than the first proportion corresponding to the second window, or the area of the first window is greater than the area of the second window, or the second proportion corresponding to the first window is greater than the second proportion corresponding to the second window, or the offset distance corresponding to the first window is less than the offset distance corresponding to the second window, or the ratio of the offset distance corresponding to the first window is less than the ratio of the offset distance corresponding to the second window.
[0048] In some embodiments, the task scheduling module is specifically configured to schedule the graphic processing tasks in the first scheduling queue and the graphic processing tasks in the second scheduling queue to the GPU according to a preset scheduling ratio, the priority of the first scheduling queue, and the priority of the second scheduling queue.
[0049] The preset scheduling ratio is a ratio of a time length for executing the graphic processing task in the first scheduling queue to a time length for executing the graphic processing task in the second scheduling queue, or a ratio of scheduling the graphic processing task in the first scheduling queue to scheduling the graphic processing task in the second scheduling queue.
[0050] In a possible implementation, the GPU includes a first processing core and a second processing core, and the preset scheduling ratio includes a first preset scheduling ratio and a second preset scheduling ratio.
[0051] The first processing core is configured to execute the graphic processing task in the first scheduling queue and the graphic processing task in the second scheduling queue according to the first preset scheduling ratio.
[0052] The second processing core is configured to execute the graphic processing task in the first scheduling queue and the graphic processing task in the second scheduling queue according to the second preset scheduling ratio.
[0053] In an example, the first preset scheduling ratio is the same as the second preset scheduling ratio.
[0054] In another possible implementation, the GPU includes a first processing core and a second processing core.
[0055] The first processing core is configured to execute the graphic processing task in the first scheduling queue.
[0056] The second processing core is configured to execute the graphic processing task in the first scheduling queue and the graphic processing task in the second scheduling queue according to the preset scheduling ratio.
[0057] For example, the preset scheduling ratio is preset or determined according to a current load of the GPU.
[0058] In a possible implementation, the load of the GPU is greater than or equal to a first preset load.
[0059] In some embodiments, the window running module is further configured to run a third window, and the apparatus further includes:
[0060] A task division module is configured to divide the graphic processing task corresponding to the third window to the first scheduling queue when the load of the GPU is less than a second preset load, and the priority of the graphic processing task corresponding to the first window is higher than the priority of the graphic processing task corresponding to the third window.
[0061] In some embodiments, the first window and the second window are windows of a same application.
[0062] In some embodiments, the first window is a focus window, and the second window is a non-focus window.
[0063] In a third aspect, the embodiments of the present application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program, the electronic device implements the task scheduling method in any of the first aspect.
[0064] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, the computer readable storage medium stores a computer program, when the computer program is executed by a computer, the computer implements the task scheduling method in any of the first aspect.
[0065] In a fifth aspect, the embodiments of the present application provide a computer program product, when the computer program product is executed on an electronic device, the electronic device executes the task scheduling method in any of the first aspect.
[0066] It can be understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0067] FIG. 1 is an example diagram of processing a plurality of application corresponding graphic processing tasks;
[0068] FIG. 2 is a structural schematic diagram of an electronic device to which the task scheduling method provided by the embodiments of the present application is applicable;
[0069] FIG. 3 is a software architecture schematic diagram to which the task scheduling method provided by the embodiments of the present application is applicable;
[0070] FIG. 4 is a flow schematic diagram of a task scheduling method provided by the embodiments of the present application;
[0071] FIG. 5 is an application scenario schematic diagram one provided by the embodiments of the present application;
[0072] FIG. 6 is an application scenario schematic diagram two provided by the embodiments of the present application;
[0073] FIG. 7 is an example diagram one of task scheduling provided by the embodiments of the present application;
[0074] FIG. 8 is an example diagram two of task scheduling provided by the embodiments of the present application;
[0075] FIG. 9 is an example diagram three of task scheduling provided by the embodiments of the present application;
[0076] FIG. 10 is an example diagram four of task scheduling provided by the embodiments of the present application;
[0077] FIG. 11 is a flow diagram of another task scheduling method according to an embodiment of the present application. DETAILED DESCRIPTION
[0078] It should be understood that the term "comprising" as used in the specification and in the claims indicates the presence of the recited features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0079] It should also be understood that the term "and / or" as used in the specification and in the claims indicates any combination of the associated listed items, as well as all possible combinations of the items, and includes these combinations.
[0080] In addition, in the description of the specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance.
[0081] In the present specification, the phrase "one embodiment" or "some embodiments" etc. means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearance of the phrases "in one example", "in some embodiments", "in another example", "in some other embodiments", etc. in various places in the specification is not necessarily all referring to the same embodiment, but means "one or more but not all embodiments", unless otherwise specifically stated. The terms "comprise", "include", "have" and their conjugates mean "including but not limited to", unless otherwise specifically stated.
[0082] In addition, "a plurality of" mentioned in the embodiments of the present application should be interpreted as two or more.
[0083] The steps involved in the task scheduling method provided in the embodiments of the present application are only examples, and not all steps are necessarily performed, or the content in each information or message is necessarily selected. In use, they can be increased or reduced as needed. The same step or step or message with the same function in different embodiments can be mutually referenced and learned.
[0084] The business scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of network architecture and the appearance of new business scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0085] An electronic device can generally include a GPU. The GPU can be used for graphics rendering, for example, for rendering a picture required to be displayed by a window. Frame rate refers to the number of pictures displayed per second (FPS) of an animation or a video, etc. Among them, when the frame rate is higher, the number of pictures displayed per second is more, the displayed picture is smoother, and the user experience is better. When the frame rate is lower, the number of pictures displayed per second is less, the displayed picture has problems such as lag or delay, and the user experience is affected. It should be understood that the processing performance of the GPU is a key factor affecting the frame rate. When the GPU takes a shorter time to process a single frame of picture, the obtained frame rate will be higher. When the GPU takes a longer time to process a single frame of picture, the obtained frame rate will be lower.
[0086] Generally, an electronic device can run multiple windows simultaneously. When the electronic device runs multiple windows simultaneously, the multiple windows generally need to call the GPU for picture rendering, that is, the GPU needs to process the graphics processing tasks corresponding to the multiple windows respectively to obtain the pictures corresponding to the windows. It should be understood that the graphics processing task corresponding to the window can refer to the task submitted by the application corresponding to the window to the GPU, which needs to be rendered. Among them, in order to realize the processing of the graphics processing tasks corresponding to the windows, the execution of the graphics processing tasks corresponding to the windows can generally be managed by a unified scheduling queue. That is, the graphics processing tasks corresponding to the windows can be placed in the scheduling queue. The GPU can sequentially obtain the graphics processing tasks from the scheduling queue in order to process them.
[0087] For example, please refer to FIG. 1, which shows an example of processing graphics processing tasks corresponding to multiple applications. This example takes the electronic device running window A, window B, window C and window D simultaneously as an example for illustrative explanation.
[0088] As shown in FIG. 1, when window A needs to schedule the GPU for execution of a graphics processing task, the electronic device can place the graphics processing task corresponding to window A (which can be referred to as graphics processing task A) into the scheduling queue. Similarly, when window B needs to schedule the GPU for execution of a graphics processing task, the electronic device can place the graphics processing task corresponding to window B (which can be referred to as graphics processing task B) into the scheduling queue. When window C needs to schedule the GPU for execution of a graphics processing task, the electronic device can place the graphics processing task corresponding to window C (which can be referred to as graphics processing task C) into the scheduling queue. When window D needs to schedule the GPU for execution of a graphics processing task, the electronic device can place the graphics processing task corresponding to window D (which can be referred to as graphics processing task D) into the scheduling queue.
[0089] The GPU can sequentially obtain the graphics processing tasks from the scheduling queue according to the time sequence in which the graphics processing tasks are placed in the scheduling queue, and perform the graphics processing tasks. That is, the graphics processing tasks can be processed by the processor core (also referred to as a core or a processing core, for example, the GPU includes core 1 and core 2 in FIG. 1) of the GPU according to the time sequence. The GPU can include a plurality of processor cores (or also referred to as computing units), which can simultaneously perform tasks, thereby achieving efficient parallel computing and improving the processing efficiency of the GPU. It should be understood that queue3, queue2, queue1 and queue0 in FIG. 1 can respectively refer to graphics processing tasks.
[0090] It should be understood that when the electronic device simultaneously runs a plurality of windows, the user generally pays more attention to some of the windows. The above-mentioned manner in which all the windows call the GPU to perform the graphics processing tasks according to the time sequence can reduce the occupation of the GPU by the windows to which the user pays more attention, cause the frame rate of the windows to which the user pays more attention to be low, and thus cause the windows to which the user pays more attention to have problems such as lag or delay, thereby affecting the user experience.
[0091] For example, in the scenario shown in FIG. 1, when the user pays more attention to window C, if the graphics processing task corresponding to window C is not placed in the scheduling queue of the GPU first, window C needs to wait until the GPU finishes processing the graphics processing tasks corresponding to other windows, and then call the GPU to process the graphics processing task C corresponding to window C. That is, the graphics processing task C corresponding to window C is blocked by the graphics processing tasks corresponding to other windows, causing the time length of a single frame of the window C to be long, causing the frame rate of the window C to be low, and thus causing the window C to have problems such as lag or delay, thereby affecting the user experience.
[0092] To solve the above-mentioned problems, the embodiments of the present application provide a task scheduling method, an electronic device and a computer readable storage medium. In the method, when the electronic device simultaneously runs a plurality of windows, the electronic device can determine the priorities of the graphics processing tasks corresponding to the windows, and can place the graphics processing tasks with high priorities in a high-priority scheduling queue and place the graphics processing tasks with low priorities in a low-priority scheduling queue, so that the GPU can preferentially execute the graphics processing tasks in the high-priority scheduling queue, that is, the graphics processing tasks corresponding to the windows to which the user pays more attention can be preferentially executed, the proportion of the occupation of the GPU by the graphics processing tasks with high priorities can be ensured, the frame rate of the windows to which the user pays more attention can be improved, the smoothness of the windows to which the user pays more attention can be improved, the user experience can be improved, and the method has strong ease of use and practicality.
[0093] In embodiments of the present application, the electronic device can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a desktop computer, and the like. Embodiments of the present application do not limit the specific type of electronic device.
[0094] The electronic device related in embodiments of the present application will be introduced first. Please refer to FIG. 2, which shows a structural schematic diagram of an electronic device 200.
[0095] The electronic device 200 can include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a loudspeaker 270A, a receiver 270B, a microphone 270C, a headset interface 270D, a sensor module 280, a key 290, a camera 291, and a display screen 292, and the like. The sensor module 280 can include a pressure sensor 280A, a gyroscope sensor 280B, a barometric pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, and the like.
[0096] It can be understood that the structure shown in embodiments of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0097] The processor 210 can include one or more processing units, for example: the processor 210 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors.
[0098] The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.
[0099] The processor 210 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory can save instructions or data that have just been used or are used repeatedly by the processor 210. If the processor 210 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 210, thereby improving the efficiency of the system.
[0100] In some embodiments, the processor 210 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0101] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a limitation on the structure of the electronic device 200. In some other embodiments of the present application, the electronic device 200 can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.
[0102] The charging management module 240 is configured to receive a charging input from a charger.
[0103] The power management module 241 is configured to connect the battery 242 and the charging management module 240. The power management module 241 receives an input of the battery 242 and / or the charging management module 240 to supply power to the processor 210, the internal memory 221, the display screen 292, the camera 291, and the wireless communication module 260.
[0104] The wireless communication function of the electronic device 200 can be realized by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, and the baseband processor.
[0105] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0106] The mobile communication module 250 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 200. The mobile communication module 250 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 250 can also amplify the signals modulated by the modem processor, and convert the signals into electromagnetic waves to be radiated by the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 250 can be arranged in the processor 210. In some embodiments, at least part of the functional modules of the mobile communication module 250 and at least part of the modules of the processor 210 can be arranged in the same device.
[0107] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 270A, a microphone 270B, etc.), or displays an image or a video through the display screen 292. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 210 and be disposed in the same device as the mobile communication module 250 or other functional modules.
[0108] The wireless communication module 260 can provide a wireless communication solution including a wireless local area network (WLAN) (such as a wireless fidelity (Wi-Fi) network), Bluetooth (BT), a global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, and the like, which are applied to the electronic device 200. The wireless communication module 260 can be one or more devices that integrate at least one communication processing module. The wireless communication module 260 receives an electromagnetic wave via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signal, and transmits the processed signal to the processor 210. The wireless communication module 260 can also receive a signal to be transmitted from the processor 210, perform frequency modulation and amplification thereon, and radiate the signal as an electromagnetic wave via the antenna 2.
[0109] In some embodiments, the antenna 1 and the mobile communication module 250 of the electronic device 200 are coupled, and the antenna 2 and the wireless communication module 260 are coupled, so that the electronic device 200 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).
[0110] The electronic device 200 implements a display function through a GPU, a display screen 292, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 292 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 can include one or more GPUs, which execute program instructions to generate or change display information.
[0111] The display screen 292 is configured to display images, videos, and the like. The display screen 292 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diodes (QLED), or the like. In some embodiments, the electronic device 200 can include one or N display screens 292, where N is a positive integer greater than 1.
[0112] The electronic device 200 can implement a photographing function through an ISP, the camera 291, a video codec, a GPU, the display screen 292, and an application processor.
[0113] The ISP is configured to process data fed back by the camera 291.
[0114] The camera 291 is configured to capture still images or videos. In some embodiments, the electronic device 200 can include one or N cameras 291, where N is a positive integer greater than 1.
[0115] The digital signal processor is configured to process digital signals, which can be digital image signals and other digital signals. The video codec is configured to compress or decompress digital videos. The electronic device 200 can support one or more video codecs. In this way, the electronic device 200 can play or record videos in multiple encoding formats, such as moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, and the like.
[0116] The NPU is a neural-network (NN) computing processor, which is configured to quickly process input information by referring to a biological neural network structure, such as a transmission mode between neurons in the human brain, and can constantly self-learn. Through the NPU, the electronic device 200 can implement intelligent cognitive applications, such as image recognition, face recognition, voice recognition, text understanding, and the like.
[0117] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to extend the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music and videos are stored in the external memory card.
[0118] The internal memory 221 can be used to store computer executable program codes including instructions. The internal memory 221 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), and the like. The data storage area can store data (such as audio data, a phone book, etc.) created during use of the electronic device 200, and the like. In addition, the internal memory 221 can include a high-speed random access memory, and can also include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 210 executes various function applications and data processing of the electronic device 200 by running instructions stored in the internal memory 221 and / or instructions stored in a memory disposed in the processor.
[0119] The electronic device 200 can implement an audio function through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, an application processor, and the like. For example, music playing, recording, and the like.
[0120] The audio module 270 is used to convert digital audio information into an analog audio signal output, and is also used to convert an analog audio input into a digital audio signal. The audio module 270 can also be used to encode and decode audio signals. The keys 290 include a power-on key, a volume key, and the like.
[0121] The keys 290 can be mechanical keys. They can also be touch keys. The electronic device 200 can receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 200.
[0122] The software system of the electronic device 200 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. For example, the software system of the electronic device 200 can adopt an Android operating system (OS), a Harmony OS, an IOS, or the like with a layered architecture. The embodiments of the present application exemplarily illustrate the software structure of the electronic device 200 with a layered architecture.
[0123] FIG. 3 is a software structure block diagram of the electronic device 200 according to an embodiment of the present application.
[0124] The layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into four layers, from top to bottom, the application layer, the application framework layer, the runtime and system library, and the kernel layer.
[0125] The application layer can include a series of application packages.
[0126] As shown in FIG. 3, the application package can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0127] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.
[0128] As shown in FIG. 3, the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0129] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and take screenshots, etc.
[0130] The content provider is used to store and obtain data, and make the data accessible to the application. The data can include video, image, audio, dialed and received calls, browsing history and bookmarks, phonebook, etc.
[0131] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.
[0132] The phone manager is used to provide the communication function of the electronic device 200. For example, the management of call status (including call connection, call hang-up, etc.).
[0133] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
[0134] The notification manager enables an application to display notification information in a status bar, which can be used to convey a message of the notification type, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of a download, a message reminder, etc. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the system top status bar, such as a notification of a background running application, and can also be a notification in the form of a dialog window appearing on the screen. For example, a text information is prompted in the status bar, a prompt sound is emitted, the electronic device vibrates, the indicator light flashes, etc.
[0135] The runtime includes a core library and a virtual machine. The runtime is responsible for scheduling and management of the operating system.
[0136] The core library includes two parts: one part is a function function that the java language needs to call, and the other part is the core library of the operating system.
[0137] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer into binary files. The virtual machine is used to perform functions such as management of object life cycle, stack management, thread management, security and exception management, and garbage collection.
[0138] The system library can include multiple functional modules. For example: a surface manager, media libraries, a three-dimensional graphics processing library (for example: OpenGLES), a 2D graphics engine (for example: SGL), etc.
[0139] The surface manager is used to manage the display subsystem, and provides a fusion of 2D and 3D layers for multiple applications.
[0140] The media library supports multiple commonly used audio, video format playback and recording, and static image files, etc. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0141] The three-dimensional graphics processing library is used to realize three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.
[0142] The 2D graphics engine is a drawing engine for 2D drawing.
[0143] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0144] The task scheduling method provided by the embodiments of the present application will be described in detail below in combination with the drawings and specific application scenarios.
[0145] Referring to FIG. 4, FIG. 4 shows a schematic flowchart of a task scheduling method provided in an embodiment of the present application. The method can be applied to the electronic device described above, and the electronic device can include a GPU. As shown in FIG. 4, the method can include the following steps.
[0146] S401. When the electronic device runs multiple windows, the electronic device determines the priority of the graphic processing task corresponding to each window.
[0147] In some embodiments, the priority of the graphic processing task corresponding to each window can be determined according to at least one of the area of the visible region corresponding to each window, the proportion of the visible region corresponding to each window, the area of each window, the proportion of the screen corresponding to each window, the offset distance between the center point of each window and the center of the display interface, and the offset distance ratio corresponding to each window. For specific ways in which the electronic device determines the priority of the graphic processing task corresponding to each window, please refer to the relevant content in the following “The process in which the electronic device determines the priority of the graphic processing task corresponding to each window will be described in detail below”.
[0148] S402. The electronic device divides the graphic processing task corresponding to each window into a corresponding scheduling queue according to the priority of the graphic processing task corresponding to each window.
[0149] In some embodiments, the electronic device can be provided with N scheduling queues, where N can be a positive integer greater than or equal to 2. Each scheduling queue can have a corresponding priority. For example, the priorities of the scheduling queues can be different from each other, that is, one scheduling queue can correspond to one priority. For example, the priorities of multiple scheduling queues can be the same, that is, two or more scheduling queues can correspond to one priority. The following description will be exemplarily described with the example that one scheduling queue corresponds to one priority.
[0150] In one example, when the electronic device is provided with two scheduling queues, for example, a first scheduling queue and a second scheduling queue, the priority of the first scheduling queue can be higher than the priority of the second scheduling queue. At this time, the electronic device can divide the graphic processing task with high priority into the first scheduling queue according to the priority of the graphic processing task corresponding to each window, and can divide the graphic processing task with low priority into the second scheduling queue.
[0151] For specific content in which the electronic device divides the graphic processing task corresponding to each window into a corresponding scheduling queue according to the priority of the graphic processing task corresponding to each window, please refer to the relevant content in the following “The process in which the electronic device divides the graphic processing task corresponding to each window into a corresponding scheduling queue according to the priority of the graphic processing task corresponding to each window will be described in detail below”.
[0152] S403. The electronic device schedules the graphics processing tasks in each of the scheduling queues to the GPU for execution according to the priority of each of the scheduling queues.
[0153] In some embodiments, the graphics processing tasks in the scheduling queue with high priority can be scheduled to the GPU for execution in priority, i.e., the GPU can execute the graphics processing tasks in the scheduling queue with high priority in priority. For example, when two scheduling queues, e.g., a first scheduling queue and a second scheduling queue, are provided in the electronic device, and the priority of the first scheduling queue is higher than the priority of the second scheduling queue, the electronic device can schedule the graphics processing tasks in the first scheduling queue to the GPU for execution in priority, i.e., the GPU can execute the graphics processing tasks in the first scheduling queue in priority.
[0154] The specific content where the electronic device schedules the graphics processing tasks in each of the scheduling queues to the GPU for execution according to the priority of each of the scheduling queues can be referred to the related content in the following "The process where the electronic device schedules the graphics processing tasks in each of the scheduling queues to the GPU for execution according to the priority of each of the scheduling queues will be described in detail below."
[0155] In the embodiments of the present application, when the electronic device runs multiple windows simultaneously, the electronic device can determine the priority of the graphics processing tasks corresponding to each window, and can put the graphics processing tasks with high priority into the scheduling queue with high priority, and put the graphics processing tasks with low priority into the scheduling queue with low priority. That is, the electronic device can put the graphics processing tasks corresponding to the window with high user attention into the scheduling queue with high priority, and put the graphics processing tasks corresponding to the window with low user attention into the scheduling queue with low priority, so that the GPU can execute the graphics processing tasks in the scheduling queue with high priority in priority when performing the graphics processing tasks, i.e., the GPU can execute the graphics processing tasks corresponding to the window with high user attention in priority, which can increase the proportion of the window with high user attention in the GPU, can reduce the waiting time delay of the window with high user attention, thereby can improve the frame rate of the window with high user attention, improve the picture fluency of the window with high user attention, and improve the user experience.
[0156] For example, the multiple windows run by the electronic device can be windows of different applications, or all or part of the multiple windows can be windows of the same application. In addition, any window run by the electronic device can be a foreground window, or can be a background window.
[0157] In some embodiments, the task scheduling method provided in the embodiments of the present application can be an optional function in the electronic device. The electronic device can determine whether to enable the function according to the actual scene to determine whether to schedule the graphics processing tasks to the GPU for execution by the task scheduling method provided in the embodiments of the present application.
[0158] In one example, the electronic device can determine whether to enable the function according to the load of the GPU. That is, when the electronic device runs multiple windows, the electronic device can determine the load of the GPU. When it is determined that the load of the GPU is greater than or equal to a preset load (which can be referred to as preset load A for example), the electronic device can determine that the GPU is overloaded, that is, it is determined that the GPU cannot currently meet the task processing requirements of the multiple windows, at this time, the electronic device can schedule the graphics processing tasks to the GPU for execution according to the task scheduling method provided in the embodiments of the present application. When it is determined that the load of the GPU is less than the preset load A, the electronic device can determine that the GPU is not overloaded, that is, it can be determined that the GPU can meet the current task processing requirements, at this time, the terminal device can schedule the graphics processing tasks to the GPU for execution by other scheduling methods.
[0159] That is, when it is determined that the GPU is overloaded, the electronic device can determine the priority of the graphics processing tasks corresponding to each window, and can divide the graphics processing tasks corresponding to each window into corresponding scheduling queues according to the priority of the graphics processing tasks corresponding to each window, that is, the graphics processing tasks with high priority can be divided into high-priority scheduling queues, and the graphics processing tasks with low priority can be divided into low-priority scheduling queues. Subsequently, the electronic device can schedule the graphics processing tasks in each scheduling queue to the GPU for execution according to the priority of each scheduling queue, so that the GPU can preferentially execute the graphics processing tasks with high priority, ensure the proportion of the GPU occupied by the graphics processing tasks with high priority, and improve the frame rate and the smoothness of the picture of the window with high user attention.
[0160] It should be noted that the preset load A can be determined according to actual application scenarios, and the embodiments of the present application do not limit this.
[0161] The process of determining the priority of the graphics processing tasks corresponding to each window by the electronic device will be described in detail below.
[0162] In some embodiments, when the electronic device runs multiple windows at the same time, the window or windows with high user attention generally have a larger visible area. Therefore, when the electronic device runs multiple windows at the same time, the electronic device can determine the user attention to each window according to the area of the region (which can be referred to as the first region corresponding to each window) displayed by each window in the display interface, and determine the priority of the graphics processing tasks corresponding to each window in this way. That is, the electronic device can determine the area of the first region corresponding to each window, and can determine the priority of the graphics processing tasks corresponding to each window according to the area of the first region corresponding to each window. That is, the electronic device can determine the priority of the graphics processing tasks corresponding to each window according to the size of the visible area of each window.
[0163] For example, the area of the first region corresponding to each window can be greater than or equal to 0. When the area of the first region corresponding to a certain window is equal to 0, it can be indicated that the window is not currently displayed in the display interface. When the area of the first region corresponding to a certain window is greater than 0, it can be indicated that all or part of the window is displayed in the display interface, i.e., the first region corresponding to the window can include all or part of the window.
[0164] For example, when the area of the first region corresponding to a certain window is greater, i.e., the visible region of the window is greater, it can be indicated that the window currently displays more content in the display interface, and the possibility that the user pays attention to the window will be greater. Therefore, the electronic device can determine that the user's attention to the window will be higher, and at this time, the electronic device can determine that the priority of the graphical processing task corresponding to the window is higher. When the area of the first region corresponding to a certain window is smaller, i.e., the visible region of the window is smaller, it can be indicated that the window currently displays less content in the display interface, and the possibility that the user pays attention to the window will be smaller. Therefore, the electronic device can determine that the user's attention to the window will be lower, and at this time, the electronic device can determine that the priority of the graphical processing task corresponding to the window is lower.
[0165] In one example, the electronic device can determine the priority of the graphical processing task corresponding to each window according to the ratio between the area of the first region corresponding to each window and the area of the display interface.
[0166] For example, the electronic device can determine the priority of the graphical processing task corresponding to each window as the ratio between the area of the first region corresponding to each window and the area of the display interface.
[0167] For example, when the windows running on the electronic device include window A, window B, window C, and window D, it is assumed that the electronic device determines that the ratio between the area of the first region corresponding to window A and the area of the display interface is 0.5, the ratio between the area of the first region corresponding to window B and the area of the display interface is 0.3, the ratio between the area of the first region corresponding to window C and the area of the display interface is 0.2, and the ratio between the area of the first region corresponding to window D and the area of the display interface is 0. At this time, the electronic device can determine that the priority of the graphical processing task corresponding to window A is 0.5, the priority of the graphical processing task corresponding to window B is 0.3, the priority of the graphical processing task corresponding to window C is 0.2, and the priority of the graphical processing task corresponding to window D is 0.
[0168] For example, the electronic device can be provided with at least two priorities corresponding to the graphic processing task and an interval range corresponding to each priority. After determining the ratio between the area of the first region corresponding to each window and the area of the display interface, the electronic device can determine the interval range to which the ratio between the area of the first region corresponding to each window and the area of the display interface belongs, and can determine the priority of the graphic processing task corresponding to each window according to the interval range.
[0169] For example, the electronic device can be provided with a first priority and a second priority corresponding to the graphic processing task, and can be provided with an interval range (for example, which can be referred to as interval range A1) corresponding to the first priority and an interval range (for example, which can be referred to as interval range A2) corresponding to the second priority. Among them, the first priority can be higher than the second priority.
[0170] When the windows running on the electronic device include window A, window B, window C and window D, it is assumed that the electronic device determines that the ratio between the area of the first region corresponding to window A and the area of the display interface is located in interval range A1, determines that the ratio between the area of the first region corresponding to window B and the area of the display interface is located in interval range A2, determines that the ratio between the area of the first region corresponding to window C and the area of the display interface is located in interval range A1, and determines that the ratio between the area of the first region corresponding to window D and the area of the display interface is located in interval range A2. At this time, the electronic device can determine that the priority of the graphic processing task corresponding to window A and the priority of the graphic processing task corresponding to window C are both the first priority, and the priority of the graphic processing task corresponding to window B and the priority of the graphic processing task corresponding to window D are both the second priority.
[0171] For example, the electronic device can be provided with a first priority, a second priority and a third priority corresponding to the graphic processing task, and can be provided with interval range A1 corresponding to the first priority, interval range A2 corresponding to the second priority, and interval range (for example, which can be referred to as interval range A3) corresponding to the third priority. Among them, the first priority can be higher than the second priority, and the second priority can be higher than the third priority.
[0172] When the windows running in the electronic device include the window A, the window B, the window C and the window D, it is assumed that the electronic device determines that the ratio between the area of the first region corresponding to the window A and the area of the display interface is located in the interval range A1, determines that the ratio between the area of the first region corresponding to the window B and the area of the display interface is located in the interval range A2, determines that the ratio between the area of the first region corresponding to the window C and the area of the display interface is located in the interval range A3, and determines that the ratio between the area of the first region corresponding to the window D and the area of the display interface is located in the interval range A2. At this time, the electronic device can determine that the priority of the image processing task corresponding to the window A is the first priority, the priority of the image processing task corresponding to the window B and the priority of the image processing task corresponding to the window D are both the second priority, and the priority of the image processing task corresponding to the window C is the third priority.
[0173] For example, the electronic device can be provided with the first priority, the second priority, the third priority and the fourth priority corresponding to the image processing task, and can be provided with the interval range A1 corresponding to the first priority, the interval range A2 corresponding to the second priority, the interval range A3 corresponding to the third priority, and the interval range (for example, which can be referred to as the interval range A4) corresponding to the fourth priority. Among them, the first priority can be higher than the second priority, the second priority can be higher than the third priority, and the third priority can be higher than the fourth priority.
[0174] When the windows running in the electronic device include the window A, the window B, the window C and the window D, it is assumed that the electronic device determines that the ratio between the area of the first region corresponding to the window A and the area of the display interface is located in the interval range A1, determines that the ratio between the area of the first region corresponding to the window B and the area of the display interface is located in the interval range A2, determines that the ratio between the area of the first region corresponding to the window C and the area of the display interface is located in the interval range A3, and determines that the ratio between the area of the first region corresponding to the window D and the area of the display interface is located in the interval range A4. At this time, the electronic device can determine that the priority of the image processing task corresponding to the window A is the first priority, the priority of the image processing task corresponding to the window B is the second priority, the priority of the image processing task corresponding to the window C is the third priority, and the priority of the image processing task corresponding to the window D is the fourth priority.
[0175] It should be noted that the number of priorities corresponding to the image processing task provided in the electronic device can be determined according to the actual scene, and the embodiments of the present application do not limit this. For example, the number of priorities corresponding to the image processing task can be set according to the number of scheduling queues provided in the electronic device.
[0176] For example, when two scheduling queues are provided in the electronic device, it can be determined that the priority corresponding to the graphics processing task includes two, such as the first priority and the second priority. For example, when three scheduling queues are provided in the electronic device, it can be determined that the priority corresponding to the graphics processing task includes three, such as the first priority, the second priority, and the third priority. For example, when four scheduling queues are provided in the electronic device, it can be determined that the priority corresponding to the graphics processing task includes four, such as the first priority, the second priority, the third priority, and the fourth priority. For example, when N scheduling queues are provided in the electronic device, it can be determined that the priority corresponding to the graphics processing task includes N, and the like. In addition, the specific value range of the interval range A1, the interval range A2, the interval range A3, and the interval range A4 can be determined according to the actual scene, and the embodiments of the present application do not limit this.
[0177] In the embodiments of the present application, the window can be a window running in the electronic device. For any window, the area of the first region corresponding to the window can include the entire area of the first region corresponding to the window, or can include part of the area of the first region corresponding to the window, for example, can only include the area of the content region in the first region. The content region can be used to display specific content. For example, when the first region corresponding to a certain window includes a content region, a title bar, a border, a navigation bar, and a toolbar, the area of the first region corresponding to the window can include the area of the content region, the area of the title bar, the area of the border, the area of the navigation bar, and the area of the toolbar. Alternatively, the area of the first region corresponding to the window can only include the area of the content region.
[0178] It should be understood that the area of each window described later can include the entire area of each window, or can include part of the area of each window, for example, can only include the area of the content region in each window. In the following, the area of the first region corresponding to each window will be exemplarily described as only including the area of the content region in the first region, and the area of each window will be exemplarily described as only including the area of the content region in each window.
[0179] For example, referring to FIG. 5, FIG. 5 shows an application scenario diagram one provided by the embodiments of the present application. The application scenario takes the window running in the electronic device as an example, which includes window A, window B, window C, and window D, and the entire window A is displayed on the display interface, the entire window B is displayed on the display interface, part of the window C is displayed on the display interface, and the window D is not displayed on the display interface (for example, the window D is completely blocked by the window A).
[0180] As shown in FIG. 5, the electronic device can determine that the area of the first region 510 corresponding to the window A is greater than the area of the first region 520 corresponding to the window B, the area of the first region 520 corresponding to the window B is greater than the area of the first region 530 corresponding to the window C, and the area of the first region 530 corresponding to the window C is greater than the area of the first region corresponding to the window D.
[0181] At this time, the electronic device can determine that the attention of the user to the window A is higher than the attention of the user to the window B, the attention of the user to the window B is higher than the attention of the user to the window C, and the attention of the user to the window C is higher than the attention of the user to the window D. Therefore, the electronic device can determine that the priority of the image processing task corresponding to the window A is higher than the priority of the image processing task corresponding to the window B, the priority of the image processing task corresponding to the window B is higher than the priority of the image processing task corresponding to the window C, and the priority of the image processing task corresponding to the window C is higher than the priority of the image processing task corresponding to the window D.
[0182] In a possible implementation, the electronic device can further determine the area of each window, and can determine the priority of the image processing task corresponding to each window according to the area of the first region corresponding to each window and the area of each window. That is, the electronic device can determine the priority of the image processing task corresponding to each window according to the size of the visible region of each window and the size of each window itself.
[0183] In an example, for each window, the electronic device can determine the proportion (for example, which can be referred to as a visible region proportion) of the first region corresponding to the window in the window according to the area of the first region corresponding to the window and the area of the window. Subsequently, the electronic device can determine the priority of the image processing task corresponding to each window according to the visible region proportion corresponding to each window. That is, the electronic device can determine the priority of the image processing task corresponding to each window according to the proportion of the visible region of each window in each window.
[0184] For example, when the visible region proportion corresponding to a window is greater, it indicates that the content blocked by the window is less, that is, the completeness of the content displayed by the window is higher, and the possibility that the user pays attention to the window will be greater. Therefore, the electronic device can determine that the attention of the user to the window will be higher, and at this time, the electronic device can determine that the priority of the image processing task corresponding to the window is higher. When the visible region proportion corresponding to a window is smaller, it indicates that the content blocked by the window is more, that is, the completeness of the content displayed by the window is lower, and the possibility that the user pays attention to the window will be smaller. Therefore, the electronic device can determine that the attention of the user to the window will be lower, and at this time, the electronic device can determine that the priority of the image processing task corresponding to the window is lower.
[0185] For example, refer to FIG. 6, which shows a second application scenario provided by the embodiments of the present application. The application scenario takes the windows running on the electronic device as an example, which include window A, window B, window C and window D, and the entire window A is displayed on the display interface, part of the window B is displayed on the display interface, part of the window C is displayed on the display interface, and the window D is not displayed on the display interface.
[0186] As shown in FIG. 6, the electronic device determines the area of the first area 610 corresponding to the window A and the area of the window A, and can determine the visual area ratio corresponding to the window A according to the area of the first area 610 and the area of the window A. That is, the electronic device can determine that the visual area ratio corresponding to the window A is 1.
[0187] The electronic device can determine the area of the first area 620 corresponding to the window B and the area of the window B, and can determine the visual area ratio corresponding to the window B according to the area of the first area 620 and the area of the window B. It is assumed that the electronic device determines that the visual area ratio corresponding to the window B is 0.8.
[0188] The electronic device can determine the area of the first area 630 corresponding to the window C and the area of the window C, and can determine the visual area ratio corresponding to the window C according to the area of the first area 630 and the area of the window C. It is assumed that the electronic device determines that the visual area ratio corresponding to the window C is 0.5.
[0189] The electronic device can determine the area of the first area corresponding to the window D and the area of the window D, and can determine the visual area ratio corresponding to the window D according to the area of the first area corresponding to the window D and the area of the window D. That is, the electronic device can determine that the visual area ratio corresponding to the window D is 0.
[0190] Therefore, the electronic device can determine that the priority of the image processing task corresponding to the window A is higher than the priority of the image processing task corresponding to the window B, the priority of the image processing task corresponding to the window B is higher than the priority of the image processing task corresponding to the window C, and the priority of the image processing task corresponding to the window C is higher than the priority of the image processing task corresponding to the window D.
[0191] In a possible implementation, the electronic device can determine the visual area ratio corresponding to each window as the priority of the image processing task corresponding to each window. Wherein, the larger the visual area ratio, the higher the priority; the smaller the visual area ratio, the lower the priority.
[0192] For example, when the windows running on the electronic device include window A, window B, window C and window D, it is assumed that the electronic device determines that the visual area ratio corresponding to window A is 1, the visual area ratio corresponding to window B is 0.8, the visual area ratio corresponding to window C is 0.5, and the visual area ratio corresponding to window D is 0. At this time, the electronic device can determine that the priority of the graphic processing task corresponding to window A is 1, the priority of the graphic processing task corresponding to window B is 0.8, the priority of the graphic processing task corresponding to window C is 0.5, and the priority of the graphic processing task corresponding to window D is 0.
[0193] In another possible implementation, the electronic device can be provided with at least two priorities of the graphic processing task and an interval range corresponding to each priority. The electronic device can determine the priority of the graphic processing task corresponding to each window according to the interval range to which the visual area ratio corresponding to each window belongs.
[0194] It should be understood that the specific content of the electronic device determining the priority of the graphic processing task corresponding to each window according to the interval range to which the visual area ratio corresponding to each window belongs can refer to the related content of the electronic device determining the priority of the graphic processing task corresponding to each window according to the interval range to which the ratio between the area of the first area corresponding to each window and the area of the display interface belongs, and will not be described here for the sake of brevity.
[0195] It should be noted that the interval range corresponding to each priority in the scenario of determining the priority of the graphic processing task corresponding to each window based on the visual area ratio corresponding to each window can be the same as or different from the interval range corresponding to each priority in the scenario of determining the priority of the graphic processing task corresponding to each window based on the ratio between the area of the first area corresponding to each window and the area of the display interface, and can be determined according to the actual scenario.
[0196] In some other embodiments, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the area of each window.
[0197] For example, when the area of a window is larger, it can be indicated that the possibility of the user paying attention to the window will be larger, and therefore, the electronic device can determine that the attention degree of the user to the window will be higher, and at this time, the electronic device can determine that the priority of the graphic processing task corresponding to the window will be higher. When the area of a window is smaller, it can be indicated that the possibility of the user paying attention to the window will be smaller. Therefore, the electronic device can determine that the attention degree of the user to the window will be lower, and at this time, the electronic device can determine that the priority of the graphic processing task corresponding to the window will be lower.
[0198] In one example, the electronic device can determine the proportion of each window in the display interface (which can be referred to as the screen proportion corresponding to each window) according to the area of each window and the area of the display interface, and can determine the priority of the graphic processing task corresponding to each window according to the screen proportion corresponding to each window.
[0199] For example, the larger the screen proportion corresponding to a window, the higher the attention of the user to the window, and the electronic device can determine that the priority of the graphic processing task corresponding to the window is higher. The smaller the screen proportion corresponding to a window, the lower the attention of the user to the window, and the electronic device can determine that the priority of the graphic processing task corresponding to the window is lower.
[0200] In one possible implementation, the electronic device can determine the screen proportion corresponding to each window as the priority of the graphic processing task corresponding to each window.
[0201] In another possible implementation, the electronic device can be provided with at least two priority levels of graphic processing tasks and an interval range corresponding to each priority level. After determining the screen proportion corresponding to each window, the electronic device can determine the interval range to which the screen proportion corresponding to each window belongs, and can determine the priority of the graphic processing task corresponding to each window according to the interval range.
[0202] Similarly, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the interval range to which the screen proportion corresponding to each window belongs. For brevity, the details are not repeated here.
[0203] It should be noted that the interval range corresponding to each priority level in the scenario of determining the priority of the graphic processing task corresponding to each window based on the screen proportion corresponding to each window can be the same as or different from the interval range corresponding to each priority level in the scenario of determining the priority of the graphic processing task corresponding to each window based on the ratio between the area of the first region corresponding to each window and the area of the display interface. The specific interval range can be determined according to the actual scenario.
[0204] In other embodiments, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the area of the first region corresponding to each window, the area of each window, and the area of the display interface.
[0205] In one example, the electronic device can obtain a weight corresponding to the visual area ratio (e.g., which can be referred to as a first weight) and a weight corresponding to the screen ratio (e.g., a second weight). For each window, the electronic device can perform a weighted calculation according to the first weight, the visual area ratio corresponding to the window, the second weight, and the screen ratio corresponding to the window, to obtain a weighted result corresponding to the window. Subsequently, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the weighted result corresponding to each window. When the weighted result corresponding to a certain window is larger, the priority of the graphic processing task corresponding to the window is higher. When the weighted result corresponding to a certain window is smaller, the priority of the graphic processing task corresponding to the window is lower.
[0206] It should be noted that the first weight and the second weight can be determined according to actual scenarios, and embodiments of the present application do not limit this. For example, the first weight can be determined to be 0.7 and the second weight can be determined to be 0.3 according to actual scenarios. For example, the first weight can be determined to be 0.8 and the second weight can be determined to be 0.2 according to actual scenarios, and the like.
[0207] For example, the electronic device can determine the weighted result corresponding to each window as the priority of the graphic processing task corresponding to each window.
[0208] For example, the electronic device can be provided with at least two priorities of graphic processing tasks and an interval range corresponding to each priority. After determining the weighted result corresponding to each window, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the interval range to which the weighted result corresponding to each window belongs.
[0209] It should be understood that the specific content of the electronic device determining the priority of the graphic processing task corresponding to each window according to the interval range to which the weighted result corresponding to each window belongs can refer to the related content of the electronic device determining the priority of the graphic processing task corresponding to each window according to the interval range to which the ratio between the area of the first area corresponding to each window and the area of the display interface belongs, and for the sake of brevity, will not be repeated here.
[0210] In other embodiments, the electronic device can also determine the distance between the center point of each window and the center point of the display interface. Subsequently, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the distance (or which can be referred to as the offset distance) between the center point of each window and the center point of the display interface.
[0211] When the distance between the center point of a window and the center point of the display interface is closer, it indicates that the window is closer to the central position of the display interface, and it can be considered that the possibility of the user paying attention to the window will be greater, i.e., it can be determined that the attention degree of the user to the window is higher. When the distance between the center point of a window and the center point of the display interface is farther, it indicates that the window is farther away from the central position of the display interface, and it can be considered that the possibility of the user paying attention to the window will be smaller, i.e., it can be determined that the attention degree of the user to the window is lower.
[0212] For each window, the electronic device can determine a window offset ratio (or can be referred to as an offset distance ratio) corresponding to the window according to the distance between the center point of the window and the center point of the display interface and the display interface (for example, the diagonal length of the display interface). Subsequently, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the window offset ratio corresponding to each window.
[0213] In one example, the electronic device can determine the window offset ratio corresponding to each window as the priority of the graphic processing task corresponding to each window.
[0214] In another example, at least two priority levels of the graphic processing task and an interval range corresponding to each priority level can be set in the electronic device. After determining the window offset ratio corresponding to each window, the electronic device can determine the interval range to which the window offset ratio corresponding to each window belongs, and can determine the priority of the graphic processing task corresponding to each window according to the interval range to which it belongs.
[0215] Similarly, the specific content of the electronic device determining the priority of the graphic processing task corresponding to each window according to the interval range to which the window offset ratio corresponding to each window belongs can refer to the related content of the electronic device determining the priority of the graphic processing task corresponding to each window according to the interval range to which the ratio between the area of the first region corresponding to each window and the area of the display interface belongs, and for the sake of brevity, will not be repeated here.
[0216] In a possible implementation, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the visible region proportion and the window offset ratio corresponding to each window.
[0217] For example, the electronic device can obtain a first weight corresponding to the visible area ratio and a third weight corresponding to the window offset ratio. For each window, the electronic device can perform a weighted calculation according to the first weight, the visible area ratio corresponding to the window, the third weight, and the window offset ratio corresponding to the window, to obtain a weighted result corresponding to the window. Subsequently, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the weighted result corresponding to each window. It should be understood that the greater the weighted result corresponding to a window, the higher the priority of the graphic processing task corresponding to the window. The smaller the weighted result corresponding to a window, the lower the priority of the graphic processing task corresponding to the window.
[0218] In another possible implementation, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the screen ratio and the window offset ratio corresponding to each window.
[0219] For example, the electronic device can obtain a second weight corresponding to the screen ratio and a third weight corresponding to the window offset ratio. For each window, the electronic device can perform a weighted calculation according to the second weight, the screen ratio corresponding to the window, the third weight, and the window offset ratio corresponding to the window, to obtain a weighted result corresponding to the window. Subsequently, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the weighted result corresponding to each window. It should be understood that the greater the weighted result corresponding to a window, the higher the priority of the graphic processing task corresponding to the window. The smaller the weighted result corresponding to a window, the lower the priority of the graphic processing task corresponding to the window.
[0220] In another possible implementation, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the visible area ratio, the screen ratio, and the window offset ratio corresponding to each window.
[0221] For example, the electronic device can obtain a first weight corresponding to the visible area ratio, a second weight corresponding to the screen ratio, and a third weight corresponding to the window offset ratio. For each window, the electronic device can perform a weighted calculation according to the first weight, the visible area ratio corresponding to the window, the second weight, the screen ratio corresponding to the window, the third weight, and the window offset ratio corresponding to the window, to obtain a weighted result corresponding to the window. Subsequently, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the weighted result corresponding to each window.
[0222] As can be seen from the above description, the closer the distance between the center point of a window and the center point of the display interface, the closer the window is to the central position of the display interface, and it can be determined that the user's attention to the window will be higher, i.e., it can be determined that the priority of the graphic processing task corresponding to the window will be higher. The farther the distance between the center point of a window and the center point of the display interface, the farther the window is from the central position of the display interface, and it can be determined that the user's attention to the window will be lower, i.e., it can be determined that the priority of the graphic processing task corresponding to the window will be lower. Therefore, for a window whose center point is closer to the central position of the display interface, to ensure that the priority of the graphic processing task corresponding to the window is higher, when the window offset ratio corresponding to each window is used for weighted calculation, the electronic device can perform weighted calculation according to (1-window offset ratio) and the third weight to obtain the weighted result corresponding to each window.
[0223] That is, in the scenario of determining the weighted result according to the window offset ratio, for each window, the weighted result corresponding to the window = the visible area ratio corresponding to the window * the first weight + (1-the window offset ratio corresponding to the window) * the third weight. Or, the weighted result corresponding to the window = the visible area ratio corresponding to the window * the first weight + the screen ratio corresponding to the window * the second weight + (1-the window offset ratio corresponding to the window) * the third weight, and so on.
[0224] It should be noted that the third weight can be determined according to actual scenarios, and the embodiments of the present application do not limit this.
[0225] In one example, after determining the weighted result corresponding to each window, the electronic device can determine the priority of the graphic processing task corresponding to each window as the weighted result corresponding to each window.
[0226] In another example, the electronic device can be provided with at least two priorities of graphic processing tasks and an interval range corresponding to each priority. After determining the weighted result corresponding to each window, the electronic device can determine the priority of the graphic processing task corresponding to each window according to the interval range to which the weighted result corresponding to each window belongs.
[0227] In some embodiments, when the electronic device runs multiple windows, the user's attention to the focus window is generally the highest, and therefore, to ensure the frame rate of the focus window and improve the smoothness of the picture of the focus window to improve the user's viewing experience of the focus window. The electronic device can determine the focus window according to each window, and can determine that the priority of the graphic processing task corresponding to the focus window is higher than the priority of the graphic processing task corresponding to a non-focus window. The focus window can be a window located at the uppermost layer of the display interface and directly interacted with the user.
[0228] It should be noted that the specific manner of determining the focus window is not limited by the embodiments of the present application, and can be determined according to actual scenarios.
[0229] It should be understood that the manner of determining the priority of the graphic processing task corresponding to the non-focus window can refer to the manner of determining the priority of the graphic processing task corresponding to each window. For example, the priority of the graphic processing task corresponding to each non-focus window can be determined according to the area of the first region corresponding to each non-focus window, or can be determined according to the area of each non-focus window, or can be determined according to the area of the first region corresponding to each non-focus window and the area of the window, or can be determined according to the area of the first region corresponding to each non-focus window, the area of the window, and the area of the display interface, or can be determined according to the distance between the center point of each non-focus window and the center point of the display interface, or can be determined according to the area of the first region corresponding to each non-focus window, the area of the non-focus window, the area of the display interface, and the distance between the center point of each non-focus window and the center point of the display interface, and so on.
[0230] For example, when the windows running on the electronic device include window A, window B, window C, and window D, the electronic device can determine the focus window from window A, window B, window C, and window D, and assume that the electronic device determines window A as the focus window, at this time, the electronic device can determine that the priority of the graphic processing task corresponding to window A is the highest priority. For window B, window C, and window D, the electronic device can determine the area of the first region corresponding to window B and the area of window B, can determine the area of the first region corresponding to window C and the area of window C, and can determine the area of the first region corresponding to window D and the area of window D, and can determine the visual area ratio corresponding to window B according to the area of the first region corresponding to window B and the area of window B, can determine the visual area ratio corresponding to window C according to the area of the first region corresponding to window C and the area of window C, and can determine the visual area ratio corresponding to window D according to the area of the first region corresponding to window D and the area of window D.
[0231] Assume that the electronic device determines that the visual area ratio corresponding to window B is greater than the visual area ratio corresponding to window C, and the visual area ratio corresponding to window C is greater than the visual area ratio corresponding to window D. Therefore, the electronic device can determine that the priority of the graphic processing task corresponding to window A is higher than the priority of the graphic processing task corresponding to window B, the priority of the graphic processing task corresponding to window B is higher than the priority of the graphic processing task corresponding to window C, and the priority of the graphic processing task corresponding to window C is higher than the priority of the graphic processing task corresponding to window D.
[0232] The process of dividing the graphic processing tasks corresponding to each window into the corresponding scheduling queue according to the priority of the graphic processing tasks corresponding to each window will be described in detail below.
[0233] In the embodiments of the present application, at least two scheduling queues can be arranged in the electronic device. After determining the priorities of the graphic processing tasks corresponding to the windows, the electronic device can divide the graphic processing tasks corresponding to the windows to the corresponding scheduling queues according to the priorities of the graphic processing tasks corresponding to the windows.
[0234] In some embodiments, two scheduling queues, for example, a first scheduling queue and a second scheduling queue, can be arranged in the electronic device, and the priority of the first scheduling queue can be higher than the priority of the second scheduling queue. That is, the graphic processing tasks in the first scheduling queue can be executed by the GPU in priority.
[0235] In one example, in the scenario where the priorities of the graphic processing tasks corresponding to the windows are specific values (for example, a ratio, a visual area proportion, or a weighted result, etc.), after determining the priorities of the graphic processing tasks corresponding to the windows, the electronic device can divide the graphic processing tasks with a priority greater than or equal to a certain threshold (which can be referred to as threshold A) to the first scheduling queue, and can divide the graphic processing tasks with a priority less than the threshold A to the second scheduling queue.
[0236] It should be understood that the specific value of the threshold A can be determined according to the actual application scenario, and the embodiments of the present application do not limit this. For example, the threshold A can be determined to be 0.8 according to the actual application scenario. That is, after determining the priorities of the graphic processing tasks corresponding to the windows, the electronic device can divide the graphic processing tasks with a priority greater than or equal to 0.8 to the first scheduling queue, and can divide the graphic processing tasks with a priority less than 0.8 to the second scheduling queue. For example, the threshold A can be determined to be 1 according to the actual application scenario. That is, after determining the priorities of the graphic processing tasks corresponding to the windows, the electronic device can divide the graphic processing tasks with a priority greater than or equal to 1 to the first scheduling queue, and can divide the graphic processing tasks with a priority less than 1 to the second scheduling queue.
[0237] For example, please refer to FIG. 7, which shows an example diagram one of task scheduling provided by the embodiments of the present application. This example takes the application scenario shown in FIG. 5 as an example for illustrative description, and takes the visual area proportion corresponding to each window as the priority of the graphic processing task corresponding to each window as an example for illustrative description.
[0238] As shown in FIG. 5, the electronic device can determine the visual area proportion corresponding to window A according to the area of the first region 510 corresponding to window A and the area of window A, that is, the electronic device can determine that the visual area proportion corresponding to window A is 1. At this time, the electronic device can determine that the priority of the graphic processing task A corresponding to window A is 1.
[0239] The electronic device can determine the visual area proportion corresponding to window B according to the area of the first area 520 corresponding to window B and the area of window B, that is, can determine that the visual area proportion corresponding to window B is 1. At this time, the electronic device can determine that the priority of the graphical processing task B corresponding to window B is 1.
[0240] The electronic device can determine the visual area proportion corresponding to window C according to the area of the first area 530 corresponding to window C and the area of window C. Assuming that the electronic device determines that the visual area proportion corresponding to window C is 0.5. At this time, the electronic device can determine that the priority of the graphical processing task C corresponding to window C is 0.5.
[0241] The electronic device can determine the visual area proportion corresponding to window D according to the area of the first area corresponding to window D (that is, 0) and the area of window D, that is, can determine that the visual area proportion corresponding to window D is 0. At this time, the electronic device can determine that the priority of the graphical processing task D corresponding to window D is 0.
[0242] Assuming that the threshold value A is 1, the electronic device can determine that the priority of the image processing task A corresponding to window A and the priority of the graphical processing task B corresponding to window B are both equal to the threshold value A (that is, 1), and can determine that the priority of the graphical processing task C corresponding to window C and the priority of the graphical processing task D corresponding to window D are both less than the threshold value A (that is, 1). Therefore, the electronic device can divide the graphical processing task A corresponding to window A and the graphical processing task B corresponding to window B into the first scheduling queue, and can divide the graphical processing task C corresponding to window C and the graphical processing task D corresponding to window D into the second scheduling queue.
[0243] Therefore, as shown in FIG. 7, the electronic device can divide the graphical processing task A corresponding to the unobstructed window A and the graphical processing task B corresponding to the unobstructed window B into the first scheduling queue, and can divide the graphical processing task C corresponding to the partially obstructed window C and the graphical processing task D corresponding to the fully obstructed window D into the second scheduling queue, so that the graphical processing tasks corresponding to the unobstructed window A and window B can be preferentially executed by the GPU, the occupancy ratio of the unobstructed window to the GPU can be improved, the frame rate of the unobstructed window can be improved, thereby improving the picture fluency of the unobstructed window and improving the viewing experience of the user on the unobstructed window. For example, the GPU can include two cores, core 1 and core 2, and the GPU can preferentially schedule the graphical processing task A corresponding to the unobstructed window A and the graphical processing task B corresponding to the unobstructed window B to the core 1 and the core 2 for execution.
[0244] In another example, in a scenario where the priority of the graphic processing task corresponding to each window is a specific value (for example, a ratio, a visual area ratio, or a weighted result), after determining the priority of the graphic processing task corresponding to each window, the electronic device can sort the windows according to the order of the priority from high to low to obtain a sorting result. Subsequently, the electronic device can determine that the graphic processing tasks corresponding to the first W windows in the sorting result are divided into the first scheduling queue, and can divide the graphic processing tasks corresponding to other windows into the second scheduling queue. The other windows can refer to the windows other than the first W windows in the sorting result.
[0245] It should be understood that the specific value of W can be determined according to the actual scene, and the embodiments of the present application do not limit this. For example, the value of W can be determined to be any value such as 1, 2, or 3 according to the actual scene.
[0246] In another example, in a scenario where the priority of the graphic processing task corresponding to each window is not a specific value, that is, in a scenario where the priority of the graphic processing task corresponding to each window is the first priority or the second priority, the number of priorities corresponding to the graphic processing tasks can be the same as the number of scheduling queues, that is, when the priority of the graphic processing task corresponding to each window is the first priority or the second priority, after determining the priority of the graphic processing task corresponding to each window, the electronic device can divide the graphic processing tasks with high priority into the first scheduling queue, and can divide the graphic processing tasks with low priority into the second scheduling queue. For example, when the first priority is higher than the second priority, the electronic device can divide the graphic processing tasks with the first priority into the first scheduling queue, and can divide the graphic processing tasks with the second priority into the second scheduling queue.
[0247] In a possible implementation, the electronic device can divide the graphic processing tasks corresponding to each window into the corresponding scheduling queue based on the load of the GPU.
[0248] For example, when the load of the GPU is greater than or equal to a preset load (which can be referred to as a preset load B), the electronic device can divide the graphic processing tasks with high priority into the scheduling queue with high priority, and can divide the graphic processing tasks with low priority into the scheduling queue with low priority. When the load of the GPU is less than the preset load B, the electronic device can divide the graphic processing tasks with high priority and part of the graphic processing tasks with low priority into the scheduling queue with high priority, and can divide another part of the graphic processing tasks with low priority into the scheduling queue with low priority. That is, when the load of the GPU is large, the electronic device can preferentially schedule the graphic processing tasks with high priority to the GPU for execution. When the load of the GPU is small, the electronic device can preferentially schedule the graphic processing tasks with high priority and part of the graphic processing tasks with low priority to the GPU for execution.
[0249] It should be noted that the preset load B can be determined according to an actual scene, and embodiments of the present application do not limit this. When the load of the GPU is less than the preset load B, the low-priority graphics processing task divided into the high-priority scheduling queue can be determined according to an actual scene, and embodiments of the present application do not limit this.
[0250] For example, in the scene in which the electronic device runs window A, window B and window C, it is assumed that the electronic device determines that the priority of the graphics processing task corresponding to window A is higher than the priority of the graphics processing task corresponding to window B, and the priority of the graphics processing task corresponding to window B is higher than the priority of the graphics processing task corresponding to window C. When the electronic device determines that the load of the GPU is greater than or equal to the preset load B, the electronic device can divide the graphics processing task corresponding to window A into the first scheduling queue, and can divide the graphics processing task corresponding to window B and the graphics processing task corresponding to window C into the second scheduling queue.
[0251] When the electronic device determines that the load of the GPU is less than the preset load B, the electronic device can divide the graphics processing task corresponding to window A into the first scheduling queue, can divide the graphics processing task corresponding to window B into the second scheduling queue, and can divide the graphics processing task corresponding to window C into the first scheduling queue. Alternatively, the electronic device can divide the graphics processing task corresponding to window A into the first scheduling queue, can divide the graphics processing task corresponding to window B into the first scheduling queue, and can divide the graphics processing task corresponding to window C into the second scheduling queue.
[0252] In other embodiments, three scheduling queues can be provided in the electronic device, for example, the first scheduling queue, the second scheduling queue and the third scheduling queue, and the priority of the first scheduling queue can be higher than the priority of the second scheduling queue, and the priority of the second scheduling queue can be higher than the priority of the third scheduling queue.
[0253] In one example, in the scene in which the priority of the graphics processing task corresponding to each window is a specific value (for example, a ratio, a visual area proportion or a weighted result, etc.), after determining the priority of the graphics processing task corresponding to each window, the electronic device can divide the graphics processing task with a priority greater than or equal to a certain threshold (for example, threshold B) into the first scheduling queue, can divide the graphics processing task with a priority greater than or equal to a certain threshold (for example, threshold C) and less than threshold B into the second scheduling queue, and can divide the graphics processing task with a priority less than threshold C into the third scheduling queue.
[0254] It should be understood that specific values of the threshold B and the threshold C can be determined according to actual application scenarios, and embodiments of the present application do not limit this. For example, the threshold B can be determined to be 1 and the threshold C can be determined to be 0.5 according to actual application scenarios. That is, after determining the priority of the graphic processing task corresponding to each window, the electronic device can divide the graphic processing task with a priority greater than or equal to 1 into the first scheduling queue, can divide the graphic processing task with a priority greater than or equal to 0.5 and less than 1 into the second scheduling queue, and can divide the graphic processing task with a priority less than 0.5 into the third scheduling queue.
[0255] In another example, in a scenario in which the priority of the graphic processing task corresponding to each window is a specific value (for example, a ratio, a visual area proportion, or a weighted result), after determining the priority of the graphic processing task corresponding to each window, the electronic device can sort the windows according to the order from high to low of the priority to obtain a sorting result. Subsequently, the electronic device can divide the graphic processing task corresponding to the first M1 windows in the sorting result into the first scheduling queue, can divide the graphic processing task corresponding to the M1+1th window to the M2th window into the second scheduling queue, and can divide the graphic processing task corresponding to other windows into the third scheduling queue. The other windows can refer to the windows other than the first M2 windows in the sorting result.
[0256] It should be noted that M2 is greater than M1, and specific values of M1 and M2 can be determined according to actual scenarios, and embodiments of the present application do not limit this. For example, M1 can be determined to be 1 and M2 can be determined to be 3 according to actual scenarios, that is, the graphic processing task corresponding to the first window in the sorting result can be divided into the first scheduling queue, the graphic processing task corresponding to the second window and the graphic processing task corresponding to the third window in the sorting result can be divided into the second scheduling queue, and the graphic processing task corresponding to the window other than the first window, the second window, and the third window in the sorting result can be divided into the third scheduling queue.
[0257] In another example, in a scenario in which the priority of the graphic processing task corresponding to each window is a specific value (for example, a ratio, a visual area proportion, or a weighted result), the electronic device can further determine a focus window according to each window, and can divide the graphic processing task corresponding to the focus window into the first scheduling queue.
[0258] For non-focus windows, the electronic device can divide the graphic processing task with a priority greater than or equal to a certain threshold (which can be referred to as threshold D for example) to the second scheduling queue, and can divide the graphic processing task with a priority less than the threshold D to the third scheduling queue. Alternatively, the electronic device can sort the non-focus windows according to the order from high to low of the priority, and obtain a sorting result. Subsequently, the electronic device can determine that the graphic processing tasks corresponding to the first R non-focus windows in the sorting result are divided to the second scheduling queue, and can divide the graphic processing tasks corresponding to other non-focus windows to the third scheduling queue.
[0259] It should be noted that the specific value of the threshold D and the specific value of R can be determined according to the actual scene, and the embodiments of the present application do not limit this.
[0260] For example, please refer to FIG. 8, which shows an example diagram two of task scheduling provided by the embodiments of the present application. This example takes the application scenario shown in FIG. 5 as an example for illustrative description, and takes the visual area ratio corresponding to each window as the priority of the graphic processing task corresponding to each window as an example for illustrative description.
[0261] As shown in FIG. 5, the electronic device can determine that window A is the focus window. Therefore, the electronic device can divide the graphic processing task A corresponding to window A to the first scheduling queue.
[0262] For window B, the electronic device can determine the visual area ratio corresponding to window B according to the area of the first area 520 corresponding to window B and the area of window B, that is, can determine that the visual area ratio corresponding to window B is 1. At this time, the electronic device can determine that the priority of the graphic processing task B corresponding to window B is 1.
[0263] For window C, the electronic device can determine the visual area ratio corresponding to window C according to the area of the first area 530 corresponding to window C and the area of window C. Assuming that the electronic device determines that the visual area ratio corresponding to window C is 0.5. Therefore, the electronic device can determine that the priority of the graphic processing task C corresponding to window C is 0.5.
[0264] For window D, the electronic device can determine the visual area ratio corresponding to window D according to the area of the first area corresponding to window D (that is, 0) and the area of window D, that is, can determine that the visual area ratio corresponding to window D is 0. At this time, the electronic device can determine that the priority of the graphic processing task D corresponding to window D is 0.
[0265] Assuming that the threshold value D is 1, the electronic device can determine that the priority of the graphical processing task B corresponding to the window B is equal to the threshold value D, and can determine that the priority of the graphical processing task corresponding to the window C and the priority of the graphical processing task corresponding to the window D are both less than the threshold value D. Therefore, the electronic device can divide the graphical processing task B corresponding to the window B to the second scheduling queue, and can divide the graphical processing task C corresponding to the window C and the graphical processing task D corresponding to the window D to the third scheduling queue.
[0266] Therefore, as shown in FIG. 8, the electronic device can divide the graphical processing task A corresponding to the focus window A to the first scheduling queue, can divide the graphical processing task B corresponding to the non-focus and non-occluded window B to the second scheduling queue, and can divide the graphical processing task C corresponding to the non-focus and partially occluded window C and the graphical processing task D corresponding to the non-focus and fully occluded window D to the third scheduling queue, so that the graphical processing task A corresponding to the focus window A can be preferentially executed by the GPU, the proportion of the GPU occupied by the focus window can be preferentially ensured, the frame rate of the focus window is improved, thereby improving the picture fluency of the focus window and improving the viewing experience of the user on the focus window. For example, the GPU can include two cores, core 1 and core 2, and the GPU can preferentially schedule the graphical processing task A corresponding to the focus window A to core 1 and core 2 for execution.
[0267] In another example, in a scenario where the priority of the graphical processing task corresponding to each window is not a specific numerical value, i.e., the priority of the graphical processing task corresponding to each window is a first priority or a second priority, etc., the number of priorities corresponding to the graphical processing tasks can be the same as the number of scheduling queues, i.e., the priority of the graphical processing task corresponding to each window is a first priority, a second priority, or a third priority. After determining the priority of the graphical processing task corresponding to each window, the electronic device can divide the graphical processing task with the highest priority to the first scheduling queue, can divide the graphical processing task with the lowest priority to the third scheduling queue, and can divide the graphical processing task with the intermediate priority to the second scheduling queue.
[0268] For example, when the first priority is higher than the second priority, and the second priority is higher than the third priority, the electronic device can divide the graphical processing task with the first priority to the first scheduling queue, can divide the graphical processing task with the second priority to the second scheduling queue, and can divide the graphical processing task with the third priority to the third scheduling queue.
[0269] In another possible implementation, four scheduling queues can be provided in the electronic device, for example, a first scheduling queue, a second scheduling queue, a third scheduling queue, and a fourth scheduling queue, and the priority of the first scheduling queue can be higher than the priority of the second scheduling queue, the priority of the second scheduling queue can be higher than the priority of the third scheduling queue, and the priority of the third scheduling queue can be higher than the priority of the fourth scheduling queue.
[0270] In one example, in a scenario where the priorities of the graphic processing tasks corresponding to the windows are specific values (for example, a ratio, a visual area ratio, or a weighted result), after determining the priorities of the graphic processing tasks corresponding to the windows, the electronic device can divide the graphic processing tasks with a priority greater than or equal to a certain threshold (for example, threshold E) to the first scheduling queue, divide the graphic processing tasks with a priority greater than or equal to a certain threshold (for example, threshold F) and less than threshold E to the second scheduling queue, divide the graphic processing tasks with a priority greater than or equal to a certain threshold (for example, threshold G) and less than threshold F to the third scheduling queue, and divide the graphic processing tasks with a priority less than threshold G to the fourth scheduling queue.
[0271] It should be understood that the specific values of threshold E, threshold F, and threshold G can be determined according to actual application scenarios, and embodiments of the present application do not limit this. For example, threshold E can be determined to be 1, threshold F can be determined to be 0.8, and threshold G can be determined to be 0.5 according to actual application scenarios. That is, after determining the priorities of the graphic processing tasks corresponding to the windows, the electronic device can divide the graphic processing tasks with a priority greater than or equal to 1 to the first scheduling queue, divide the graphic processing tasks with a priority greater than or equal to 0.8 and less than 1 to the second scheduling queue, divide the graphic processing tasks with a priority greater than or equal to 0.5 and less than 0.8 to the third scheduling queue, and divide the graphic processing tasks with a priority less than 0.5 to the fourth scheduling queue.
[0272] In another example, in a scenario where the priorities of the graphic processing tasks corresponding to the windows are specific values (for example, a ratio, a visual area ratio, or a weighted result), after determining the priorities of the graphic processing tasks corresponding to the windows, the electronic device can sort the windows according to the order from high to low of the priorities to obtain a sorting result. Subsequently, the electronic device can divide the graphic processing tasks corresponding to the first M1 windows in the sorting result to the first scheduling queue, divide the graphic processing tasks corresponding to the M1+1th window to the M2th window in the sorting result to the second scheduling queue, divide the graphic processing tasks corresponding to the M2+1th window to the M3th window in the sorting result to the third scheduling queue, and divide the graphic processing tasks corresponding to other windows in the sorting result to the fourth scheduling queue. The other windows can refer to the windows other than the first M3 windows in the sorting result.
[0273] It should be noted that the specific value of M1, the specific value of M2 and the specific value of M3 can be determined according to the actual scene, and the embodiments of the present application do not limit this.
[0274] In another example, in the case where the priority of the graphic processing task corresponding to each window is a specific value (such as a ratio, a visual area ratio, or a weighted result, etc.), the electronic device can also determine the focus window according to each window, and can divide the graphic processing task corresponding to the focus window to the first scheduling queue.
[0275] For non-focus windows, the electronic device can divide the graphic processing task with a priority greater than or equal to a certain threshold (such as threshold H) to the second scheduling queue, can divide the graphic processing task with a priority greater than or equal to a certain threshold (such as threshold J) and less than threshold H to the third scheduling queue, and can divide the graphic processing task with a priority less than threshold J to the fourth scheduling queue. Alternatively, the electronic device can sort each non-focus window according to the order from large to small of the priority, and obtain a sorting result. Subsequently, the electronic device can divide the graphic processing task corresponding to the first S1 non-focus windows in the sorting result to the second scheduling queue, can divide the graphic processing task corresponding to the S1+1th non-focus window to the S2th non-focus window to the third scheduling queue, and can divide the graphic processing task corresponding to other non-focus windows to the fourth scheduling queue. Wherein, other non-focus windows can refer to non-focus windows other than the first S2 non-focus windows in the sorting result.
[0276] It should be noted that the specific value of threshold H, the specific value of threshold J, the specific value of S1 and the specific value of S2 can be determined according to the actual scene, and the embodiments of the present application do not limit this.
[0277] For example, please refer to FIG. 9, which shows an example diagram three of task scheduling provided by the embodiments of the present application. This example takes the application scenario shown in FIG. 5 as an example for illustrative description, and takes the visual area ratio corresponding to each window as the priority of the graphic processing task corresponding to each window as an example for illustrative description.
[0278] As shown in FIG. 5, the electronic device can determine window A as the focus window. Therefore, the electronic device can divide the graphic processing task A corresponding to window A to the first scheduling queue.
[0279] For window B, the electronic device can determine the visual area ratio corresponding to window B according to the area of the first area 520 corresponding to window B and the area of window B, that is, can determine that the visual area ratio corresponding to window B is 1. At this time, the electronic device can determine that the priority of the graphic processing task B corresponding to window B is 1.
[0280] For the window C, the electronic device can determine the visual area ratio corresponding to the window C according to the area of the first area 530 corresponding to the window C and the area of the window C. It is assumed that the electronic device determines that the visual area ratio corresponding to the window C is 0.5. Therefore, the electronic device can determine that the priority of the graphic processing task C corresponding to the window C is 0.5.
[0281] For the window D, the electronic device can determine the visual area ratio corresponding to the window D according to the area of the first area corresponding to the window D (i.e. 0) and the area of the window D, that is, can determine that the visual area ratio corresponding to the window D is 0. At this time, the electronic device can determine that the priority of the graphic processing task D corresponding to the window D is 0.
[0282] It is assumed that the threshold value H is 1 and the threshold value J is 0.3. The electronic device can determine that the priority of the graphic processing task B corresponding to the window B is equal to the threshold value H, can determine that the priority of the graphic processing task corresponding to the window C is greater than the threshold value J and less than the threshold value H, and can determine that the priority of the graphic processing task corresponding to the window D is less than the threshold value J. Therefore, the electronic device can divide the graphic processing task B corresponding to the window B to the second scheduling queue, can divide the graphic processing task C corresponding to the window C to the third scheduling queue, and can divide the graphic processing task D corresponding to the window D to the fourth scheduling queue.
[0283] Therefore, as shown in FIG. 9, the electronic device can divide the graphic processing task A corresponding to the focus window A to the first scheduling queue, can divide the graphic processing task B corresponding to the non-focus and non-occluded window B to the second scheduling queue, can divide the graphic processing task C corresponding to the non-focus and partially occluded window C to the third scheduling queue, and can divide the graphic processing task D corresponding to the non-focus and fully occluded window D to the fourth scheduling queue, so that the graphic processing task A corresponding to the focus window A can be preferentially executed by the GPU. For example, the GPU can include four cores, core 1, core 2, core 3 and core 4, and the GPU can preferentially schedule the graphic processing task A corresponding to the focus window A to the core 1, the core 2, the core 3 and the core 4 for execution.
[0284] In another example, in a scenario where the priorities of the graphic processing tasks corresponding to the windows are not specific numerical values, i.e., in a scenario where the priorities of the graphic processing tasks corresponding to the windows are a first priority or a second priority, etc., the number of priorities of the graphic processing tasks can be the same as the number of scheduling queues, i.e., the priorities of the graphic processing tasks corresponding to the windows are a first priority, a second priority, a third priority, or a fourth priority. After determining the priorities of the graphic processing tasks corresponding to the windows, the electronic device can divide the graphic processing tasks with the highest priority to the first scheduling queue, can divide the graphic processing tasks with the second highest priority to the second scheduling queue, can divide the graphic processing tasks with the third highest priority to the third scheduling queue, and can divide the graphic processing tasks with the lowest priority to the fourth scheduling queue.
[0285] For example, when the first priority is higher than the second priority, the second priority is higher than the third priority, and the third priority is higher than the fourth priority, the electronic device can divide the graphic processing tasks with the first priority to the first scheduling queue, can divide the graphic processing tasks with the second priority to the second scheduling queue, can divide the graphic processing tasks with the third priority to the third scheduling queue, and can divide the graphic processing tasks with the fourth priority to the fourth scheduling queue.
[0286] It should be noted that five scheduling queues, six scheduling queues, seven scheduling queues, or eight scheduling queues, etc. can be provided in the electronic device. The specific content of the electronic device dividing the graphic processing tasks corresponding to the windows to five scheduling queues, six scheduling queues, seven scheduling queues, or eight scheduling queues is similar to the content of the electronic device dividing the graphic processing tasks corresponding to the windows to three scheduling queues or four scheduling queues, and specific reference can be made to the related content of the electronic device dividing the graphic processing tasks corresponding to the windows to three scheduling queues or four scheduling queues, which will not be described herein again.
[0287] The process of the electronic device scheduling the graphic processing tasks in each scheduling queue to the GPU for execution according to the priorities of the scheduling queues will be described in detail below.
[0288] In the present embodiment, after dividing the graphic processing tasks corresponding to the windows to the corresponding scheduling queues, the electronic device can schedule the graphic processing tasks according to the priorities of the scheduling queues. That is, the graphic processing tasks in the scheduling queue with a high priority can be preferentially scheduled to the GPU for execution.
[0289] In some embodiments, the electronic device can schedule the graphic processing tasks in each scheduling queue to the GPU for execution according to a preset scheduling ratio and the priorities of the scheduling queues.
[0290] In a possible implementation, the preset scheduling ratio can refer to a ratio between scheduling times of the scheduling queues. The scheduling time of a scheduling queue can refer to a time for which a graphics processing task in the scheduling queue is executed on the GPU. The preset scheduling ratio can be determined according to an actual scenario, which is not limited by the embodiments of the present application. It should be understood that the higher the priority of a scheduling queue is, the more scheduling time the scheduling queue will have; the lower the priority of a scheduling queue is, the less scheduling time the scheduling queue will have. That is, the execution time of the graphics processing task with high priority on the GPU can be increased by increasing the scheduling time of the scheduling queue with high priority, so as to increase the execution time of the graphics processing task corresponding to the window with high user attention on the GPU, improve the frame rate of the window with high user attention, improve the picture fluency of the window with high user attention, and improve the user experience.
[0291] In another possible implementation, the preset scheduling ratio can refer to a ratio between scheduling frequencies of the scheduling queues. The scheduling frequency of a scheduling queue can refer to a number of times for which a graphics processing task in the scheduling queue is executed on the GPU. The preset scheduling ratio can be determined according to an actual scenario, which is not limited by the embodiments of the present application. It should be understood that the higher the priority of a scheduling queue is, the higher the scheduling frequency of the scheduling queue will be; the lower the priority of a scheduling queue is, the lower the scheduling frequency of the scheduling queue will be. That is, the execution times of the graphics processing task with high priority on the GPU can be increased by increasing the scheduling frequency of the scheduling queue with high priority, so as to increase the execution times of the graphics processing task corresponding to the window with high user attention on the GPU, improve the frame rate of the window with high user attention, improve the picture fluency of the window with high user attention, and improve the user experience.
[0292] For example, when the first scheduling queue and the second scheduling queue are provided in the electronic device, and the priority of the first scheduling queue is higher than the priority of the second scheduling queue, the preset scheduling ratio can be determined according to an actual scenario. Assuming that the preset scheduling ratio is determined to be 3:1 according to the actual scenario, the GPU can first execute the graphics processing tasks in the first scheduling queue three times, and then execute the graphics processing task in the second scheduling queue once, for example, the GPU can first execute three graphics processing tasks in the first scheduling queue, and then execute one graphics processing task in the second scheduling queue.
[0293] For example, the preset scheduling ratio can be a scheduling ratio pre-set in the electronic device. Alternatively, the preset scheduling ratio can be a scheduling ratio determined by the electronic device according to the load of the GPU. For example, when the load of the GPU is large, the electronic device can determine that the preset scheduling ratio is large, so that the scheduling time of the high-priority scheduling queue is higher than the scheduling time of the low-priority scheduling queue, or the scheduling frequency of the high-priority scheduling queue is higher than the scheduling frequency of the low-priority scheduling queue, so that the GPU preferentially executes the graphics processing tasks in the high-priority scheduling queue. For example, when the load of the GPU is small, the electronic device can determine that the preset scheduling ratio is small, for example, the preset scheduling ratio can be determined to be 1:1.
[0294] In one example, when the GPU includes a plurality of cores, each core of the GPU can execute the graphics processing tasks in each scheduling queue with the same preset scheduling ratio. Alternatively, each core of the GPU can execute the graphics processing tasks in each scheduling queue with different preset scheduling ratios. For example, a part of the cores in the GPU can execute the graphics processing tasks in each scheduling queue with a preset scheduling ratio A, and another part of the cores in the GPU can execute the graphics processing tasks in each scheduling queue with a preset scheduling ratio B. The preset scheduling ratio A and the preset scheduling ratio B can be different.
[0295] For example, when the electronic device is provided with a first scheduling queue and a second scheduling queue, and the priority of the first scheduling queue is higher than the priority of the second scheduling queue, the preset scheduling ratio can be determined according to the actual scene, and each core of the GPU can sequentially process the graphics processing tasks in the first scheduling queue and the second scheduling queue based on the preset scheduling ratio. Taking the preset scheduling ratio as the ratio between the scheduling times of each scheduling queue, and the preset scheduling ratio as 3:1 as an example, when the scheduling time of the GPU is 100ms, the scheduling time corresponding to the first scheduling queue can be determined to be 100ms*3 / (3+1) = 75ms, and the scheduling time corresponding to the second scheduling queue can be determined to be 100ms*3 / (3+1) = 25ms. That is, when the scheduling time of the GPU is 100ms, each core of the GPU can execute the graphics processing tasks in the first scheduling queue in the first 75ms, and can execute the graphics processing tasks in the second scheduling queue in the remaining 25ms.
[0296] For example, when the first scheduling queue and the second scheduling queue are provided in the electronic device, and the priority of the first scheduling queue is higher than the priority of the second scheduling queue, the preset scheduling ratio A and the preset scheduling ratio B can be determined according to the actual scene, a part of the cores (for example, which can be referred to as core 1) in the GPU can sequentially process the graphics processing tasks in the first scheduling queue and the second scheduling queue based on the preset scheduling ratio A, and another part of the cores (for example, which can be referred to as core 2) in the GPU can sequentially process the graphics processing tasks in the first scheduling queue and the second scheduling queue based on the preset scheduling ratio B.
[0297] The preset scheduling ratio is the ratio between the scheduling time of each scheduling queue, and the preset scheduling ratio A is 3:1 and the preset scheduling ratio B is 4:1 as an example. That is, when the scheduling time of the GPU is 100 ms, for the core 1, the scheduling time corresponding to the first scheduling queue can be 100 ms*3 / (3+1)=75 ms, and the scheduling time corresponding to the second scheduling queue can be 100 ms*3 / (3+1)=25 ms; for the core 2, the scheduling time corresponding to the first scheduling queue can be 100 ms*4 / (4+1)=80 ms, and the scheduling time corresponding to the second scheduling queue can be 100 ms*1 / (4+1)=20 ms. That is, when the scheduling time of the GPU is 100 ms, the core 1 of the GPU can execute the graphics processing tasks in the first scheduling queue in the first 75 ms, and can execute the graphics processing tasks in the second scheduling queue in the remaining 25 ms. The core 2 of the GPU can execute the graphics processing tasks in the first scheduling queue in the first 80 ms, and can execute the graphics processing tasks in the second scheduling queue in the remaining 20 ms.
[0298] In a possible implementation, when the GPU includes a plurality of cores, a part of the cores of the GPU can be used to execute the graphics processing tasks in the scheduling queue with higher priority, and another part of the cores of the GPU can execute the graphics processing tasks in all scheduling queues or other scheduling queues according to the preset scheduling ratio.
[0299] For example, in the scenario where the first scheduling queue and the second scheduling queue are provided in the electronic device, and the priority of the first scheduling queue is higher than the priority of the second scheduling queue, it is assumed that the GPU includes the core 1 and the core 2, the core 1 of the GPU can be used to execute the graphics processing tasks in the first scheduling queue, and the core 2 of the GPU can execute the graphics processing tasks in the first scheduling queue and the graphics processing tasks in the second scheduling queue according to the preset scheduling ratio.
[0300] The preset scheduling ratio is taken as an example, and the preset scheduling ratio is 4:1, that is, when the scheduling time of the GPU is 100 ms, for the core 2, the scheduling time corresponding to the first scheduling queue can be determined as 100 ms*4 / (4+1)=80 ms, and the scheduling time corresponding to the second scheduling queue can be 100 ms*1 / (4+1)=20 ms. That is, when the scheduling time of the GPU is 100 ms, the core 1 of the GPU can execute the graphics processing task in the first scheduling queue exclusively within 100 ms. The core 2 of the GPU can execute the graphics processing task in the first scheduling queue in the first 80 ms, and can execute the graphics processing task in the second scheduling queue in the remaining 20 ms.
[0301] It should be noted that when the electronic device runs multiple windows, the task scheduling method provided in the embodiments of the present application can reasonably call the GPU, and the utilization rate of the GPU can be improved, so that not only the frame rate of the window with high user attention can be improved, but also the overall frame rate of the electronic device can be improved. The overall frame rate of the electronic device can refer to the number of frames displayed by the electronic device per second, that is, the sum of the number of frames displayed by each window per second.
[0302] For example, in the scenario of sliding ten windows and a pull-down menu through the task center, in the multi-round scheduling of graphics processing tasks through other task scheduling methods, the overall frame rate and the average frame rate of the electronic device can be as shown in Table 1 below. In addition, in the multi-round scheduling of graphics processing tasks through the task scheduling method provided in the embodiments of the present application, the overall frame rate and the average frame rate of the electronic device can also be as shown in Table 1 below.
[0303] Table 1
[0304] As can be seen from Table 1, in the scenario of the electronic device running multiple windows, when the scheduling of graphics processing tasks is performed through other task scheduling methods, the average frame rate of the electronic device as a whole can be 108.1 fps. When the scheduling of graphics processing tasks is performed through the task scheduling method provided in the embodiments of the present application, the average frame rate of the electronic device as a whole can reach 113.6 fps, the average time consumption per frame can be reduced by 0.6 ms, and the overall average frame rate can be improved by 5.5 frames. That is, under the condition of certain GPU resources, the task scheduling method provided in the embodiments of the present application can more reasonably utilize the GPU resources, so as to improve the overall frame rate of the electronic device, improve the frame rate of each window, improve the smoothness of the picture, and improve the user experience.
[0305] In some embodiments, when the electronic device includes multiple GPUs, some of the multiple GPUs can be dedicated to performing the graphics processing tasks in the scheduling queue with higher priority. Thus, after the graphics processing tasks corresponding to the windows are divided into the corresponding scheduling queues, the electronic device can perform the graphics processing tasks in the scheduling queue with higher priority by the some of the GPUs, so that the graphics processing tasks corresponding to the windows with higher user attention can be performed by the GPUs in time, the waiting time delay of the windows with higher user attention can be reduced, the frame rate of the windows with higher user attention can be improved, and the picture fluency of the windows with higher user attention can be improved, thereby improving the viewing experience of the user on the windows with higher user attention.
[0306] In the embodiments of the present application, the windows running on the electronic device can be any window in the electronic device that needs to perform graphics rendering. For example, the windows can include windows using a system common rendering mechanism (which can also be referred to as a unified rendering mechanism), or windows not using the system common rendering mechanism (i.e., windows using their own independent rendering mechanism for graphics rendering).
[0307] In one example, for the windows using the system common rendering mechanism, when the rendering service (RS) in the electronic device renders the windows, the RS can determine the priority of the graphics processing tasks corresponding to the windows according to the aforementioned priority determination manner, and can render the windows according to the priority of the graphics processing tasks corresponding to the windows. For example, the graphics processing tasks with high priority can be put into the high-priority rendering queue of the RS, and the graphics processing tasks with low priority can be put into the low-priority rendering queue of the RS.
[0308] In one implementation, the graphics processing tasks with high priority can be rendered by a main thread, and the graphics processing tasks with low priority can be rendered by a sub-thread.
[0309] It should be noted that the number of rendering queues in the RS can be determined according to the actual scenario. For example, the number of rendering queues in the RS can be determined according to the number of scheduling queues set in the electronic device. For example, when two scheduling queues are set in the electronic device, the RS can include two rendering queues. For example, when four scheduling queues are set in the electronic device, the RS can include four rendering queues. For example, when N scheduling queues are set in the electronic device, the RS can include N rendering queues, where N is a positive integer, and the like.
[0310] Therefore, when the windows running on the electronic device are all windows using the system common rendering mechanism, when the GPU is called to perform the graphic processing tasks corresponding to the windows, the graphic processing tasks corresponding to the windows can be divided into the scheduling queues of different priorities of the GPU according to the priorities of the rendering queues in the RS, so that the GPU can perform the graphic processing tasks according to the priorities of the scheduling queues. For example, the graphic processing tasks in the rendering queue of high priority can be put into the scheduling queue of high priority of the GPU, and the graphic processing tasks in the rendering queue of low priority can be put into the scheduling queue of low priority of the GPU.
[0311] For example, when the windows running on the electronic device include windows using the system common rendering mechanism and windows not using the system common rendering mechanism (which can be referred to as self-drawing windows), the electronic device can also determine the priorities of the graphic processing tasks corresponding to the self-drawing windows according to the priority determination manner described above. Subsequently, the electronic device can comprehensively schedule according to the priorities of the graphic processing tasks allocated with priorities by the RS and the priorities of the graphic processing tasks corresponding to the self-drawing windows, to divide the graphic processing tasks corresponding to the windows into the scheduling queues of different priorities of the GPU.
[0312] For example, when the first scheduling queue and the second scheduling queue are provided in the electronic device, and the priority of the first scheduling queue is higher than the priority of the second scheduling queue, the graphic processing tasks in the rendering queue of high priority in the RS and the graphic processing tasks corresponding to the self-drawing window of high priority can be divided into the first scheduling queue, and the graphic processing tasks in the rendering queue of low priority in the RS and the graphic processing tasks corresponding to the self-drawing window of low priority can be divided into the second scheduling queue.
[0313] For example, refer to FIG. 10, which shows an example diagram four of task scheduling provided by the embodiments of the present application. This example takes the windows running on the electronic device as an example, which include four windows using the system common rendering mechanism (which can be referred to as uniform drawing window B1, uniform drawing window B2, uniform drawing window B3 and uniform drawing window B4) and two self-drawing windows (which can be referred to as self-drawing window A1 and self-drawing window A2). In addition, this example also takes the GPU as an example, which includes the first scheduling queue and the second scheduling queue, and the priority of the first scheduling queue can be higher than the priority of the second scheduling queue. The RS includes the rendering queue of high priority (which can be shown as the high rendering queue in FIG. 9) and the rendering queue of low priority (which can be shown as the low rendering queue in FIG. 10).
[0314] It is assumed that the RS determines that the priority of the graphics processing task corresponding to the unified drawing window B1 is high priority and the priority of the graphics processing task corresponding to the unified drawing window B2, the priority of the graphics processing task corresponding to the unified drawing window B3 and the priority of the graphics processing task corresponding to the unified drawing window B4 are all low priority according to the first region corresponding to each unified drawing window. Therefore, the RS can put the graphics processing task corresponding to the unified drawing window B1 into the rendering queue of high priority, and can put the priority of the graphics processing task corresponding to the unified drawing window B2, the priority of the graphics processing task corresponding to the unified drawing window B3 and the priority of the graphics processing task corresponding to the unified drawing window B4 into the rendering queue of low priority.
[0315] It is assumed that the electronic device determines that the priority of the graphics processing task corresponding to the self-drawing window A1 is high priority and the priority of the graphics processing task corresponding to the self-drawing window A2 is low priority according to the first region corresponding to each self-drawing window.
[0316] Therefore, as shown in FIG. 10, the electronic device can put the graphics processing task in the rendering queue of high priority of the RS (i.e., the graphics processing task corresponding to the unified drawing window B1) and the graphics processing task corresponding to the high-priority self-drawing window A1 into the first scheduling queue of the GPU, and can put the graphics processing task in the rendering queue of low priority of the RS (i.e., the graphics processing task corresponding to the unified drawing window B2, the graphics processing task corresponding to the unified drawing window B3 and the graphics processing task corresponding to the unified drawing window B4) and the graphics processing task corresponding to the low-priority self-drawing window A2 into the second scheduling queue of the GPU. The GPU can execute the graphics processing tasks in the first scheduling queue and the graphics processing tasks in the second scheduling queue according to the priority of the first scheduling queue and the priority of the second scheduling queue. For example, the GPU can include core 1 and core 2, and the GPU can preferentially schedule each graphics processing task in the first scheduling queue to core 1 and core 2 for execution.
[0317] Another task scheduling method provided by the embodiments of the present application will be exemplarily described below based on the above description. Please refer to FIG. 11, which shows a schematic flowchart of another task scheduling method provided by the embodiments of the present application. The method can be applied to the electronic device described above, and the electronic device can include a GPU. As shown in FIG. 11, the method can include:
[0318] S1101, the electronic device runs a first window and a second window.
[0319] Exemplarily, the first window and the second window can be windows of the same application, or can be windows of different applications.
[0320] For example, the first window can be a foreground running window or a background running window. Similarly, the second window can be a foreground running window or a background running window.
[0321] In S1102, the electronic device schedules the graphic processing tasks in the first scheduling queue and the graphic processing tasks in the second scheduling queue to the GPU according to the priority of the first scheduling queue and the priority of the second scheduling queue; the first scheduling queue includes the graphic processing tasks corresponding to the first window, the second scheduling queue includes the graphic processing tasks corresponding to the second window, the priority of the first scheduling queue is higher than the priority of the second scheduling queue, and the priority of the graphic processing tasks corresponding to the first window is higher than the priority of the graphic processing tasks corresponding to the second window.
[0322] In the embodiments of the present application, when the electronic device runs the first window and the second window, the electronic device can determine the priority of the graphic processing tasks corresponding to the first window and the priority of the graphic processing tasks corresponding to the second window, and can divide the graphic processing tasks corresponding to the first window into the first scheduling queue and divide the graphic processing tasks corresponding to the second window into the second scheduling queue according to the priority of the graphic processing tasks corresponding to the first window and the priority of the graphic processing tasks corresponding to the second window. In dividing the graphic processing tasks into the first scheduling queue and the second scheduling queue, the electronic device can schedule the graphic processing tasks (for example, the graphic processing tasks corresponding to the first window) in the first scheduling queue and the graphic processing tasks (for example, the graphic processing tasks corresponding to the second window) in the second scheduling queue to the GPU according to the priority of the first scheduling queue and the priority of the second scheduling queue.
[0323] It should be noted that the specific content of the electronic device determining the priority of the graphic processing task corresponding to the first window and the priority of the graphic processing task corresponding to the second window can refer to the related content in the foregoing "the process that the electronic device determines the priority of the graphic processing task corresponding to each window will be described in detail below". The specific content of the electronic device dividing the graphic processing task corresponding to the first window into the first scheduling queue and dividing the graphic processing task corresponding to the second window into the second scheduling queue according to the priority of the graphic processing task corresponding to the first window and the priority of the graphic processing task corresponding to the second window can refer to the related content in the foregoing "the process that the electronic device divides the graphic processing task corresponding to each window into the corresponding scheduling queue according to the priority of the graphic processing task corresponding to each window will be described in detail below". The specific content of the electronic device scheduling the graphic processing task in the first scheduling queue and the graphic processing task in the second scheduling queue to the GPU for execution according to the priority of the first scheduling queue and the priority of the second scheduling queue can refer to the related content in the foregoing "the process that the electronic device schedules the graphic processing task in each scheduling queue to the GPU for execution according to the priority of each scheduling queue will be described in detail below". For the sake of brevity, it will not be repeated here.
[0324] In the embodiments of the present application, when the electronic device runs the first window and the second window at the same time, the electronic device can determine the priority of the graphic processing task corresponding to the first window and the priority of the graphic processing task corresponding to the second window, and can put the graphic processing task with high priority into the first scheduling queue with high priority, and put the graphic processing task with low priority into the second scheduling queue with low priority, so that the GPU can preferentially execute the graphic processing task in the first scheduling queue with high priority, that is, the graphic processing task corresponding to the window which the user pays more attention to can be preferentially executed, the proportion of the graphic processing task with high priority to the GPU can be ensured, so as to improve the frame rate of the window which the user pays more attention to, improve the smoothness of the window which the user pays more attention to, and improve the user experience.
[0325] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0326] Corresponding to the task scheduling method described in the above embodiments, the embodiments of the present application also provide a task scheduling device, and each module of the device can correspondingly implement each step of the task scheduling method.
[0327] It should be noted that the information interaction, execution process and the like between the above apparatuses / units are based on the same concept as the method embodiments of the present application, and the specific functions and brought technical effects can be referred to the method embodiments part, which will not be repeated here.
[0328] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific name of each functional unit and module is only for easy distinction, and does not limit the protection scope of the present application. The specific working process of the unit and module in the system can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0329] The embodiment of the present application further provides an electronic device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor, and the processor executes the computer program to enable the electronic device to implement the steps in any of the foregoing method embodiments. For example, the structure of the electronic device can be as shown in FIG. 2.
[0330] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a computer to enable the computer to implement the steps in any of the foregoing method embodiments.
[0331] The embodiment of the present application provides a computer program product, which enables an electronic device to implement the steps in any of the foregoing method embodiments when the computer program product is run on the electronic device.
[0332] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the processes in the above-mentioned embodiment methods, which can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer readable storage medium, and the computer program can implement the steps of each method embodiment when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable storage medium at least includes any entity or device capable of carrying the computer program code to the device / equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, such as U disk, mobile hard disk, magnetic disk or optical disk.
[0333] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0334] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0335] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed mutual units can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0336] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed to multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.
[0337] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A task scheduling method, characterized by, The method is applied to an electronic device including a graphics processing unit (GPU), and the method comprises: The electronic device runs a first window and a second window; The electronic device schedules graphics processing tasks in a first scheduling queue and graphics processing tasks in a second scheduling queue to the GPU for execution according to a priority of the first scheduling queue and a priority of the second scheduling queue; the first scheduling queue includes graphics processing tasks corresponding to the first window, the second scheduling queue includes graphics processing tasks corresponding to the second window, the priority of the first scheduling queue is higher than the priority of the second scheduling queue, and the priority of the graphics processing tasks corresponding to the first window is higher than the priority of the graphics processing tasks corresponding to the second window.
2. The method of claim 1, wherein, The priority of the graphics processing tasks corresponding to the window is determined according to at least one of an area of a first region corresponding to the window, a first proportion corresponding to the window, an area of the window, a second proportion corresponding to the window, an offset distance corresponding to the window, and an offset distance ratio corresponding to the window. The area of the first region corresponding to the window includes an area of a region currently displayed by the window in a display interface, the first proportion corresponding to the window is a ratio between the area of the first region corresponding to the window and the area of the window, the second proportion corresponding to the window is a ratio between the area of the window and an area of the display interface, the offset distance corresponding to the window is a distance between a center point of the window and a center point of the display interface, and the offset distance ratio corresponding to the window is a ratio between the offset distance corresponding to the window and a diagonal line length of the display interface.
3. The method according to claim 1 or 2, characterized in that, The area of the first region corresponding to the first window is greater than the area of the first region corresponding to the second window, or the first proportion corresponding to the first window is greater than the first proportion corresponding to the second window, or the area of the first window is greater than the area of the second window, or the second proportion corresponding to the first window is greater than the second proportion corresponding to the second window, or the offset distance corresponding to the first window is less than the offset distance corresponding to the second window, or the offset distance ratio corresponding to the first window is less than the offset distance ratio corresponding to the second window.
4. The method according to any one of claims 1 to 3, characterized in that, The electronic device schedules the graphics processing tasks in the first scheduling queue and the graphics processing tasks in the second scheduling queue to the GPU for execution according to the priority of the first scheduling queue and the priority of the second scheduling queue, comprising: The electronic device schedules the graphics processing tasks in the first scheduling queue and the graphics processing tasks in the second scheduling queue to the GPU for execution according to a preset scheduling ratio, the priority of the first scheduling queue, and the priority of the second scheduling queue. The preset scheduling ratio is a ratio between a time length for executing the graphics processing tasks in the first scheduling queue and a time length for executing the graphics processing tasks in the second scheduling queue; or, the preset scheduling ratio is a ratio between scheduling the graphics processing tasks in the first scheduling queue and scheduling the graphics processing tasks in the second scheduling queue.
5. The method of claim 4, wherein, The GPU comprises a first processing core and a second processing core, and the preset scheduling ratio comprises a first preset scheduling ratio and a second preset scheduling ratio. The first processing core executes the graphic processing tasks in the first scheduling queue and the graphic processing tasks in the second scheduling queue according to the first preset scheduling ratio. The second processing core executes the graphic processing tasks in the first scheduling queue and the graphic processing tasks in the second scheduling queue according to the second preset scheduling ratio.
6. The method of claim 5, wherein, The first preset scheduling ratio is the same as the second preset scheduling ratio.
7. The method of claim 4, wherein, The GPU comprises a first processing core and a second processing core. The first processing core executes the graphic processing tasks in the first scheduling queue. The second processing core executes the graphic processing tasks in the first scheduling queue and the graphic processing tasks in the second scheduling queue according to the preset scheduling ratio.
8. The method according to any one of claims 4 to 7, characterized in that, The preset scheduling ratio is preset or determined according to the current load of the GPU.
9. The method according to any one of claims 1 to 8, characterized in that, The load of the GPU is greater than or equal to a first preset load.
10. The method according to any one of claims 1 to 9, characterized in that, The electronic device further runs a third window, and the method further comprises: When the load of the GPU is less than a second preset load, the graphic processing tasks corresponding to the third window are divided into the first scheduling queue, and the priority of the graphic processing tasks corresponding to the first window is higher than the priority of the graphic processing tasks corresponding to the third window.
11. The method according to any one of claims 1 to 10, characterized in that, The first window and the second window are windows of the same application.
12. The method according to any one of claims 1 to 11, characterized in that, The first window is a focus window, and the second window is a non-focus window.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program, so that the electronic device implements the task scheduling method in any one of claims 1 to 12.
14. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by a computer, so that the computer implements the task scheduling method in any one of claims 1 to 12.
Citation Information
Patent Citations
Process scheduling method and device for preventing screen jam of user interface in operating system
CN102073545A
Resource scheduling method and electronic equipment
CN115599513A
Task scheduling method and device and storage medium
CN118689597A
Method and device for determining application priority of multi-task system and computer equipment
CN118689600A
Task scheduling method, electronic equipment and computer readable storage medium
CN119987962A