Thread scheduling method and apparatus, and electronic device and medium

By scheduling threads to processor cores with higher operating frequency in the user interface update state, the problem of unsmooth display interface of electronic devices is solved, and the efficiency and responsiveness of interface updates are improved.

WO2024245117A1PCT designated stage expired Publication Date: 2024-12-05VIVO MOBILE COMM CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/095063
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-31
Filing Date
2024-05-24
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

When users use electronic devices to view the user interface, they are prone to lag problems, especially when the user interface is updated, resulting in poor display.

Method used

The display task is processed using the higher frequency processor core by scheduling the target thread from the lower operating frequency first processor core to the higher operating frequency second processor core in the user interface update state.

Benefits of technology

It effectively avoids stuttering of the user interface during the update process and improves the fluency of the electronic device display user interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024095063_05122024_PF_FP_ABST
    Figure CN2024095063_05122024_PF_FP_ABST
Patent Text Reader

Abstract

A thread scheduling method and apparatus, and an electronic device and a medium, which belong to the field of communications. The thread scheduling method comprises: when a user interface of a target application is displayed, an electronic device acquiring first information (201); and when the first information indicates that the user interface of the target application is in an interface update state, the electronic device scheduling a target thread from a first processor core to a second processor core for running (202), wherein the target thread is used for displaying the user interface of the target application, and the operating frequency of the first processor core is less than the operating frequency of the second processor core.
Need to check novelty before this filing date? Find Prior Art

Description

Thread scheduling method, device, electronic device and medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on May 31, 2023, with application number 202310636399.1 and titled “Thread Scheduling Method, Device, Electronic Device and Medium,” the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of communications, and specifically relates to a thread scheduling method, device, electronic device, and medium. Background Art

[0004] Typically, when a user uses an electronic device to view a user interface, the electronic device can dispatch the relevant threads for displaying the user interface to the small core for processing, thereby processing the process of displaying the user interface to display the content of the user interface.

[0005] However, in the related art, when a user uses an electronic device to view a user interface, there is a problem of lag.

[0006] Summary of the Invention

[0007] The purpose of the embodiments of the present application is to provide a thread scheduling method, device, electronic device and medium, which can improve the smoothness of the user interface displayed by the electronic device.

[0008] In a first aspect, an embodiment of the present application provides a thread scheduling method, the method comprising: obtaining first information when displaying the user interface of a target application; when the first information indicates that the user interface of the target application is in an interface update state, scheduling a target thread from a first processor core to a second processor core to run, the target thread being used to display the user interface of the target application; wherein the operating frequency of the first processor core is less than the operating frequency of the second processor core.

[0009] In a second aspect, an embodiment of the present application provides a thread scheduling device, which includes: an acquisition module and a scheduling module, wherein: the acquisition module is used to acquire first information when displaying the user interface of the target application; the scheduling module is used to schedule the target thread from the first processor core to the second processor core to run when the first information acquired by the acquisition module indicates that the user interface of the target application is in an interface update state, and the target thread is used to display the user interface of the target application; wherein the operating frequency of the first processor core is less than the operating frequency of the second processor core.

[0010] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method of the first aspect are implemented.

[0011] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.

[0012] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method of the first aspect.

[0013] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method of the first aspect.

[0014] In a seventh aspect, an embodiment of the present application provides an electronic device, which is configured to execute the method of the first aspect.

[0015] In an embodiment of the present application, an electronic device can obtain first information while displaying the user interface of a target application, and when the first information indicates that the user interface of the target application is in an interface update state, schedule the target thread from the first processor core to the second processor core for execution, where the target thread is used to display the user interface of the target application, wherein the operating frequency of the first processor core is lower than the operating frequency of the second processor core. Based on this solution, scheduling the target thread to the second processor core with a higher operating frequency to execute can avoid the user interface of the target application from being stuck during the update process, thereby improving the smoothness of the electronic device in displaying the user interface. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] FIG1 is a flow chart of a thread scheduling method according to an embodiment of the present invention;

[0017] FIG2 is a second flow chart of a thread scheduling method provided in an embodiment of the present application;

[0018] FIG3 is a third flow chart of a thread scheduling method provided in an embodiment of the present application;

[0019] FIG4 is a fourth flow chart of a thread scheduling method provided in an embodiment of the present application;

[0020] FIG5 is a fifth flow chart of a thread scheduling method provided in an embodiment of the present application;

[0021] FIG6 is a schematic diagram of a structure of a thread scheduling device according to an embodiment of the present application;

[0022] FIG7 is a second structural diagram of the thread scheduling device provided in an embodiment of the present application;

[0023] FIG8 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0024] FIG9 is a hardware schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0026] The following describes the terms involved in the embodiments of the present application.

[0027] With the advancement of electronic device technology, the architectural design of the central processing unit (CPU), the core component of electronic devices, has become increasingly diverse. Currently, CPU architectures can include super cores, large cores, and small cores. Super cores offer the highest performance, power consumption, and operating frequency, followed by large cores, and then small cores. Therefore, super cores and large cores can accelerate task processing and are responsible for high-load scenarios, such as running multiple applications simultaneously and gaming. Small cores are responsible for low-load scenarios, such as connecting applications to the internet and running background tasks.

[0028] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0029] The thread scheduling method, device, electronic device, and medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0030] The thread scheduling method provided in the embodiment of the present application is applied to a scenario where the user interface of an application is stuck while being updated. The specific application scenario can be determined according to usage requirements and is not limited by this application.

[0031] Typically, when a user uses an electronic device to view a user interface, such as a webpage, the electronic device can dispatch the relevant threads for displaying the webpage to the small core for processing, thereby processing the webpage display process and displaying the page content of the webpage. However, when a user uses an electronic device to view a webpage, the user may quickly scroll through the list, and it may take a long time for the scrolled page content to be displayed, resulting in lag during the scrolling process.

[0032] In an embodiment of the present application, an electronic device can obtain first information while displaying the user interface of a target application, and when the first information indicates that the user interface of the target application is in an interface update state, schedule the target thread from the first processor core to the second processor core for execution, where the target thread is used to display the user interface of the target application, wherein the operating frequency of the first processor core is lower than the operating frequency of the second processor core. Based on this solution, scheduling the target thread to the second processor core with a higher operating frequency to execute can avoid the user interface of the target application from being stuck during the update process, thereby improving the smoothness of the electronic device in displaying the user interface.

[0033] The execution subject of the thread scheduling method provided in the embodiment of the present invention can be an electronic device, or it can be a functional module and / or functional entity in the electronic device that can implement the thread scheduling method. The technical solution provided in the embodiment of the present application will be explained below using an electronic device as an example.

[0034] The present application provides a thread scheduling method. As shown in FIG1 , the thread scheduling method may include the following steps 201 and 202:

[0035] Step 201: The electronic device obtains first information while displaying the user interface of the target application.

[0036] In an embodiment of the present application, the above-mentioned first information is used to indicate the interface update status of the user interface of the target application.

[0037] In some embodiments of the present application, the first information includes: a first operating frequency of the first processor core, first interface information and second interface information of the user interface.

[0038] It should be noted that the first interface information and the second interface information are interface information of the user interface of the target application obtained at different times.

[0039] In the embodiment of the present application, the above-mentioned target application may be an application running in the foreground.

[0040] In some embodiments of the present application, the target application may be any one of the following: a video application, a communication application, an editing application, a search application, a document application, etc.

[0041] In some embodiments of the present application, the above-mentioned user interface may be a page including list content or an interface including a scroll bar in the target application.

[0042] In an embodiment of the present application, the electronic device can, when displaying the desktop, obtain the first information by displaying the user's click input on the application identifier of the target application, such as the click input on the application icon of the target application, so that the electronic device displays the user interface corresponding to the target application.

[0043] Step 202: When the first information indicates that the user interface of the target application is in an interface updating state, the electronic device schedules the target thread from the first processor core to the second processor core for execution.

[0044] In an embodiment of the present application, the target thread is used to display the user interface of the target application.

[0045] In the embodiment of the present application, the operating frequency of the first processor core is lower than the operating frequency of the second processor core.

[0046] In some embodiments of the present application, the CPU may include at least two processor cores. It is understood that the above-mentioned processor cores are the cores of the CPU.

[0047] In the embodiment of the present application, the at least two processor cores may be at least one first processor core, at least one second processor core, and at least one third processor core.

[0048] In the embodiment of the present application, the operating frequency of the first processor core is greater than the operating frequency of the third processor core.

[0049] It should be noted that if the electronic device determines that the user interface of the target application is in a high-load scenario such as an interface update state, for example, when the user quickly slides the user interface of the target application, it can be processed by the second processor core with a higher operating frequency to improve the processing performance of the CPU; if the electronic device determines that the target application is in a low-load scenario such as running in the background, for example, when the application is in the process of connecting to the Internet, it can be processed by the second processor core or the third processor core with a lower operating frequency to improve the efficiency of the CPU.

[0050] In an embodiment of the present application, the electronic device can start the target application by running the thread related to the target application through the first processor core or the third processor core of the CPU, thereby displaying the user interface of the target application.

[0051] In the embodiment of the present application, the first information indicates that the user interface of the target application is in an interface updating state, for example, the user interface of the target application may be in a sliding state.

[0052] In the embodiment of the present application, the above operating frequency is the actual frequency of the processor core when it is currently running.

[0053] In some embodiments of the present application, the operating frequency may be related to at least one of the following: computing power, transient response capability, power consumption, etc.

[0054] It is understandable that the higher the operating frequency of the processor core, the higher the computing power, instantaneous response capability and power consumption of the processor core.

[0055] It should be noted that, when the electronic device determines that the user interface of the target application is in an updating state, it obtains the target thread that displays the user interface of the target application, and then schedules the target thread from the first processor core to run on the second processor core.

[0056] In an embodiment of the present application, the electronic device can obtain first information while displaying the user interface of the target application, and determine whether the user interface of the target application is in an interface update state based on the first information. If the user interface of the target application is in the interface update state, it means that the target application is in a high-load operation scenario. If the first processor core with a lower operating frequency continues to be used, the target thread displaying the user interface of the target application may not match the computing power and instantaneous response capability of the CPU, resulting in a longer time to display the updated user interface. Therefore, when the first information indicates that the user interface of the target application is in the interface update state, the target thread should be scheduled from the first processor core to the second processor core to run to improve the performance of the CPU.

[0057] Optionally, in an embodiment of the present application, as shown in FIG2 , the first information includes: a first operating frequency of the first processor core. Step 202 may be implemented by the following step 202a1:

[0058] Step 202a1: When the first operating frequency is greater than or equal to the second operating frequency, the electronic device schedules the target thread from the first processor core to the second processor core for execution.

[0059] In the embodiment of the present application, the second operating frequency includes any one of the following: a preset operating frequency, and an operating frequency of the first processor core before the first operating frequency is obtained.

[0060] In some embodiments of the present application, the preset frequency may be an operating frequency when the CPU of the electronic device cannot smoothly process multi-threaded tasks.

[0061] In the embodiment of the present application, if the first operating frequency of the first processor core is greater than or equal to the second operating frequency, it can be considered that the user interface of the target application is in an interface update state.

[0062] Optionally, in an embodiment of the present application, as shown in FIG3 , the first information includes first interface information and second interface information of a user interface, and the first interface information and the second interface information are interface information of the user interface of the target application acquired at different times. The step 202 can be specifically implemented by the following step 202b1:

[0063] Step 202b1: When the first interface information and the second interface information do not match, the electronic device schedules the target thread from the first processor core to the second processor core for execution.

[0064] In some embodiments of the present application, the time of obtaining the above-mentioned first interface information may be earlier than the time of obtaining the second interface information, or may be later than the time of obtaining the second interface information.

[0065] In the embodiment of the present application, the first interface information and the second interface information do not match, which can be understood as the first interface information and the second interface information are different.

[0066] In the embodiment of the present application, if the first interface information does not match the second interface information, it means that the user interface of the target application is in an interface update state.

[0067] It should be noted that when the user interface of the target application is in an updating state, since the user slides and inputs the user interface of the target application, the first interface information and the second interface information of the user interface of the target application obtained by the electronic device at different times do not match, that is, the user interface of the target application is in an updating state.

[0068] In an embodiment of the present application, an electronic device can obtain first information while displaying the user interface of a target application, and when the first information indicates that the user interface of the target application is in an interface update state, schedule the target thread from the first processor core to the second processor core for execution, where the target thread is used to display the user interface of the target application, wherein the operating frequency of the first processor core is lower than the operating frequency of the second processor core. Based on this solution, scheduling the target thread to the second processor core with a higher operating frequency to execute can avoid the user interface of the target application from being stuck during the update process, thereby improving the smoothness of the electronic device in displaying the user interface.

[0069] Optionally, in the embodiment of the present application, the “target thread” in the above step 202 may include at least one of the following: a main thread, a rendering thread.

[0070] In an embodiment of the present application, the main thread is a thread for obtaining data related to the display content in the application page, and the rendering thread is a thread for rendering the display content in the application page. The main thread and the rendering thread are synchronized. When the electronic device obtains the main thread, it also obtains the rendering thread. In other words, when the electronic device obtains the rendering thread, it also obtains the main thread.

[0071] In the embodiment of the present application, the electronic device can obtain the target thread according to the thread identifier.

[0072] Optionally, in an embodiment of the present application, as shown in FIG4 , before “scheduling the target thread from the first processor core to the second processor core to run” in step 202 above, the thread scheduling method provided in the embodiment of the present application further includes the following steps 301 and 302:

[0073] Step 301: When first information indicates that the user interface of the target application is in an interface updating state, the electronic device obtains a target thread identifier.

[0074] In the embodiment of the present application, the above-mentioned target thread identifier is used to indicate the target thread.

[0075] In some embodiments of the present application, the target thread identifier may include at least one of the following: a target thread identity document (ID), a target thread number, and the like.

[0076] Step 302: The electronic device obtains the target thread according to the target thread identifier.

[0077] In the embodiment of the present application, one thread identifier corresponds to one thread.

[0078] In some embodiments of the present application, the electronic device can obtain all thread identifiers related to the target application from the CPU, and based on these thread identifiers, obtain the target thread identifier for displaying the user interface of the target application, and then determine the target thread according to the target thread identifier.

[0079] As can be seen, since the electronic device can obtain the target thread according to the target thread identifier, it can accurately find the target thread for displaying the user interface of the target application from multiple threads, thereby improving the accuracy of the electronic device in obtaining the target thread.

[0080] Optionally, in an embodiment of the present application, as shown in FIG5 , before “scheduling the target thread from the first processor core to the second processor core to run” in step 202 above, the thread scheduling method provided in the embodiment of the present application further includes the following step 401:

[0081] Step 401: When first information indicates that the user interface of the target application is in an interface updating state, the electronic device increases the first priority of the target thread.

[0082] In the embodiment of the present application, the above-mentioned first priority includes at least one of the following: the scheduling priority when being scheduled to run on the second processor core, and the running priority after being scheduled to the second processor core.

[0083] Example 1: When the user interface of the target application is in an updating state, the electronic device increases the scheduling priority of the target thread used to display the user interface of the target application, that is, before scheduling the target thread to run on the second processor core, the scheduling priority of the target thread to be scheduled to run on the second processor core is increased so that the target thread can be scheduled to run on the second processor core with priority.

[0084] Example 2: When the user interface of the target application is in an updating state, the electronic device increases the running priority of the target thread used to display the user interface of the target application, that is, after scheduling the target thread to the second processor core, the electronic device increases the priority of the target thread running on the second processor core so that the target thread can run preferentially on the second processor core.

[0085] As can be seen, since the electronic device can increase the priority of the target thread, the target thread can be preferentially scheduled to run on the second processor core, or run preferentially on the second processor core. This can speed up the task scheduling response corresponding to the target thread and obtain full support from the computing power of the second processor core, thereby improving the execution speed of the task corresponding to the target thread of the electronic device.

[0086] Optionally, in an embodiment of the present application, the CPU further includes a third processor core. After the above step 201 , the thread scheduling method provided in the embodiment of the present application further includes the following step 501 .

[0087] Step 501: When first information indicates that the user interface of the target application is not in an interface update state, the electronic device schedules the target thread from the first processor core to the third processor core for execution.

[0088] In the embodiment of the present application, the operating frequency of the third processor core is lower than the operating frequency of the first processor core.

[0089] In the embodiment of the present application, the above-mentioned first information indicates that the user interface of the target application is not in the interface updating state, which can be understood as the first information indicating that the user interface of the target application is in the interface static state.

[0090] In some embodiments of the present application, the first information includes a first operating frequency of the first processor core. When the first operating frequency is less than the second operating frequency, it indicates that the user interface of the target application is not in an interface update state.

[0091] In some embodiments of the present application, the above-mentioned first information includes first interface information and second interface information. If the first interface information does not match the second interface information, it means that the user interface of the target application is not in an interface update state.

[0092] In some embodiments of the present application, if the first information indicates that the user interface of the target application is not in the interface update state, the first priority of the target thread can be lowered, which can reduce the power consumption of the CPU.

[0093] It can be seen that since the electronic device schedules the target thread from the first processor core to run on the third processor core whose operating frequency is lower than that of the first processor core when the first information indicates that the user interface of the target application is not in the interface update state, it can ensure that the CPU power consumption is reduced while the CPU processes thread tasks in an orderly manner.

[0094] The thread scheduling method provided in the embodiment of the present application can be executed by a thread scheduling device. In the embodiment of the present application, the thread scheduling device provided in the embodiment of the present application is described by taking the thread scheduling method executed by the thread scheduling device as an example.

[0095] An embodiment of the present application provides a thread scheduling device, as shown in Figure 6, the thread scheduling device 400 includes: an acquisition module 401 and a scheduling module 402, wherein: the above-mentioned acquisition module 401 is used to obtain first information when displaying the user interface of the target application; the above-mentioned scheduling module 402 is used to schedule the target thread from the first processor core to the second processor core to run when the first information obtained by the acquisition module indicates that the user interface of the target application is in an interface update state, and the target thread is used to display the user interface of the target application; wherein the operating frequency of the first processor core is less than the operating frequency of the second processor core.

[0096] The thread scheduling device provided in the embodiment of the present application schedules the target thread to run on the second processor core with a higher operating frequency, thereby avoiding the user interface of the target application from being stuck during the update process and improving the smoothness of the electronic device displaying the user interface.

[0097] Optionally, in an embodiment of the present application, the above-mentioned first information includes the first operating frequency of the first processor core; the above-mentioned scheduling module 402 is specifically used to schedule the target thread from the first processor core to the second processor core to run when the first operating frequency is greater than or equal to the second operating frequency; wherein the second operating frequency includes any one of the following: a preset operating frequency, and the operating frequency of the first processor core before obtaining the first operating frequency.

[0098] Optionally, in this embodiment of the present application, the first information includes first and second interface information of a user interface, where the first and second interface information are interface information of the user interface of the target application acquired at different times. The scheduling module 402 is specifically configured to schedule the target thread from the first processor core to the second processor core if the first and second interface information do not match.

[0099] Optionally, in an embodiment of the present application, the target thread includes at least one of the following: a main thread and a rendering thread.

[0100] Optionally, in an embodiment of the present application, the above-mentioned acquisition module 401 is also used to obtain the target thread identifier before scheduling the target thread from the first processor core to run on the second processor core; and obtain the target thread based on the target thread identifier; the target thread identifier is used to indicate the target thread.

[0101] Thus, since the thread scheduling device can obtain the target thread according to the target thread identifier, it can accurately find the target thread for displaying the user interface of the target application from multiple threads, thereby improving the accuracy of the thread scheduling device in obtaining the target thread.

[0102] Optionally, in an embodiment of the present application, as shown in Figure 7, the above-mentioned device also includes: an adjustment module 403, and the above-mentioned adjustment module 403 is used to increase the first priority of the target thread before scheduling the target thread from the first processor core to run on the second processor core; wherein the first priority includes at least one of the following: the scheduling priority when being scheduled to run on the second processor core, and the running priority after being scheduled to the second processor core.

[0103] As can be seen, since the thread scheduling device can increase the priority of the target thread, the target thread can be preferentially scheduled to run on the second processor core, or run preferentially on the second processor core. This can speed up the scheduling response of the task corresponding to the target thread and obtain full support from the computing power of the second processor core, thereby improving the execution speed of the task corresponding to the target thread of the thread scheduling device.

[0104] The thread scheduling device in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or chip. The electronic device can be a terminal or other device other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.

[0105] The thread scheduling device in the embodiment of the present application can be a device having an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0106] The thread scheduling device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0107] Optionally, as shown in Figure 8, an embodiment of the present application also provides an electronic device 600, including a processor 601 and a memory 602, wherein the memory 602 stores a program or instruction that can be run on the processor 601. When the program or instruction is executed by the processor 601, the various steps of the above-mentioned thread scheduling method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0108] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0109] FIG8 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.

[0110] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101 , a network module 102 , an audio output unit 103 , an input unit 104 , a sensor 105 , a display unit 106 , a user input unit 107 , an interface unit 108 , a memory 109 , and a processor 110 .

[0111] Those skilled in the art will appreciate that the electronic device 100 may further include a power source (such as a battery) for powering various components. The power source may be logically connected to the processor 110 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The electronic device structure shown in FIG9 does not limit the electronic device. The electronic device may include more or fewer components than shown, or may combine certain components or arrange the components differently, which will not be described in detail here.

[0112] Among them, the above-mentioned processor 110 is used to obtain first information when displaying the user interface of the target application; and when the first information indicates that the user interface of the target application is in an interface update state, the target thread is scheduled from the first processor core to the second processor core to run, and the target thread is used to display the user interface of the target application; wherein the operating frequency of the first processor core is less than the operating frequency of the second processor core.

[0113] In the electronic device provided in the embodiment of the present application, the target thread is scheduled to run on the second processor core with a higher operating frequency, thereby avoiding the user interface of the target application from being stuck during the update process and improving the smoothness of the electronic device in displaying the user interface.

[0114] Optionally, in an embodiment of the present application, the above-mentioned first information includes the first operating frequency of the first processor core; the above-mentioned processor 110 is specifically used to schedule the target thread from the first processor core to run on the second processor core when the first operating frequency is greater than or equal to the second operating frequency; wherein the second operating frequency includes any one of the following: a preset operating frequency, and the operating frequency of the first processor core before obtaining the first operating frequency.

[0115] Optionally, in an embodiment of the present application, the above-mentioned first information includes first interface information and second interface information of the user interface, and the first interface information and the second interface information are interface information of the user interface of the target application obtained at different times; the above-mentioned processor 110 is specifically used to schedule the target thread from the first processor core to the second processor core to run when the first interface information and the second interface information do not match.

[0116] Optionally, in an embodiment of the present application, the target thread includes at least one of the following: a main thread and a rendering thread.

[0117] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is also used to obtain a target thread identifier before scheduling the target thread from the first processor core to run on the second processor core; and obtain the target thread based on the target thread identifier; the target thread identifier is used to indicate the target thread.

[0118] As can be seen, since the electronic device can obtain the target thread according to the target thread identifier, it can accurately find the target thread for displaying the user interface of the target application from multiple threads, thereby improving the accuracy of the electronic device in obtaining the target thread.

[0119] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is also used to increase the first priority of the target thread before scheduling the target thread from the first processor core to the second processor core for execution; wherein the first priority includes at least one of the following: the scheduling priority when being scheduled to run on the second processor core, and the running priority after being scheduled to the second processor core.

[0120] As can be seen, since the electronic device can increase the priority of the target thread, the target thread can be preferentially scheduled to run on the second processor core, or run preferentially on the second processor core. This can speed up the task scheduling response corresponding to the target thread and obtain full support from the computing power of the second processor core, thereby improving the execution speed of the task corresponding to the target thread of the electronic device.

[0121] It should be understood that in an embodiment of the present application, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0122] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0123] Processor 110 may include one or more processing units. Optionally, processor 110 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 110.

[0124] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned thread scheduling method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0125] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0126] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned thread scheduling method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0127] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0128] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned thread scheduling method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0129] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0130] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0131] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A thread scheduling method, wherein: The method comprises: Acquiring first information while displaying a user interface of a target application; When the first information indicates that the user interface of the target application is in an interface update state, scheduling a target thread from the first processor core to run on the second processor core, the target thread being used to display the user interface of the target application; The operating frequency of the first processor core is lower than the operating frequency of the second processor core.

2. The method according to claim 1, wherein: The first information includes a first operating frequency of the first processor core; The step of scheduling the target thread from the first processor core to the second processor core for execution when the first information indicates that the user interface of the target application is in an interface update state comprises: When the first operating frequency is greater than or equal to the second operating frequency, scheduling the target thread from the first processor core to run on the second processor core; The second operating frequency includes any one of the following: a preset operating frequency, and an operating frequency of the first processor core before the first operating frequency is obtained.

3. The method according to claim 1, wherein: The first information includes first interface information and second interface information of the user interface, where the first interface information and the second interface information are interface information of the user interface of the target application acquired at different times; The step of scheduling the target thread from the first processor core to the second processor core for execution when the first information indicates that the user interface of the target application is in an interface update state comprises: When the first interface information and the second interface information do not match, the target thread is scheduled from the first processor core to run on the second processor core.

4. The method according to claim 1, wherein: The target thread includes at least one of the following: a main thread and a rendering thread.

5. The method according to claim 1, wherein: Before scheduling the target thread from the first processor core to the second processor core for execution, the method further includes: Obtaining a target thread identifier; the target thread identifier is used to indicate the target thread; According to the target thread identifier, the target thread is acquired.

6. The method according to claim 1, wherein: Before scheduling the target thread from the first processor core to the second processor core for execution, the method further includes: Raising the first priority of the target thread; The first priority level includes at least one of the following: a scheduling priority level when being scheduled to run on the second processor core, and a running priority level after being scheduled to run on the second processor core.

7. A thread scheduling device, wherein: The device comprises: an acquisition module and a scheduling module, wherein: The acquisition module is used to acquire the first information when displaying the user interface of the target application; The scheduling module is used to schedule a target thread from the first processor core to run on the second processor core when the first information acquired by the acquisition module indicates that the user interface of the target application is in an interface update state, and the target thread is used to display the user interface of the target application; The operating frequency of the first processor core is lower than the operating frequency of the second processor core.

8. The device according to claim 7, wherein: The first information includes a first operating frequency of the first processor core; The scheduling module is specifically configured to schedule the target thread from the first processor core to the second processor core for execution when the first operating frequency is greater than or equal to the second operating frequency; The second operating frequency includes any one of the following: a preset operating frequency, and an operating frequency of the first processor core before the first operating frequency is obtained.

9. The device according to claim 7, wherein: The first information includes first interface information and second interface information of the user interface, where the first interface information and the second interface information are interface information of the user interface of the target application acquired at different times; The scheduling module is specifically used to schedule the target thread from the first processor core to the second processor core for execution when the first interface information and the second interface information do not match.

10. The device according to claim 7, wherein: The target thread includes at least one of the following: a main thread and a rendering thread.

11. The device according to claim 7, wherein: The acquisition module is further configured to acquire a target thread identifier before scheduling the target thread from the first processor core to the second processor core for execution; and acquire the target thread according to the target thread identifier; The target thread identifier is used to indicate the target thread.

12. The device according to claim 7, wherein: The device further includes: a priority-raising module, the priority-raising module being used to raise the first priority of the target thread before scheduling the target thread from the first processor core to the second processor core for execution; The first priority level includes at least one of the following: The priority of the second processor core after being scheduled to the second processor core.

13. An electronic device, wherein: The method comprises a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the thread scheduling method according to any one of claims 1 to 6 are implemented.

14. A readable storage medium, wherein: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the thread scheduling method according to any one of claims 1 to 6 are implemented.

15. A chip, wherein: The chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the thread scheduling method according to any one of claims 1 to 6.

16. A computer program product, wherein: The program product is stored in a non-transitory storage medium, and the program product is executed by at least one processor to implement the steps of the thread scheduling method according to any one of claims 1 to 6.

17. An electronic device, wherein: The electronic device is configured to execute the steps of the thread scheduling method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Processor core scheduling method, device, terminal and storage medium

    CN108536538A

  • Thread scheduling method and electronic equipment

    CN115016706A

  • CPU scheduling method and device, terminal equipment and storage medium

    CN115048209A

  • Task scheduling method, electronic equipment, chip system and storage medium

    CN115904647A

  • Thread scheduling method and device, electronic equipment and medium

    CN116541151A