Task scheduling method, electronic equipment and computer readable storage medium

By scheduling graphics processing tasks according to the priority of the window in electronic devices, the frame rate reduction problem caused by sharing GPU resources in multiple windows is solved, and the user experience is improved.

CN119987962AActive Publication Date: 2025-05-13HUAWEI TECH CO LTD

Patent Information

Application Number
CN202411989324.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-05-13
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

When an electronic device runs multiple windows at the same time, all windows call the GPU equally for rendering the screen, resulting in a decrease in the frame rate of the windows that users are more concerned about, and there will be lag or delays, affecting the user experience.

Method used

By determining the priority of the graphics processing tasks corresponding to each window and putting high-priority tasks into a high-priority scheduling queue, low-priority tasks into a low-priority scheduling queue, the GPU prioritizes high-priority tasks.

Benefits of technology

It improves the frame rate and fluency of the windows that users are more concerned about, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987962A_ABST
    Figure CN119987962A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of terminals, and particularly relates to a task scheduling method, electronic equipment and a computer readable storage medium. In the method, when the electronic equipment runs a plurality of windows, the electronic equipment can put the graphic processing tasks with high priorities into a scheduling queue with high priorities and put the graphic processing tasks with low priorities into a scheduling queue with low priorities based on the priorities of the graphic processing tasks corresponding to the windows; the graphics processing tasks corresponding to the windows with relatively high user attention are put into the scheduling queue with high priority, and the graphics processing tasks corresponding to the windows with relatively low user attention are put into the scheduling queue with low priority, so that the graphics processing tasks can be executed by the GPU when the graphics processing tasks are executed; according to the embodiment of the invention, the graphic processing task corresponding to the window with high user attention can be executed preferentially, the picture frame rate of the window with high user attention is improved, the picture fluency of the window with high user attention is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application number of the original application is 202411377664.X, the original application date is September 29, 2024, and the name of the invention is “Task Scheduling Method, Electronic Device and Computer-readable Storage Medium”. The entire contents of the original application are incorporated into this application by reference. Technical Field

[0002] The present application belongs to the field of terminal technology, and in particular relates to a task scheduling method, an electronic device, and a computer-readable storage medium. Background Art

[0003] Electronic devices generally include a graphics processing unit (GPU). The GPU can be used for graphics rendering, for example, for rendering the images to be displayed in a window. The shorter the time it takes for the GPU to process a single frame, the higher the frame rate (i.e., the number of frames displayed per second (FPS)) obtained. The higher the frame rate, i.e., the more frames are displayed per second, the smoother the displayed images will be, and the better the user experience will be.

[0004] At present, electronic devices can generally run multiple windows at the same time. When an electronic device runs multiple windows at the same time, these multiple windows generally call the GPU equally to render the screen. When an electronic device runs multiple windows at the same time, users are generally more concerned about some of the windows. At this time, all windows call the GPU equally to process the screen, which will reduce the GPU occupancy of the windows that users are more concerned about, resulting in a decrease in the frame rate corresponding to the windows that users are more concerned about, thereby causing problems such as freezes or delays in the windows that users are more concerned about, affecting the user experience. Summary of the invention

[0005] The embodiments of the present application provide a task scheduling method, an electronic device, and a computer-readable storage medium, which can improve the frame rate of windows that users pay more attention to, improve the smoothness of windows that users pay more attention to, and enhance the user experience.

[0006] In a first aspect, an embodiment of the present application provides a task scheduling method, which is applied to an electronic device, wherein the electronic device includes a graphics processor (GPU), and the method includes:

[0007] The electronic device runs a first window and a second window;

[0008] 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; the first scheduling queue includes the graphics processing tasks corresponding to the first window, the second scheduling queue includes the 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.

[0009] It should be understood that the higher the priority of the graphics processing task corresponding to the window, the higher the user's attention to the window. The lower the priority of the graphics processing task corresponding to the window, the lower the user's attention to the window.

[0010] In the task scheduling method provided above, when an electronic device runs multiple windows at the same time, the electronic device can determine the priority of the graphics processing tasks corresponding to each window, and based on the priority of the graphics processing tasks, can put high-priority graphics processing tasks into a high-priority scheduling queue and low-priority graphics processing tasks into a low-priority scheduling queue, so that the GPU can give priority to executing the graphics processing tasks in the high-priority scheduling queue, that is, the graphics processing tasks corresponding to the windows that the user pays more attention to can be given priority execution, and the occupancy ratio of the GPU by high-priority graphics processing tasks can be ensured, so as to increase the frame rate of the windows that the user pays more attention to, improve the smoothness of the windows that the user pays more attention to, and enhance the user experience.

[0011] In some embodiments, the priority of the graphics 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] Among them, the area of ​​the first area corresponding to the window includes the area of ​​the area 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 area 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 an electronic device runs multiple windows at the same time, the window with a larger or more complete visible area (i.e., the first area) is generally the one that users pay more attention to. Alternatively, the window with a larger window is generally the one that users pay more attention to. Alternatively, the window with a closer distance to the center of the display interface is generally the one that users pay more attention to.

[0014] In the task scheduling method provided in this embodiment, the electronic device can determine the user's attention to each window according to one or more of the size of the visible area corresponding to each window (i.e., the area of ​​the first area), the proportion of the visible area (i.e., the first proportion, which can be used to indicate the integrity of the visible area), the window size, the screen proportion (i.e., the second proportion, which can be used to indicate 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 graphics processing task corresponding to each window. Among them, for a window with a higher degree of user attention, it can be determined that the priority of the graphics processing task corresponding to the window is higher; for a window with a lower degree of user attention, it can be determined that the priority of the graphics processing task corresponding to the window is lower, so that the graphics processing task corresponding to the window with a higher degree of user attention can be executed by the GPU first, thereby improving the frame rate of the window with a higher degree of user attention, thereby improving the picture smoothness of the window with a higher degree of user attention.

[0015] In other embodiments, the area of ​​the first region corresponding to the first window is larger than the area of ​​the first region corresponding to the second window, or the first proportion corresponding to the first window is larger than the first proportion corresponding to the second window, or the area of ​​the first window is larger than the area of ​​the second window, or the second proportion corresponding to the first window is larger than the second proportion corresponding to the second window, or the offset distance corresponding to the first window is smaller than the offset distance corresponding to the second window, or the offset distance ratio corresponding to the first window is smaller than the offset distance ratio corresponding to the second window.

[0016] In some embodiments, 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, including:

[0017] 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, a priority of the first scheduling queue, and a priority of the second scheduling queue;

[0018] The preset scheduling ratio is the ratio of the time for executing the graphics processing tasks in the first scheduling queue to the time for executing the graphics processing tasks in the second scheduling queue; or, the preset scheduling ratio is the ratio of scheduling the graphics processing tasks in the first scheduling queue to scheduling the graphics processing tasks in the second scheduling queue.

[0019] It should be understood that when the preset scheduling ratio is the ratio of the execution time of graphics processing tasks in each scheduling queue, the higher the priority of the scheduling queue, the longer the execution time of the graphics processing tasks in the scheduling queue will be; when the priority of the scheduling queue is lower, the shorter the execution time of the graphics processing tasks in the scheduling queue will be, so as to increase the execution time of graphics processing tasks in high-priority scheduling queues, so that the GPU can have more time to execute high-priority graphics processing tasks, thereby improving the speed and efficiency of executing graphics processing tasks in high-priority scheduling queues, improving the frame rate and smoothness of windows with higher user attention, and improving the user's viewing experience of windows with higher attention.

[0020] Similarly, when the preset scheduling ratio can be the ratio of scheduling graphics processing tasks in each scheduling queue, that is, the ratio of the number of times the graphics processing tasks in each scheduling queue are scheduled, the higher the priority of the scheduling queue, the more times the graphics processing tasks in the scheduling queue will be scheduled; when the priority of the scheduling queue is lower, the fewer times the graphics processing tasks in the scheduling queue will be scheduled, so as to increase the number of times the GPU schedules graphics processing tasks in high-priority scheduling queues, thereby improving the speed and efficiency of executing graphics processing tasks in high-priority scheduling queues, thereby improving the frame rate and smoothness of windows that users pay more attention to, and improving the user's viewing experience of windows that they pay more attention to.

[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 graphics processing tasks in the first scheduling queue and the graphics processing tasks in the second scheduling queue according to the first preset scheduling ratio;

[0023] 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 second preset scheduling ratio.

[0024] It should be understood that the first scheduling ratio and the second scheduling ratio may be the same or different. That is, when the GPU includes multiple cores, each core of the GPU may execute the graphics processing tasks in each scheduling queue at the same preset scheduling ratio. Alternatively, each core of the GPU may execute the graphics processing tasks in each scheduling queue at 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 specifically execute graphics processing tasks in a scheduling queue with a higher priority, and another part of the cores of the GPU can execute graphics processing tasks in each scheduling queue according to a preset scheduling ratio, or another part of the cores of the GPU can execute graphics processing tasks in other scheduling queues according to a preset scheduling ratio. By using a part of the cores of the GPU to specifically execute graphics processing tasks in a scheduling queue with a higher priority, it can be ensured that the graphics processing tasks in the scheduling queue with a higher priority are executed in a timely manner, thereby improving the frame rate and smoothness of the window with higher user attention, thereby improving the user experience.

[0029] Exemplarily, the preset scheduling ratio is preset, or is determined according to a current load of the GPU.

[0030] It should be understood that when determining the preset scheduling ratio based on the current load of the GPU, when the current load of the GPU is large, the electronic device may determine that the preset scheduling ratio is large, so that the execution time of the graphics processing task in the high-priority scheduling queue is longer than the execution time of the graphics processing task in the low-priority scheduling queue, or the number of times the graphics processing tasks in the high-priority scheduling queue are scheduled is more than the number of times the graphics processing tasks in the low-priority scheduling queue are scheduled, so that when the GPU load is large, the graphics processing tasks in the high-priority scheduling queue can be executed first, thereby improving the frame rate and smoothness of the windows with high user attention, and ensuring the user's viewing experience of windows with high user attention.

[0031] In a possible implementation manner, 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 by the implementation, when it is determined that the GPU is overloaded, that is, when it is determined that the GPU cannot meet the task processing requirements of all current windows, 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 scheduling queues of different priorities according to the priority of the graphics processing tasks corresponding to each window. 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 give priority to executing the graphics processing tasks corresponding to the windows that the user pays more attention to, ensuring the frame rate and smoothness of the windows that the user pays more attention to, and improving the user's viewing experience of the windows that pay more attention to.

[0034] In some embodiments, the electronic device further runs a third window, and the method further includes:

[0035] When the load of the GPU is less than a second preset load, the graphics processing task corresponding to the third window is assigned to 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 graphics processing tasks corresponding to each window into corresponding scheduling queues 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 high-priority graphics processing tasks into the high-priority scheduling queue, and can divide the low-priority graphics processing tasks into the low-priority scheduling queue. When the load of the GPU is less than the second preset load, the electronic device can divide the high-priority graphics processing tasks and part of the low-priority graphics processing tasks into the high-priority scheduling queue, and can divide another part of the low-priority graphics processing tasks into the low-priority scheduling queue. That is, when the load of the GPU is large, the high-priority graphics processing tasks can be preferentially scheduled to the GPU for execution. When the load of the GPU is small, when the high-priority graphics processing tasks are preferentially scheduled to the GPU for execution, some low-priority graphics processing tasks can also be preferentially scheduled to the GPU for execution, so that when the load of the GPU is small, that is, when the resources of the GPU are sufficient, some low-priority graphics processing tasks can also be preferentially executed.

[0037] It should be understood that the second preset load may be the same as or different from the first preset load, and may be determined according to the actual scenario.

[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 may be windows of the same application or windows of different applications.

[0040] In some 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 an electronic device runs multiple windows, since the user generally pays the most attention to the focus window, in order to ensure the frame rate of the focus window and improve the picture smoothness of the focus window, so as to enhance the user's viewing experience of the focus window, it can be determined that the priority of the graphics processing task corresponding to the focus window is higher than the priority of the graphics processing task corresponding to the non-focus window, and the priority of the graphics processing task corresponding to the focus window can be placed in the highest priority scheduling queue, so that the GPU can execute the graphics processing task corresponding to the focus window first.

[0042] In a second aspect, an embodiment of the present application provides a task scheduling device, which is applied to an electronic device, wherein the electronic device includes a graphics processor GPU, and the device includes:

[0043] A window running module, used for running the first window and the second window;

[0044] A task scheduling module is used to schedule 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; the first scheduling queue includes the graphics processing tasks corresponding to the first window, the second scheduling queue includes the 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.

[0045] In some embodiments, the priority of the graphics 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;

[0046] Among them, the area of ​​the first area corresponding to the window includes the area of ​​the area 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 area 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.

[0047] In other embodiments, the area of ​​the first region corresponding to the first window is larger than the area of ​​the first region corresponding to the second window, or the first proportion corresponding to the first window is larger than the first proportion corresponding to the second window, or the area of ​​the first window is larger than the area of ​​the second window, or the second proportion corresponding to the first window is larger than the second proportion corresponding to the second window, or the offset distance corresponding to the first window is smaller than the offset distance corresponding to the second window, or the offset distance ratio corresponding to the first window is smaller than the offset distance ratio corresponding to the second window.

[0048] In some embodiments, the task scheduling module is specifically used for the electronic device to schedule 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;

[0049] The preset scheduling ratio is the ratio of the time for executing the graphics processing tasks in the first scheduling queue to the time for executing the graphics processing tasks in the second scheduling queue; or, the preset scheduling ratio is the ratio of scheduling the graphics processing tasks in the first scheduling queue to scheduling the graphics processing tasks 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 used to execute the graphics processing tasks in the first scheduling queue and the graphics processing tasks in the second scheduling queue according to the first preset scheduling ratio;

[0052] The second processing core is used to execute the graphics processing tasks in the first scheduling queue and the graphics processing tasks in the second scheduling queue according to the second preset scheduling ratio.

[0053] In one example, the first scheduling ratio is the same as the second 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 used to execute the graphics processing tasks in the first scheduling queue;

[0056] The second processing core is used to 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.

[0057] Exemplarily, the preset scheduling ratio is preset, or is determined according to a current load of the GPU.

[0058] In a possible implementation manner, 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 used to run a third window, and the device further includes:

[0060] A task division module is used to divide the graphics processing task corresponding to the third window into the first scheduling queue when the load of the GPU is less than a second preset load, 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.

[0061] In some embodiments, the first window and the second window are windows of the same application.

[0062] In some other embodiments, the first window is a focus window and the second window is a non-focus window.

[0063] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the task scheduling method described in any one of the first aspects above.

[0064] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein 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 described in any one of the first aspects above.

[0065] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is executed on an electronic device, the electronic device executes the task scheduling method described in any one of the above-mentioned first aspects.

[0066] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 It is an example diagram for processing graphics processing tasks corresponding to multiple applications;

[0068] Figure 2 is a schematic diagram of the structure of an electronic device to which the task scheduling method provided in an embodiment of the present application is applicable;

[0069] Figure 3 Schematic diagram of software architecture to which the task scheduling method provided in the embodiment of the present application is applicable;

[0070] Figure 4 It is a flowchart of a task scheduling method provided in an embodiment of the present application;

[0071] Figure 5 This is an example of an application scenario provided by the embodiment of the present application. Figure 1 ;

[0072] Figure 6 This is an example of an application scenario provided by the embodiment of the present application. Figure 2 ;

[0073] Figure 7 This is an example of task scheduling provided by the embodiment of the present application. Figure 1 ;

[0074] Figure 8 This is an example of task scheduling provided by the embodiment of the present application. Figure 2 ;

[0075] Fig. 9 This is an example of task scheduling provided by the embodiment of the present application. Figure 3 ;

[0076] Fig.10 This is an example of task scheduling provided by the embodiment of the present application. Figure 4 ;

[0077] Fig.11 It is a flowchart of another task scheduling method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0078] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0079] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0080] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0081] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one example", "in some embodiments", "in another example", "in other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0082] In addition, the “plurality” 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 embodiment of the present application are only examples, not all steps are steps that must be executed, or not all information or messages are required, and can be increased or decreased as needed during use. The same step or steps or messages with the same function in the embodiment of the present application can be referenced and learned from each other in different embodiments.

[0084] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art will appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0085] Electronic devices generally include GPUs. GPUs can be used for graphics rendering, such as for rendering the screens that need to be displayed in a window. Frame rate refers to the number of frames displayed per second (FPS) of animations or videos. Among them, when the frame rate is higher, the more frames are displayed per second, the smoother the displayed screen will be, and the better the user experience. When the frame rate is lower, the fewer frames are displayed per second, and the displayed screen will have problems such as freeze or delay, affecting the user experience. It should be understood that the processing performance of the GPU is a key factor affecting the frame rate. When the GPU processes a single frame of the screen for a shorter time, the higher the frame rate obtained will be. When the GPU processes a single frame of the screen for a longer time, the lower the frame rate obtained will be.

[0086] Generally, an electronic device can run multiple windows at the same time. When an electronic device runs multiple windows at the same time, these multiple windows generally need to call the GPU to render the screen, that is, the graphics processing tasks corresponding to these multiple windows need to be processed by the GPU respectively to obtain the screen corresponding to each window. It should be understood that the graphics processing task corresponding to the window may refer to the task that the application corresponding to the window submits to the GPU and requires graphics rendering. Among them, in order to realize the processing of the graphics processing tasks corresponding to each window, the execution of the graphics processing tasks corresponding to each window can generally be managed through a unified scheduling queue. In other words, the graphics processing tasks corresponding to each window can be placed in the scheduling queue. The GPU can obtain the graphics processing tasks from the scheduling queue in order for processing.

[0087] For example, see Figure 1 , Figure 1 An example diagram of processing graphics processing tasks corresponding to multiple applications is shown. This example is illustrated by taking an electronic device running window A, window B, window C and window D at the same time as an example.

[0088] like Figure 1As shown, when window A needs to schedule the GPU to perform a graphics processing task, the electronic device can put the graphics processing task corresponding to window A (for example, it can be called graphics processing task A) into the scheduling queue. Similarly, when window B needs to schedule the GPU to perform a graphics processing task, the electronic device can put the graphics processing task corresponding to window B (for example, it can be called graphics processing task B) into the scheduling queue. When window C needs to schedule the GPU to perform a graphics processing task, the electronic device can put the graphics processing task corresponding to window C (for example, it can be called graphics processing task C) into the scheduling queue. When window D needs to schedule the GPU to perform a graphics processing task, the electronic device can put the graphics processing task corresponding to window D (for example, it can be called graphics processing task D) into the scheduling queue.

[0089] The GPU can retrieve graphics processing tasks from the scheduling queue in the order in which they are placed in the scheduling queue. That is, the GPU can execute graphics processing tasks in the order in which they are placed in the scheduling queue. Figure 1 In the example, the GPU includes core 1 and core 2 for example) to process the graphics processing task. The GPU may include multiple processor cores (or may also be called computing units), which can execute tasks simultaneously, thereby achieving efficient parallel computing and improving the processing efficiency of the GPU. It should be understood that Figure 1 Here, queue3, queue2, queue1 and queue0 may refer to graphics processing tasks respectively.

[0090] It should be understood that when an electronic device runs multiple windows at the same time, users are generally more concerned about some of the windows. The above-mentioned method of calling the GPU in chronological order to perform graphics processing tasks by all windows will reduce the GPU occupancy of the windows that users are more concerned about, resulting in a lower frame rate of the windows that users are more concerned about, thereby causing problems such as freezes or delays in the windows that users are more concerned about, affecting the user experience.

[0091] For example, in Figure 1 In the scenario shown, when the user is more concerned about window C, if the graphics processing task corresponding to window C is not the first to be put into the GPU scheduling queue, window C needs to wait until the GPU has processed the graphics processing tasks corresponding to other windows before calling 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, resulting in a longer duration of a single frame corresponding to window C, causing the frame rate of the picture corresponding to window C to drop, thereby causing the picture displayed by window C to freeze or delay, affecting the user experience.

[0092] To solve the above 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 runs multiple windows at the same time, the electronic device can determine the priority of the graphics processing tasks corresponding to each window, and can put the high-priority graphics processing tasks into the high-priority scheduling queue, and put the low-priority graphics processing tasks into the low-priority scheduling queue, so that the GPU can give priority to executing the graphics processing tasks in the high-priority scheduling queue, that is, the graphics processing tasks corresponding to the windows that the user pays more attention to can be given priority execution, and the occupation ratio of the GPU by the high-priority graphics processing tasks can be ensured, so as to improve the frame rate of the screen of the window that the user pays more attention to, improve the smoothness of the screen of the window that the user pays more attention to, and improve the user experience, which has strong ease of use and practicality.

[0093] In the embodiments of the present application, the electronic device may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a desktop computer, etc. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.

[0094] The following first introduces the electronic device involved in the embodiment of the present application. Figure 2 , Figure 2 A schematic structural diagram of an electronic device 200 is shown.

[0095] The electronic device 200 may 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 speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a camera 291, and a display screen 292. The sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an air 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 is to be understood that the structure illustrated in the embodiment 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 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0097] The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (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 may be independent devices or integrated into one or more processors.

[0098] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0099] The processor 210 may 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 may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

[0100] In some embodiments, the processor 210 may include one or more interfaces. The interface may 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 is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0102] The charging management module 240 is used to receive charging input from a charger.

[0103] The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 to power 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 210 can be implemented through the antenna 1 , the antenna 2 , the mobile communication module 250 , the wireless communication module 260 , the modem processor and the baseband processor.

[0105] Antenna 1 and antenna 2 are used 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 reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0106] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 200. The mobile communication module 250 may 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 from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the same device as at least some of the modules of the processor 210.

[0107] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the 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. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 270A, a receiver 270B, etc.), or displays an image or video through a display screen 292. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 250 or other functional modules.

[0108] The wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 200. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0109] In some embodiments, the antenna 1 of the electronic device 200 is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may 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 may 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 system (SBAS).

[0110] The electronic device 200 implements the display function through a GPU, a display screen 292, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 292 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or change display information.

[0111] The display screen 292 is used to display images, videos, etc. 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 or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 200 may include 1 or N display screens 292, where N is a positive integer greater than 1.

[0112] The electronic device 200 can realize the shooting function through ISP, camera 291, video codec, GPU, display screen 292 and application processor.

[0113] The ISP is used to process the data fed back by the camera 291 .

[0114] The camera 291 is used to capture still images or videos. In some embodiments, the electronic device 200 may include 1 or N cameras 291, where N is a positive integer greater than 1.

[0115] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. The video codec is used 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 coding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0116] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the electronic device 200 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0117] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand 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, such as storing music, video and other files in the external memory card.

[0118] The internal memory 221 can be used to store computer executable program codes, which include instructions. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 210 executes various functional 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 provided in the processor.

[0119] The electronic device 200 can implement audio functions such as music playing and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor.

[0120] The audio module 270 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 270 can also be used to encode and decode audio signals. The buttons 290 include a power button, a volume button, etc.

[0121] The key 290 may be a mechanical key or a touch key. The electronic device 200 may receive key input and generate key signal input related to user settings and function control of the electronic device 200.

[0122] The software system of the electronic device 200 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. For example, the software system of the electronic device 200 may adopt an Android operating system (OS), a Harmony OS, or an IOS with a layered architecture. The embodiment of the present application takes a layered architecture as an example to exemplify the software structure of the electronic device 200.

[0123] Figure 3It is a software structure block diagram of the electronic device 200 according to an embodiment of the present application.

[0124] The layered architecture divides the software into several layers, each with clear roles and division of labor. The 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] like Figure 3 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0127] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0128] like Figure 3 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0129] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0130] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0131] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0132] The phone manager is used to provide communication functions of the electronic device 200, such as management of call status (including connecting, hanging up, etc.).

[0133] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0134] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0135] Runtime includes core libraries and virtual machines. Runtime is responsible for the scheduling and management of the operating system.

[0136] The core library consists of two parts: one part is the 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 a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0138] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0139] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0140] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0141] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0142] A 2D graphics engine is a drawing engine for 2D drawings.

[0143] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0144] The task scheduling method provided in the embodiment of the present application will be described in detail below with reference to the accompanying drawings and specific application scenarios.

[0145] See also Figure 4 , Figure 4 FIG. 1 is a schematic flow chart of a task scheduling method provided by 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. Figure 4 As shown, the method may include:

[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 graphics processing tasks corresponding to each window can be determined based on at least one of the area of ​​the visible area corresponding to each window, the proportion of the visible area corresponding to each window, the area of ​​each window, the screen proportion 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. The specific method for the electronic device to determine the priority of the graphics processing tasks corresponding to each window can refer to the relevant content in the subsequent "The process of the electronic device determining the priority of the graphics processing tasks corresponding to each window will be described in detail below".

[0148] S402: The electronic device divides the graphics processing tasks corresponding to each window into corresponding scheduling queues according to the priorities of the graphics processing tasks corresponding to each window.

[0149] In some embodiments, N scheduling queues may be provided in the electronic device, where N may be a positive integer greater than or equal to 2. Each scheduling queue may have a corresponding priority. Exemplarily, the priorities of each scheduling queue may be different from each other, that is, one scheduling queue may correspond to one priority. Exemplarily, the priorities of multiple scheduling queues may be the same, that is, two or more scheduling queues may correspond to one priority. The following description will be exemplarily described by taking one scheduling queue corresponding to one priority as an example.

[0150] In one example, when two scheduling queues are provided in the electronic device, such as a first scheduling queue and a second scheduling queue, the priority of the first scheduling queue may be higher than the priority of the second scheduling queue. At this time, the electronic device may classify high-priority graphics processing tasks into the first scheduling queue and low-priority graphics processing tasks into the second scheduling queue according to the priorities of the graphics processing tasks corresponding to each window.

[0151] Among them, the specific content of the electronic device dividing the graphics processing tasks corresponding to each window into the corresponding scheduling queue according to the priority of the graphics processing tasks corresponding to each window can be referred to the relevant content in the subsequent "The following will describe in detail the process of the electronic device dividing the graphics processing tasks corresponding to each window into the corresponding scheduling queue according to the priority of the graphics processing tasks corresponding to each window".

[0152] S403: The electronic device schedules the graphics processing tasks in each scheduling queue to the GPU for execution according to the priority of each scheduling queue.

[0153] In some embodiments, graphics processing tasks in a high-priority scheduling queue may be preferentially scheduled to the GPU for execution, that is, the GPU may preferentially execute graphics processing tasks in a high-priority scheduling queue. For example, when two scheduling queues are provided in an electronic device, such as 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 electronic device may preferentially schedule graphics processing tasks in the first scheduling queue to the GPU for execution, that is, the GPU may preferentially execute graphics processing tasks in the first scheduling queue.

[0154] Among them, the specific content of the electronic device scheduling the graphics processing tasks in each scheduling queue to the GPU for execution according to the priority of each scheduling queue can be referred to the relevant content in the subsequent "The following will describe in detail the process of the electronic device scheduling the graphics processing tasks in each scheduling queue to the GPU for execution according to the priority of each scheduling queue".

[0155] In an embodiment of the present application, when an electronic device runs multiple windows at the same time, the electronic device can determine the priority of the graphics processing tasks corresponding to each window, and can put high-priority graphics processing tasks into a high-priority scheduling queue, and low-priority graphics processing tasks into a low-priority scheduling queue. That is, the graphics processing tasks corresponding to windows with higher user attention can be put into a high-priority scheduling queue, and the graphics processing tasks corresponding to windows with lower user attention can be put into a low-priority scheduling queue, so that when the GPU executes the graphics processing tasks, it can give priority to executing the graphics processing tasks in the high-priority scheduling queue, that is, give priority to executing the graphics processing tasks corresponding to windows with higher user attention, which can increase the occupation ratio of windows with higher user attention to the GPU, and can reduce the waiting delay of windows with higher user attention, so as to improve the picture frame rate of windows with higher user attention, improve the picture smoothness of windows with higher user attention, and improve the user experience.

[0156] Exemplarily, the multiple windows run by the electronic device may be windows of different applications, or all or part of the multiple windows may be windows of the same application. In addition, any window run by the electronic device may be a window run in the foreground, or may be a window run in the background. In some embodiments, the task scheduling method provided in the embodiment of the present application may be an optional function in the electronic device. The electronic device may determine whether to enable the function according to the actual scenario to determine whether to schedule the graphics processing task to the GPU for execution through the task scheduling method provided in the embodiment of the present application.

[0157] In one example, the electronic device can determine whether to enable the function based on 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 the preset load (for example, it can be called preset load A), 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 these multiple windows. At this time, the electronic device can schedule the graphics processing task to the GPU for execution according to the task scheduling method provided in the embodiment 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 task to the GPU for execution through other scheduling methods.

[0158] That is to say, when determining 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, 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. 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 give priority to the execution of high-priority graphics processing tasks, ensure the occupation ratio of high-priority graphics processing tasks to the GPU, and improve the frame rate and picture smoothness of windows with high user attention.

[0159] It should be noted that the preset load A can be specifically determined according to the actual application scenario, and the embodiment of the present application does not limit this.

[0160] The following is a detailed description of the process of determining the priority of the graphics processing tasks corresponding to each window by the electronic device. bright.

[0161] In some embodiments, when an electronic device runs multiple windows at the same time, the user's attention is generally higher for one or more windows with larger visible areas. Therefore, when an electronic device runs multiple windows at the same time, the electronic device can determine the user's attention to each window based on the area of ​​the area displayed by each window in the display interface (for example, it can be called the first area corresponding to each window), so as to determine the priority of the graphics processing task corresponding to each window. In other words, the electronic device can determine the area of ​​the first area corresponding to each window, and can determine the priority of the graphics processing task corresponding to each window based on the area of ​​the first area corresponding to each window. That is, the electronic device can determine the priority of the graphics processing task corresponding to each window based on the size of the visible area of ​​each window.

[0162] Exemplarily, the area of ​​the first region corresponding to each window may be greater than or equal to 0. When the area of ​​the first region corresponding to a certain window is equal to 0, it may indicate 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 may indicate that all or part of the window is displayed in the display interface, that is, the first region corresponding to the window may include all or part of the window.

[0163] Exemplarily, when the area of ​​the first region corresponding to a certain window is larger, that is, the visible area of ​​the window is larger, 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. At this time, the electronic device can determine that the priority of the graphics processing task corresponding to the window is higher. When the area of ​​the first region corresponding to a certain window is smaller, that is, the visible area 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. At this time, the electronic device can determine that the priority of the graphics processing task corresponding to the window is lower.

[0164] In one example, the electronic device may determine the priority of the graphics 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.

[0165] Exemplarily, the electronic device may determine the ratio between the area of ​​the first region corresponding to each window and the area of ​​the display interface as the priority of the graphic processing task corresponding to each window.

[0166] 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 graphics processing task corresponding to window A is 0.5, the priority of the graphics processing task corresponding to window B is 0.3, the priority of the graphics processing task corresponding to window C is 0.2, and the priority of the graphics processing task corresponding to window D is 0.

[0167] Exemplarily, at least two priorities corresponding to the graphics processing tasks and an interval range corresponding to each priority may be set in the electronic device. 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 may 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 may determine the priority of the graphics processing task corresponding to each window according to the interval range.

[0168] For example, the electronic device may be provided with a first priority and a second priority corresponding to the graphics processing task, and may be provided with an interval range corresponding to the first priority (for example, it may be called interval range A1) and an interval range corresponding to the second priority (for example, it may be called interval range A2). The first priority may be higher than the second priority.

[0169] 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 area corresponding to window A and the area of ​​the display interface is within interval range A1, determines that the ratio between the area of ​​the first area corresponding to window B and the area of ​​the display interface is within interval range A2, determines that the ratio between the area of ​​the first area corresponding to window C and the area of ​​the display interface is within interval range A1, and determines that the ratio between the area of ​​the first area corresponding to window D and the area of ​​the display interface is within interval range A2. At this time, the electronic device can determine that the priority of the graphics processing task corresponding to window A and the priority of the graphics processing task corresponding to window C are both the first priority, and the priority of the graphics processing task corresponding to window B and the priority of the graphics processing task corresponding to window D are both the second priority.

[0170] For example, the electronic device may be provided with a first priority, a second priority, and a third priority corresponding to the graphics processing task, and may be provided with an interval range A1 corresponding to the first priority, an interval range A2 corresponding to the second priority, and an interval range (for example, may be referred to as interval range A3) corresponding to the third priority. The first priority may be higher than the second priority, and the second priority may be higher than the third priority.

[0171] 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 area corresponding to window A and the area of ​​the display interface is within interval range A1, determines that the ratio between the area of ​​the first area corresponding to window B and the area of ​​the display interface is within interval range A2, determines that the ratio between the area of ​​the first area corresponding to window C and the area of ​​the display interface is within interval range A3, and determines that the ratio between the area of ​​the first area corresponding to window D and the area of ​​the display interface is within interval range A2. At this time, the electronic device can determine that the priority of the graphics processing task corresponding to window A is the first priority, the priority of the image processing task corresponding to window B and the priority of the graphics processing task corresponding to window D are both the second priority, and the priority of the graphics processing task corresponding to window C is the third priority.

[0172] For example, the electronic device may be provided with a first priority, a second priority, a third priority, and a fourth priority corresponding to the graphics processing task, and may be provided with an interval range A1 corresponding to the first priority, an interval range A2 corresponding to the second priority, an interval range A3 corresponding to the third priority, and an interval range (for example, interval range A4) corresponding to the fourth priority. The first priority may be higher than the second priority, the second priority may be higher than the third priority, and the third priority may be higher than the fourth priority.

[0173] 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 area corresponding to window A and the area of ​​the display interface is within interval range A1, determines that the ratio between the area of ​​the first area corresponding to window B and the area of ​​the display interface is within interval range A2, determines that the ratio between the area of ​​the first area corresponding to window C and the area of ​​the display interface is within interval range A3, and determines that the ratio between the area of ​​the first area corresponding to window D and the area of ​​the display interface is within interval range A4. At this time, the electronic device can determine that the priority of the graphics processing task corresponding to window A is the first priority, the priority of the graphics processing task corresponding to window B is the second priority, the priority of the graphics processing task corresponding to window C is the third priority, and the priority of the graphics processing task corresponding to window D is the fourth priority.

[0174] It should be noted that the number of priorities corresponding to the graphics processing tasks set in the electronic device can be determined according to the actual scenario, and the embodiments of the present application do not limit this. Exemplarily, the number of priorities corresponding to the graphics processing tasks can be set according to the number of scheduling queues set in the electronic device.

[0175] For example, when two scheduling queues are provided in the electronic device, it can be determined that the priorities corresponding to the graphics processing task include 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 priorities corresponding to the graphics processing task include 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 priorities corresponding to the graphics processing task include 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 priorities corresponding to the graphics processing task include N, and so on. In addition, the specific value ranges of interval range A1, interval range A2, interval range A3 and interval range A4 can be determined according to the actual scenario, and the embodiments of the present application are not limited to this.

[0176] Among them, the windows described in the embodiments of the present application may all refer to windows running in an electronic device. For any window, the area of ​​the first area corresponding to the window may include the entire area of ​​the first area corresponding to the window, or may include a partial area of ​​the first area corresponding to the window, for example, it may only include the area of ​​the content area in the first area. The content area can be used to display specific content. For example, when the first area corresponding to a certain window includes a content area, a title bar, a border, a navigation bar, and a toolbar, the area of ​​the first area corresponding to the window may include the area of ​​the content area, 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 area corresponding to the window may only include the area of ​​the content area.

[0177] It should be understood that the area of ​​each window described later may include the entire area of ​​each window, or may include a portion of the area of ​​each window, for example, may include only the area of ​​the content area of ​​each window. The following is an example in which the area of ​​the first area corresponding to each window includes only the area of ​​the content area in the first area, and the area of ​​each window includes only the area of ​​the content area in the window.

[0178] For example, see Figure 5 , Figure 5 The application scenario provided by the embodiment of the present application is shown Figure 1This application scenario is exemplified by an example in which the windows running on the electronic device include window A, window B, window C, and window D, and window A is entirely displayed on the display interface, window B is entirely displayed on the display interface, window C is partially displayed on the display interface, and window D is not displayed on the display interface (for example, window D is completely blocked by window A).

[0179] like Figure 5 As shown, the electronic device can determine that the area of ​​the first area 510 corresponding to window A is larger than the area of ​​the first area 520 corresponding to window B, the area of ​​the first area 520 corresponding to window B is larger than the area of ​​the first area 530 corresponding to window C, and the area of ​​the first area 530 corresponding to window C is larger than the area of ​​the first area corresponding to window D.

[0180] At this time, the electronic device may determine that the user's attention to window A is higher than that to window B, the user's attention to window B is higher than that to window C, and the user's attention to window C is higher than that to window D. Therefore, the electronic device may determine that the priority of the image processing task corresponding to window A is higher than the priority of the graphics processing task corresponding to window B, the priority of the image processing task corresponding to window B is higher than the priority of the graphics processing task corresponding to window C, and the priority of the image processing task corresponding to window C is higher than the priority of the graphics processing task corresponding to window D.

[0181] In a possible implementation, the electronic device may also determine the area of ​​each window, and may determine the priority of the graphics processing task corresponding to each window according to the area of ​​the first area corresponding to each window and the area of ​​each window. That is, the electronic device may determine the priority of the graphics processing task corresponding to each window according to the size of the visible area of ​​each window and the size of each window itself.

[0182] In one example, for each window, the electronic device can determine the proportion of the first area corresponding to the window in the window (for example, it can be called the visible area proportion) based on the area of ​​the first area corresponding to the window and the area of ​​the window. Subsequently, the electronic device can determine the priority of the graphics processing task corresponding to each window based on the visible area proportion corresponding to each window. That is, the electronic device can determine the priority of the graphics processing task corresponding to each window based on the visible area proportion of each window in each window.

[0183] Exemplarily, when the visible area corresponding to a certain window accounts for a larger proportion, it indicates that the window has less content blocked, that is, the more complete the content displayed by the window is, the more likely the user will pay attention to the window. 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 graphics processing task corresponding to the window is higher. When the visible area corresponding to a certain window accounts for a smaller proportion, it indicates that the window has more content blocked, that is, the less complete the content displayed by the window is, and the less likely the user will pay attention to the window. 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 graphics processing task corresponding to the window is lower.

[0184] For example, see Figure 6 , Figure 6 The application scenario provided by the embodiment of the present application is shown Figure 2 This application scenario is exemplified by an example in which the windows running on the electronic device include window A, window B, window C and window D, and all of window A is displayed on the display interface, part of window B is displayed on the display interface, part of window C is displayed on the display interface, and window D is not displayed on the display interface.

[0185] like Figure 6 As shown, the electronic device determines the area of ​​the first area 610 corresponding to window A and the area of ​​window A, and can determine the visible area ratio corresponding to window A according to the area of ​​the first area 610 and the area of ​​window A. That is, the electronic device can determine that the visible area ratio corresponding to window A is 1.

[0186] The electronic device may determine the area of ​​the first region 620 corresponding to window B and the area of ​​window B, and may determine the visible area ratio corresponding to window B according to the area of ​​the first region 620 and the area of ​​window B. Assume that the electronic device determines that the visible area ratio corresponding to window B is 0.8.

[0187] The electronic device may determine the area of ​​the first region 630 and the area of ​​the window C corresponding to the window C, and may determine the visible area ratio corresponding to the window C according to the area of ​​the first region 630 and the area of ​​the window C. Assume that the electronic device determines that the visible area ratio corresponding to the window C is 0.5.

[0188] The electronic device can determine the area of ​​the first region corresponding to window D and the area of ​​window D, and can determine the visible area ratio corresponding to window D according to the area of ​​the first region corresponding to window D and the area of ​​window D. That is, the electronic device can determine that the visible area ratio corresponding to window D is 0.

[0189] Therefore, the electronic device can determine that the priority of the image processing task corresponding to window A is higher than the priority of the graphics processing task corresponding to window B, the priority of the image processing task corresponding to window B is higher than the priority of the graphics processing task corresponding to window C, and the priority of the image processing task corresponding to window C is higher than the priority of the graphics processing task corresponding to window D.

[0190] In a possible implementation, the electronic device may determine the visible area ratio corresponding to each window as the priority of the graphics processing task corresponding to each window, wherein a larger visible area ratio indicates a higher priority, and a smaller visible area ratio indicates a lower priority.

[0191] 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 visible area ratio corresponding to window A is 1, the visible area ratio corresponding to window B is 0.8, the visible area ratio corresponding to window C is 0.5, and the visible area ratio corresponding to window D is 0. At this time, the electronic device can determine that the priority of the graphics processing task corresponding to window A is 1, the priority of the graphics processing task corresponding to window B is 0.8, the priority of the graphics processing task corresponding to window C is 0.5, and the priority of the graphics processing task corresponding to window D is 0.

[0192] In another possible implementation, at least two priorities corresponding to the graphics processing task and an interval range corresponding to each priority may be set in the electronic device. The electronic device may determine the priority of the graphics processing task corresponding to each window according to the interval range to which the visible area proportion corresponding to each window belongs.

[0193] It should be understood that the electronic device determines the specific content of the priority of the graphics processing task corresponding to each window according to the interval range to which the visible area corresponding to each window belongs. The relevant content of determining the priority of the graphics processing task corresponding to each window according to the interval range of the ratio between the area of ​​the first area corresponding to each window and the area of ​​the display interface of the aforementioned electronic device can be referred to. For the sake of simplicity, it will not be repeated here.

[0194] It should be noted that the interval range corresponding to each priority level in the scenario where the priority of the graphics processing task corresponding to each window is determined based on the proportion of the visible area corresponding to each window, and the interval range corresponding to each priority level in the scenario where the priority of the graphics processing task corresponding to each window is determined based on the ratio between the area of ​​the first area corresponding to each window and the area of ​​the display interface may be the same or different, and may be determined according to the actual scenario.

[0195] In other embodiments, the electronic device may determine the priority of the graphics processing task corresponding to each window according to the area of ​​each window.

[0196] For example, when the area of ​​a certain window is larger, it can be indicated that the possibility that the user will pay attention to the window is greater. Therefore, the electronic device can determine that the user's attention to the window is higher. At this time, the electronic device can determine that the priority of the graphics processing task corresponding to the window is higher. When the area of ​​a certain window is smaller, it can be indicated that the possibility that the user will pay attention to the window is smaller. Therefore, the electronic device can determine that the user's attention to the window is lower. At this time, the electronic device can determine that the priority of the graphics processing task corresponding to the window is lower.

[0197] In one example, the electronic device can determine the proportion of each window in the display interface (for example, which can be called the screen proportion corresponding to each window) based on the area of ​​each window and the area of ​​the display interface, and can determine the priority of the graphics processing task corresponding to each window based on the screen proportion corresponding to each window.

[0198] For example, when the screen ratio corresponding to a certain window is larger, it can indicate that the user pays more attention to the window, and at this time, the electronic device can determine that the priority of the graphics processing task corresponding to the window is higher. When the screen ratio corresponding to a certain window is smaller, it can indicate that the user pays less attention to the window, and at this time, the electronic device can determine that the priority of the graphics processing task corresponding to the window is lower.

[0199] In a possible implementation, the electronic device may determine the screen ratio corresponding to each window as the priority of the graphics processing task corresponding to each window.

[0200] In another possible implementation, at least two priorities corresponding to the graphics processing task and an interval range corresponding to each priority may be set in the electronic device. After determining the screen proportions corresponding to each window, the electronic device may determine the interval range to which the screen proportions corresponding to each window belong, and may determine the priority of the graphics processing task corresponding to each window according to the interval range.

[0201] Similarly, the electronic device determines the specific content of the priority of the graphics processing task corresponding to each window according to the interval range to which the screen ratio corresponding to each window belongs. The relevant content of determining the priority of the graphics processing task corresponding to each window according to the interval range of the ratio between the area of ​​the first area corresponding to each window and the area of ​​the display interface of the aforementioned electronic device can be referred to. For the sake of simplicity, it will not be repeated here.

[0202] It should be noted that the interval range corresponding to each priority level in the scenario where the priority level of the graphics processing task corresponding to each window is determined based on the screen ratio corresponding to each window, and the interval range corresponding to each priority level in the scenario where the priority level of the graphics processing task corresponding to each window is determined based on the ratio between the area of ​​the first region corresponding to each window and the area of ​​the display interface may be the same or different, and may be determined based on the actual scenario.

[0203] In other embodiments, the electronic device may determine the priority of the graphics 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.

[0204] In one example, the electronic device can obtain the weight corresponding to the visible area ratio (for example, it can be called the first weight) and the weight corresponding to the screen ratio (for example, the second weight). For each window, the electronic device can perform weighted calculation according to the first weight, the visible area ratio corresponding to the window, the second weight and the screen ratio corresponding to the window to obtain the weighted result corresponding to the window. Subsequently, the electronic device can determine the priority of the graphics processing task corresponding to each window according to the weighted results corresponding to each window. Among them, the larger the weighted result corresponding to a window, the higher the priority of the graphics processing task corresponding to the window. When the weighted result corresponding to a window is smaller, the priority of the graphics processing task corresponding to the window is lower.

[0205] It should be noted that the first weight and the second weight can be specifically determined according to the actual scenario, and the embodiment of the present application is not limited to this. For example, the first weight can be determined to be 0.7 and the second weight can be 0.3 according to the actual scenario. For example, the first weight can be determined to be 0.8 and the second weight can be 0.2 according to the actual scenario, and so on.

[0206] Exemplarily, the electronic device may determine the weighted result corresponding to each window as the priority of the graphic processing task corresponding to each window.

[0207] Exemplarily, at least two priorities corresponding to the graphics processing task and an interval range corresponding to each priority may be set in the electronic device. After determining the weighted results corresponding to each window, the electronic device may determine the priority of the graphics processing task corresponding to each window according to the interval range to which the weighted results corresponding to each window belong.

[0208] It should be understood that the electronic device determines the specific content of the priority of the graphics processing task corresponding to each window according to the interval range to which the weighted results corresponding to each window belong. The relevant content of determining the priority of the graphics processing task corresponding to each window according to the interval range of the ratio between the area of ​​the first area corresponding to each window and the area of ​​the display interface of the aforementioned electronic device can be referred to. For the sake of simplicity, it will not be repeated here.

[0209] In other embodiments, the electronic device may also determine the distance between the center point of each window and the center point of the display interface. Subsequently, the electronic device may determine the priority of the graphics processing task corresponding to each window according to the distance (or offset distance) between the center point of each window and the center point of the display interface.

[0210] Among them, when the distance between the center point of a certain window and the center point of the display interface is closer, it can be said that the window is closer to the center position of the display interface, and it can be considered that the possibility that the user pays attention to the window is greater, that is, it can be determined that the user's attention to the window is higher. When the distance between the center point of a certain window and the center point of the display interface is farther, it can be said that the window is farther away from the center position of the display interface, and it can be considered that the possibility that the user pays attention to the window is smaller, that is, it can be determined that the user's attention to the window is lower.

[0211] Exemplarily, for each window, the electronic device may determine the window offset ratio (or offset distance ratio) corresponding to the window based on the distance between the center point of the window and the center point of the display interface, and the display interface (e.g., the diagonal length of the display interface). Subsequently, the electronic device may determine the priority of the graphics processing task corresponding to each window based on the window offset ratio corresponding to each window.

[0212] In one example, the electronic device may determine the window offset ratio corresponding to each window as the priority of the graphics processing task corresponding to each window.

[0213] In another example, at least two priorities corresponding to the graphics processing task and an interval range corresponding to each priority may be set in the electronic device. After determining the window offset ratio corresponding to each window, the electronic device may determine the interval range to which the window offset ratio corresponding to each window belongs, and may determine the priority of the graphics processing task corresponding to each window according to the interval range.

[0214] Similarly, the electronic device determines the specific content of the priority of the graphics processing task corresponding to each window according to the interval range to which the window offset ratio corresponding to each window belongs. The relevant content of determining the priority of the graphics 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 by the aforementioned electronic device can be referred to. For the sake of brevity, it will not be repeated here.

[0215] In a possible implementation, the electronic device may determine the priority of the graphics processing task corresponding to each window according to the visible area ratio and the window offset ratio corresponding to each window.

[0216] Exemplarily, the electronic device may 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 may perform 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 may determine the priority of the graphics processing task corresponding to each window according to the weighted results corresponding to each window. It should be understood that the larger the weighted result corresponding to a window, the higher the priority of the graphics processing task corresponding to the window. The smaller the weighted result corresponding to a window, the lower the priority of the graphics processing task corresponding to the window.

[0217] In another possible implementation, the electronic device may determine the priority of the graphics processing task corresponding to each window according to the screen ratio and window offset ratio corresponding to each window.

[0218] Exemplarily, the electronic device may 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 may perform 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 may determine the priority of the graphics processing tasks corresponding to each window according to the weighted results corresponding to each window. It should be understood that the larger the weighted result corresponding to a window, the higher the priority of the graphics processing task corresponding to the window. When the weighted result corresponding to a window is smaller, the priority of the graphics processing task corresponding to the window is lower.

[0219] In another possible implementation, the electronic device may determine the priority of the graphics processing task corresponding to each window according to the visible area ratio, screen ratio and window offset ratio corresponding to each window.

[0220] Exemplarily, the electronic device may 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 may perform weighted calculation based on 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 may determine the priority of the graphics processing task corresponding to each window based on the weighted results corresponding to each window.

[0221] It can be seen from the above description that when the distance between the center point of a certain window and the center point of the display interface is closer, it can be shown that the window is closer to the central position of the display interface, and it can be determined that the user's attention to the window will be higher, that is, it can be determined that the priority of the graphics processing task corresponding to the window will be higher. When the distance between the center point of a certain window and the center point of the display interface is farther, it can be shown that the window is farther away from the central position of the display interface, and it can be determined that the user's attention to the window will be less, that is, it can be determined that the priority of the graphics 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, in order to ensure that the priority of the graphics processing task corresponding to the window is higher, when performing weighted calculation according to the window offset ratio corresponding to each window, 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.

[0222] That is, in the scenario where the weighted result is determined 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.

[0223] It should be noted that the third weight can be specifically determined according to the actual scenario, and the embodiment of the present application does not limit this.

[0224] In one example, after determining the weighted results corresponding to each window, the electronic device may determine the weighted results corresponding to each window as the priority of the graphics processing task corresponding to each window.

[0225] In another example, at least two priorities corresponding to the graphics processing task and an interval range corresponding to each priority may be set in the electronic device. After determining the weighted results corresponding to each window, the electronic device may determine the priority of the graphics processing task corresponding to each window according to the interval range to which the weighted results corresponding to each window belong.

[0226] In some embodiments, when an electronic device runs multiple windows, the user generally pays the most attention to the focus window. Therefore, in order to ensure the frame rate of the focus window, the smoothness of the focus window is improved to enhance the user's viewing experience of the focus window. The electronic device can determine the focus window based on each window, and can determine that the priority of the graphics processing task corresponding to the focus window is higher than the priority of the graphics processing task corresponding to the non-focus window. Among them, the focus window can refer to the window located at the top layer of the display interface and directly interacting with the user.

[0227] It should be noted that the embodiment of the present application does not limit the specific method of determining the focus window, which can be determined according to the actual scenario.

[0228] It should be understood that the method for determining the priority of the graphics processing task corresponding to the non-focus window can refer to the method for determining the priority of the graphics processing task corresponding to each window mentioned above. For example, it can be determined according to the area of ​​the first area corresponding to each non-focus window, or it can be determined according to the area of ​​each non-focus window, or it can be determined according to the area of ​​the first area corresponding to each non-focus window and the area of ​​the window, or it can be determined according to the area of ​​the first area corresponding to each non-focus window, the area of ​​the window and the area of ​​the display interface, or it can be determined according to the distance between the center point of the window corresponding to each non-focus window and the center point of the display interface, or it can be determined according to the area of ​​the first area 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.

[0229] 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. Assuming that the electronic device determines that window A is the focus window, at this time, the electronic device can determine that the priority of the graphics 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 area corresponding to window B and the area of ​​window B, can determine the area of ​​the first area corresponding to window C and the area of ​​window C, and can determine the area of ​​the first area corresponding to window D and the area of ​​window D, and can determine the proportion of the visible area corresponding to window B based on the area of ​​the first area corresponding to window B and the area of ​​window B, can determine the proportion of the visible area corresponding to window C based on the area of ​​the first area corresponding to window C and the area of ​​window C, and can determine the proportion of the visible area corresponding to window D based on the area of ​​the first area corresponding to window D and the area of ​​window D.

[0230] Assume that the electronic device determines that the visible area ratio corresponding to window B is greater than the visible area ratio corresponding to window C, and the visible area ratio corresponding to window C is greater than the visible area ratio corresponding to window D. Therefore, the electronic device can determine 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, 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, and the priority of the graphics processing task corresponding to window C is higher than the priority of the graphics processing task corresponding to window D.

[0231] Next, the electronic device will process the graphics processing tasks corresponding to each window according to the priority of the graphics processing tasks corresponding to each window. The process of allocating shape processing tasks to corresponding scheduling queues is described in detail.

[0232] In the embodiment of the present application, at least two scheduling queues may be provided in the electronic device. After determining the priority of the graphics processing tasks corresponding to each window, the electronic device may 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.

[0233] In some embodiments, two scheduling queues may be provided in the electronic device, for example, a first scheduling queue and a second scheduling queue, and the priority of the first scheduling queue may be higher than the priority of the second scheduling queue, that is, the graphics processing tasks in the first scheduling queue may be executed by the GPU first.

[0234] In one example, in a scenario where the priority of the graphics processing tasks corresponding to each window is a specific numerical value (such as a ratio, a percentage of visible area, or a weighted result, etc.), after determining the priority of the graphics processing tasks corresponding to each window, the electronic device can classify the graphics processing tasks whose priority is greater than or equal to a certain threshold (for example, which can be called threshold A) into the first scheduling queue, and can classify the graphics processing tasks whose priority is less than threshold A into the second scheduling queue.

[0235] It should be understood that the specific value of threshold A can be determined according to the actual application scenario, and the embodiments of the present application are not limited to this. For example, the threshold A can be determined to be 0.8 according to the actual application scenario. That is, after determining the priority of the graphics processing tasks corresponding to each window, the electronic device can classify the graphics processing tasks with a priority greater than or equal to 0.8 into the first scheduling queue, and can classify the graphics processing tasks with a priority less than 0.8 into 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 priority of the graphics processing tasks corresponding to each window, the electronic device can classify the graphics processing tasks with a priority greater than or equal to 1 into the first scheduling queue, and can classify the graphics processing tasks with a priority less than 1 into the second scheduling queue.

[0236] For example, see Figure 7 , Figure 7 An example of task scheduling provided by an embodiment of the present application is shown Figure 1 . This example starts with Figure 5 The application scenario shown is used as an example for exemplary description, and this example is used as an example for exemplary description to determine the proportion of the visible area corresponding to each window as the priority of the graphics processing task corresponding to each window.

[0237] Depend on Figure 5 It can be seen that the electronic device can determine the visible area ratio corresponding to window A according to the area of ​​the first area 510 corresponding to window A and the area of ​​window A, that is, the visible area ratio corresponding to window A can be determined to be 1. At this time, the electronic device can determine that the priority of the graphics processing task A corresponding to window A is 1.

[0238] The electronic device can determine the visible 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 the visible area ratio corresponding to window B as 1. At this time, the electronic device can determine the priority of the graphics processing task B corresponding to window B as 1.

[0239] The electronic device may determine the visible 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. Assume that the electronic device determines that the visible area ratio corresponding to window C is 0.5. At this time, the electronic device may determine that the priority of the graphics processing task C corresponding to window C is 0.5.

[0240] The electronic device can determine the visible area ratio corresponding to window D according to the area of ​​the first area corresponding to window D (ie, 0) and the area of ​​window D, that is, can determine that the visible area ratio corresponding to window D is 0. At this time, the electronic device can determine that the priority of the graphics processing task D corresponding to window D is 0.

[0241] Assuming that threshold A is 1, the electronic device can determine that the priority of image processing task A corresponding to window A and the priority of graphics processing task B corresponding to window B are both equal to threshold A (i.e., 1), and can determine that the priority of graphics processing task C corresponding to window C and the priority of graphics processing task D corresponding to window D are both less than threshold A (i.e., 1). Therefore, the electronic device can classify graphics processing task A corresponding to window A and graphics processing task B corresponding to window B into the first scheduling queue, and can classify graphics processing task C corresponding to window C and graphics processing task D corresponding to window D into the second scheduling queue.

[0242] Therefore, if Figure 7 As shown, the electronic device can divide the graphics processing task A corresponding to the unobstructed window A and the graphics processing task B corresponding to the unobstructed window B into the first scheduling queue, and can divide the graphics processing task C corresponding to the partially obstructed window C and the graphics processing task D corresponding to the fully obstructed window D into the second scheduling queue, so that the graphics processing tasks corresponding to the unobstructed window A and the window B can be executed by the GPU first, which can increase the occupancy ratio of the unobstructed window to the GPU, increase the picture frame rate of the unobstructed window, thereby improving the picture smoothness of the unobstructed window and enhancing the user's viewing experience of the unobstructed window. For example, the GPU may include two cores, core 1 and core 2, and the GPU can preferentially schedule the graphics processing task A corresponding to the unobstructed window A and the graphics processing task B corresponding to the unobstructed window B to core 1 and core 2 for execution.

[0243] In another example, in a scenario where the priority of the graphics processing task corresponding to each window is a specific numerical value (such as a ratio, a visible area ratio, or a weighted result, etc.), after determining the priority of the graphics processing task corresponding to each window, the electronic device can sort the windows in descending order of priority to obtain a sorting result. Subsequently, the electronic device can determine that the graphics processing tasks corresponding to the first W windows in the sorting result are divided into the first scheduling queue, and can divide the graphics processing tasks corresponding to other windows into the second scheduling queue. Other windows may refer to windows other than the first W windows in the sorting result.

[0244] It should be understood that the specific value of W can be determined according to the actual scenario, and the embodiment of the present application does 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 scenario.

[0245] In another example, in a scenario where the priority of the graphics processing task corresponding to each window is not a specific numerical value, that is, in a scenario where the priority of the graphics processing task corresponding to each window is the first priority or the second priority, the number of priorities corresponding to the graphics processing task can be the same as the number of scheduling queues, that is, when the priority of the graphics processing task corresponding to each window can be the first priority or the second priority, after determining the priority of the graphics processing task corresponding to each window, the electronic device can classify the high-priority graphics processing task into the first scheduling queue, and can classify the low-priority graphics processing task into the second scheduling queue. For example, when the first priority is higher than the second priority, the electronic device can classify the first-priority graphics processing task into the first scheduling queue, and can classify the second-priority graphics processing task into the second scheduling queue.

[0246] In a possible implementation, the electronic device may divide the graphics processing tasks corresponding to each window into corresponding scheduling queues based on the load of the GPU.

[0247] Exemplarily, when the load of the GPU is greater than or equal to a preset load (for example, it can be called preset load B), the electronic device can classify high-priority graphics processing tasks into a high-priority scheduling queue, and can classify low-priority graphics processing tasks into a low-priority scheduling queue. When the load of the GPU is less than the preset load B, the electronic device can classify high-priority graphics processing tasks and part of low-priority graphics processing tasks into a high-priority scheduling queue, and can classify another part of low-priority graphics processing tasks into a low-priority scheduling queue. That is, when the load of the GPU is large, the electronic device can give priority to scheduling high-priority graphics processing tasks to the GPU for execution. When the load of the GPU is small, the electronic device can give priority to scheduling high-priority graphics processing tasks and part of low-priority graphics processing tasks to the GPU for execution.

[0248] It should be noted that the preset load B can be determined according to the actual scenario, and the embodiment of the present application does not limit this. When the load of the GPU is less than the preset load B, the low-priority graphics processing tasks in the high-priority scheduling queue can be determined according to the actual scenario, and the embodiment of the present application does not limit this.

[0249] For example, in a scenario where an 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 may classify the graphics processing task corresponding to window A into the first scheduling queue, and may classify the graphics processing task corresponding to window B and the graphics processing task corresponding to window C into the second scheduling queue.

[0250] When the electronic device determines that the load of the GPU is less than the preset load B, the electronic device may classify the graphics processing task corresponding to window A into the first scheduling queue, the graphics processing task corresponding to window B into the second scheduling queue, and the graphics processing task corresponding to window C into the first scheduling queue. Alternatively, the electronic device may classify the graphics processing task corresponding to window A into the first scheduling queue, the graphics processing task corresponding to window B into the first scheduling queue, and the graphics processing task corresponding to window C into the second scheduling queue.

[0251] In other embodiments, three scheduling queues may be provided in the electronic device, such as a first scheduling queue, a second scheduling queue, and a third scheduling queue, and the priority of the first scheduling queue may be higher than the priority of the second scheduling queue, and the priority of the second scheduling queue may be higher than the priority of the third scheduling queue.

[0252] In one example, in a scenario where the priority of the graphics processing tasks corresponding to each window is a specific numerical value (such as a ratio, a percentage of visible area, or a weighted result, etc.), after determining the priority of the graphics processing tasks corresponding to each window, the electronic device can classify the graphics processing tasks whose priority is greater than or equal to a certain threshold (such as threshold B) into a first scheduling queue, and can classify the graphics processing tasks whose priority is greater than or equal to a certain threshold (such as threshold C) and less than threshold B into a second scheduling queue, and can classify the graphics processing tasks whose priority is less than threshold C into a third scheduling queue.

[0253] It should be understood that the specific values ​​of threshold B and threshold C can be determined according to the actual application scenario, and the embodiments of the present application are not limited to this. For example, threshold B can be determined to be 1 and threshold C can be determined to be 0.5 according to the actual application scenario. That is, after determining the priority of the graphics processing tasks corresponding to each window, the electronic device can classify the graphics processing tasks with a priority greater than or equal to 1 into the first scheduling queue, the graphics processing tasks with a priority greater than or equal to 0.5 and less than 1 into the second scheduling queue, and the graphics processing tasks with a priority less than 0.5 can be classified into the third scheduling queue.

[0254] In another example, in a scenario where the priority of the graphics processing tasks corresponding to each window is a specific numerical value (such as a ratio, a visible area ratio, or a weighted result, etc.), after determining the priority of the graphics processing tasks corresponding to each window, the electronic device can sort the windows in descending order of priority to obtain a sorting result. Subsequently, the electronic device can classify the graphics processing tasks corresponding to the first M1 windows in the sorting result into the first scheduling queue, the graphics processing tasks corresponding to the M1+1th window to the M2th window into the second scheduling queue, and the graphics processing tasks corresponding to other windows into the third scheduling queue. Among them, other windows may refer to windows other than the first M2 windows in the sorting result.

[0255] It should be noted that M2 is greater than M1, and the specific value of M1 and the specific value of M2 can be determined according to the actual scenario, and the embodiment of the present application does not limit this. For example, according to the actual scenario, M1 can be determined to be 1 and M2 can be determined to be 3, that is, the graphics processing task corresponding to the first window in the sorting result can be divided into the first scheduling queue, the graphics processing task corresponding to the second window in the sorting result and the graphics processing task corresponding to the third window can be divided into the second scheduling queue, and the graphics 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.

[0256] In another example, in a scenario where the priority of the graphics processing tasks corresponding to each window is a specific value (such as a ratio, a percentage of visible area, or a weighted result, etc.), the electronic device can also determine the focus window based on each window, and can divide the graphics processing tasks corresponding to the focus window into the first scheduling queue.

[0257] For non-focus windows, the electronic device may classify graphics processing tasks with a priority greater than or equal to a certain threshold (for example, threshold D) into the second scheduling queue, and may classify graphics processing tasks with a priority less than threshold D into the third scheduling queue. Alternatively, the electronic device may sort the non-focus windows in descending order of priority to obtain a sorting result. Subsequently, the electronic device may determine that the graphics processing tasks corresponding to the first R non-focus windows in the sorting result are classified into the second scheduling queue, and may classify the graphics processing tasks corresponding to other non-focus windows into the third scheduling queue.

[0258] 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 scenario, and the embodiments of the present application do not limit this.

[0259] For example, see Figure 8 , Figure 8 An example of task scheduling provided by an embodiment of the present application is shown Figure 2 . This example starts with Figure 5 The application scenario shown is used as an example for exemplary description, and this example is used as an example for exemplary description to determine the proportion of the visible area corresponding to each window as the priority of the graphics processing task corresponding to each window.

[0260] Depend on Figure 5 It can be known that the electronic device can determine that window A is the focus window. Therefore, the electronic device can assign the graphics processing task A corresponding to window A to the first scheduling queue.

[0261] For window B, the electronic device can determine the visible 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, determine that the visible area ratio corresponding to window B is 1. At this time, the electronic device can determine that the priority of the graphics processing task B corresponding to window B is 1.

[0262] For window C, the electronic device may determine the visible 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. Assume that the electronic device determines that the visible area ratio corresponding to window C is 0.5. Therefore, the electronic device may determine that the priority of the graphics processing task C corresponding to window C is 0.5.

[0263] For window D, the electronic device can determine the visible area ratio corresponding to window D according to the area of ​​the first area corresponding to window D (i.e., 0) and the area of ​​window D, that is, can determine that the visible area ratio corresponding to window D is 0. At this time, the electronic device can determine that the priority of the graphics processing task D corresponding to window D is 0.

[0264] Assuming that the threshold D is 1, the electronic device can determine that the priority of the graphics processing task B corresponding to the window B is equal to the threshold D, and can determine that the priority of the graphics processing task corresponding to the window C and the priority of the graphics processing task corresponding to the window D are both less than the threshold D. Therefore, the electronic device can classify the graphics processing task B corresponding to the window B into the second scheduling queue, and can classify the graphics processing task C corresponding to the window C and the graphics processing task D corresponding to the window D into the third scheduling queue.

[0265] Therefore, if Figure 8 As shown, the electronic device can classify the graphics processing task A corresponding to the focus window A into the first scheduling queue, can classify the graphics processing task B corresponding to the non-focus and unobstructed window B into the second scheduling queue, and can classify the graphics processing task C corresponding to the non-focus and partially obstructed window C and the graphics processing task D corresponding to the non-focus and fully obstructed window D into the third scheduling queue, so that the graphics processing task A corresponding to the focus window A can be executed by the GPU first, and the occupation ratio of the focus window to the GPU can be ensured first, thereby improving the picture frame rate of the focus window, thereby improving the picture smoothness of the focus window and enhancing the user's viewing experience of the focus window. For example, the GPU may include two cores, core 1 and core 2, and the GPU may prioritize scheduling the graphics processing task A corresponding to the focus window A to core 1 and core 2 for execution.

[0266] In another example, when the priority of the graphics processing tasks corresponding to each window is not a specific numerical value, that is, in the scenario where the priority of the graphics processing tasks corresponding to each window is the first priority or the second priority, the number of priorities corresponding to the graphics processing tasks can be the same as the number of scheduling queues, that is, the priority of the graphics processing tasks corresponding to each window is the first priority, the second priority or the third priority. After determining the priority of the graphics processing tasks corresponding to each window, the electronic device can classify the graphics processing tasks with the highest priority into the first scheduling queue, the graphics processing tasks with the lowest priority into the third scheduling queue, and the graphics processing tasks with intermediate priorities into the second scheduling queue.

[0267] 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 assign the graphics processing task of the first priority to the first scheduling queue, can assign the graphics processing task of the second priority to the second scheduling queue, and can assign the graphics processing task of the third priority to the third scheduling queue.

[0268] In another possible implementation, four scheduling queues may 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 may be higher than the priority of the second scheduling queue, the priority of the second scheduling queue may be higher than the priority of the third scheduling queue, and the priority of the third scheduling queue may be higher than the priority of the fourth scheduling queue.

[0269] In one example, in a scenario where the priority of the graphics processing tasks corresponding to each window is a specific numerical value (such as a ratio, a proportion of visible area or a weighted result, etc.), after determining the priority of the graphics processing tasks corresponding to each window, the electronic device can classify the graphics processing tasks whose priority is greater than or equal to a certain threshold (such as threshold E) into a first scheduling queue, and can classify the graphics processing tasks whose priority is greater than or equal to a certain threshold (such as threshold F) and less than threshold E into a second scheduling queue, and can classify the graphics processing tasks whose priority is greater than or equal to a certain threshold (such as threshold G) and less than threshold F into a third scheduling queue, and can classify the graphics processing tasks whose priority is less than threshold G into a fourth scheduling queue.

[0270] It should be understood that the specific values ​​of threshold E, threshold F and threshold G can be specifically determined according to the actual application scenario, and the embodiments of the present application are not limited to this. For example, threshold E can be determined to be 1, threshold F to be 0.8, and threshold G to be 0.5 according to the actual application scenario. That is, after determining the priority of the graphics processing tasks corresponding to each window, the electronic device can classify the graphics processing tasks with a priority greater than or equal to 1 into the first scheduling queue, the graphics processing tasks with a priority greater than or equal to 0.8 and less than 1 into the second scheduling queue, the graphics processing tasks with a priority greater than or equal to 0.5 and less than 0.8 into the third scheduling queue, and the graphics processing tasks with a priority less than 0.5 can be classified into the fourth scheduling queue.

[0271] In another example, in a scenario where the priority of the graphics processing tasks corresponding to each window is a specific numerical value (such as a ratio, a visible area ratio, or a weighted result, etc.), after determining the priority of the graphics processing tasks corresponding to each window, the electronic device can sort the windows in descending order of priority to obtain a sorting result. Subsequently, the electronic device can divide the graphics processing tasks corresponding to the first M1 windows in the sorting result into the first scheduling queue, divide the graphics processing tasks corresponding to the M1+1th window to the M2th window in the sorting result into the second scheduling queue, divide the graphics processing tasks corresponding to the M2+1th window to the M3th window in the sorting result into the third scheduling queue, and divide the graphics processing tasks corresponding to other windows in the sorting result into the fourth scheduling queue. Among them, other windows may refer to windows other than the first M3 windows in the sorting result.

[0272] 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 scenario, and the embodiments of the present application do not limit this.

[0273] In another example, in a scenario where the priority of the graphics processing tasks corresponding to each window is a specific value (such as a ratio, a percentage of visible area, or a weighted result, etc.), the electronic device can also determine the focus window based on each window, and can divide the graphics processing tasks corresponding to the focus window into the first scheduling queue.

[0274] For non-focus windows, the electronic device may classify graphics processing tasks whose priority is greater than or equal to a certain threshold (e.g., threshold H) into the second scheduling queue, may classify graphics processing tasks whose priority is greater than or equal to a certain threshold (e.g., threshold J) and less than threshold H into the third scheduling queue, and may classify graphics processing tasks whose priority is less than threshold J into the fourth scheduling queue. Alternatively, the electronic device may sort the non-focus windows in descending order of priority to obtain a sorting result. Subsequently, the electronic device may classify the graphics processing tasks corresponding to the first S1 non-focus windows in the sorting result into the second scheduling queue, may classify the graphics processing tasks corresponding to the S1+1th non-focus windows to the S2th non-focus windows into the third scheduling queue, and may classify the graphics processing tasks corresponding to other non-focus windows into the fourth scheduling queue. Among them, other non-focus windows may refer to non-focus windows other than the first S2 non-focus windows in the sorting result.

[0275] It should be noted that the specific value of the threshold H, the specific value of the threshold J, the specific value of S1 and the specific value of S2 can be determined according to the actual scenario, and the embodiments of the present application do not limit this.

[0276] For example, see Fig. 9 , Fig. 9 An example of task scheduling provided by an embodiment of the present application is shown Figure 3 . This example starts with Figure 5 The application scenario shown is used as an example for exemplary description, and this example is used as an example for exemplary description to determine the proportion of the visible area corresponding to each window as the priority of the graphics processing task corresponding to each window.

[0277] Depend on Figure 5 It can be known that the electronic device can determine that window A is the focus window. Therefore, the electronic device can assign the graphics processing task A corresponding to window A to the first scheduling queue.

[0278] For window B, the electronic device can determine the visible 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, determine that the visible area ratio corresponding to window B is 1. At this time, the electronic device can determine that the priority of the graphics processing task B corresponding to window B is 1.

[0279] For window C, the electronic device may determine the visible 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. Assume that the electronic device determines that the visible area ratio corresponding to window C is 0.5. Therefore, the electronic device may determine that the priority of the graphics processing task C corresponding to window C is 0.5.

[0280] For window D, the electronic device can determine the visible area ratio corresponding to window D according to the area of ​​the first area corresponding to window D (i.e., 0) and the area of ​​window D, that is, can determine that the visible area ratio corresponding to window D is 0. At this time, the electronic device can determine that the priority of the graphics processing task D corresponding to window D is 0.

[0281] Assuming that threshold H is 1 and threshold J is 0.3, the electronic device can determine that the priority of graphics processing task B corresponding to window B is equal to threshold H, can determine that the priority of graphics processing task corresponding to window C is greater than threshold J and less than threshold H, and can determine that the priority of graphics processing task corresponding to window D is less than threshold J. Therefore, the electronic device can classify graphics processing task B corresponding to window B into the second scheduling queue, can classify graphics processing task C corresponding to window C into the third scheduling queue, and can classify graphics processing task D corresponding to window D into the fourth scheduling queue.

[0282] Therefore, if Fig. 9 As shown, the electronic device can classify the graphics processing task A corresponding to the focus window A into the first scheduling queue, the graphics processing task B corresponding to the non-focus and unobstructed window B into the second scheduling queue, the graphics processing task C corresponding to the non-focus and partially obstructed window C into the third scheduling queue, and the graphics processing task D corresponding to the non-focus and fully obstructed window D into the fourth scheduling queue, so that the graphics 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 graphics processing task A corresponding to the focus window A to core 1, core 2, core 3, and core 4 for execution.

[0283] In another example, in a scenario where the priority of the graphics processing tasks corresponding to each window is not a specific numerical value, that is, the priority of the graphics processing tasks corresponding to each window is the first priority or the second priority, etc., the number of priorities corresponding to the graphics processing tasks may be the same as the number of scheduling queues, that is, the priority of the graphics processing tasks corresponding to each window is the first priority, the second priority, the third priority or the fourth priority. After determining the priority of the graphics processing tasks corresponding to each window, the electronic device may assign the highest priority graphics processing task to the first scheduling queue, the second highest priority graphics processing task to the second scheduling queue, the third highest priority graphics processing task to the third scheduling queue, and the lowest priority graphics processing task to the fourth scheduling queue.

[0284] 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 classify the graphics processing task of the first priority into the first scheduling queue, classify the graphics processing task of the second priority into the second scheduling queue, classify the graphics processing task of the third priority into the third scheduling queue, and classify the graphics processing task of the fourth priority into the fourth scheduling queue.

[0285] It should be noted that the electronic device may be provided with five scheduling queues, six scheduling queues, seven scheduling queues or eight scheduling queues, etc. The specific content of the electronic device dividing the graphics processing tasks corresponding to each window into five scheduling queues, six scheduling queues, seven scheduling queues or eight scheduling queues is similar to the content of the electronic device dividing the graphics processing tasks corresponding to each window into three scheduling queues or four scheduling queues. For details, reference may be made to the relevant content of the electronic device dividing the graphics processing tasks corresponding to each window into three scheduling queues or four scheduling queues, which will not be repeated here.

[0286] Next, the electronic device will schedule the graphics processing tasks in each scheduling queue according to the priority of each scheduling queue. The process of transferring the data to the GPU for execution is described in detail.

[0287] In the embodiment of the present application, after the graphics processing tasks corresponding to each window are divided into corresponding scheduling queues, the electronic device can schedule the graphics processing tasks according to the priority of each scheduling queue, that is, the graphics processing tasks in the scheduling queue with a high priority can be preferentially scheduled to the GPU for execution.

[0288] In some embodiments, the electronic device may schedule the graphics processing tasks in each scheduling queue to the GPU for execution according to a preset scheduling ratio and the priority of each scheduling queue.

[0289] In one possible implementation, the preset scheduling ratio may refer to the ratio between the scheduling times of each scheduling queue. The scheduling time of a scheduling queue may refer to the time when the graphics processing task in the scheduling queue is executed on the GPU. Among them, the preset scheduling ratio can be determined according to the actual scenario, and the embodiments of the present application are not limited to this. It should be understood that when the priority of a scheduling queue is higher, the scheduling time of the scheduling queue will be more; when the priority of a scheduling queue is lower, the scheduling time of the scheduling queue will be less. That is, by increasing the scheduling time of a high-priority scheduling queue, the execution time of the GPU for high-priority graphics processing tasks can be increased, so as to increase the execution time of the GPU for graphics processing tasks corresponding to windows with higher user attention, which can improve the frame rate of windows with higher user attention, improve the picture smoothness of windows with higher user attention, and improve the user experience.

[0290] In another possible implementation, the preset scheduling ratio may refer to the ratio between the scheduling frequencies of each scheduling queue. The scheduling frequency of a scheduling queue may refer to the number of times the GPU executes the graphics processing tasks in the scheduling queue. Among them, the preset scheduling ratio can be determined according to the actual scenario, and the embodiments of the present application are not limited to this. It should be understood that when the priority of a scheduling queue is higher, the scheduling frequency of the scheduling queue will be higher; when the priority of a scheduling queue is lower, the scheduling frequency of the scheduling queue will be lower. That is, the number of executions of high-priority graphics processing tasks by the GPU can be increased by increasing the scheduling frequency of high-priority scheduling queues, so as to increase the number of executions of graphics processing tasks corresponding to windows with higher user attention by the GPU, which can improve the frame rate of windows with higher user attention, improve the smoothness of the pictures of windows with higher user attention, and improve the user experience.

[0291] For example, when a first scheduling queue and a second scheduling queue are provided in an electronic device, and the priority of the first scheduling queue is higher than that of the second scheduling queue, the preset scheduling ratio can be determined according to the 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 task 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.

[0292] Exemplarily, the preset scheduling ratio may be a scheduling ratio pre-set in the electronic device. Alternatively, the preset scheduling ratio may 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 may determine that the preset scheduling ratio is relatively 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 gives priority to executing the graphics processing tasks in the high-priority scheduling queue. For example, when the load of the GPU is small, the electronic device may determine that the preset scheduling ratio is relatively small, such as determining that the preset scheduling ratio is 1:1.

[0293] In one example, when the GPU includes multiple cores, each core of the GPU may execute the graphics processing tasks in each scheduling queue at the same preset scheduling ratio. Alternatively, each core of the GPU may execute the graphics processing tasks in each scheduling queue at different preset scheduling ratios. For example, a portion of the cores in the GPU may execute the graphics processing tasks in each scheduling queue at a preset scheduling ratio A, and another portion of the cores in the GPU may execute the graphics processing tasks in each scheduling queue at a preset scheduling ratio B. The preset scheduling ratio A and the preset scheduling ratio B may be different.

[0294] For example, when a first scheduling queue and a second scheduling queue are provided in an electronic device, and the priority of the first scheduling queue is higher than the priority of the second scheduling queue, a preset scheduling ratio can be determined according to the actual scenario, and each core of the GPU can process the graphics processing tasks in the first scheduling queue and the second scheduling queue in sequence 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 is 3:1 as an example, that is, when the scheduling time of the GPU is 100ms, it can be determined that the scheduling time corresponding to the first scheduling queue can be 100ms*3 / (3+1)=75ms, and the scheduling time corresponding to the second scheduling queue can 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.

[0295] For example, when a first scheduling queue and a second scheduling queue are provided in an electronic device, and the priority of the first scheduling queue is higher than that of the second scheduling queue, the preset scheduling ratio A and the preset scheduling ratio B can be determined according to the actual scenario, and a part of the cores in the GPU (for example, can be called core 1) can process the graphics processing tasks in the first scheduling queue and the second scheduling queue in sequence based on the preset scheduling ratio A, and another part of the cores in the GPU (for example, can be called core 2) can process the graphics processing tasks in the first scheduling queue and the second scheduling queue in sequence based on the preset scheduling ratio B.

[0296] Taking the preset scheduling ratio as the ratio between the scheduling times 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 100ms, for core 1, it can be determined that the scheduling time corresponding to the first scheduling queue can be 100ms*3 / (3+1)=75ms, and the scheduling time corresponding to the second scheduling queue can be 100ms*3 / (3+1)=25ms; for core 2, it can be determined that the scheduling time corresponding to the first scheduling queue can be 100ms*4 / (4+1)=80ms, and the scheduling time corresponding to the second scheduling queue can be 100ms*1 / (4+1)=20ms. That is, when the scheduling time of the GPU is 100ms, the core 1 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. The core 2 of the GPU can execute the graphics processing tasks in the first scheduling queue in the first 80ms, and can execute the graphics processing tasks in the second scheduling queue in the remaining 20ms.

[0297] In one possible implementation, when the GPU includes multiple cores, some of the GPU cores can be used exclusively to execute graphics processing tasks in a scheduling queue with a higher priority, and another part of the GPU cores can execute graphics processing tasks in other scheduling queues according to a preset scheduling ratio.

[0298] For example, in a scenario where a first scheduling queue and a second scheduling queue are set in an electronic device, and the priority of the first scheduling queue is higher than the priority of the second scheduling queue, assuming that the GPU includes core 1 and core 2, core 1 of the GPU can specifically execute graphics processing tasks in the first scheduling queue, and core 2 of the GPU can execute graphics processing tasks in the first scheduling queue and graphics processing tasks in the second scheduling queue according to a preset scheduling ratio.

[0299] Taking the preset scheduling ratio as the ratio between the scheduling times of each scheduling queue, and the preset scheduling ratio as 4:1 as an example, when the scheduling time of the GPU is 100ms, for core 2, it can be determined that the scheduling time corresponding to the first scheduling queue can be 100ms*4 / (4+1)=80ms, and the scheduling time corresponding to the second scheduling queue can be 100ms*1 / (4+1)=20ms. That is, when the scheduling time of the GPU is 100ms, the core 1 of the GPU can exclusively execute the graphics processing tasks in the first scheduling queue within 100ms. The core 2 of the GPU can execute the graphics processing tasks in the first scheduling queue in the first 80ms, and can execute the graphics processing tasks in the second scheduling queue in the remaining 20ms.

[0300] It should be noted that when an electronic device runs multiple windows, the task scheduling method provided by the embodiment of the present application can reasonably call the GPU, which can improve the utilization rate of the GPU, thereby not only improving the frame rate of the window with high user attention, but also improving the overall frame rate of the electronic device. Among them, the overall frame rate of the electronic device can refer to the number of screens displayed by the electronic device per second, that is, the sum of the number of screens displayed by each window per second.

[0301] For example, in a scenario where ten windows and a drop-down menu are slid through the task center, in multiple rounds of scheduling of graphics processing tasks through other task scheduling methods, the overall frame rate and average frame rate of the electronic device can be as shown in the following Table 1. In addition, in multiple rounds of scheduling of graphics processing tasks through the task scheduling method provided in the embodiment of the present application, the overall frame rate and average frame rate of the electronic device can also be as shown in the following Table 1.

[0302] Table 1

[0303]

[0304] As can be seen from Table 1, in the scenario where the electronic device runs multiple windows, when the graphics processing task is scheduled by other task scheduling methods, the average frame rate of the electronic device as a whole can be 108.1fps. When the graphics processing task is scheduled by the task scheduling method provided in the embodiment of the present application, the average frame rate of the electronic device as a whole can reach 113.6fps, the average time consumption per frame can be reduced by 0.6ms, and the overall average frame rate can be increased by 5.5 frames. That is, when the GPU resources are certain, the task scheduling method provided in the embodiment of the present application can make more reasonable use of the GPU resources, thereby improving the overall frame rate of the electronic device, the frame rate of the picture of each window, the smoothness of the picture, and the user experience.

[0305] In other embodiments, when the electronic device includes multiple GPUs, some of the multiple GPUs can be used to execute graphics processing tasks in a scheduling queue with a higher priority. Therefore, after the graphics processing tasks corresponding to each window are divided into corresponding scheduling queues, the electronic device can use these GPUs to execute the graphics processing tasks in the scheduling queue with a higher priority, so that the graphics processing tasks corresponding to the windows with higher user attention can be executed by the GPU in a timely manner, which can reduce the waiting delay of the windows with higher user attention, improve the frame rate of the windows with higher user attention, and improve the picture smoothness of the windows with higher user attention, thereby improving the user's viewing experience of the windows with higher user attention.

[0306] In the embodiment of the present application, the window running in the electronic device may be any window in the electronic device that needs to perform graphics rendering. For example, it may include a window that uses a system common rendering mechanism (e.g., it may also be called a unified rendering mechanism), or it may include a window that does not use a system common rendering mechanism (i.e., a window that uses its own independent rendering mechanism for graphics rendering).

[0307] In one example, for each window using the system common rendering mechanism, when a rendering service (RS) in an electronic device renders each window, the RS can determine the priority of the graphics processing task corresponding to each window according to the priority determination method described above, and can render each window according to the priority of the graphics processing task corresponding to each window. For example, a high-priority graphics processing task can be placed in a high-priority rendering queue of the RS, and a low-priority graphics processing task can be placed in a low-priority rendering queue of the RS.

[0308] In one implementation, a high-priority graphics processing task may be rendered by a main thread, and a low-priority graphics processing task may be rendered by a child thread.

[0309] It should be noted that the number of rendering queues in RS can be determined according to the actual scenario. Exemplarily, the number of rendering queues in 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, RS can include two rendering queues. For example, when four scheduling queues are set in the electronic device, RS can include four rendering queues. For example, when N scheduling queues are set in the electronic device, RS can include N rendering queues, N is a positive integer, and so on.

[0310] Therefore, when all windows running on the electronic device are windows that use the system's common rendering mechanism, when the GPU is called to execute the graphics processing tasks corresponding to each window, the graphics processing tasks corresponding to each window can be divided into scheduling queues of different priorities of the GPU according to the priority of the rendering queue in the RS, so that the GPU can execute the graphics processing tasks according to the priority of each scheduling queue. For example, the graphics processing tasks in the high-priority rendering queue can be placed in the high-priority scheduling queue of the GPU, and the graphics processing tasks in the low-priority rendering queue can be placed in the low-priority scheduling queue of the GPU.

[0311] Exemplarily, when the windows running on the electronic device include windows that use the system common rendering mechanism and windows that do not use the system common rendering mechanism (e.g., self-drawing windows), the electronic device can also determine the priority of the graphics processing tasks corresponding to the respective drawing windows according to the priority determination method described above. Subsequently, the electronic device can perform comprehensive scheduling according to the priority of the graphics processing tasks to which the RS has assigned priorities and the priority of the graphics processing tasks corresponding to the respective drawing windows, so as to divide the graphics processing tasks corresponding to the respective windows into scheduling queues of different priorities of the GPU.

[0312] For example, when a first scheduling queue and a second scheduling queue are set in an electronic device, and the priority of the first scheduling queue is higher than that of the second scheduling queue, the graphics processing tasks in the high-priority rendering queue in RS and the graphics processing tasks corresponding to the high-priority self-drawing window can be divided into the first scheduling queue, and the graphics processing tasks in the low-priority rendering queue in RS and the graphics processing tasks corresponding to the low-priority self-drawing window can be divided into the second scheduling queue.

[0313] For example, see Fig.10 , Fig.10 An example of task scheduling provided by an embodiment of the present application is shown Figure 4 . This example takes the example that the windows running on the electronic device include four windows using the system common rendering mechanism (for example, they can be called unified drawing window B1, unified drawing window B2, unified drawing window B3 and unified drawing window B4) and two self-drawing windows (for example, they can be called self-drawing window A1 and self-drawing window A2). In addition, this example also includes a GPU including a first scheduling queue and a second scheduling queue, and the priority of the first scheduling queue can be higher than the priority of the second scheduling queue, and RS includes a high-priority rendering queue ( Fig. 9 ) and a low priority rendering queue ( Fig.10 In the figure, a low rendering queue is shown as an example for illustrative explanation.

[0314] Assume that, based on the first area corresponding to each unified drawing window, RS determines that the priority of the graphics processing task corresponding to the unified drawing window B1 is a high priority, and determines that 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 priorities. Therefore, RS can put the graphics processing task corresponding to the unified drawing window B1 into a high-priority rendering queue, 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 graphics processing task corresponding to the unified drawing window B4 into a low-priority rendering queue.

[0315] Assume that the electronic device determines that the priority of the graphics processing task corresponding to the self-drawing window A1 is high priority and determines that the priority of the graphics processing task corresponding to the self-drawing window A2 is low priority according to the first areas corresponding to the respective drawing windows.

[0316] Therefore, if Fig.10 As shown, the electronic device can put the graphics processing tasks in the high-priority rendering queue of RS (i.e., the graphics processing tasks corresponding to the unified drawing window B1) and the graphics processing tasks corresponding to the high-priority self-drawing window A1 into the first scheduling queue of the GPU, and can put the graphics processing tasks in the low-priority rendering queue of RS (i.e., the graphics processing tasks corresponding to the unified drawing window B2, the graphics processing tasks corresponding to the unified drawing window B3, and the graphics processing tasks corresponding to the unified drawing window B4) and the graphics processing tasks 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 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 prioritize the scheduling of each graphics processing task in the first scheduling queue to core 1 and core 2 for execution.

[0317] Based on the above description, another task scheduling method provided by the embodiment of the present application is exemplarily described below. Fig.11 , Fig.11 FIG. 2 shows a schematic flow chart of another task scheduling method provided by 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. Fig.11 As shown, the method may include:

[0318] S1101: The electronic device runs a first window and a second window.

[0319] Exemplarily, the first window and the second window may be windows of the same application, or may be windows of different applications.

[0320] Exemplarily, the first window may be a window running in the foreground, or may be a window running in the background. Similarly, the second window may be a window running in the foreground, or may be a window running in the background.

[0321] S1102. 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; the first scheduling queue includes the graphics processing tasks corresponding to the first window, and the second scheduling queue includes the 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.

[0322] In an embodiment 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 graphics processing task corresponding to the first window and the priority of the graphics processing task corresponding to the second window, and can divide the graphics processing task corresponding to the first window into the first scheduling queue and divide the graphics processing task corresponding to the second window into the second scheduling queue according to the priority of the graphics processing task corresponding to the first window and the priority of the graphics processing task corresponding to the second window. In dividing the graphics processing tasks into the first scheduling queue and the second scheduling queue, the electronic device can schedule the graphics processing tasks in the first scheduling queue (e.g., the graphics processing tasks corresponding to the first window) and the graphics processing tasks in the second scheduling queue (e.g., the graphics processing tasks corresponding to the second window) to the GPU for execution according to the priority of the first scheduling queue and the priority of the second scheduling queue.

[0323] It should be noted that the electronic device determines the priority of the graphics processing task corresponding to the first window and the priority of the graphics processing task corresponding to the second window for specific content, which can refer to the relevant content in the aforementioned "the process of the electronic device determining the priority of the graphics processing task corresponding to each window will be described in detail below". The electronic device divides the graphics processing task corresponding to the first window into the first scheduling queue and the graphics processing task corresponding to the second window into the second scheduling queue for specific content, which can refer to the aforementioned "the process of the electronic device dividing the graphics processing tasks corresponding to each window into the corresponding scheduling queue according to the priority of the graphics processing task corresponding to each window" for specific content. 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 for specific content, which can refer to the aforementioned "the process of the electronic device scheduling the graphics processing tasks in each scheduling queue to the GPU for execution according to the priority of each scheduling queue" for specific content, which will not be repeated here for the sake of simplicity.

[0324] In an embodiment of the present application, when the electronic device runs a first window and a second window at the same time, the electronic device can determine the priority of the graphics processing task corresponding to the first window and the priority of the graphics processing task corresponding to the second window, and can put the high-priority graphics processing task into the high-priority first scheduling queue, and put the low-priority graphics processing task into the low-priority second scheduling queue, so that the GPU can give priority to executing the graphics processing tasks in the high-priority first scheduling queue, that is, the graphics processing tasks corresponding to the windows that the user pays more attention to can be given priority execution, and the occupancy ratio of the GPU by high-priority graphics processing tasks can be ensured, so as to improve the frame rate of the picture of the window that the user pays more attention to, improve the smoothness of the picture of the window that the user pays more attention to, and enhance the user experience.

[0325] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal 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 embodiment, the embodiment of the present application further provides a task scheduling device, and each module of the device can correspond to each step of implementing the task scheduling method.

[0327] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0328] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0329] The present application also provides an electronic device, the electronic device comprising 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, wherein when the processor executes the computer program, the electronic device implements the steps in any of the above-mentioned method embodiments. Exemplarily, the structure of the electronic device can be as follows: Figure 2 shown.

[0330] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a computer, the computer implements the steps in any of the above method embodiments.

[0331] An embodiment of the present application provides a computer program product. When the computer program product is executed on an electronic device, the electronic device implements the steps in any of the above method embodiments.

[0332] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include at least: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.

[0333] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0334] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0335] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0336] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0337] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A task scheduling method, characterized in that: Applied to an electronic device, the electronic device includes a graphics processor GPU, and the method includes: The electronic device runs a first window and a second window; 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; the first scheduling queue includes the graphics processing tasks corresponding to the first window, the second scheduling queue includes the 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 according to claim 1, characterized in that The priority of the graphics processing task 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; Among them, the area of ​​the first area corresponding to the window includes the area of ​​the area 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 area 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.

3. The method according to claim 1 or 2, characterized in that: The area of ​​the first region corresponding to the first window is larger than the area of ​​the first region corresponding to the second window, or the first proportion corresponding to the first window is larger than the first proportion corresponding to the second window, or the area of ​​the first window is larger than the area of ​​the second window, or the second proportion corresponding to the first window is larger than the second proportion corresponding to the second window, or the offset distance corresponding to the first window is smaller than the offset distance corresponding to the second window, or the offset distance ratio corresponding to the first window is smaller 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 dispatches the graphics processing tasks in the first scheduling queue and the graphics processing tasks in the second scheduling queue to the GPU for execution, including: 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, a priority of the first scheduling queue, and a priority of the second scheduling queue; The preset scheduling ratio is the ratio of the time for executing the graphics processing tasks in the first scheduling queue to the time for executing the graphics processing tasks in the second scheduling queue; or, the preset scheduling ratio is the ratio of scheduling the graphics processing tasks in the first scheduling queue to scheduling the graphics processing tasks in the second scheduling queue.

5. The method according to claim 4, characterized in that 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; The first 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 first preset scheduling ratio; 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 second preset scheduling ratio.

6. The method according to claim 5, characterized in that The first preset scheduling ratio is the same as the second preset scheduling ratio.

7. The method according to claim 4, characterized in that The GPU includes a first processing core and a second processing core; The first processing core executes the graphics processing tasks in the first scheduling queue; 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.

8. The method according to any one of claims 4 to 7, characterized in that The preset scheduling ratio is preset, or is 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 also runs a third window, and the method further includes: When the load of the GPU is less than a second preset load, the graphics processing task corresponding to the third window is assigned to 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.

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: When the processor executes the computer program, the electronic device implements the task scheduling method according to any one of claims 1 to 12.

14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a computer, the computer is enabled to implement the task scheduling method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Resource scheduling method and device and electronic equipment

    CN111400022A

  • Data processing method and electronic equipment

    CN116048742A

  • GPU resource scheduling method

    CN116450331A

  • System for controlling display of multiwindow

    JP1990118720A

Cited By

  • Task scheduling method, electronic device and computer-readable storage medium

    WO2026066342A1