Task scheduling method and related apparatus
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-01-10
- Publication Date
- 2026-07-14
Smart Images

Figure CN122397003A_ABST
Abstract
Description
Task scheduling method and related device Technical Field
[0001] The present application relates to the field of terminals, and in particular to a task scheduling method and related devices. Background Art
[0002] Currently, application developers can set their own GPU processing priority. However, some non-desktop applications may have the same or even higher GPU processing priority than desktop applications, causing the GPU to be unable to respond to desktop application tasks in a timely manner, affecting desktop display smoothness and the user experience.
[0003] Summary of the Invention
[0004] The present application provides a task scheduling method and related devices.
[0005] In a first aspect, the present application provides a task scheduling method, applied to an electronic device, the method comprising: receiving a first operation from a user; in response to the first operation, starting a first application; while running the first application, executing a first GPU task created by the first application; receiving a second operation from the user; in response to the second operation, exiting the first application to a desktop application; wherein, in the process of exiting the first application to the desktop application, terminating the execution of the first GPU task and executing the second GPU task created by the desktop application.
[0006] Applications other than desktop applications installed on electronic devices (such as mobile phones and tablets) can be called non-desktop applications. One application among non-desktop applications can be called a first application, such as a video editing application, a video playback application, an instant messaging application, a game application, etc. In implementing the method provided in the first aspect, in the process of exiting from the first application to the desktop, the electronic device can suspend the execution of the GPU task of the first application (i.e., the first GPU task) and give priority to the execution of the GPU task created by the desktop application (i.e., the second GPU task), so as to reduce the response time of the GPU task of the desktop application and avoid desktop display freezes.
[0007] In some embodiments, the second GPU task is a rendering task.
[0008] GPU tasks include rendering, compositing, and image processing. Blockages in rendering and compositing tasks directly lead to screen display lag. The electronic device can suspend execution of the GPU task for the first application and instead execute the rendering task for the desktop application. This effectively avoids desktop display lag and limits desktop applications from preempting GPU resources, minimizing the impact of preemption on other applications.
[0009] In some embodiments, the priority of the first GPU task is the second priority, and terminating execution of the first GPU task and executing the second GPU task created by the desktop application includes: updating the priority of the second GPU task to the first priority, where the first priority is higher than the second priority; and terminating execution of the first GPU task and executing the second GPU task based on the priorities of the second GPU task and the first GPU task.
[0010] Before the update, the priority of the second GPU task is the third priority, which is equal to or lower than the second priority.
[0011] The electronic device can switch between executing GPU tasks for different applications by using GPU processing priority. Specifically, when the GPU processing priority of a desktop application is not higher than that of a first application, the electronic device can increase the GPU processing priority of the desktop application to terminate the GPU task of the first application and prioritize the execution of the desktop application's GPU task, thus avoiding desktop display lag.
[0012] In some embodiments, the electronic device is provided with a first queue and a second queue, the first queue corresponds to a first priority, and the second queue corresponds to a second priority. Updating the priority of the second GPU task created by the desktop application to the first priority includes: adding the second GPU task created by the desktop application to the first queue.
[0013] The electronic device can directly add the GPU tasks of the desktop application to the high-priority queue to increase the GPU processing priority of the desktop application, so that the GPU tasks of the desktop application are processed first. The electronic device does not need to reset the GPU processing priority of the desktop application. In this way, after the process of exiting the first application to the desktop application is completed, that is, after returning to the desktop application, the electronic device does not need to reset the GPU processing priority of the desktop application to restore it to the initial setting.
[0014] In some embodiments, the first priority level is adjacent to the second priority level.
[0015] Preferably, when increasing the GPU processing priority of the desktop application, the electronic device may only increase the priority of the desktop application by one level. In other embodiments, the electronic device may directly increase the priority of the desktop application to the highest priority.
[0016] In some embodiments, after executing the second GPU task created by the desktop application, the method further includes: continuing to execute the first GPU task.
[0017] In some embodiments, after executing the second GPU task created by the desktop application, that is, after successfully exiting the first application and returning to the desktop application, the electronic device may no longer execute the remaining first GPU tasks of the first application to save power consumption.
[0018] In some embodiments, the first application is a video editing application.
[0019] In some embodiments, the first GPU task is an image processing task.
[0020] In this way, suspending the execution of the first GPU task will not affect the user's experience.
[0021] In a second aspect, the present application provides a task scheduling method, which is applied to an electronic device, and the method includes: running a desktop application; while running the desktop application, executing a first GPU task created by a first application; receiving a third operation from a user; in response to the third operation, exiting the desktop application and running a second application; wherein, in the process of exiting the desktop application and running the second application, terminating the execution of the first GPU task and executing the second GPU task created by the desktop application, the second application is the same as or different from the first application.
[0022] When implementing the method provided in the second aspect, the electronic device can process the GPU task of the first application while running a desktop application. A non-desktop application that is the same as or different from the first application can be referred to as a second application. When entering the second application from the desktop application, the electronic device can suspend execution of the first GPU task and prioritize execution of the second GPU task created by the desktop application, thereby reducing the response time of the desktop application's GPU task and avoiding desktop display lag.
[0023] In some embodiments, the second GPU task is a rendering task.
[0024] In some embodiments, the priority of the first GPU task is the second priority, and terminating execution of the first GPU task and executing the second GPU task created by the desktop application includes: updating the priority of the second GPU task to the first priority, where the first priority is higher than the second priority; and terminating execution of the first GPU task and executing the second GPU task based on the priorities of the second GPU task and the first GPU task.
[0025] Before the update, the priority of the second GPU task is the third priority, which is equal to or lower than the second priority.
[0026] In some embodiments, the electronic device is provided with a first queue and a second queue, the first queue corresponds to a first priority, and the second queue corresponds to a second priority. Updating the priority of the second GPU task created by the desktop application to the first priority includes: adding the second GPU task created by the desktop application to the first queue.
[0027] In some embodiments, the first priority level is adjacent to the second priority level.
[0028] In some embodiments, after executing the second GPU task created by the desktop application, the method further includes: continuing to execute the first GPU task.
[0029] In some embodiments, the first application is a video editing application.
[0030] In some embodiments, the first GPU task is an image processing task.
[0031] It is understandable that some embodiments of the second aspect correspond to some embodiments of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding embodiments of the first aspect, and will not be repeated here.
[0032] In a third aspect, the present application provides a task scheduling method, applied to an electronic device, the method comprising: displaying a first desktop; executing a first GPU task created by a first application during displaying the first desktop; receiving a fourth operation from a user; in response to the fourth operation, exiting the first desktop and displaying a second desktop; wherein, during exiting the first desktop and displaying the second desktop, terminating execution of the first GPU task and executing a second GPU task created by a desktop application, the first application being different from the desktop application.
[0033] By implementing the method provided in the third aspect, when running a desktop application, the electronic device can process the GPU task of the first application. During the process of switching desktops, the electronic device can suspend execution of the first GPU task and prioritize execution of the second GPU task created by the desktop application, thereby reducing the response time of the desktop application's GPU task and avoiding desktop display lag.
[0034] In some embodiments, the second GPU task is a rendering task.
[0035] In some embodiments, the priority of the first GPU task is the second priority, and terminating execution of the first GPU task and executing the second GPU task created by the desktop application includes: updating the priority of the second GPU task to the first priority, where the first priority is higher than the second priority; and terminating execution of the first GPU task and executing the second GPU task based on the priorities of the second GPU task and the first GPU task.
[0036] Before the update, the priority of the second GPU task is the third priority, which is equal to or lower than the second priority.
[0037] In some embodiments, the electronic device is provided with a first queue and a second queue, the first queue corresponds to a first priority, and the second queue corresponds to a second priority. Updating the priority of the second GPU task created by the desktop application to the first priority includes: adding the second GPU task created by the desktop application to the first queue.
[0038] In some embodiments, the first priority level is adjacent to the second priority level.
[0039] In some embodiments, after executing the second GPU task created by the desktop application, the method further includes: continuing to execute the first GPU task.
[0040] In some embodiments, the first application is a video editing application.
[0041] In some embodiments, the first GPU task is an image processing task.
[0042] It is understandable that some embodiments of the third aspect correspond to some embodiments of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding embodiments of the first aspect, and will not be repeated here.
[0043] In a fourth aspect, the present application provides a task scheduling method, applied to an electronic device, the method comprising: displaying a third application in a first area of a screen of the electronic device, and displaying a fourth application in a second area of the screen, where the fourth application is different from the third application; in the process of displaying the third application in the first area and displaying the fourth application in the second area: at a first moment, executing a third GPU task created by the third application; at a second moment, suspending execution of the third GPU task and executing a fourth GPU task created by the fourth application, the second moment being after the first moment.
[0044] By implementing the method provided in the fourth aspect, in a split-screen scenario, the electronic device can suspend the execution of the GPU task of one application (for example, the third GPU task of the third application) and give priority to the execution of the GPU task of another application (for example, the fourth GPU task of the fourth application).
[0045] In some embodiments, the third application is a desktop application. In this case, the fourth application can be any non-desktop application other than the desktop application.
[0046] In some embodiments, the fourth application is a video player application or a game application. In this case, the third application can be a desktop application or a non-desktop application other than the video player application or the game application.
[0047] In some embodiments, before the second moment, the method further includes: receiving a fifth operation applied to the second area, and after the fifth operation, no other touch operations applied outside the second area before the second moment. This means that in some embodiments, the fourth application may also be the application targeted by the most recent user operation, i.e., the focus application. In this case, the third application may be a desktop application or a non-desktop application other than a video playback application or a game application.
[0048] In this way, electronic devices can give priority to processing GPU tasks for strong real-time applications or focus applications such as video playback applications and game applications, avoiding display freezes in the applications that users are more concerned about, and avoiding affecting the user experience.
[0049] In some embodiments, the fourth GPU task is a rendering task.
[0050] In some embodiments, the priority of the third GPU task is the second priority, suspending execution of the third GPU task and executing the fourth GPU task created by the fourth application includes: updating the priority of the fourth GPU task to the first priority, where the first priority is higher than the second priority; and suspending execution of the third GPU task and executing the fourth GPU task based on the priorities of the fourth GPU task and the third GPU task.
[0051] Before the update, the priority of the fourth GPU task is the third priority, which is equal to or lower than the second priority.
[0052] In some embodiments, the electronic device is provided with a first queue and a second queue, the first queue corresponds to a first priority, and the second queue corresponds to a second priority. Updating the priority of the fourth GPU task created by the desktop application to the first priority includes: adding the fourth GPU task created by the desktop application to the first queue.
[0053] In some embodiments, the first priority level is adjacent to the second priority level.
[0054] In some embodiments, after executing the fourth GPU task created by the desktop application, the method further includes: continuing to execute the third GPU task.
[0055] It is understandable that some embodiments of the fourth aspect correspond to some embodiments of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding embodiments of the first aspect, and will not be repeated here.
[0056] In a fifth aspect, the present application provides a task scheduling method, applied to an electronic device, the method including: receiving a first GPU task; when the first GPU task is a rendering task, obtaining a system scene; when the system scene is a desktop animation scene, and the first GPU task is created for a desktop application, increasing the GPU processing priority of the first GPU task; wherein, the desktop animation scene includes one or more of the following: exiting the first application to the desktop application, entering the first application from the desktop application, and updating the desktop application content, and the first application is an application installed on the electronic device.
[0057] By implementing the method provided in the fifth aspect, the electronic device can increase the GPU processing priority of the GPU tasks of the desktop application in the desktop animation scene, reduce the response time of the GPU tasks of the desktop application, and avoid desktop display freezes.
[0058] In some embodiments, the method further includes: when the system scenario is a desktop and application split-screen scenario, and the first GPU task is created for a non-desktop application in the desktop and application split-screen scenario, increasing the GPU processing priority of the first GPU task.
[0059] By implementing the above method, in a split-screen scenario of desktop and application, the electronic device can suspend the execution of the GPU task of the desktop application and give priority to the execution of the GPU task of another non-desktop application in the split-screen scenario, so as to avoid display lag problems in non-desktop applications that users are more concerned about, thereby avoiding affecting the user experience.
[0060] In some embodiments, the method also includes: when the system scenario is a multi-application split-screen scenario, and the first GPU task is created for a strong real-time application or a focus application in the multi-application split-screen scenario, increasing the GPU processing priority of the first GPU task, and the focus application refers to the application targeted by the most recent user operation.
[0061] By implementing the above method, in a multi-application split-screen scenario, the electronic device can give priority to processing GPU tasks of strong real-time applications or focus applications such as video playback applications and game applications, avoiding display freezes in the applications that users are more concerned about, and avoiding affecting the user experience.
[0062] In some embodiments, the method further includes: when the first GPU task is an image processing task, lowering the GPU processing priority of the first GPU task.
[0063] By implementing the above method, the electronic device can also lower the priority of image processing tasks, thereby indirectly increasing the priority of rendering tasks and synthesis tasks, and avoiding screen display freezes.
[0064] In some embodiments, the method further includes: when the first GPU task is an image processing task and the second application that created the first GPU task is in a whitelist that allows priority reduction, reducing the GPU processing priority of the first GPU task.
[0065] By implementing the above method, the electronic device can limit the scope of GPU tasks whose GPU processing priority is reduced through the whitelist of tasks that are allowed to reduce the priority, thereby avoiding excessive occupation of GPU resources and affecting the normal operation of other applications.
[0066] In some embodiments, desktop content updates include: desktop content updates based on switching desktops by a user sliding operation, and desktop content updates triggered by components within the desktop updating displayed content based on preset rules.
[0067] Desktop animation scenarios also include: desktop content updates based on user swipes to switch desktops, and desktop content updates triggered by desktop components updating their displayed content based on preset rules. This way, when a user swipes to switch desktops or when content on certain desktop elements is updated, the electronic device can also increase the GPU processing priority of the desktop application's GPU tasks to avoid desktop display lag.
[0068] In a sixth aspect, the present application provides an electronic device comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer programs. When the one or more processors execute the computer programs, the electronic device performs the method described in the first aspect and any possible implementation of the first aspect, or the electronic device performs the method described in the second aspect and any possible implementation of the second aspect, or the electronic device performs the method described in the fourth aspect and any possible implementation of the fourth aspect, or the electronic device performs the method described in the fifth aspect and any possible implementation of the fifth aspect.
[0069] In the seventh aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect, or enable the electronic device to execute the method described in the second aspect and any possible implementation of the second aspect, or enable the electronic device to execute the method described in the fourth aspect and any possible implementation of the fourth aspect, or enable the electronic device to execute the method described in the fifth aspect and any possible implementation of the fifth aspect.
[0070] In an eighth aspect, the present application provides a computer-readable storage medium comprising a computer program. When the computer program is run on an electronic device, the electronic device is caused to execute the method described in the first aspect and any possible implementation of the first aspect, or the electronic device is caused to execute the method described in the second aspect and any possible implementation of the second aspect, or the electronic device is caused to execute the method described in the fourth aspect and any possible implementation of the fourth aspect, or the electronic device is caused to execute the method described in the fifth aspect and any possible implementation of the fifth aspect.
[0071] In the ninth aspect, the present application provides a computer program product comprising instructions. When the above-mentioned computer program product is run on an electronic device, the above-mentioned electronic device executes the method described in the first aspect and any possible implementation of the first aspect, or the electronic device executes the method described in the second aspect and any possible implementation of the second aspect, or the electronic device executes the method described in the fourth aspect and any possible implementation of the fourth aspect, or the electronic device executes the method described in the fifth aspect and any possible implementation of the fifth aspect.
[0072] It is understandable that the electronic device provided in the sixth aspect, the chip system provided in the seventh aspect, the computer storage medium provided in the eighth aspect, and the computer program product provided in the ninth aspect are all used to perform the methods provided in this application. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] FIG1 is a system architecture diagram of an electronic device 100 provided in an embodiment of the present application;
[0074] FIG2 is a schematic diagram of a GPU task scheduling method provided by an embodiment of the present application;
[0075] Figures 3A-3C are user interfaces for exiting from a non-desktop application and returning to the desktop, provided by an embodiment of the present application;
[0076] FIG4 is a flowchart of a task scheduling method provided in an embodiment of the present application;
[0077] 5A-5E are schematic diagrams of a user interface for returning to the desktop provided in an embodiment of the present application;
[0078] 6A-6E are schematic diagrams of a user interface for starting an application provided in an embodiment of the present application;
[0079] 7A-7E are schematic diagrams of a user interface for switching desktops provided in an embodiment of the present application;
[0080] FIG8 is a schematic diagram of a split screen provided in an embodiment of the present application;
[0081] FIG9 is a schematic diagram of another split screen provided in an embodiment of the present application;
[0082] FIG10 is a schematic diagram of a GPU task scheduling provided by an embodiment of the present application;
[0083] FIG11 is a schematic diagram of another GPU task scheduling embodiment provided by the present application;
[0084] FIG12 is a flow chart provided in an embodiment of the present application;
[0085] FIG13 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0086] The electronic device 100 is equipped with a graphics processing unit (GPU), which can provide the electronic device 100 with graphics computing capabilities, such as rendering and compositing.
[0087] The GPU has multiple task queues. Each task queue corresponds to a GPU processing priority. After receiving multiple tasks, the GPU prioritizes tasks in the higher-priority queue. When a task queue is overloaded with tasks, tasks further down the queue and in the middle of the lower-priority queue are more likely to time out, causing the corresponding application (hereinafter referred to as the application) to experience lag.
[0088] The electronic device 100 has Android desktop applications. In addition to desktop applications, the electronic device 100 also has multiple other applications installed. Applications other than desktop applications are referred to as non-desktop applications. Non-desktop applications can be provided by the manufacturer of the electronic device 100 or by other software developers, such as video playback applications, video editing applications, and game applications downloaded from an application store.
[0089] Currently, app developers can set their own GPU processing priority. In the Android system architecture, GPU processing priorities include 1 (also known as REAL TIME), 4 (also known as HIGH), 8 (also known as MEDIUM), and 12 (also known as LOW), with priority 1 being the highest and priority 12 being the lowest. For example, the developer of video playback app X (a non-desktop app) can set its GPU processing priority to 8.
[0090] At this time, the GPU processing priority of some non-desktop applications will be equal to or even higher than that of desktop applications (for example, if the priority of video playback application X is 8, the priority of the desktop application is also 8; if the priority of video playback application X is 4, the priority of the desktop application is 8). As a result, the GPU cannot respond to the tasks of the desktop application in a timely manner, affecting the smoothness of desktop display and the user experience.
[0091] In view of this, an embodiment of the present application provides a task scheduling method that can be applied to an electronic device 100 including a GPU.
[0092] By implementing this method, the electronic device 100 can identify the task type, application, and current system scenario of a GPU task. When the task type of a GPU task is rendering, the application to which it belongs is a desktop application, and it is in a desktop animation scene, the electronic device 100 can increase the GPU processing priority of the GPU task; when the task type of a GPU task is rendering, and the application to which it belongs is a non-desktop application in a desktop and application split-screen scene, the electronic device 100 can increase the GPU processing priority of the GPU task; when the task type of a GPU task is rendering, and the application to which it belongs is a strong real-time application or a focus application in a multi-application split-screen scene, the electronic device 100 can increase the GPU processing priority of the GPU task.
[0093] In this way, the electronic device 100 can flexibly adjust the GPU processing priority of each GPU task at the system level according to the GPU task type, the scenario, etc., and no longer solely determines the GPU processing priority of each GPU task based on the GPU processing priority preset by the application, so as to avoid freeze problems such as desktop display freeze and improve user experience.
[0094] FIG1 is a system architecture diagram of an electronic device 100 provided in an embodiment of the present application.
[0095] The software system of the electronic device 100 may adopt a layered architecture. In the embodiment of the present application, preferably, the electronic device 100 may specifically adopt an Android system architecture in the layered architecture.
[0096] A layered architecture divides software into several layers. Layers communicate with each other through software interfaces. The Android system consists of four layers: the application layer (referred to as the application layer), the application framework layer (referred to as the framework layer), the system library layer, and the kernel layer. Figure 1 shows only the application layer and the kernel layer.
[0097] The application layer includes multiple applications. As shown in Figure 1, the application layer can include desktop applications and non-desktop applications: Application A, Application B, etc. This embodiment of the application does not limit the specific type of non-desktop applications. Non-desktop applications can include video playback applications, video editing applications, instant messaging applications, or game applications.
[0098] The kernel layer is the layer between hardware and software. As shown in Figure 1, the kernel layer includes at least a GPU driver and a display driver. The GPU driver controls the GPU to process image data. The image data processed by the GPU is then sent to the display. The display driver controls the display to display the image data.
[0099] Any application in the application layer can send tasks to the GPU through the GPU driver. Electronic device 100 can run multiple applications simultaneously. In this case, the GPU driver can receive multiple tasks from multiple applications. The GPU driver can sort these tasks based on their arrival time and the GPU processing priority of the corresponding applications. The GPU responds to each task in sequence according to this order.
[0100] Exemplarily, the GPU driver may be set with four priorities, denoted as S1, S2, S3, and S4. Among them, S1 (highest priority) > S2 > S3 > S4 (lowest priority). S1, S2, S3, and S4 correspond one-to-one to the priorities 1, 4, 8, and 12 listed above. Correspondingly, the GPU driver is set with four task queues, denoted as Q1, Q2, Q3, and Q4. Among them, Q1 corresponds to S1, which is used to cache tasks with a priority of S1; Q2 corresponds to S2, which is used to cache tasks with a priority of S2; Q3 corresponds to S3, which is used to cache tasks with a priority of S3; Q4 corresponds to S4, which is used to cache tasks with a priority of S4. In one embodiment, the GPU processing priority of the desktop application can be set to S3, and the GPU processing priority of application A can also be set to S3. At this time, the GPU processing priority of the non-desktop application: application A is the same as that of the desktop application.
[0101] As shown in Figure 2, the GPU driver can sequentially receive four tasks from the application layer: B1, B2, B3, and B4. B1, B2, and B3 are issued by application A, while B4 is issued by a desktop application. Based on application A's GPU processing priority S3, the GPU driver can add B1 to queue Q3 after receiving B1; add B2 to queue Q3 after receiving B2; and add B3 to queue Q3 after receiving B3. Based on the desktop application's GPU processing priority S3, the GPU driver can add B4 to queue Q3 after receiving B4.
[0102] After the tasks in the high-priority queues (e.g., Q1 and Q2) are processed, the GPU can start processing the tasks in Q3. Thus, the GPU can process B1, B2, B3, and B4 in sequence.
[0103] Figures 3A-3C are a set of user interfaces for exiting application A and returning to the desktop, provided in an embodiment of the present application.
[0104] For example, Application A can be a video editing application, such as Jianying. Figure 3A shows an editing interface 31 of a video editing application provided in an embodiment of the present application. Users can edit videos through editing interface 31. During the above process, Application A can issue GPU tasks to the GPU. GPU tasks include at least three types: rendering, compositing, and image processing. The GPU tasks issued by Application A to the GPU include one or more of the above.
[0105] 3B , while displaying the editing interface 31 , the electronic device 100 may receive a touch operation of sliding upward from the bottom edge of the screen, referred to as an up-swipe operation. Referring to FIG3C , in response to the above operation, the electronic device 100 may display a desktop 32 provided by the desktop application.
[0106] Preferably, in the process of switching from the editing interface 31 to the desktop 32, application A can be switched to the background operation mode; the desktop application can be switched to the foreground operation mode.
[0107] After Application A switches to background mode, it can continue to send tasks to the GPU. These tasks are mostly image processing tasks, such as using filters or beauty algorithms to change the video display effect.
[0108] At this point, as shown in Figure 2, before the desktop application sends tasks to the GPU, the GPU continues to receive tasks from Application A. Later, the GPU will also receive tasks from Application A. Furthermore, because Application A and the desktop application have the same GPU processing priority, the GPU will respond to Application A's tasks first after receiving them. This increases the response time of the desktop application's tasks, triggering desktop display lag and impacting the user experience.
[0109] In view of this, an embodiment of the present application provides a task scheduling method. FIG4 is a flow chart of a task scheduling method provided by an embodiment of the present application.
[0110] S401: Determine the type of GPU task X.
[0111] At any moment, any application in the application layer can send a task to the CPU, denoted as Task X (the first GPU task). After the GPU driver receives Task X, it determines its type: rendering, compositing, or image processing. The GPU driver can determine Task X's type by its thread name.
[0112] S402: When task X is a rendering task, obtain the current system scene.
[0113] A state of an operating system during operation can be referred to as a system scenario. In the embodiments of the present application, system scenarios include at least a desktop animation scenario, a desktop and application split-screen scenario, and a multi-application split-screen scenario. The GPU driver can determine the current system scenario through a system identifier. Subsequent embodiments will specifically describe the above desktop animation scenario, desktop and application split-screen scenario, and multi-application split-screen scenario, which will not be expanded here.
[0114] S403: When the desktop animation scene is in progress and the application to which Task X belongs is a desktop application, increase the GPU processing priority of Task X. The application to which Task X belongs is the application that issued Task X. The GPU driver can determine the application to which Task X belongs by the process name of Task X.
[0115] S404: When the desktop and application are split-screen, and the application to which task X belongs is a non-desktop application in the scenario, increase the GPU processing priority of task X.
[0116] S405: When the multi-application split-screen scenario is in progress and the application to which Task X belongs is a hard real-time application, increase the GPU processing priority of Task X. In this scenario, the application occupying the screen display in the multi-application split-screen scenario is referred to as the foreground application. Foreground applications that frequently render (rendering frequency per unit time exceeding a preset value) are referred to as hard real-time applications, such as gaming applications and video playback applications.
[0117] S406: In a multi-application split-screen scenario, when the application to which task X belongs is the focus application, increase the GPU processing priority of task X. The application on which the user's most recent touch operation (fifth operation) rests among the foreground applications may be called the focus application.
[0118] S407: When task X is a synthesis task, increase the GPU processing priority of task X.
[0119] S408 : When task X is an image processing task, maintain or reduce the GPU processing priority of task X.
[0120] In one embodiment, the GPU driver may directly set the priority of Task X to the highest level to improve the GPU processing priority of Task X. In another embodiment, the GPU driver may also increase the priority of Task X by one level to improve the GPU processing priority of Task X.
[0121] Preferably, when increasing the GPU processing priority of task X as shown in S407, the GPU driver can directly set the priority of task X to the highest level, such as S1. When increasing the GPU processing priority of task X as shown in S403-S406, the GPU driver can also increase the priority of task X by one level, such as from S3 to S2.
[0122] In one embodiment, when Task X is an image processing task, the GPU driver maintains the GPU processing priority of Task X. The time it takes for the GPU to process a task is called the GPU response time. In another embodiment, the electronic device 100 may include an application whitelist to record applications whose maximum GPU response time exceeds a preset value, i.e., applications that do not require a fast GPU response. When Task X is an image processing task and the application to which Task X belongs is included in the application whitelist, the GPU driver may lower the GPU processing priority of Task X; otherwise, the GPU driver may maintain the GPU processing priority of Task X.
[0123] By implementing the above method, the electronic device 100 can selectively increase the GPU processing priority of the desktop rendering task, which can effectively avoid the desktop display jamming problem, while occupying as few GPU resources as possible, avoiding affecting the normal operation of other applications, and improving the user experience.
[0124] 5A-5E are schematic diagrams of a user interface for returning to the desktop provided in an embodiment of the present application.
[0125] The electronic device 100 may receive a user operation (i.e., a first operation) acting on the shortcut icon of application A. In response to the above operation, the electronic device 100 may start and run application A (first application). During the running of application A, the electronic device 100 may receive a preset specific operation. In response to the above operation, the electronic device 100 may exit application A that is currently occupying the screen display and switch to the desktop application to display the desktop. Referring to Figure 5A, application A may be a video editing application. When running the video editing application, the electronic device 100 may occupy the screen to display the editing interface 31. During the display of the editing interface 31, the electronic device 100 may receive an upward sliding operation (second operation). In response to the above upward sliding operation, the electronic device 100 may exit application A, switch to the desktop application, and display the desktop 32.
[0126] Among them, before displaying the desktop, the electronic device 100 will first display a set of images switching to the desktop. This set of images is also called desktop entry animation. Exemplarily, the electronic device 100 can display a set of images shown in Figures 5B to 5D in sequence. The electronic device 100 can first capture the editing interface 31 to obtain a frame screenshot, and then the electronic device 100 can gradually reduce the above screenshot. After reducing the screenshot to a preset size, the electronic device 100 can switch to the shortcut icon of application A, and then gradually reduce the shortcut icon of application A, and finally display the desktop 32. The screen image sequence shown in Figures 5B to 5D is a set of desktop entry animations.
[0127] 6A-6E are schematic diagrams of a user interface for starting an application provided in an embodiment of the present application.
[0128] In the process of displaying the desktop, the electronic device 100 may run an application A in the background, such as a video editing application (first application). In the process of displaying the desktop, the electronic device 100 may receive a user operation on any application shortcut icon. In response to the above operation, the electronic device 100 may open the application corresponding to the shortcut icon and display a user interface provided by the application. Referring to the desktop 32 shown in Figure 6A, the electronic device 100 may receive a user operation (third operation) on the shortcut icon of application A, such as a click operation. In response to the above operation, the electronic device 100 may exit the desktop application and run application A (second application), displaying a user interface of application A, such as the editing interface 33.
[0129] Among them, before displaying the user interface provided by the application, the electronic device 100 may first display a set of images for entering the application. This set of images is also called desktop exit effects. Exemplarily, the electronic device 100 may display a set of images shown in Figures 6B to 6D in sequence. The electronic device 100 may first enlarge the shortcut icon of application A. After enlarging the above icon to a preset size, the electronic device 100 may display the image corresponding to application A (preferably, the image may be a screenshot of the main interface of application A), and then gradually enlarge the above image, and finally display the editing interface 33. The screen image sequence shown in Figures 6B to 6D is a set of desktop exit effects.
[0130] In another scenario, while displaying the desktop, the electronic device 100 may run an application C in the background, such as a drawing application (first application). During the display of the desktop, the GPU may process the GPU tasks of application C. After receiving a user operation (third operation) on the shortcut icon of application A, the electronic device 100 may exit the desktop application and run application A (second application). At this time, the first application running in the background before the third operation and the second application running after the third operation are not the same application. That is, exiting the desktop application to run the second application may be to update an application previously running in the background to run in the foreground (occupying the screen), or it may be to start and run a new application.
[0131] 7A-7E are schematic diagrams of a user interface for switching desktops provided in an embodiment of the present application.
[0132] During the process of displaying the desktop, the electronic device 100 may receive a left swipe / right swipe operation. In response to the above operation, the electronic device 100 may switch the desktop. The left swipe operation refers to a touch operation of sliding from the right edge of the screen to the left; the right swipe operation refers to a touch operation of sliding from the left edge of the screen to the right. The left swipe and right swipe operations are also called switching operations. Referring to Figure 7A, during the process of displaying the desktop 32 (first desktop), the electronic device 100 may receive a left swipe operation. In response to the above operation, the electronic device 100 may switch from displaying the desktop 32 to displaying the desktop 34 (second desktop).
[0133] Among them, before displaying the desktop 34, the electronic device 100 may first display a set of gradient images. This set of images is also called a desktop switching effect. The desktop switching effect can be determined based on the two desktops before and after the switching operation. Exemplarily, as shown, the electronic device 100 may sequentially display a set of gradient images described in Figures 7B to 7D. Among them, Figures 7B to 7D are determined based on the desktop 32 before the switching operation and the desktop 34 after the switching operation. In Figures 7B to 7D, the proportion of image content from the desktop 32 continues to decrease, and the proportion of image content from the desktop 34 continues to increase. The screen image sequence shown in Figures 7B to 7D is a set of desktop switching effects.
[0134] When the electronic device 100 displays the desktop entry animation shown in Figures 5B-5D, the desktop exit animation shown in Figures 6B-6D, or the desktop switching animation shown in Figures 7B-7D, the GPU driver can determine that it is currently in the desktop animation scene.
[0135] In some embodiments, the desktop 32 also includes self-changing elements, such as weather cards, clock dials, photo album memory cards, etc. Taking the weather card as an example, the weather card can update the display content in the card according to weather changes, such as updating the sunny icon to a rainstorm icon, etc. At this time, while maintaining the display of the desktop 32, the desktop application will also issue rendering tasks to the GPU to update the self-changing elements in the desktop 32. At this time, the update of the desktop 32 caused by the update of the self-changing elements can also be called a desktop animation scene. The desktop animation scene is a scene where the desktop content changes.
[0136] FIG8 is a schematic diagram of a split screen provided in an embodiment of the present application.
[0137] The electronic device 100 can create one or more windows. An application can occupy a window to display the user interface provided by the application. Typically, the window area is smaller than the screen area. Therefore, a window is also called a small window. The screen display area outside the window is called the basic display area. The basic display area, also known as the large window, can also be used by an application to display its user interface.
[0138] As shown in Figure 8, the electronic device 100 can create a window 81. Application A (fourth application) can use window 81. Preferably, application A is a video playback application, such as Honor Video. At this time, application A can use window 81 to play videos. The screen display area outside window 81 (second area) is recorded as the basic display area 82 (first area). As shown in Figure 8, the desktop application (third application) can use the basic display area 82 to display a desktop including multiple application shortcut icons. It can be understood that compared to the desktop 32 that occupies the entire screen display, at this time, the desktop displayed by the desktop application is incomplete.
[0139] A display scene that includes one or more windows may be referred to as a split-screen scene. The split-screen scene of the desktop and application A shown in FIG8 is also referred to as a desktop-and-application split-screen scene. When electronic device 100 performs the split-screen display operation shown in FIG8 , the GPU driver may determine that the scene is currently in the desktop-and-application split-screen scene.
[0140] FIG9 is another schematic diagram of a split screen provided in an embodiment of the present application.
[0141] Applications that use large windows are also called large window applications. In a split-screen scenario, large window applications can also be non-desktop applications. Referring to Figure 9, the gallery application (the third application, a non-desktop application) can be displayed in split screen with application A (the fourth application, such as a video playback application). Preferably, large window applications that use the basic display area are different from small window applications that use windows.
[0142] The split-screen scenario of multiple non-desktop applications is also called a multi-application split-screen scenario. When the electronic device 100 performs the split-screen display operation shown in FIG9 , the GPU driver can determine that it is currently in the multi-application split-screen scenario.
[0143] In addition to the floating window split screen shown in Figures 8 and 9, the electronic device 100 can also support tiled split screen. In the tiled split screen scenario, the windows do not overlap. The electronic device 100 can support two or more windows. Among the two or more windows, at most one window displays a desktop application, and the other windows display non-desktop applications.
[0144] Through the scheduling method shown in FIG4 , the GPU driver can rearrange the received tasks of different applications and re-order the GPU processing order based on the preset GPU processing priority.
[0145] FIG10 is a schematic diagram of a GPU task scheduling provided in an embodiment of the present application.
[0146] In the scenario of returning to the desktop shown in Figures 5A-5E, the electronic device 100 is running at least a desktop and a video editing application (first application). When the editing interface 31 is displayed, the video editing application may send three tasks to the GPU in succession: B1, B2, and B3 (first GPU tasks), wherein B1, B2, and B3 are all image processing tasks, such as using filters to change the display effect of the video screen. According to the scheduling method shown in Figure 4, the GPU driver can determine to maintain the processing priority of B1, B2, and B3. When the GPU processing priority of the video editing application is S3 (second priority), the GPU driver can determine that the processing priority of B1, B2, and B3 is S3, and then add B1, B2, and B3 to the queue Q3 (second queue) in turn.
[0147] Then, the GPU driver may receive task B4 (the second GPU task). The GPU driver may determine that B4 is a rendering task based on the thread name of B4. Further, the GPU driver may obtain the current system scene. At this time, the GPU driver may determine that it is currently in a desktop motion scene. Therefore, after determining that B4 belongs to a desktop application based on the process name of B4, the GPU driver may confirm to increase the priority of B4. When the GPU processing priority of the desktop application is S3 (the third priority), the GPU driver may increase the priority of B4 to S2 or S1 (the first priority). Preferably, the GPU driver may increase the priority of B4 to S2, which is adjacent to S3, i.e., increase it by one priority. Therefore, the GPU driver may add B4 to queue Q2 (the first queue).
[0148] At this time, the GPU can process B4 first, and then process B1, B2, and B3.
[0149] FIG11 is another schematic diagram of GPU task scheduling provided in an embodiment of the present application.
[0150] In the desktop and application split-screen scenario shown in Figure 8, electronic device 100 runs at least the desktop and video playback applications. As shown in Figure 11, the GPU driver can receive task B0 (the third GPU task) issued by the desktop application. Based on the priority of S3 (the second priority), the GPU driver can add B0 to queue Q3 (the second queue).
[0151] Then, the GPU driver can receive three tasks issued by the video playback application: B1, B2, and B3 (the fourth GPU task). Taking B1 as an example, the GPU driver can determine that B1 is a rendering task. Furthermore, the GPU driver can obtain the current system scene. At this time, the GPU driver can determine that it is currently in a desktop and application split-screen scene. After determining that the video playback application to which B1 belongs is a non-desktop application, the GPU driver can confirm to increase the priority of B1. Similarly, the GPU driver can increase the priority of B2 and B3. When the GPU processing priority of the video playback application is S3 (the third priority), as shown in Figure 11, the GPU driver can increase the priority of B1, B2, and B3 to S2 (the first priority). Therefore, the GPU driver can add B1, B2, and B3 to queue Q2 (the first queue).
[0152] At this time, the GPU prioritizes processing B1, B2, B3, and then B0.
[0153] In this way, the electronic device 100 can selectively increase the GPU processing priority of the desktop rendering task, which can effectively avoid the desktop display jamming problem, while occupying as few GPU resources as possible, avoiding affecting the normal operation of other applications, and improving the user experience.
[0154] FIG12 is a flow chart provided in an embodiment of the present application.
[0155] The application can be any application installed on the electronic device 100, such as the desktop, application A, application B, etc. shown in FIG1. The application includes a rendering thread, which can be used to create a thread. The thread created by the rendering thread includes a rendering thread.
[0156] Between the application layer and the kernel layer lies the application framework layer (framework layer). This layer provides an application programming interface (API) and programming framework for upper-layer applications. The application framework layer includes several predefined functions. Among them, the framework layer includes the display composition function SurfaceFlinger, which is used to compose images.
[0157] As shown in Figure 12, an application can create a rendering task through the rendering thread and then send the rendering task to the GPU driver. When content needs to be displayed on the display, such as when displaying an interactive interface, the application can send the rendering content to the rendering thread and create a rendering task.
[0158] Applications, such as video editing applications, can also send image processing tasks to the GPU driver.
[0159] A single image frame displayed on a display may come from multiple applications. SurfaceFlinger can composite the rendered images from these applications into a single frame, which it then sends to the display. The image generated by the GPU performing the rendering task is called a rendered image. Applications can send rendered images to SurfaceFlinger. SurfaceFlinger creates a composite task based on the received rendered image, and then issues the composite task to the GPU driver to complete the composite.
[0160] The GPU driver determines the GPU processing priority of tasks based on the order in which they are received, the application's GPU priority, and the scheduling policy shown in Figure 4. It then sends the tasks to the GPU in sequence according to this priority. The GPU driver translates the task instructions issued by the upper layer into machine code that the GPU can understand and then sends them to the GPU. The GPU performs rendering, compositing, and image processing based on the machine code.
[0161] FIG13 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application.
[0162] 13 , the electronic device 100 may include a battery 110 , a processor 120 , a memory 130 , a display screen 140 , and a sensor 150 . The battery 110 , the processor 120 , the memory 130 , the display screen 140 , and the sensor 150 are connected via a bus 160 .
[0163] The battery 110 provides power to the processor 120 , the memory 130 , the display 140 , the sensor 150 , and the like.
[0164] The processor 120 may include multiple processing units, such as a central processing unit (CPU) 121, a graphics processing unit (GPU) 122, an application processor (AP) 123, a modem processor, 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). The controller may generate an operation control signal based on an instruction opcode and a timing signal to control instruction fetching and execution.
[0165] The processor 120 may include one or more interfaces. The interfaces 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. The processor 120 may obtain data and control signals through the above interfaces.
[0166] The memory 130 is used to store computer programs. The memory 130 includes one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 120, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The non-volatile memory can also store executable programs and store user and application data. The executable programs and data stored in the non-volatile memory can be loaded into the random access memory in advance for direct reading and writing by the processor 120.
[0167] A computer executable program that implements the task scheduling method described in the embodiment of the present application may be stored in the memory 130. The processor 120 may read and execute the program from the memory 130, thereby selectively increasing the processing priority of some GPU tasks of some applications, thereby avoiding screen display freezes and improving the user experience.
[0168] The electronic device 100 may further include an external memory interface for connecting to an external non-volatile memory to expand the storage capacity of the electronic device 100 .
[0169] The display screen 140 is used for display. The display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD) or an organic light-emitting diode (OLED). In some embodiments, the electronic device 100 may include multiple display screens 140. In this case, the split screen shown in Figures 8 and 9 can be a split screen based on multiple display screens 140. One of the multiple display screens 140 is used for one application. The electronic device 100 implements the display functions shown in Figures 5A-5E, Figures 6A-6E, Figures 7A-7E, Figures 8, and Figure 9 through the GPU, the display screen 140, and the application processor.
[0170] In an embodiment of the present application, the sensor 150 includes at least a touch sensor. The touch sensor is also called a "touch device". The touch sensor can be arranged in the display screen 140 and form a touch screen with the display screen 140, also called a "touch screen". The touch sensor is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. The application processor can then provide visual output related to the touch operation through the display screen 140 to implement user interactive control functions, such as the function of returning to the desktop triggered by the upward swipe operation shown in Figures 5A to 5E, the function of opening an application triggered by the click operation shown in Figures 6A to 6E, and the function of switching desktops triggered by the left swipe operation shown in Figures 7A to 7E.
[0171] Not limited to the touch sensor shown in FIG13 , the sensor 150 may also include more sensors, such as a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc., which are not listed one by one here.
[0172] The electronic device 100 is not limited to the components shown in FIG13 . The electronic device 100 may also include more components, such as an antenna, a mobile communication module, a wireless communication module, an audio module, an earphone jack, buttons, a motor, an indicator, a camera, and a subscriber identification module (SIM) card interface. The electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 140, and an application processor. The electronic device 100 may implement an audio function through an audio module, a speaker, a receiver, a microphone, an earphone jack, and an application processor. For example, music playback, recording, etc.
[0173] Preferably, in the embodiment of the present application, the electronic device 100 is a mobile phone or a tablet computer.
[0174] The electronic device 100 is not limited to a mobile phone. It can also be a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device and / or a smart city device. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100.
[0175] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A task scheduling method, applied to an electronic device, characterized in that, The method includes: Receiving a first operation of a user; In response to the first operation, starting a first application; When the first application is running, executing a first GPU task created by the first application; Receiving a second operation of the user; In response to the second operation, exiting the first application to a desktop application; Wherein, during the process of exiting the first application to the desktop application, aborting the execution of the first GPU task and executing a second GPU task created by the desktop application.
2. The method according to claim 1, wherein The second GPU task is a rendering task.
3. The method according to claim 1 or 2, characterized in that, The priority of the first GPU task is the second priority. The aborting the execution of the first GPU task and executing the second GPU task created by the desktop application includes: Updating the priority of the second GPU task to a first priority, where the first priority is higher than the second priority; Aborting the execution of the first GPU task and executing the second GPU task according to the priorities of the second GPU task and the first GPU task.
4. The method according to claim 2, wherein The electronic device is provided with a first queue and a second queue. The first queue corresponds to the first priority, and the second queue corresponds to the second priority. The updating the priority of the second GPU task created by the desktop application to the first priority includes: adding the second GPU task created by the desktop application to the first queue.
5. The method according to claim 3, characterized in that The first priority and the second priority are adjacent.
6. The method according to claim 3, wherein Before the updating, the priority of the second GPU task is a third priority, and the third priority is equal to or lower than the second priority.
7. The method according to any one of claims 1-6, characterized in that, After executing the second GPU task created by the desktop application, the method further includes: continuing to execute the first GPU task.
8. The method according to claim 1, wherein The first application is a video editing application.
9. The method according to claim 8, wherein The first GPU task is an image processing task.
10. A task scheduling method, applied to an electronic device, characterized in that The method includes: Running a desktop application; When the desktop application is running, executing a first GPU task created by a first application; Receiving a third operation of the user; In response to the third operation, exiting the desktop application and running a second application; Wherein, during the process of exiting the desktop application and running the second application, aborting the execution of the first GPU task and executing a second GPU task created by the desktop application, and the second application is the same as or different from the first application.
11. The method according to claim 10, wherein, The second GPU task is a rendering task.
12. The method according to claim 10 or 11, characterized in that, The priority of the first GPU task is the second priority. The aborting the execution of the first GPU task and executing the second GPU task created by the desktop application includes: Updating the priority of the second GPU task to a first priority, where the first priority is higher than the second priority; Aborting the execution of the first GPU task and executing the second GPU task according to the priorities of the second GPU task and the first GPU task.
13. The method according to claim 11, wherein The electronic device is provided with a first queue and a second queue. The first queue corresponds to the first priority, and the second queue corresponds to the second priority. Updating the priority of the second GPU task created by the desktop application to the first priority includes: adding the second GPU task created by the desktop application to the first queue.
14. The method according to claim 12, wherein The first priority is adjacent to the second priority.
15. The method according to claim 12, wherein Before the update, the priority of the second GPU task is the third priority, and the third priority is equal to or lower than the second priority.
16. The method according to any one of claims 10-15, characterized in that, After executing the second GPU task created by the desktop application, the method further includes: continuing to execute the first GPU task.
17. The method according to claim 10, wherein The first application is a video editing application.
18. The method according to claim 17, wherein The first GPU task is an image processing task.
19. A task scheduling method, applied to an electronic device, characterized in that, The method includes: Displaying a third application in a first area of the screen of the electronic device, and displaying a fourth application in a second area of the screen, where the fourth application is different from the third application; During the process of displaying the third application in the first area and the fourth application in the second area: At a first moment, executing a third GPU task created by the third application; At a second moment, aborting the execution of the third GPU task and executing a fourth GPU task created by the fourth application, where the second moment is after the first moment.
20. The method according to claim 19, wherein The fourth GPU task is a rendering task.
21. The method according to claim 19 or 20, characterized in that, The priority of the third GPU task is the second priority. Aborting the execution of the third GPU task and executing the fourth GPU task created by the fourth application includes: Updating the priority of the fourth GPU task to the first priority, where the first priority is higher than the second priority; Aborting the execution of the third GPU task and executing the fourth GPU task according to the priorities of the fourth GPU task and the third GPU task.
22. The method according to claim 20, wherein The electronic device is provided with a first queue and a second queue. The first queue corresponds to the first priority, and the second queue corresponds to the second priority. Updating the priority of the fourth GPU task created by the desktop application to the first priority includes: adding the fourth GPU task created by the desktop application to the first queue.
23. The method according to claim 21, wherein The first priority is adjacent to the second priority.
24. The method according to claim 21, wherein Before the update, the priority of the fourth GPU task is the third priority, and the third priority is equal to or lower than the second priority.
25. The method according to any one of claims 19-24, characterized in that, After executing the fourth GPU task created by the desktop application, the method further includes: continuing to execute the third GPU task.
26. The method according to claim 19, wherein The third application is a desktop application.
27. The method according to claim 19, wherein The fourth application is a video playback application or a game application.
28. The method according to claim 19, wherein Before the second moment, the method further includes: receiving a fifth operation acting on the second area, and after the fifth operation and before the second moment, there is no other touch operation acting outside the second area.
29. An electronic device, characterized in that, Comprising one or more processors and one or more memories; wherein, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program, and when the one or more processors execute the computer program, the electronic device is caused to execute the method according to any one of claims 1-9, or execute the method according to any one of claims 10-18, or execute the method according to any one of claims 19-28.
30. A chip system, which is applied to an electronic device, the chip system includes one or more processors, characterized in that, The processor is used to call computer instructions to cause the electronic device to execute the method according to any one of claims 1-9, or execute the method according to any one of claims 10-18, or execute the method according to any one of claims 19-28.
31. A computer-readable storage medium, comprising a computer program, characterized in that, When the computer program runs on the electronic device, the electronic device is caused to execute the method according to any one of claims 1-9, or execute the method according to any one of claims 10-18, or execute the method according to any one of claims 19-28.