Thread scheduling method and related device
By setting high-priority thread scheduling in the electronic device for the background desktop that the user is concerned about, the problem of slow response speed to background application requests is solved and the user experience and interface fluency are improved.
Patent Information
- Application Number
- CN202310442466.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-21
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-04-21
AI Technical Summary
When an electronic device runs multiple applications, the request response speed of the background application is slow, which affects the user experience, especially the background desktop request that the user is concerned about is not responded to in time.
By detecting the background desktop request that the user is paying attention to, its main thread is set to high priority, and CPU resources are used first to quickly respond to requests initiated by the background desktop, and the thread scheduling method is implemented.
It improves the user experience, ensures that the background desktop can run quickly and respond to user operations in a timely manner, and improves the smoothness of multi-task switching animations and interface display.
Smart Images

Figure CN117112154B
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to a thread scheduling method and related devices. Background Art
[0002] When an electronic device runs multiple applications, the kernel will schedule resources to run the threads of each application according to the foreground or background status of the application. Usually, the kernel will respond to the requests of the foreground application first, that is, it will schedule relevant resources to run the threads of the foreground application first. This will cause some requests initiated by the background desktop that users are concerned about to fail to be responded to and executed in time, thus affecting the user experience.
[0003] How to solve the above problems is an urgent problem to be solved. Summary of the invention
[0004] The present application provides a thread scheduling method and related devices. In this method, when the electronic device detects that a background desktop that the user is concerned about initiates a request, the main thread of the background desktop that the user is concerned about is set as a high-priority thread, and the high-priority thread is used to preferentially respond to the request initiated by the background desktop, that is, CPU resources are preferentially used, and better CPU resources are used to respond to the request initiated by the background desktop, thereby enabling the background desktop that the user is concerned about to run quickly and improve the user experience.
[0005] In a first aspect, the present application provides a thread scheduling method, which includes: running a desktop application in the background and displaying a first interface provided by a first application; receiving a first operation; keeping the desktop application running in the background, and switching the thread of the desktop application from a first core to a second core, the performance of the second core being better than the performance of the first core; based on the second core, displaying a multi-task switching animation provided by the desktop application.
[0006] After implementing the method provided in the first aspect, when the desktop running in the background receives a first operation input by the user, a larger core with better performance can be used to preferentially respond to the first operation, that is, relevant resources are preferentially scheduled to run the desktop thread to execute the task corresponding to the first operation, thereby improving the user experience.
[0007] In combination with the method described in the first aspect, the first operation includes: an operation on a multitasking key, or a first swiping operation on the bottom of the display screen.
[0008] In this way, the user can trigger the display of multi-task switching animations through a variety of operation methods, and can respond to different trigger operations in a timely manner and display smooth multi-task switching animations in a timely manner.
[0009] In combination with the method described in the first aspect, after displaying the multi-task switching animation provided by the desktop application, the method also includes: switching the desktop application to the foreground and displaying the multi-task management interface provided by the desktop, which includes one or more application cards.
[0010] In this way, the multi-task management interface can be displayed after the multi-task switching animation effect is displayed promptly and smoothly, which is equivalent to quickly responding to user operations, displaying the multi-task management interface in a timely manner, and improving the user experience.
[0011] In combination with the method described in the first aspect, after displaying the multi-task switching animation provided by the desktop application, the method further includes: switching the first application from the foreground to the background, and switching from the second core to the first core.
[0012] In this way, switching the first application to the background and running it on the first core can release more resources for the foreground desktop application to use, thereby improving the user experience of using the desktop application.
[0013] In combination with the method described in the first aspect, after displaying the multitasking management interface provided by the desktop, the method also includes: receiving an operation acting on a card of a second application in the multitasking management interface; the second application runs in the second core; and displaying a second interface provided by the second application.
[0014] In this way, the user can open the second application through the multi-tasking management interface, so that the second application can run quickly in the foreground and on the second core.
[0015] In combination with the method described in the first aspect, the first operation includes a first swipe up operation. After displaying the multi-task switching animation provided by the desktop application, the method also includes: receiving a first swipe down operation for canceling the first swipe up operation; switching the thread of the desktop application from the second core to the first core; and displaying the first interface.
[0016] In this way, when the user triggers the multi-task switching animation through the first swipe up operation, the first swipe up operation can also be canceled. After inputting the cancellation of the first swipe up operation, the resources of the second core occupied by the desktop can be released for the first application to continue to occupy and run the first application quickly.
[0017] In a second aspect, the present application provides a thread scheduling method, which includes: running a desktop application in the background and displaying a first interface provided by a first application; receiving a second operation; keeping the desktop application running in the background, and switching the thread of the desktop application from a first core to a second core, the performance of the second core being better than that of the first core; based on the second core, displaying the main interface switching animation provided by the desktop application.
[0018] After implementing the method provided by the second aspect, when the desktop running in the background receives a second operation input by the user, a larger core with better performance can be used to preferentially respond to the second operation, that is, relevant resources are preferentially scheduled to run the desktop thread to execute the task corresponding to the second operation, thereby improving the user experience.
[0019] In combination with the method described in the second aspect, the second operation includes: an operation on a home page HOME key, or a second swipe up operation on the bottom of the display screen.
[0020] In this way, the user can trigger the display of the main interface switching effect through a variety of operation methods, and can respond to different trigger operations in a timely manner and display the main interface switching effect smoothly in a timely manner.
[0021] In combination with the method described in the second aspect, after displaying the main interface switching animation provided by the desktop application, the method also includes: switching the desktop application to the foreground and displaying the main interface provided by the desktop application, wherein the main interface includes one or more application icons.
[0022] In this way, the main interface can be displayed after the multi-task switching animation is displayed promptly and smoothly, which is equivalent to quickly responding to user operations, displaying the main interface in time, and improving user experience.
[0023] In combination with the method described in the second aspect, after displaying the main interface switching animation provided by the desktop application, the method also includes: switching the first application from the foreground to the background, and switching from the second core to the first core.
[0024] In this way, switching the first application to the background and running it on the first core can release more resources for the foreground desktop application to use, thereby improving the user experience of using the desktop application.
[0025] In combination with the method described in the second aspect, after displaying the main interface provided by the desktop application, the method also includes: receiving an operation acting on the icon of the second application in the main interface; the second application runs in the second core; and displaying the second interface provided by the second application.
[0026] In this way, the user can open the second application through the main interface, so that the second application can run quickly in the foreground and on the second core.
[0027] In combination with the method described in the second aspect, the first operation includes a second swipe up operation. After displaying the main interface switching animation provided by the desktop application, the method also includes: receiving a second swipe down operation for canceling the second swipe up operation; switching the thread of the desktop application from the second core to the first core; and displaying the first interface.
[0028] In this way, when the user triggers the main interface switching animation through the second swipe up operation, the second swipe up operation can be canceled, and after the second swipe up operation is canceled, the resources of the second core occupied by the desktop can be released for the first application to continue to occupy and run the first application quickly.
[0029] In a third aspect, the present application provides a thread scheduling method, which includes: running a desktop application in the background and displaying a first interface provided by a first application; receiving a third operation; keeping the desktop application running in the background, and switching the thread of the desktop application from the first core to the second core, the performance of the second core being better than the performance of the first core; based on the second core, displaying a notification bar switching effect provided by the desktop application.
[0030] After implementing the method provided by the third aspect, when the desktop running in the background receives a third operation input by the user, a larger core with better performance can be used to preferentially respond to the third operation, that is, relevant resources are preferentially scheduled to run the desktop thread to execute the task corresponding to the third operation, thereby improving the user experience.
[0031] In combination with the method described in the third aspect, after displaying the notification bar switching effect provided by the desktop application, the method also includes: switching the desktop application to the foreground and displaying the notification bar interface provided by the desktop application, which notification bar interface includes notifications of one or more applications.
[0032] In this way, the notification bar interface can be displayed after the notification bar switching effect is displayed promptly and smoothly, which is equivalent to quickly responding to user operations, displaying the notification bar interface in a timely manner, and improving the user experience.
[0033] In combination with the method described in the third aspect, after displaying the notification bar switching effect provided by the desktop application, the method also includes: switching the first application from the foreground to the background, and switching from the second core to the first core.
[0034] In this way, switching the first application to the background and running it on the first core can release more resources for the foreground desktop application to use, thereby improving the user experience of using the desktop application.
[0035] In combination with the method described in the third aspect, after displaying the notification bar interface provided by the desktop, the method also includes: receiving an operation acting on a notification of a second application in the notification bar interface; the second application runs in the second core; and displaying a second interface provided by the second application.
[0036] In this way, the user can open the second application through the notification bar interface, so that the second application can run quickly in the foreground and on the second core.
[0037] In combination with the method described in the third aspect, the third operation includes a third slide operation. After displaying the notification bar switching effect provided by the desktop application, the method also includes: receiving a third swipe up operation for canceling the third slide operation; switching the desktop from the second core to the first core; and displaying the first interface.
[0038] In this way, when the user triggers the notification bar switching animation through the third swipe operation, the third swipe operation can be canceled, and after inputting the cancellation of the third swipe operation, the resources of the second core occupied by the desktop can be released for the first application to continue to occupy and run the first application quickly.
[0039] In combination with the method described in the first aspect, a first operation is received; the desktop application is kept running in the background, and the thread of the desktop application is switched from the first core to the second core for execution, specifically including: the system user interface SystemUI receives an event triggered by a multi-tasking key; the SystemUI sends an instruction to the desktop application that the multi-tasking key is triggered; the desktop application instructs the kernel layer to switch the thread of the desktop application from the first core to the second core for execution.
[0040] In combination with the method described in the first aspect, a first operation is received; the desktop application is kept running in the background, and the thread of the desktop application is switched from the first core to the second core for execution, specifically including: the desktop application receives an event triggered by a first swipe-up operation; the desktop application instructs the kernel layer to switch the thread of the desktop application from the first core to the second core for execution.
[0041] In combination with the method described in the first aspect, the desktop application instructs the kernel Kernel to switch the thread of the desktop application from the first core to the second core for execution, specifically including: the desktop application sends an instruction to the scheduling module to set the thread of the desktop application to a high priority; the scheduling module sends an instruction to the Kernel through the framework layer to set the thread of the desktop application to a high priority; the Kernel layer switches the thread of the desktop application from the first core to the second core for execution.
[0042] In a fourth aspect, the present application provides an electronic device, comprising a screen, a memory, and multiple processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute a method as described in any one of the first to third aspects.
[0043] In a fifth aspect, the present application provides a chip, which is applied to an electronic device, and the chip includes multiple processors, which are used to call computer instructions so that the electronic device executes any one of the methods described in the first to third aspects.
[0044] In a sixth aspect, the present application provides a computer-readable storage medium, which includes instructions. When the instructions are executed on an electronic device, the electronic device executes the method as described in any one of the first to third aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic diagram of opening a multitasking interface on a desktop running in the background by triggering the multitasking key provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of triggering a background-running desktop to open a multitasking interface through a first swipe-up operation provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of an interface for opening an application through an application card in a multitasking interface provided by an embodiment of the present application;
[0048] Figure 4 A schematic diagram of triggering the desktop running in the background to open the main interface through a second upward sliding operation provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of revoking a first swipe up operation provided in an embodiment of the present application;
[0050] Figure 6 A flowchart of a thread scheduling method provided in an embodiment of the present application;
[0051] Figure 7 An OS interaction diagram for triggering an electronic device to play a multi-task switching animation and display a multi-task interface by using a multi-task key provided in an embodiment of the present application;
[0052] Figure 8 An OS interaction diagram for triggering an electronic device to play a multi-task switching animation effect through a first swipe up operation and for canceling the first swipe up operation to trigger the electronic device to end the multi-task switching animation effect provided in an embodiment of the present application;
[0053] Fig. 9 A schematic diagram of the operation record of the desktop provided in the embodiment of the present application;
[0054] Fig.10 A schematic diagram of the electronic device system architecture provided in an embodiment of the present application;
[0055] Fig.11A schematic diagram of the hardware architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0057] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0058] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0059] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that can be recognized by the user. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.
[0060] First, the relevant concepts involved in this application are introduced.
[0061] Foreground running: Foreground running means that the electronic device is running an application and the application is visible to the user or can be directly interacted with through the user interface. For example, when the electronic device displays the playback interface of a music application and the user can see and interact with the music playback interface, the music application is in the foreground running state.
[0062] Background running: Background running means that the electronic device is running an application but the application is invisible to the user. For example, when the electronic device is playing music but displays the interface of other applications in progress, the music application is in the background running state. Compared with the application running in the background, the application running in the foreground can use more central processor unit (CPU) resources of the electronic device, such as running on the big core, and thus running faster.
[0063] Scheduling priority: Scheduling technology is the basis for the operation of multi-threaded electronic devices. Various threads use the CPU resources of electronic devices in a time-sharing manner. For example, user input, electronic device output (interface display, audio playback), etc. are all scheduled threads of electronic devices. Different threads may have different scheduling priorities. Compared with low-priority threads, high-priority threads can enjoy priority scheduling services, that is, they can use CPU resources first and use better CPU resources (such as using large cores) to perform related tasks. Usually, the priority of the foreground application thread is higher than the priority of the background application thread.
[0064] Big core / small core: An electronic device can be equipped with multiple core processors (also known as multi-core processors), among which processors with higher performance can be called big cores, processors with lower performance can be called small cores, big cores can also be called second cores, small cores can also be called first cores, and the number of big cores and the number of small cores can be one or more. The performance of the processor can be measured by any one or more of the following indicators: cache size, main frequency, external frequency, power limit, energy efficiency ratio or CPU instruction set, etc. In short, applications running on high-performance big cores run faster, and applications running on low-performance small cores run slower.
[0065] Based on the introduction of the above concepts, it can be known that when an electronic device runs multiple applications, the foreground application is given priority and occupies more CPU resources than the background application, so the running speed of the foreground application is faster than that of the background application. However, in some scenarios, users pay more attention to background applications, and the electronic device defaults to scheduling the threads of the foreground application to execute on the large core. The threads of the background application cannot be scheduled in time or the scheduling is too long and the running time on the small core is too long, which will cause the background application to run too slowly, thus affecting the user experience.
[0066] In order to solve the above problems, the present application provides a thread scheduling method and related devices. In this method, when the electronic device detects that the background desktop that the user is concerned about initiates a request, the main thread of the background desktop that the user is concerned about is set as a high-priority thread, and the high-priority thread is used to preferentially respond to the request initiated by the background application, that is, the CPU resources are preferentially used, and better CPU resources are used to respond to the request initiated by the background application, thereby enabling the background desktop that the user is concerned about to run quickly and improve the user experience.
[0067] In the embodiments of the present application, high priority is a relative concept. Specifically, high priority means that the main thread of the background application that the user cares about is higher than the priority of the main thread of the background application scheduled by default in the kernel before the main thread of the background application is set to high priority. In an achievable manner, high priority is specifically higher than or equal to the priority of the thread of the foreground application by default of the kernel.
[0068] In the embodiment of the present application, the scenarios in which the backend desktop initiates a request that the user is concerned about include but are not limited to the following scenarios:
[0069] (1) A request initiated by the desktop running in the background to open the multitasking interface.
[0070] Specifically, when the electronic device displays any interface other than the interface provided by the desktop, if the user inputs a first operation (including: an operation on the multitasking key in the navigation bar, or a first swipe up operation at the bottom of the display screen), the desktop running in the background is triggered to initiate a request to the bottom layer to display the multitasking interface. In the process of the display screen of the electronic device switching from the aforementioned any interface to the multitasking interface, the display screen of the electronic device will display the multitasking switching effect provided by the desktop. During the playback of the multitasking switching effect, the desktop is still in the background application until the multitasking interface (also known as the multitasking management interface) is displayed after the playback of the multitasking switching effect is completed. The desktop will switch to the foreground application, and the application that previously provided any of the aforementioned interfaces will switch to the background application. Because the playback effect of the multitasking switching effect (such as fluency, timeliness, etc.) will greatly affect the user experience, the request initiated by the desktop running in the background to open the multitasking interface is regarded as a scenario that the user is more concerned about.
[0071] (2) A request initiated by the desktop running in the background to open the main interface.
[0072] Specifically, when the electronic device displays any interface other than the interface provided by the desktop, if the user inputs a second operation (including: an operation on the HOME button in the navigation bar, or a second swipe up operation on the display screen), the desktop running in the background is triggered to initiate a request to the bottom layer to display the main interface. Similarly, in the process of the display screen of the electronic device switching from any of the aforementioned interfaces to the main interface, the display screen of the electronic device will display the main interface switching effect provided by the desktop. During the playback of the main interface switching effect, the desktop is still in the background application until the electronic device plays the main interface switching effect and displays the main interface (including one or more application icons). The desktop will switch to the foreground application, and the application that previously provided any of the aforementioned interfaces will switch to the background application. Because the playback effect of the multi-task switching effect (such as fluency, timeliness, etc.) will greatly affect the user experience, the request for opening the main interface initiated by the desktop running in the background is used as a scenario that users are more concerned about.
[0073] (3) A request initiated by the desktop running in the background to open the drop-down notification bar.
[0074] Specifically, when the electronic device displays any interface other than the interface provided by the desktop, if the user inputs a third operation (the third sliding operation on the top of the display screen), the desktop running in the background is triggered to initiate a request to the bottom layer to display the drop-down notification bar. Similarly, in the process of the display screen of the electronic device switching from the aforementioned any interface to the drop-down notification bar, the display screen of the electronic device will display the drop-down notification bar switching effect provided by the desktop. During the playback of the drop-down notification bar switching effect, the desktop is still in the background application until the electronic device plays the drop-down notification bar switching effect and displays the drop-down notification bar interface (including one or more application notifications). The desktop will switch to the foreground application, and the application that previously provided any of the aforementioned interfaces will switch to the background application. Because the playback effect (such as fluency, timeliness, etc.) of the drop-down notification bar switching effect will greatly affect the user experience, the request initiated by the desktop running in the background to open the drop-down notification bar is regarded as a scenario that the user is more concerned about.
[0075] (4) A request for switching applications initiated by the desktop running in the background.
[0076] Specifically, when the electronic device displays the interface of any application other than the interface provided by the desktop, if the user inputs the fourth operation (left / right sliding operation on the side of the display screen), the desktop running in the background is triggered to initiate a switch to the interface of the most recently run application to the bottom layer. Similarly, in the process of the display screen of the electronic device switching from the aforementioned any interface to the interface of the most recently run application, the display screen of the electronic device will display the application interface switching effect provided by the desktop. During the playback of the application interface switching effect, the desktop is still in the background application until the electronic device plays the application interface switching effect and displays the interface of the most recently run application. The application that previously provided any of the aforementioned interfaces will switch to the background application. Because the playback effect of the application interface switching effect (such as fluency, timeliness, etc.) will greatly affect the user experience, the request for switching applications initiated by the desktop running in the background is regarded as a scenario that users are more concerned about.
[0077] The above only introduces several scenarios that users pay attention to by way of example. In addition, the scenarios that users pay attention to may also include others. They are not listed one by one here, and the embodiments of the present application do not limit this.
[0078] Next, the thread scheduling method provided by this application is introduced in conjunction with a UI implementation example.
[0079] refer to Figure 1 , Figure 1 A schematic diagram of opening the multitasking interface of the desktop running in the background triggered by the multitasking key.
[0080] Figure 1 Where a is the interface of application A displayed when the electronic device runs application A in the foreground. The user can input an operation on the multitasking key 111 during the process of running application A in the foreground. After the electronic device detects the operation, it will trigger the desktop of the electronic device to play the multitasking switching effect and then display the multitasking interface. In this application, application A can also be referred to as the first application, and the interface of application A can also be referred to as the first interface.
[0081] Figure 1 bc in the figure is the multitasking switching animation displayed when the desktop switches from the interface of application A to the multitasking interface. The multitasking switching animation may be, for example, gradually reducing the image corresponding to the interface of application A, and gradually displaying the images corresponding to the interfaces of other recently running applications (if any), such as displaying the image corresponding to the interface of application B.
[0082] Among them, the images corresponding to the interfaces of one or more applications included in the multi-tasking switching animation can be static or dynamically changing, and other recently running applications may be applications that are kept active in the background or applications that have ended running. The embodiments of the present application do not limit this.
[0083] Figure 1 The d in the figure is a multitasking interface provided by the desktop. The multitasking interface includes a card of at least one application, for example, a card of application A, a card of application B, and a card of application C. Application A, application B, and application C are the applications most recently run by the electronic device.
[0084] The electronic device displays Figure 1 In the process of the interface of application A shown in a, application A is in the foreground and runs on the big core, and the desktop is in the background and runs on the small core.
[0085] The electronic device displays Figure 1 During the multitasking switching animation shown in bc, application A is still running in the foreground and can run on the big core. The desktop is still running in the background, but in order to provide users with fast and smooth multitasking switching animation, after the user inputs an operation on the multitasking key 111, the desktop running in the background will set the main thread to run on the big core. The optional desktop will set the main thread to a high-priority thread, so that the bottom layer can prioritize the scheduling of the high-priority thread and provide better CPU resources to run the thread (that is, the main thread of the desktop runs on the big core), thereby achieving a quick response to the request to open the multitasking interface and smooth display of the multitasking switching animation.
[0086] The electronic device displays Figure 1 After the multitasking interface shown in d is displayed, the desktop switches to the foreground and runs on the big core, and application A switches to the background and runs on the small core.
[0087] refer to Figure 2 , Figure 2 A schematic diagram of opening the multitasking interface of the desktop running in the background triggered by the first swipe up operation.
[0088] Figure 2 a in the figure is the interface of application A displayed when the electronic device runs application A in the foreground. The user can input the first upward sliding operation during the process of running application A in the foreground. After the electronic device detects the operation, it will trigger the desktop of the electronic device to play the multi-task switching effect, and then display the multi-task interface. The first upward sliding operation is an operation of sliding upward from the bottom of the display screen, and the sliding speed is less than the preset value and the sliding distance is less than the preset value.
[0089] Figure 2bc in the figure is the multitasking switching animation displayed when the desktop switches from the interface of application A to the multitasking interface. The multitasking switching animation may be, for example, gradually reducing the image corresponding to the interface of application A, and gradually displaying the images corresponding to the interfaces of other recently running applications (if any), such as displaying the image corresponding to the interface of application B.
[0090] Among them, the images corresponding to the interfaces of one or more applications included in the multi-tasking switching animation can be static or dynamically changing, and other recently running applications may be applications that are kept active in the background or applications that have ended running. The embodiments of the present application do not limit this.
[0091] Figure 2 The d in the figure is a multitasking interface provided by the desktop. The multitasking interface includes a card of at least one application, for example, a card of application A, a card of application B, and a card of application C. Application A, application B, and application C are the applications most recently run by the electronic device.
[0092] and Figure 1 The scenario shown is similar to:
[0093] The electronic device displays Figure 2 In the process of the interface of application A shown in a, application A is in the foreground and runs on the big core, and the desktop is in the background and runs on the small core.
[0094] The electronic device displays Figure 2 During the multitasking switching animation shown in bc, application A is still running in the foreground and can run on the big core. The desktop is still running in the background, but in order to provide users with fast and smooth multitasking switching animation, after the user inputs the first swipe up operation, the desktop running in the background will set the main thread to run on the big core. The optional desktop will set the main thread to a high-priority thread, so that the bottom layer can prioritize the high-priority thread and provide better CPU resources to run the thread (that is, the main thread of the desktop runs on the big core), thereby achieving a quick response to the request to open the multitasking interface and smooth display of the multitasking switching animation.
[0095] The electronic device displays Figure 2 After the multitasking interface shown in d is displayed, the desktop switches to the foreground and runs on the big core, and application A switches to the background and runs on the small core.
[0096] and Figure 1 The differences in the scenarios shown are:
[0097] The multitasking switching effect triggered by the multitasking key may be the same as or different from the multitasking switching effect triggered by the first swipe up operation. Specifically, the switching mechanism of the multitasking switching effect triggered by the multitasking key is fixed, while the switching speed and content of the multitasking switching effect triggered by the first swipe up operation are affected by the sliding speed and sliding distance of the first swipe up operation input by the user.
[0098] refer to Figure 3 , Figure 3 A diagram of the interface for opening an application through an application card in the multitasking interface.
[0099] Figure 3 The a in the above is the Figure 1 d or Figure 2 The d in the figure is the multitasking interface displayed on the desktop of the electronic device. When the multitasking interface is displayed on the desktop of the electronic device, the user can click on the card of any application. After the electronic device detects the operation, it will trigger the desktop to display the application interface switching effect. After that, the application corresponding to the card runs in the foreground and displays the interface of the application. For example, after the user clicks on the card of application B, the desktop will be triggered to display the following Figure 3 The interface switching effect of application B shown in bc is displayed, and then the interface of application B is displayed. In this application, application B can also be called a second application, and the interface of application B can also be called a second interface.
[0100] Figure 3 bc in the figure is the interface switching effect of application B displayed when the desktop switches from the multitasking interface to the interface of application B. The interface switching effect of application B may be, for example, gradually enlarging the image corresponding to the interface of application B.
[0101] Figure 3 d in is the interface of application B. When the electronic device displays the interface of application B, the desktop switches from the foreground running state to the background running state and runs on the small core, and application B switches to the foreground running and runs on the large core.
[0102] refer to Figure 4 , Figure 4 A schematic diagram of opening the main interface of the desktop running in the background by triggering the second upward swipe operation.
[0103] Figure 4 a in the figure is the interface of application A displayed when the electronic device runs application A in the foreground. The user can input a second upward sliding operation during the process of running application A in the foreground. After the electronic device detects the operation, it will trigger the electronic device's desktop to play the main interface switching effect, and then display the main interface. The second upward sliding operation is an operation of sliding upward from the bottom of the display screen, and the sliding speed is greater than a preset value, or the sliding distance is greater than a preset value.
[0104] Figure 4 bc in the figure is the main interface switching animation displayed when the desktop switches from the interface of application A to the main interface. The main interface switching animation may be, for example, gradually reducing the image corresponding to the interface of application A.
[0105] Figure 4 The d in the figure is the main interface provided by the desktop. The main interface includes icons of one or more applications installed on the electronic device (e.g., application A-application D), icons of commonly used applications (e.g., phone, text messages, browser, and camera), date, time, weather, and other information.
[0106] and Figure 1 , Figure 2 The scenario shown is similar to:
[0107] The electronic device displays Figure 4 In the process of the interface of application A shown in a, application A is in the foreground and runs on the big core, and the desktop is in the background and runs on the small core.
[0108] The electronic device displays Figure 2 During the main interface switching effect shown in bc, application A is still running in the foreground and can run on the big core / small core, depending on the type of application A or the task being executed. For example, when application A is an audio or video playback application or is executing an audio or video playback task, application A continues to run on the big core. For example, when application A is a social or shopping application, application A switches to running on the small core. The desktop is still running in the background, but in order to provide users with fast and smooth playback of the main interface switching effect, after the user inputs the second swipe up operation, the desktop running in the background will set the main thread to run on the big core. The optional desktop will set the main thread to a high-priority thread, so that the bottom layer can prioritize the scheduling of the high-priority thread and provide better CPU resources to run the thread (that is, the main thread of the desktop runs on the big core), thereby achieving a quick response to the request to open the main interface and smoothly displaying the main interface switching effect.
[0109] The electronic device displays Figure 4 After the main interface shown in d is displayed, the desktop switches to the foreground and runs on the big core, and application A switches to the background and runs on the small core.
[0110] refer to Figure 5 , Figure 5 A schematic diagram exemplarily shows the withdrawal of the first swipe up operation.
[0111] Figure 5a in the figure is the interface of application A displayed when the electronic device runs application A in the foreground. The user can input the first swipe up operation during the process of running application A in the foreground. After the electronic device detects the operation, it will trigger the desktop of the electronic device to play the multi-task switching effect, and then display the multi-task interface. However, if the user does not leave the screen after inputting the first swipe up operation but cancels the first swipe up operation through the first swipe down operation, the desktop of the electronic device will be triggered to play the multi-task switching effect, and then continue to display the interface of application A.
[0112] Figure 5 bc in the figure is the multitasking switching effect displayed when the desktop switches from the interface of application A to the multitasking interface. The multitasking switching effect may be, for example: gradually shrinking the image corresponding to the interface of application A, and in the process of gradually shrinking the image corresponding to the interface of application A, (if any) the images corresponding to the interfaces of other recently running applications will also be gradually displayed. During the user's upward swipe, if the user does not want to open the multitasking interface, the first swiping operation may be undone. Specifically, the swiping operation may be canceled by swiping down to the bottom and then leaving the screen during the process of inputting the first swiping operation. During the process of the user inputting the cancellation of the first swiping operation, the image corresponding to the interface of application A will gradually expand until the user swips down to the bottom and then leaves the screen, and the image will be displayed. Figure 5 The interface of application A shown in (d).
[0113] Figure 5 d in the figure is the interface of application A displayed when the electronic device runs application A in the foreground.
[0114] and Figure 1 , Figure 2 , Figure 4 The scenario shown is similar to:
[0115] The electronic device displays Figure 5 In the process of the interface of application A shown in a, application A is in the foreground and runs on the big core, and the desktop is in the background and runs on the small core.
[0116] The electronic device displays Figure 5During the multi-task switching animation shown in bc, application A is still running in the foreground and can run on the big core. The desktop is still running in the background, but in order to provide users with fast and smooth multi-task switching animation, after the user inputs the first swipe up operation, the desktop running in the background will set the main thread to run on the big core, and the optional desktop will set the main thread to a high-priority thread, so that the bottom layer can give priority to scheduling the high-priority thread and provide better CPU resources to run the thread (that is, the main thread of the desktop runs on the big core), thereby achieving a quick response to the request to open the multi-task interface and smoothly displaying the multi-task switching animation. After the user inputs to cancel the first swipe up operation, the desktop running in the background will set the main thread to run on the small core, and the optional desktop will cancel the main thread set to a high-priority thread, so that the bottom layer can no longer give priority to scheduling the desktop main thread and occupy less CPU resources to run the thread (that is, the main thread of the desktop runs on the small core).
[0117] The electronic device displays Figure 5 After the interface of application A shown in d in FIG. 1 is displayed, application A is still in the foreground and running on the large core, and the desktop is still in the background and running on the small core.
[0118] In addition, when the user is running application A in the foreground, that is, displaying the interface of application A, and receives a third operation (the third sliding operation on the top of the display screen), the desktop running in the background is triggered to initiate a request to the bottom layer to display the drop-down notification bar. Similarly, when the display screen of the electronic device switches from any of the aforementioned interfaces to the drop-down notification bar, the display screen of the electronic device will display the drop-down notification bar switching effect provided by the desktop. The introduction of the drop-down notification bar switching effect scene is similar to the above, and will not be repeated here.
[0119] In addition, when the user is running application A in the foreground, that is, displaying the interface of application A, and receives the fourth operation (a left / right sliding operation on the side of the display screen), the desktop running in the background is triggered to initiate a switch to the interface of the most recently run application at the bottom layer. Similarly, in the process of the electronic device's display screen switching from any of the aforementioned interfaces to the interface of the most recently run application, the electronic device's display screen will display the application interface switching animation provided by the desktop. The introduction to the application interface switching animation scene is similar to the above, and will not be repeated here.
[0120] It is understandable that in addition to being able to cancel the first swipe up operation, the user can also cancel the second swipe up operation and the third swipe up operation. Similar to cancelling the first swipe up operation, the second swipe down operation of cancelling the second swipe up operation, the third swipe down operation of the third swipe up operation, and the fourth operation can be described in the same way as the description of cancelling the first swipe up operation, which will not be described in detail here.
[0121] Based on the introduction of the aforementioned application scenarios, the thread scheduling method provided by this application is introduced in conjunction with the method flow chart.
[0122] like Figure 6 As shown, the method flow includes the following steps:
[0123] S61, the electronic device runs other applications other than the desktop in the foreground.
[0124] Specifically, the electronic device runs application A in the foreground, and application A is any application other than the desktop. When the electronic device runs application A in the foreground, the display screen of the electronic device will display the interface of application A, such as the above Figure 1 a or the preceding text Figure 2 The interface shown in a in FIG. 1 is shown in FIG. 1 , and the application A runs on the big core. The number of the application A can be one or more.
[0125] In the embodiment of the present application, running on the big core means that in most cases, that is, when the big core occupancy rate meets the conditions, all or part of the application threads run on the big core. In some extreme cases, such as when the electronic device executes multiple tasks at the same time, resulting in the big core occupancy rate being too high and not meeting the conditions, all or part of the application threads will run on the small core.
[0126] S62, the electronic device detects an operation for opening a multitasking interface.
[0127] Specifically, operations for opening the multitasking interface include but are not limited to:
[0128] For operations on the multitasking key in the navigation bar of an electronic device, please refer to the previous article for details. Figure 1 The operation of clicking the multitasking key 111 shown in the scene shown; or, the operation of sliding upwards on the bottom of the electronic device display screen, which can be specifically referred to in the previous text Figure 2 The first sliding operation is shown in the illustrated scene.
[0129] Different trigger operations cause the electronic device to set the desktop main thread to high priority in different ways. For details, please refer to the following text. Figure 7-Figure 8 The diagram of the internal modules of the electronic device is shown.
[0130] S63, the desktop of the electronic device sets the desktop main thread to a high priority through the scheduling module.
[0131] Specifically, the desktop of the electronic device may send an instruction to set the desktop main thread as a high priority to the scheduling module, so that the scheduling module notifies the kernel to schedule the desktop main thread according to the high priority policy.
[0132] Among them, the scheduling module can be, for example, a power saving wizard (also known as IAware) installed in the electronic device. IAware is a system-level application in the electronic device, which can provide application performance scheduling, security protection, and power saving functions. The performance scheduling function includes setting the desktop main thread to a high priority according to the instructions of the upper desktop as proposed in this application, and notifying the kernel to schedule the desktop main thread according to the high priority policy.
[0133] The implementation form, name, etc. of the scheduling module can also be other, and the embodiments of the present application do not limit this. The function of the scheduling module has been recorded in detail in this application.
[0134] S64, the core of the electronic device prioritizes the desktop main thread and runs the desktop main thread on the large core.
[0135] Specifically, after the scheduling module receives the instruction sent by the desktop to set the desktop main thread to a high priority, the scheduling module notifies the kernel to schedule the desktop main thread according to the high priority policy, and the kernel schedules the desktop main thread according to the high priority policy.
[0136] Among them, scheduling the desktop main thread according to the high-priority strategy includes but is not limited to: compared with low-priority threads, CPU resources are used preferentially to execute the high-priority desktop main thread, and the CPU resources used are the resources of the large core, that is, the desktop main thread executes tasks on the large core, including loading and drawing multi-task switching animation elements, etc.
[0137] S65, the desktop of the electronic device displays multi-tasking switching effects.
[0138] Specifically, when the electronic device schedules the desktop main thread to execute tasks according to the high priority strategy, the desktop of the electronic device will display the multi-task switching animation effect on the display screen according to the result of drawing. For details, please refer to the previous article Figure 1 The multi-task switching effect shown in bc, or refer to the previous article Figure 2 The multi-task switching animation shown in bc.
[0139] Optionally, after the multitasking switching effect is displayed on the desktop of the electronic device, the multitasking interface will also be displayed (refer to the previous article Figure 1 / Figure 2 d) in the figure, the electronic device can then detect an operation on a card of any application in the multitasking interface, triggering the electronic device to switch the application corresponding to the card to the foreground and switch the desktop to the background. Figure 7 Description of S76-S83.
[0140] Optionally, when the multitasking switching animation is displayed on the desktop of the electronic device, if the operation that triggers the opening of the multitasking interface is the first swipe up operation, the electronic device can also detect the function of canceling the first swipe up operation, ending the playback of the multitasking switching animation, and returning to the interface of application A. For details, please refer to the following Figure 8 Description of S95-S97.
[0141] Next, combine Figure 7 and Figure 8 To introduce the previous article Figure 1-Figure 5 An interaction diagram of the operating system (OS) of the electronic device corresponding to each application scenario.
[0142] like Figure 7 As shown, the OS interaction of triggering the electronic device to play the multi-task switching animation and display the multi-task interface through the multi-task key includes the following steps:
[0143] S71, the SystemUI of the electronic device receives an operation on the multitasking key when application A is running in the foreground.
[0144] Specifically, SystemUI is a system-level application of an electronic device, which can provide display services for a status bar, a navigation bar, etc. Therefore, when any application, such as application A, is running in the foreground of the electronic device, SystemUI can receive the operation of the user input acting on the multitasking key in the navigation bar.
[0145] When the electronic device runs application A in the foreground, it runs on the big core. When the electronic device runs application A in the foreground, the desktop runs in the background, and runs on the small core.
[0146] The user operation of the electronic device to perform S71 can refer to the above description. Figure 1 The description of a in the above will not be repeated here.
[0147] S72, the SystemUI of the electronic device sends an instruction to the desktop that the multitasking key has been triggered.
[0148] Specifically, after SystemUI receives an operation input by the user on the multitasking key in the navigation bar, in response to the operation, SystemUI can send an instruction to the desktop that the multitasking key has been triggered, so as to instruct the desktop to open the multitasking interface.
[0149] In a specific implementation, the instruction that the multi-tasking key has been triggered, which is sent by SystemUI to the desktop, may be sent through an “onOverViewToggle()” interface.
[0150] S73, the desktop of the electronic device sends an instruction to the scheduling module to set the desktop main thread to a high priority.
[0151] Specifically, after receiving the instruction sent by SystemUI that the multitasking key has been triggered, the desktop of the electronic device responds to the instruction and notifies the scheduling module to set the desktop main thread to a high priority.
[0152] In a specific implementation, the instruction sent by the desktop to the scheduling module to set the desktop main thread to a high priority may be sent through an "addVipThreads()" interface.
[0153] Among them, the introduction of the scheduling module can refer to the description in S63 above, which will not be repeated here.
[0154] S74, the scheduling module of the electronic device enables the Kernel to set the desktop main thread to a high priority through the Framework.
[0155] Specifically, after receiving the instruction sent by the desktop, the scheduling module responds to the instruction and notifies the Kernel to set the desktop main thread to a high priority.
[0156] In a specific implementation, the scheduling module enables the Kernel to set the desktop main thread to a high priority through the Framework through a "reportVip()" interface, which also carries information indicating the thread number and a high priority identifier.
[0157] S75, the desktop of the electronic device executes a high-priority desktop main thread through the Kernel to load and draw multi-task switching animation elements to display the multi-task switching animation.
[0158] Specifically, the electronic device Kernel executes a high-priority desktop main thread, so that the desktop can load and draw multi-task switching animation elements to display the multi-task switching animation.
[0159] The high-priority policy includes but is not limited to: using CPU resources to execute the high-priority desktop main thread in priority over low-priority threads, and the CPU resources used are the resources of the big core, that is, the desktop main thread executes tasks on the big core. In addition, when the desktop displays the multi-task switching effect, the desktop is still running in the background, and application A is still running in the foreground and may be running on the big core / small core.
[0160] Among them, the loading and drawing of multi-task switching animation elements can be implemented through the following interfaces: "onAnimationstart()", "onAnimationupdate()" and "onAnimatiupend()" and so on.
[0161] Among them, the elements of multi-task switching effects include but are not limited to the above Figure 1 In bc, the image corresponding to the interface of application A, the card of application A, and the name of application A are shown. The image corresponding to the interface of application A can be static or dynamically changed, depending on whether application A executes related tasks to change the interface of application A during the process of switching multi-tasking animation effects.
[0162] Among them, the drawing of multi-task switching animation elements includes but is not limited to the above Figure 1 As shown in bc: the changes in the size and position of the image corresponding to the interface of application A, the drawing of the application name and the position of the application card, etc.
[0163] S76, the desktop of the electronic device displays a multitasking interface.
[0164] Specifically, after the multi-task switching animation is played on the desktop of the electronic device, the multi-task interface is displayed. The multi-task interface may be, for example, Figure 1 The content shown in d includes the card and name of application A, as well as the cards and names of other recently run applications.
[0165] S77, the desktop of the electronic device sends an instruction to the Framework to switch the desktop to the foreground and switch application A to the background.
[0166] Specifically, when the multitasking interface is displayed on the desktop of the electronic device, the desktop of the electronic device sends an instruction to the Framework to switch the desktop to the foreground and application A to the background, so that the Framework notifies the kernel to switch the desktop to the foreground and application A to the foreground.
[0167] S78, the Framework of the electronic device notifies the Kernel to refresh the desktop and the thread priority of Application A.
[0168] Specifically, after the Framework of the electronic device receives the foreground and background switching instruction sent by the desktop, it will notify the Kernel to refresh the desktop and the thread priority of application A according to the thread priorities corresponding to the default foreground running state and background running state.
[0169] As mentioned above, the priority of the thread of the application running normally is higher than the priority of the application running in the background. Therefore, the priority of the main thread of the desktop is refreshed from low priority to high priority, and the priority of the thread of application A is refreshed from high priority to low priority.
[0170] The high priority and low priority mentioned in this application are relative concepts and are not limited to specific numerical values.
[0171] It is worth noting that S77-S78 is executed during the process of the electronic device executing S76, that is, when the desktop of the electronic device displays the multitasking interface, the desktop can send instructions for switching between foreground and background applications, so that the Kernel refreshes the thread priority of the corresponding application according to the thread priority corresponding to the foreground and background running status of the application.
[0172] Optionally, during the process of displaying multiple interfaces on the desktop of the electronic device, the user can also open interfaces of other applications, and the specific implementation method is as follows:
[0173] S79, the desktop of the electronic device receives an operation acting on the card of application B in the multitasking interface.
[0174] Specifically, during the process of displaying the multitasking interface on the desktop of the electronic device, an operation input by the user acting on a card of any application in the multitasking interface, such as a card of application B, may be received.
[0175] The user operation of the electronic device to execute S79 can refer to the above description. Figure 3 The description of a in the above will not be repeated here.
[0176] S80, the switching effect of application B is displayed on the desktop of the electronic device.
[0177] Specifically, the desktop responds to the operation on the card of application B and displays the interface switching effect of application B. For details about the interface switching effect of application B, please refer to the previous description of the interface switching effect of application B. Figure 3 The description of bc in will not be repeated here.
[0178] S81, the electronic device displays the interface of application B.
[0179] Specifically, after the interface switching effect of application B is played on the desktop of the electronic device, the interface of application B is displayed. The interface of application B may be, for example, the interface of application B described above. Figure 3 The content shown in d.
[0180] S82, the desktop of the electronic device sends an instruction to the Framework to switch the desktop to the background and switch application B to the foreground.
[0181] Specifically, when the electronic device displays the interface of application B, the desktop of the electronic device sends an instruction to the Framework to switch the desktop to the background and application B to the foreground, so that the Framework notifies the kernel to switch the desktop to the background and application B to the foreground.
[0182] When the electronic device runs application B in the foreground, it is specifically running on the large core. When the electronic device runs the desktop in the background, it is specifically running on the small core.
[0183] S83, the Framework of the electronic device notifies the Kernel to refresh the desktop and the thread priority of Application B.
[0184] Specifically, after the electronic device's Framework receives the foreground and background switching instruction sent by the desktop, it will notify the Kernel to refresh the desktop and the thread priority of application B according to the thread priority corresponding to the default foreground running state and background running state. For specific refresh rules, please refer to the description of S78 above.
[0185] like Figure 8 As shown, the OS interaction of triggering the electronic device to play the multi-task switching animation effect through the first sliding operation and canceling the first sliding operation to trigger the electronic device to end the multi-task switching animation effect includes the following steps:
[0186] S91, when application A is running in the foreground, the desktop of the electronic device receives a first swipe up operation.
[0187] Specifically, when any application, such as application A, is running in the foreground of the electronic device, the desktop of the electronic device can receive a first upward sliding operation input by the user acting on the bottom of the display screen.
[0188] When the electronic device runs application A in the foreground, it runs on the big core. When the electronic device runs application A in the foreground, the desktop runs in the background, and runs on the small core.
[0189] The user operation of the electronic device to perform S91 can refer to the above description. Figure 4 The description of a in the above will not be repeated here.
[0190] S92, the desktop of the electronic device sends an instruction to the scheduling module to set the desktop main thread to a high priority.
[0191] Specifically, after receiving the first swipe-up operation, the desktop of the electronic device notifies the scheduling module to set the desktop main thread to a high priority in response to the operation.
[0192] S93, the scheduling module of the electronic device enables the Kernel to set the desktop main thread to a high priority through the Framework.
[0193] S94, the desktop of the electronic device executes a high-priority desktop main thread through the Kernel to load and draw multi-task switching animation elements to display the multi-task switching animation.
[0194] The specific implementation of S92-S94 is the same as that of the aforementioned S73-S75, and will not be repeated here.
[0195] When an electronic device displays a multi-task switching animation, the electronic device can execute the following two scenarios:
[0196] (1) Successfully display the multitasking interface and open any application card in the multitasking interface. For specific implementation, see the description of S76-S83 above.
[0197] (2) Cancel opening the multitasking interface and continue running application A in the foreground. The specific implementation is as follows:
[0198] S95, when displaying the multi-task switching animation effect, the desktop of the electronic device receives a request to cancel the first swipe up operation.
[0199] For details about how to cancel the first swipe up operation, please refer to the previous Figure 4 The description of bc will not be repeated here.
[0200] S96, the desktop of the electronic device sends an instruction to the scheduling module to cancel the high priority of the desktop main thread.
[0201] Specifically, after receiving the cancel first swipe up operation, the desktop of the electronic device responds to the operation by notifying the scheduling module to cancel setting the desktop main thread as a high priority.
[0202] In a specific implementation, the instruction sent by the desktop to the scheduling module to cancel setting the desktop main thread as a high priority may be sent through a "cancelVipThreads()" interface.
[0203] S97, the scheduling module of the electronic device enables the Kernel to cancel setting the desktop main thread as a high priority through the Framework.
[0204] Specifically, after receiving the instruction sent by the desktop, the scheduling module responds to the instruction and notifies the Kernel to cancel setting the desktop main thread as a high priority.
[0205] In a specific implementation, the scheduling module enables the Kernel to cancel setting the desktop main thread as high priority through the Framework through a "reportVip()" interface, which also carries information indicating the thread number and a high priority identifier.
[0206] In an embodiment of the present application, canceling the setting of the desktop main thread as a high priority may be to set the desktop main thread to the priority corresponding to the thread of the default background application.
[0207] After the electronic device executes S97, application A is still in the foreground running state, and specifically runs on the large core, while the desktop is in the background running state, and specifically runs on the small core.
[0208] Next, combine Fig. 9 The desktop main thread running record shown is used to introduce the beneficial effects brought about by implementing the method of the present application.
[0209] Fig. 9 Schematic diagram of the desktop operation record provided for this application.
[0210] like Fig. 9 As shown in FIG. 1 , the operation records of the desktop are compared before and after the desktop main thread is set to a high priority. The operation records can be captured by a trace tool, such as Perfetto.
[0211] By comparing the running records of the desktop before and after setting the desktop main thread to high priority, we can see that before setting the desktop main thread to high priority, the desktop main thread mainly runs on the small core, and when the desktop main thread runs on the small core, the time in Runnable is much longer than when it is in Running. Corresponding to the user experience, it is mainly manifested in slow desktop response, interface switching is stuck, and user operation is not keeping up with the hand. However, after setting the desktop main thread to high priority, the desktop main thread is mainly concentrated on running on the large core, and when the desktop main thread runs on the large core, the time in Runnable is greatly shortened and shorter than the time in Running. Corresponding to the user experience, it is mainly manifested in fast desktop response, smooth interface switching, and user operation keeping up with the hand.
[0212] Next, the form, system architecture, hardware architecture, etc. of the electronic device of this application are introduced.
[0213] Electronic equipment can be equipped Or portable terminal devices with other operating systems, such as mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPC), netbooks, and personal digital assistants (PDA), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, vehicle-mounted devices, smart home devices and / or smart city devices, etc.
[0214] The system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the system architecture of the electronic device is illustrated.
[0215] refer to Fig.10 , Fig.10 A schematic diagram of the system architecture of an electronic device is shown.
[0216] like Fig.10 As shown in FIG. 1 , the layered architecture divides the electronic device system into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, The system is divided into four layers, from top to bottom: application (APP) layer, application framework (Framework) layer, kernel (Kernel) layer and hardware layer.
[0217] The APP layer can include a series of application packages, such as Application A, Desktop, IAware, and other applications.
[0218] 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. For example, Fig.10 The window manager, content provider, view system, telephony manager, resource manager, notification manager, etc. are not shown.
[0219] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The 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 pictures.
[0220] The kernel layer is the layer between hardware and software. The kernel layer usually includes processor drivers, display drivers, sensor drivers, etc.
[0221] The hardware layer is used to perform corresponding tasks under the kernel driver. The hardware layer at least includes display screen, multi-core processor (big core, small core), etc.
[0222] Next, combine Fig.10 The system architecture shown is used to introduce the thread scheduling method provided by this application.
[0223] First, when application A is running in the foreground, the desktop is running in the background. In addition, application A specifically occupies the resources of the large core of the electronic device, that is, application A is executed on the large core, while the desktop specifically occupies the resources of the small core of the electronic device, that is, the desktop is executed on the small core. Since the performance of the large core is better than that of the small core, application A is usually in the Running state when executed on the large core, while the desktop may be in the Running, Sleep and Runnable states when executed on the small core. Among them, Running refers to the running state, Sleep refers to the end and interruption of the running state, and Runnable refers to the waiting state to be run. It can be seen that when the Sleep and Runnable time is too long, it means that the application responds slowly, affecting the user experience.
[0224] Then, in the process of running application A in the foreground, if an operation is received to open the multi-tasking interface, open the drop-down notification bar, or return to the main interface, the desktop will send an instruction to IAware through the "addVipThreads()" interface to set the desktop main thread to a high priority. After receiving the instruction, IAware will notify the Kernel through the Framework to set the desktop main thread to a high priority, thereby allowing the Kernel to execute the desktop main thread according to the high-priority strategy, including giving priority to driving the large core to execute the tasks of the desktop main thread, such as the tasks corresponding to "onAnimationupdate()", compared to other low-priority threads, so as to realize the desktop display of the corresponding multi-tasking switching effects, drop-down notification bar switching effects, or main interface switching effects.
[0225] Finally, when the desktop displays the corresponding multi-task switching effect, the pull-down notification bar switching effect, or the main interface switching effect, if the user input is introduced to cancel the corresponding operation of opening the multi-task interface, opening the pull-down notification bar, or returning to the main interface, the desktop will send an instruction to IAware through the "cancelVipThreads()" interface to cancel the desktop main thread as a high priority. After receiving the instruction, IAware notifies the Kernel through the Framework to cancel the desktop main thread set to a high priority, thereby allowing the Kernel to execute the desktop main thread according to the low-priority strategy, specifically including the task of driving the small core to execute the desktop main thread. In addition, the electronic device continues to run application A in the foreground, that is, to execute the task of application A on the large core.
[0226] refer to Fig.11 , Fig.11 A schematic diagram of the hardware architecture of an electronic device is shown.
[0227] The electronic device may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a camera 193, a display screen 194, etc. The sensor module 180 may include a pressure sensor 180A, a touch sensor 180B, an acceleration sensor 180C, etc.
[0228] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain 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.
[0229] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, 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.
[0230] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0231] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 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 110, and thus improves the efficiency of the system.
[0232] In the embodiment of the present application, the processor 110 is a multi-core processor, that is, it includes multiple core processors, such as one or more large cores and one or more small cores. The performance of the large core processor is better than that of the small core processor, that is, when a thread is executed on a large core, its execution speed is faster than that on a small core.
[0233] In the embodiment of the present application, the processor 110 is used to control the corresponding software and hardware modules to execute the above Figure 6-Figure 8 The method introduced.
[0234] In some embodiments, the processor 110 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.
[0235] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge an electronic device, and can also be used to transfer data between an electronic device and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0236] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0237] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of an electronic device. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0238] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0239] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0240] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 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.
[0241] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 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 150 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 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0242] 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 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0243] The wireless communication module 160 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 electronic devices. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0244] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 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. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).
[0245] The electronic device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0246] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display screen panel can also be made of 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, quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0247] The electronic device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0248] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0249] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0250] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.
[0251] Video codecs are used to compress or decompress digital videos. Electronic devices can support one or more video codecs. In this way, electronic devices can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0252] 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 continuously self-learn. NPU can realize applications such as intelligent cognition of electronic devices, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0253] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0254] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.
[0255] Non-volatile memory may include disk storage devices and flash memory.
[0256] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.
[0257] The random access memory can be directly read and written by the processor 110, 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.
[0258] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0259] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0260] The electronic device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0261] The audio module 170 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 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0262] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device can listen to music or listen to a hands-free call through the speaker 170A.
[0263] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0264] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device can be provided with at least one microphone 170C. In other embodiments, the electronic device can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, and directional recording function, etc.
[0265] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0266] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device detects the touch operation intensity according to the pressure sensor 180A. The electronic device can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0267] The touch sensor 180B is also called a "touch panel". The touch sensor 180B can be arranged on the display screen 194, and the touch sensor 180B and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180B 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. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180B can also be arranged on the surface of the electronic device, which is different from the position of the display screen 194.
[0268] The acceleration sensor 180C can detect the magnitude of the acceleration of the electronic device in various directions (generally X, Y, and Z axes). When the electronic device is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0269] In the embodiment of the present application, the electronic device can also determine the motion posture of the electronic device, such as whether the user lifts or picks up the electronic device, by detecting the acceleration on the three axes of X, Y, and Z on the acceleration sensor 180C.
[0270] The key 190 includes a power key, a volume key, etc. The key 190 can be a mechanical key or a touch key. The electronic device can receive key input and generate key signal input related to user settings and function control of the electronic device.
[0271] It should be understood that each step in the above method embodiment provided by the present application can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
[0272] The present application also provides an electronic device, which may include: a memory and a processor, wherein the memory may be used to store a computer program; and the processor may be used to call the computer program in the memory so that the electronic device executes the method in any one of the above embodiments.
[0273] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the method executed by the electronic device in any of the above embodiments.
[0274] In one possible design, the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
[0275] The chip system may be composed of the chip, or may include the chip and other discrete devices.
[0276] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0277] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.
[0278] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
[0279] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which enables a computer to execute the method executed by the electronic device in any of the above embodiments when the computer program is executed.
[0280] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the electronic device in any of the above embodiments.
[0281] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
[0282] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidStateDisk), etc.
[0283] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0284] In short, the above description is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.
Claims
1. A thread scheduling method, It is characterized in that The method comprises: Running a desktop application in the background and displaying a first interface provided by the first application; A first operation is received; Keep running the desktop application in the background, and switch the thread of the desktop application from the first core to the second core, where the performance of the second core is better than that of the first core; draw a multi-task switching animation corresponding to the thread of the desktop application; Based on the thread of the desktop application running on the second core, display the multi-task switching animation provided by the desktop application; The desktop application is switched to the foreground for execution, and a multi-task management interface provided by the desktop is displayed, wherein the multi-task management interface includes one or more application cards.
2. The method according to claim 1, It is characterized in that The first operation includes: An operation on the multitasking key, or a first swipe up operation at the bottom of the display screen.
3. The method according to claim 1, It is characterized in that After displaying the multi-task switching animation provided by the desktop application, the method further includes: The first application is switched from the foreground to the background, and the second core is switched to the first core.
4. The method according to claim 1, It is characterized in that After displaying the multitasking management interface provided by the desktop, the method further includes: Receiving an operation on a card of a second application in the multitasking management interface; The second application runs on the second core; Display a second interface provided by the second application.
5. The method according to claim 1, It is characterized in that The first operation includes a first upward sliding operation. After displaying the multi-task switching animation provided by the desktop application, the method further includes: receiving a first sliding down operation for canceling the first sliding up operation; Switching the thread of the desktop application from the second core to the first core for execution; The first interface is displayed.
6. A thread scheduling method, It is characterized in that The method comprises: Running a desktop application in the background and displaying a first interface provided by the first application; Receiving a second operation; Keep running the desktop application in the background, and switch the thread of the desktop application from the first core to the second core, where the performance of the second core is better than that of the first core; the thread of the desktop application draws the main interface switching animation; Based on the thread of the desktop application running on the second core, display the main interface switching animation provided by the desktop application; The desktop application is switched to the foreground for execution, and a main interface provided by the desktop application is displayed, wherein the main interface includes one or more application icons.
7. The method according to claim 6, It is characterized in that The second operation includes: An operation performed on the HOME button, or a second upward swipe operation performed at the bottom of the display.
8. The method according to claim 6, It is characterized in that After displaying the main interface switching animation provided by the desktop application, the method further includes: The first application is switched from the foreground to the background, and the second core is switched to the first core.
9. The method according to claim 6, It is characterized in that After displaying the main interface provided by the desktop application, the method further includes: Receiving an operation on an icon of a second application in the main interface; The second application runs on the second core; Display a second interface provided by the second application.
10. The method according to claim 6, It is characterized in that The second operation includes a second upward sliding operation. After displaying the main interface switching animation provided by the desktop application, the method further includes: receiving a second sliding down operation for canceling the second sliding up operation; Switching the thread of the desktop application from the second core to the first core for execution; The first interface is displayed.
11. A thread scheduling method, It is characterized in that The method comprises: Running a desktop application in the background and displaying a first interface provided by the first application; Receiving a third operation; Keep running the desktop application in the background, and switch the thread of the desktop application from the first core to the second core, where the performance of the second core is better than that of the first core; draw a notification bar switching effect corresponding to the thread of the desktop application; Based on the thread of the desktop application running on the second core, display the notification bar switching animation provided by the desktop application; The desktop application is switched to the foreground for execution, and a notification bar interface provided by the desktop application is displayed, wherein the notification bar interface includes notifications of one or more applications.
12. The method according to claim 11, It is characterized in that After displaying the notification bar switching animation provided by the desktop application, the method further includes: The first application is switched from the foreground to the background, and the second core is switched to the first core.
13. The method according to claim 11, It is characterized in that After displaying the notification bar interface provided by the desktop, the method further includes: Receiving an operation on a notification of a second application in the notification bar interface; The second application runs on the second core; Display a second interface provided by the second application.
14. The method according to claim 11, It is characterized in that The third operation includes a third sliding operation. After displaying the notification bar switching effect provided by the desktop application, the method further includes: receiving a third swipe-up operation for canceling the third swipe-down operation; Switching the thread of the desktop application from the second core to the first core for execution; The first interface is displayed.
15. The method according to any one of claims 1 to 5, It is characterized in that Receiving a first operation; keeping the desktop application running in the background, and switching the thread of the desktop application from the first core to the second core for running, specifically comprising: The system user interface SystemUI receives the event triggered by the multitasking key; The SystemUI sends an instruction that the multitasking key is triggered to the desktop application; The desktop application instructs the kernel layer to switch the thread of the desktop application from the first core to the second core for execution.
16. The method according to any one of claims 1 to 5, It is characterized in that Receiving a first operation; keeping the desktop application running in the background, and switching the thread of the desktop application from the first core to the second core for running, specifically comprising: The desktop application receives an event triggered by a first swipe-up operation; The desktop application instructs the kernel layer to switch the thread of the desktop application from the first core to the second core for execution.
17. The method according to claim 15 or 16, It is characterized in that The desktop application instructs the kernel to switch the thread of the desktop application from the first core to the second core for execution, specifically including: The desktop application sends an instruction to the scheduling module to set the thread of the desktop application to a high priority; The scheduling module sends an instruction to set the thread of the desktop application to a high priority to the Kernel through the Framework layer; The Kernel layer switches the thread of the desktop application from the first core to the second core for execution.
18. An electronic device, It is characterized in that The electronic device includes a screen, a memory, and multiple processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method described in any one of claims 1-17.
19. A chip, wherein the chip is applied to an electronic device. It is characterized in that The chip includes a plurality of processors, and the processors are used to call computer instructions so that the electronic device executes the method as claimed in any one of claims 1 to 17.
20. A computer-readable storage medium comprising instructions, It is characterized in that When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 17.
