[go: up one dir, main page]

CN116541151A - Thread scheduling method, device, electronic device and medium - Google Patents

Thread scheduling method, device, electronic device and medium Download PDF

Info

Publication number
CN116541151A
CN116541151A CN202310636399.1A CN202310636399A CN116541151A CN 116541151 A CN116541151 A CN 116541151A CN 202310636399 A CN202310636399 A CN 202310636399A CN 116541151 A CN116541151 A CN 116541151A
Authority
CN
China
Prior art keywords
processor core
thread
target
scheduling
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310636399.1A
Other languages
Chinese (zh)
Inventor
王彤伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202310636399.1A priority Critical patent/CN116541151A/en
Publication of CN116541151A publication Critical patent/CN116541151A/en
Priority to PCT/CN2024/095063 priority patent/WO2024245117A1/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a thread scheduling method, a thread scheduling device, electronic equipment and a thread scheduling medium, and belongs to the field of communication. The thread scheduling method comprises the following steps: acquiring first information under the condition of displaying a user interface of a target application; scheduling a target thread from a first processor core to a second processor core for running under the condition that the first information indicates that the user interface of the target application is in an interface updating state, wherein the target thread is used for displaying 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.

Description

线程调度方法、装置、电子设备及介质Thread scheduling method, device, electronic device and medium

技术领域technical field

本申请属于通信领域,具体涉及一种线程调度方法、装置、电子设备及介质。The present application belongs to the communication field, and in particular relates to a thread scheduling method, device, electronic equipment and medium.

背景技术Background technique

通常,在用户使用电子设备查看用户界面的场景下,电子设备可以将显示用户界面的相关线程,调度至小核进行处理,从而处理显示该用户界面的进程,以显示该用户界面的内容。Usually, in a scenario where a user uses an electronic device to view a user interface, the electronic device can schedule a thread related to displaying the user interface to a small core for processing, thereby processing the process of displaying the user interface to display the content of the user interface.

但是,相关技术中,在用户使用电子设备查看用户界面的过程中,存在出现卡顿的问题。However, in the related art, when the user uses the electronic device to view the user interface, there is a problem of stuttering.

发明内容Contents of the invention

本申请实施例的目的是提供一种线程调度方法、装置、电子设备及介质,能够提升电子设备显示用户界面的流畅性。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 fluency of displaying a user interface on the electronic device.

第一方面,本申请实施例提供了一种线程调度方法,该方法包括:在显示目标应用的用户界面的情况下,获取第一信息;在所述第一信息指示所述目标应用的用户界面处于界面更新状态的情况下,将目标线程由第一处理器核调度至第二处理器核上运行,所述目标线程用于显示所述目标应用的用户界面;其中,所述第一处理器核的工作频率小于所述第二处理器核的工作频率。In the first aspect, the embodiment of the present application provides a method for thread scheduling, the method includes: when the user interface of the target application is displayed, acquiring first information; when the first information indicates the user interface of the target application In the case of an interface update state, the target thread is scheduled from the first processor core to run on the second processor core, and the target thread is used to display the user interface of the target application; wherein, the first processor The operating frequency of the core is lower than the operating frequency of the second processor core.

第二方面,本申请实施例提供了一种线程调度装置,该装置包括:获取模块和调度模块,其中:获取模块,用于在显示目标应用的用户界面的情况下,获取第一信息;所述调度模块,用于在所述获取模块获取的所述第一信息指示所述目标应用的用户界面处于界面更新状态的情况下,将目标线程由第一处理器核调度至第二处理器核上运行,所述目标线程用于显示所述目标应用的用户界面;其中,所述第一处理器核的工作频率小于所述第二处理器核的工作频率。In the second aspect, the embodiment of the present application provides a thread scheduling device, which includes: an acquisition module and a scheduling module, wherein: the acquisition module is configured to acquire the first information when the user interface of the target application is displayed; The scheduling module is configured to schedule the target thread from the first processor core to the second processor core when the first information acquired by the acquiring module indicates that the user interface of the target application is in an interface update state 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.

第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,存储器存储可在处理器上运行的程序或指令,程序或指令被处理器执行时实现如第一方面的方法的步骤。In the third aspect, the embodiment of the present application provides an electronic device, the electronic device includes a processor and a memory, and the memory stores programs or instructions that can run on the processor, and when the programs or instructions are executed by the processor, the first aspect is implemented. steps of the method.

第四方面,本申请实施例提供了一种可读存储介质,可读存储介质上存储程序或指令,程序或指令被处理器执行时实现如第一方面的方法的步骤。In a fourth aspect, the 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 in the first aspect are implemented.

第五方面,本申请实施例提供了一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现如第一方面的方法。In the fifth aspect, the embodiment of the present application provides a chip, the chip 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 method in the first aspect.

第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面的方法。In a sixth aspect, an embodiment of the present application provides a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method in the first aspect.

在本申请实施例中,电子设备可以在显示目标应用的用户界面的情况下,获取第一信息,并在第一信息指示目标应用的用户界面处于界面更新状态的情况下,将目标线程由第一处理器核调度至第二处理器核上运行,目标线程用于显示目标应用的用户界面,其中,第一处理器核的工作频率小于第二处理器核的工作频率。基于该方案,将目标线程调度至工作频率更高的第二处理器核上运行,从而能够避免目标应用的用户界面在更新过程中会出现卡顿,提升电子设备显示用户界面过程中的流畅性。In this embodiment of the present application, the electronic device may acquire the first information when the user interface of the target application is displayed, and when the first information indicates that the user interface of the target application is in an interface update state, the target thread is changed from the first A processor core is scheduled to run on the second processor core, 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 lower than the operating frequency of the second processor core. Based on this solution, the target thread is scheduled to run on the second processor core with a higher operating frequency, so as to avoid the user interface of the target application from being stuck during the update process and improve the fluency of the electronic device displaying the user interface. .

附图说明Description of drawings

图1是本申请实施例提供的一种线程调度方法的流程示意图之一;FIG. 1 is one of the schematic flow diagrams of a thread scheduling method provided in an embodiment of the present application;

图2是本申请实施例提供的一种线程调度方法的流程示意图之二;Fig. 2 is the second schematic flow diagram of a thread scheduling method provided by the embodiment of the present application;

图3是本申请实施例提供的一种线程调度方法的流程示意图之三;Fig. 3 is the third schematic flow diagram of a thread scheduling method provided by the embodiment of the present application;

图4是本申请实施例提供的一种线程调度方法的流程示意图之四;FIG. 4 is the fourth schematic flow diagram of a thread scheduling method provided by an embodiment of the present application;

图5是本申请实施例提供的一种线程调度方法的流程示意图之五;FIG. 5 is the fifth schematic flow diagram of a thread scheduling method provided by an embodiment of the present application;

图6是本申请实施例提供的线程调度装置的结构示意图之一;FIG. 6 is one of the structural schematic diagrams of the thread scheduling device provided by the embodiment of the present application;

图7是本申请实施例提供的线程调度装置的结构示意图之二;Fig. 7 is the second structural schematic diagram of the thread scheduling device provided by the embodiment of the present application;

图8是本申请实施例提供的一种电子设备的结构示意图;FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

图9是本申请实施例提供的一种电子设备的硬件示意图。FIG. 9 is a schematic diagram of hardware of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The following will clearly describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application belong to the protection scope of this application.

以下将对本申请实施例涉及的术语进行说明。Terms involved in the embodiments of the present application will be described below.

随着电子设备技术的发展,电子设备的核心组件中央处理器(CentralProcessing Unit,CPU)的架构设计也越来越多样化,目前,CPU的架构设计中可以包括超大核、大核和小核。其中,超大核性能最强,功率最高,工作频率也最高,其次是大核,再次是小核,因此,超大核与大核可以加快任务处理速度,负责运行一些高负载场景,例如:同时运行多个应用程序,运行游戏应用等。小核负责运行一些低负载场景,例如:应用程序的联网,后台运行等。With the development of electronic equipment technology, the architecture design of the central processing unit (Central Processing Unit, CPU), which is the core component of the electronic equipment, is becoming more and more diverse. At present, the architecture design of the CPU may include super-large cores, large cores and small cores. Among them, the ultra-large core has the strongest performance, the highest power, and the highest operating frequency, followed by the large core, and the third is the small core. Therefore, the ultra-large core and the large core can speed up task processing and are responsible for running some high-load scenarios, such as: running at the same time Multiple applications, run gaming apps, etc. The small core is responsible for running some low-load scenarios, such as: networking of applications, running in the background, etc.

本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific sequence or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or described herein and that references to "first", "second", etc. to distinguish Objects are generally of one type, and the number of objects is not limited. For example, there may be one or more first objects. In addition, "and/or" in the specification and claims means at least one of the connected objects, and the character "/" generally means that the related objects are an "or" relationship.

下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的线程调度方法、装置、电子设备及介质进行详细地说明。The thread scheduling method, device, electronic device, and medium provided by the embodiments of the present application will be described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.

本申请实施例提供的线程调度方法应用于某一应用的用户界面处于更新状态下出现卡顿的场景中,具体的应用场景可以根据使用需求而定,本申请不做限定。The thread scheduling method provided by the embodiment of the present application is applied to a scenario where the user interface of an application freezes when it is in an update state. The specific application scenario can be determined according to the usage requirements, and is not limited in this application.

通常,在用户使用电子设备查看用户界面例如网页的场景下,电子设备可以将显示网页的相关线程,调度至小核进行处理,从而处理显示该网页进程,以显示该网页的页面内容。但是,由于在用户使用电子设备查看网页的过程中,可能会出现用户快速滑动列表的情况,此时可能会需要较长时间才能显示滑动后的页面内容,因此,导致滑动页面过程中会出现卡顿。Usually, when a user uses an electronic device to view a user interface such as a webpage, the electronic device can dispatch relevant threads for displaying the webpage to the small core for processing, thereby processing the process of displaying the webpage to display the page content of the webpage. However, since the user may quickly slide the list when the user uses the electronic device to view the webpage, it may take a long time to display the content of the page after the slide, and therefore, a jam occurs during the page slide process. pause.

在本申请实施例中,电子设备可以在显示目标应用的用户界面的情况下,获取第一信息,并在第一信息指示目标应用的用户界面处于界面更新状态的情况下,将目标线程由第一处理器核调度至第二处理器核上运行,目标线程用于显示目标应用的用户界面,其中,第一处理器核的工作频率小于第二处理器核的工作频率。基于该方案,将目标线程调度至工作频率更高的第二处理器核上运行,从而能够避免目标应用的用户界面在更新过程中会出现卡顿,提升电子设备显示用户界面过程中的流畅性。In this embodiment of the present application, the electronic device may acquire the first information when the user interface of the target application is displayed, and when the first information indicates that the user interface of the target application is in an interface update state, the target thread is changed from the first A processor core is scheduled to run on the second processor core, 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 lower than the operating frequency of the second processor core. Based on this solution, the target thread is scheduled to run on the second processor core with a higher operating frequency, so as to avoid the user interface of the target application from being stuck during the update process and improve the fluency of the electronic device displaying the user interface. .

本发明实施例提供的线程调度方法的执行主体可以为电子设备,也可以为该电子设备中能够实现该线程调度方法的功能模块和/或功能实体,以下将以电子设备为例对本申请实施例提供的技术方案进行说明。The execution subject of the thread scheduling method provided by the embodiment of the present invention may be an electronic device, or may be a functional module and/or a functional entity in the electronic device that can implement the thread scheduling method. The following will take the electronic device as an example to describe the embodiment of the present application. The technical solutions provided are explained.

本申请实施例提供一种线程调度方法,如图1所示,该线程调度方法可以包括如下步骤201和步骤202:The embodiment of the present application provides a thread scheduling method. As shown in FIG. 1, the thread scheduling method may include the following steps 201 and 202:

步骤201:电子设备在显示目标应用的用户界面的情况下,获取第一信息。Step 201: The electronic device acquires first information when displaying a user interface of a target application.

本申请实施例中,上述第一信息用于指示目标应用的用户界面的界面更新状态。In the embodiment of the present application, the above first information is used to indicate an interface update status of the user interface of the target application.

在本申请一些实施例中,上述第一信息包括:第一处理器核的第一工作频率、用户界面的第一界面信息和第二界面信息。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.

需要说明的是,上述第一界面信息和第二界面信息为不同时刻获取的目标应用的用户界面的界面信息。It should be noted that the above-mentioned first interface information and second interface information are interface information of the user interface of the target application acquired at different times.

本申请实施例中,上述目标应用可以为前台运行的应用。In this embodiment of the present application, the aforementioned target application may be an application running in the foreground.

在本申请一些实施例中,上述目标应用可以为以下任一项:视频类应用、通讯类应用、编辑类应用、搜索类应用、文档类应用等。In some embodiments of the present application, the above-mentioned target application may be any of the following: a video application, a communication application, an editing application, a search application, a document application, and the like.

在本申请一些实施例中,上述用户界面可以为目标应用中包括列表内容的页面或者包含滚动条的界面。In some embodiments of the present application, the aforementioned user interface may be a page including list content or an interface including a scroll bar in the target application.

本申请实施例中,电子设备可以在显示桌面的情况下,根据用户对目标应用的应用标识的点击输入,例如对目标应用的应用图标的点击输入,以使得电子设备显示目标应用对应的用户界面,从而获取第一信息。In the embodiment of the present application, when the desktop is displayed, the electronic device may, according to the user's click input on the application identifier of the target application, for example, click input on the application icon of the target application, so that the electronic device displays the user interface corresponding to the target application , so as to obtain the first information.

步骤202:电子设备在第一信息指示目标应用的用户界面处于界面更新状态的情况下,将目标线程由第一处理器核调度至第二处理器核上运行。Step 202: When the first information indicates that the user interface of the target application is in an interface update state, the electronic device schedules the target thread from the first processor core to run on the second processor core.

本申请实施例中,上述目标线程用于显示目标应用的用户界面。In the embodiment of the present application, the above-mentioned target thread is used to display the user interface of the target application.

本申请实施例中,上述第一处理器核的工作频率小于第二处理器核的工作频率。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.

在本申请一些实施例中,CPU可以包括至少两个处理器核。可以理解,上述处理器核为CPU的核心。In some embodiments of the present application, the CPU may include at least two processor cores. It can be understood that the foregoing processor core is a core of a CPU.

本申请实施例中,上述至少两个处理器核可以为至少一个第一处理器核、至少一个第二处理器核和至少一个第三处理器核。In this 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.

本申请实施例中,上述第一处理器核的工作频率大于上述第三处理器核的工作频率。In the embodiment of the present application, the operating frequency of the first processor core is higher than the operating frequency of the third processor core.

需要说明的是,若电子设备确定目标应用的用户界面处于界面更新状态等高负载的场景中,例如用户快速滑动目标应用的用户界面的过程中,则可以通过工作频率较高的第二处理器核进行处理,提升CPU的处理性能;若电子设备确定目标应用处于后台运行等低负载的场景,例如应用程序处于联网过程中,则可以通过工作频率较低的第二处理器核或者第三处理器核进行处理,提升CPU的效能。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 the interface update state, for example, during the process of the user rapidly sliding the user interface of the target application, the second processor with a higher operating frequency can core to improve the processing performance of the CPU; if the electronic device determines that the target application is running in the background and other low-load scenarios, for example, the application is in the process of networking, it can use the second processor core or the third processor core with a lower operating frequency processor core to improve CPU performance.

本申请实施例中,电子设备可以在启动运行目标应用的情况下,通过CPU的第一处理器核或者第三处理器核运行启动目标应用相关的线程,从而可以显示目标应用的用户界面。In the embodiment of the present application, when the electronic device is started to run the target application, the first processor core or the third processor core of the CPU can run and start the thread related to the target application, so as to display the user interface of the target application.

本申请实施例中,上述第一信息指示目标应用的用户界面处于界面更新状态,例如可以为目标应用的用户界面处于滑动状态。In the embodiment of the present application, the first information indicates that the user interface of the target application is in an interface update state, for example, it may be that the user interface of the target application is in a sliding state.

本申请实施例中,上述工作频率为处理器核当前运行时的实际频率。In the embodiment of the present application, the foregoing operating frequency is an actual frequency of the processor core when it is currently running.

在本申请一些实施例中,上述工作频率可以与以下至少一项相关:运算能力、瞬时响应能力、功耗等。In some embodiments of the present application, the above operating frequency may be related to at least one of the following: computing capability, instantaneous response capability, power consumption, and the like.

可以理解,处理器核的工作频率越高,则处理器核的运算能力、瞬时响应能力以及功耗也越高。It can be understood that the higher the operating frequency of the processor core, the higher the computing capability, instantaneous response capability and power consumption of the processor core.

需要说明的是,电子设备在确定目标应用的用户界面处于更新状态的情况下,获取显示目标应用的用户界面的目标线程,进而将目标线程由第一处理器核调度至第二处理器核上运行。It should be noted that, when the electronic device determines that the user interface of the target application is in an update state, it obtains the target thread displaying the user interface of the target application, and then schedules the target thread from the first processor core to the second processor core run.

本申请实施例中,电子设备可以在显示目标应用的用户界面的情况下,获取第一信息,并基于第一信息确定目标应用的用户界面是否处于界面更新状态,若目标应用的用户界面处于界面更新状态,则说明目标应用处于高负载运行的场景中,若继续采用工作频率较低的第一处理器核,可能会出现显示目标应用的用户界面的目标线程与CPU的算力以及瞬时响应能力不匹配的情况,导致需要较长时间显示更新后的用户界面,因此,要在第一信息指示目标应用的用户界面处于界面更新的状态下,将目标线程由第一处理器核调度至第二处理器核上运行,以提升CPU的性能。In this embodiment of the present application, the electronic device may obtain the first information when displaying the user interface of the target application, and determine whether the user interface of the target application is in the interface update state based on the first information. If the user interface of the target application is in the interface If the status is updated, it means that the target application is running under a high load. If the first processor core with a lower operating frequency is continued to be used, the target thread displaying the user interface of the target application, the computing power of the CPU, and the instantaneous response capability may appear. In the case of a mismatch, it takes a long time to display the updated user interface. Therefore, when the first information indicates that the user interface of the target application is in the state of interface update, the target thread is scheduled from the first processor core to the second It runs on the processor core to improve the performance of the CPU.

可选地,在本申请实施例中,如图2所示,上述第一信息包括:第一处理器核的第一工作频率,上述步骤202具体可以通过如下步骤202a1实现:Optionally, in this embodiment of the present application, as shown in FIG. 2 , the above first information includes: the first operating frequency of the first processor core, and the above step 202 can be specifically implemented through the following step 202a1:

步骤202a1:电子设备在第一工作频率大于或等于第二工作频率的情况下,将目标线程由第一处理器核调度至第二处理器核上运行。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 run on the second processor core.

本申请实施例中,上述第二工作频率包括以下任一项:预设工作频率、获取第一工作频率之前第一处理器核的工作频率。In the embodiment of the present application, the second operating frequency includes any of the following: a preset operating frequency, and an operating frequency of the first processor core before obtaining the first operating frequency.

在本申请的一些实施例中,上述预设频率可以为电子设备的CPU无法流畅地处理多线程任务时的工作频率。In some embodiments of the present application, the preset frequency may be a working frequency when the CPU of the electronic device cannot smoothly process multi-thread tasks.

本申请实施例中,若第一处理器核的第一工作频率大于或等于第二工作频率,则可以认为目标应用的用户界面处于界面更新的状态。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 may be considered that the user interface of the target application is in an interface updating state.

可选地,在本申请实施例中,如图3所示,上述第一信息包括用户界面的第一界面信息和第二界面信息,上述第一界面信息和第二界面信息为不同时刻获取的目标应用的用户界面的界面信息,上述步骤202具体可以通过如下步骤202b1实现:Optionally, in this embodiment of the present application, as shown in FIG. 3 , the above-mentioned first information includes first interface information and second interface information of the user interface, and the above-mentioned first interface information and second interface information are acquired at different times For the interface information of the user interface of the target application, the above step 202 can be specifically implemented through the following step 202b1:

步骤202b1:电子设备在第一界面信息和第二界面信息不匹配的情况下,将目标线程由第一处理器核调度至第二处理器核上运行。Step 202b1: When the first interface information does not match the second interface information, the electronic device schedules the target thread from the first processor core to run on the second processor core.

在本申请的一些实施例中,上述第一界面信息的获取时刻可以早于第二界面信息的获取时刻,也可以晚于第二界面信息的获取时刻。In some embodiments of the present application, the acquisition time of the above-mentioned first interface information may be earlier than the acquisition time of the second interface information, and may also be later than the acquisition time of the second interface information.

本申请实施例中,上述第一界面信息与第二界面信息不匹配,可以理解为第一界面信息与第二界面信息不同。In the embodiment of the present application, if the above-mentioned first interface information does not match the second interface information, it may be understood that the first interface information is different from the second interface information.

本申请实施例中,若第一界面信息与第二界面信息不匹配,则说明目标应用的用户界面处于界面更新的状态。In this 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.

需要说明的是,在目标应用的用户界面处于更新状态的情况下,由于用户对目标应用的用户界面进行滑动输入,从而使得电子设备不同时刻获取的目标应用的用户界面的第一界面信息与第二界面信息不匹配,即目标应用的用户界面处于更新状态。It should be noted that, when the user interface of the target application is in an update state, since the user performs sliding input on the user interface of the target application, the first interface information and the second interface information of the user interface of the target application acquired by the electronic device at different times The information on the two interfaces does not match, that is, the user interface of the target application is in an update state.

在本申请实施例中,电子设备可以在显示目标应用的用户界面的情况下,获取第一信息,并在第一信息指示目标应用的用户界面处于界面更新状态的情况下,将目标线程由第一处理器核调度至第二处理器核上运行,目标线程用于显示目标应用的用户界面,其中,第一处理器核的工作频率小于第二处理器核的工作频率。基于该方案,将目标线程调度至工作频率更高的第二处理器核上运行,从而能够避免目标应用的用户界面在更新过程中会出现卡顿,提升电子设备显示用户界面过程中的流畅性。In this embodiment of the present application, the electronic device may acquire the first information when the user interface of the target application is displayed, and when the first information indicates that the user interface of the target application is in an interface update state, the target thread is changed from the first A processor core is scheduled to run on the second processor core, 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 lower than the operating frequency of the second processor core. Based on this solution, the target thread is scheduled to run on the second processor core with a higher operating frequency, so as to avoid the user interface of the target application from being stuck during the update process and improve the fluency of the electronic device displaying the user interface. .

可选地,在本申请实施例中,上述步骤202中“目标线程”可以包括以下至少一项:主线程、渲染线程。Optionally, in this embodiment of the present application, the "target thread" in step 202 may include at least one of the following: a main thread and a rendering thread.

本申请实施例中,上述主线程用于获取应用页面中的显示内容的相关数据的线程,上述渲染线程用于对应用页面中显示内容进行渲染的线程。其中,上述主线程与上述渲染线程是同步的,在电子设备获取主线程的同时也会获取渲染线程,换言之,在电子设备获取渲染线程的同时也会获取主线程。In the embodiment of the present application, the above-mentioned main thread is a thread for obtaining relevant data of display content in an application page, and the above-mentioned rendering thread is for a thread for rendering display content in an application page. Wherein, the above-mentioned main thread is synchronized with the above-mentioned rendering thread, and the electronic device also obtains the rendering thread when obtaining the main thread, in other words, the electronic device also obtains the main thread when obtaining the rendering thread.

本申请实施例中,电子设备可以根据线程标识获取目标线程。In the embodiment of the present application, the electronic device may acquire the target thread according to the thread identifier.

可选地,在本申请实施例中,如图4所示,在上述步骤202中的“在将目标线程由第一处理器核调度至第二处理器核上运行”之前,本申请实施例提供的线程调度方法,还包括如下步骤301和步骤302:Optionally, in the embodiment of the present application, as shown in FIG. 4 , before "scheduling the target thread from the first processor core to the second processor core to run" in the above step 202, the embodiment of the present application The provided thread scheduling method also includes the following steps 301 and 302:

步骤301:电子设备在第一信息指示目标应用的用户界面处于界面更新状态的情况下,获取目标线程标识。Step 301: The electronic device acquires a target thread identifier when the first information indicates that the user interface of the target application is in an interface update state.

本申请实施例中,上述目标线程标识用于指示目标线程。In the embodiment of the present application, the target thread identifier is used to indicate the target thread.

在本申请一些实施例中,上述目标线程标识可以包括以下至少一项:目标线程ID、目标线程编号等。In some embodiments of the present application, the target thread identifier may include at least one of the following: target thread ID, target thread number, and the like.

步骤302:电子设备根据目标线程标识,获取目标线程。Step 302: The electronic device obtains the target thread according to the target thread identifier.

本申请实施例中,一个线程标识对应一个线程。In this embodiment of the application, one thread identifier corresponds to one thread.

在本申请一些实施例中,电子设备可以从CPU中获取目标应用相关的所有线程标识,并基于这些线程标识,获取用于显示目标应用的用户界面的目标线程标识,再根据目标线程标识确定目标线程。In some embodiments of the present application, the electronic device may 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 identifier according to the target thread identifier. thread.

如此可知,由于电子设备可以根据目标线程标识获取目标线程,从而能够从多个线程中准确找到,用于显示目标应用的用户界面的目标线程,因此,能够提升电子设备获取目标线程的准确性。It can be seen that 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, and therefore, the accuracy of obtaining the target thread by the electronic device can be improved.

可选地,在本申请实施例中,如图5所示,在上述步骤202中的“在将目标线程由第一处理器核调度至第二处理器核上运行”之前,本申请实施例提供的线程调度方法,还包括如下步骤401:Optionally, in the embodiment of the present application, as shown in FIG. 5 , before "scheduling the target thread from the first processor core to the second processor core to run" in the above step 202, the embodiment of the present application The provided thread scheduling method also includes the following step 401:

步骤401:电子设备在第一信息指示目标应用的用户界面处于界面更新状态的情况下,调高目标线程的第一优先级。Step 401: When the first information indicates that the user interface of the target application is in an interface update state, the electronic device increases the first priority of the target thread.

本申请实施例中,上述第一优先级包括以下至少一项:被调度至第二处理器核上运行的调度优先级、被调度至第二处理器核后的运行优先级。In the embodiment of the present application, the above-mentioned first priority includes at least one of the following: a scheduling priority scheduled to run on the second processor core, and an running priority after being scheduled to the second processor core.

示例1,电子设备在目标应用的用户界面处于更新状态的情况下,提高用于显示目标应用的用户界面的目标线程的调度优先级,即在将目标线程调度至第二处理器核上运行之前,提高目标线程被调度至第二处理器核上运行的调度优先级,以使得目标线程可以优先调度至第二处理器核上运行。Example 1, when the user interface of the target application is in an update state, the electronic device increases the scheduling priority of the target thread for displaying the user interface of the target application, that is, before scheduling the target thread to run on the second processor core , increasing the scheduling priority of the target thread being scheduled to run on the second processor core, so that the target thread can be preferentially scheduled to run on the second processor core.

示例2,电子设备在目标应用的用户界面处于更新状态的情况下,提高用于显示目标应用的用户界面的目标线程的运行优先级,即在将目标线程调度至第二处理器核之后,提高目标线程在第二处理器核上运行的优先级,以使得目标线程可以在第二处理器核上优先运行。Example 2, when the user interface of the target application is in an update 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 the target thread is scheduled to the second processor core, the priority is increased. 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.

如此可知,由于电子设备可以调高目标线程的优先级,这样使得目标线程可以优先调度到第二处理器核上运行,或者在第二处理器核上优先运行。从而能够加快目标线程对应的任务调度响应并得到第二处理器核的算力充分支持,因此,提升电子设备目标线程对应的任务执行速度。It can be seen that, 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. Therefore, the task scheduling response corresponding to the target thread can be accelerated and fully supported by the computing power of the second processor core, thus increasing the execution speed of the task corresponding to the target thread of the electronic device.

可选地,在本申请实施例中,上述CPU中还包括第三处理器核,在上述步骤201之后,本申请实施例提供的线程调度方法,还包括如下步骤501。Optionally, in the 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.

步骤501:电子设备在第一信息指示目标应用的用户界面未处于界面更新状态的情况下,将目标线程由第一处理器核调度至第三处理器核上运行。Step 501: When the 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 run on the third processor core.

本申请实施例中,上述第三处理器核的工作频率小于第一处理器核的工作频率。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.

本申请实施例中,上述第一信息指示目标应用的用户界面未处于界面更新状态,可以理解为第一信息指示目标应用的用户界面处于界面静止状态。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 update state, which may be understood as the first information indicates that the user interface of the target application is in the interface static state.

在本申请的一些实施例中,上述第一信息包括第一处理器核的第一工作频率,在第一工作频率小于第二工作频率的情况下,则说明目标应用的用户界面未处于界面更新状态。In some embodiments of the present application, the above-mentioned first information includes the first operating frequency of the first processor core. If the first operating frequency is lower than the second operating frequency, it means that the user interface of the target application is not updating the interface. state.

在本申请的一些实施例中,上述第一信息包括第一界面信息和第二界面信息,在第一界面信息与第二界面信息不匹配的情况下,则说明目标应用的用户界面未处于界面更新状态。In some embodiments of the present application, the above-mentioned first information includes the first interface information and the 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 the interface update status.

在本申请一些实施例中,若第一信息指示目标应用的用户界面未处于界面更新状态,则可以调低目标线程的第一优先级,这样可以降低CPU的功耗。In some embodiments of the present application, if the first information indicates that the user interface of the target application is not in an interface update state, the first priority of the target thread may be lowered, thereby reducing power consumption of the CPU.

如此可知,由于电子设备在第一信息指示目标应用的用户界面未处于界面更新状态的情况下,将目标线程由第一处理器核调度至工作频率小于第一处理器核的第三处理器核上运行,从而能够保证在CPU有序处理线程任务的情况下,降低了CPU的功耗。It can be seen that, since the electronic device schedules the target thread from the first processor core to 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. running on the CPU, so that the power consumption of the CPU can be reduced under the condition that the CPU processes thread tasks in an orderly manner.

本申请实施例提供的线程调度方法,执行主体可以为线程调度装置。本申请实施例中以线程调度装置执行线程调度方法为例,说明本申请实施例提供的线程调度装置。In the thread scheduling method provided in the embodiment of the present application, the execution subject may be a thread scheduling device. In the embodiment of the present application, the thread scheduling device executed by the thread scheduling device is taken as an example to describe the thread scheduling device provided in the embodiment of the present application.

本申请实施例提供一种线程调度装置,如图6所示,该线程调度装置400包括:获取模块401和调度模块402,其中:上述获取模块401,用于在显示目标应用的用户界面的情况下,获取第一信息;上述调度模块402,用于在获取模块获取的第一信息指示目标应用的用户界面处于界面更新状态的情况下,将目标线程由第一处理器核调度至第二处理器核上运行,目标线程用于显示目标应用的用户界面;其中,第一处理器核的工作频率小于第二处理器核的工作频率。An embodiment of the present application provides a thread scheduling device. As shown in FIG. 6, the thread scheduling device 400 includes: an acquisition module 401 and a scheduling module 402, wherein: the acquisition module 401 is used for displaying the user interface of the target application Next, acquire the first information; the scheduling module 402 is configured to schedule the target thread from the first processor core to the second processing when the first information acquired by the acquiring module indicates that the user interface of the target application is in an interface update state 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.

在本申请实施例提供的线程调度装置,将目标线程调度至工作频率更高的第二处理器核上运行,从而能够避免目标应用的用户界面在更新过程中会出现卡顿,提升电子设备显示用户界面过程中的流畅性。In the thread scheduling 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, so as to prevent the user interface of the target application from being stuck during the update process and improve the display of the electronic device. Fluency in the UI process.

可选地,在本申请实施例中,上述第一信息包括第一处理器核的第一工作频率;上述调度模块402,具体用于在第一工作频率大于或等于第二工作频率的情况下,将目标线程由第一处理器核调度至第二处理器核上运行;其中,第二工作频率包括以下任一项:预设工作频率、获取第一工作频率之前第一处理器核的工作频率。Optionally, in this 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 for when the first operating frequency is greater than or equal to the second operating frequency , the target thread is scheduled from the first processor core to run on the second processor core; wherein, the second operating frequency includes any of the following: preset operating frequency, the work of the first processor core before obtaining the first operating frequency frequency.

可选地,在本申请实施例中,上述第一信息包括用户界面的第一界面信息和第二界面信息,第一界面信息和第二界面信息为不同时刻获取的目标应用的用户界面的界面信息;上述调度模块402,具体用于在第一界面信息和第二界面信息不匹配的情况下,将目标线程由第一处理器核调度至第二处理器核上运行.Optionally, in this embodiment of the present application, the above-mentioned first information includes the first interface information and the second interface information of the user interface, and the first interface information and the second interface information are interfaces of the user interface of the target application acquired at different times information; the above scheduling module 402 is specifically used to schedule the target thread from the first processor core to run on the second processor core when the first interface information does not match the second interface information.

可选地,在本申请实施例中,上述目标线程包括以下至少一项:主线程、渲染线程。Optionally, in this embodiment of the present application, the aforementioned target thread includes at least one of the following: a main thread and a rendering thread.

可选地,在本申请实施例中,上述获取模块401,还用于在将目标线程由第一处理器核调度至第二处理器核上运行之前,获取目标线程标识;并根据目标线程标识,获取目标线程;目标线程标识用于指示目标线程。Optionally, in the embodiment of the present application, the acquisition module 401 is further configured to acquire the target thread ID before the target thread is scheduled from the first processor core to run on the second processor core; and according to the target thread ID , to get the target thread; the target thread ID is used to indicate the target thread.

如此可知,由于线程调度装置可以根据目标线程标识获取目标线程,从而能够从多个线程中准确找到,用于显示目标应用的用户界面的目标线程,因此,能够提升线程调度装置获取目标线程的准确性。It can be seen that, since the thread scheduling device can obtain the target thread according to the target thread identifier, it can accurately find the target thread used to display the user interface of the target application from multiple threads, therefore, the accuracy of the thread scheduling device in obtaining the target thread can be improved. sex.

可选地,在本申请实施例中,如图7所示,上述装置还包括:调高模块403,上述调高模块403,用于在将目标线程由第一处理器核调度至第二处理器核上运行之前,调高目标线程的第一优先级;其中,第一优先级包括以下至少一项:被调度至第二处理器核上运行的调度优先级、被调度至第二处理器核后的运行优先级。Optionally, in the embodiment of the present application, as shown in FIG. 7 , the above-mentioned apparatus further includes: an increase-adjustment module 403, the above-mentioned increase-adjustment module 403 is used to schedule the target thread from the first processor core to the second processing Before running on the processor core, increase the first priority of the target thread; wherein, the first priority includes at least one of the following: the scheduling priority that is scheduled to run on the second processor core, the scheduling priority that is scheduled to the second processor Run priority after kernel.

如此可知,由于线程调度装置可以调高目标线程的优先级,这样使得目标线程可以优先调度到第二处理器核上运行,或者在第二处理器核上优先运行。从而能够加快目标线程对应的任务调度响应并得到第二处理器核的算力充分支持,因此,提升线程调度装置目标线程对应的任务执行速度。It can be seen that, 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. Therefore, the task scheduling response corresponding to the target thread can be accelerated and fully supported by the computing power of the second processor core, thus, the execution speed of the task corresponding to the target thread of the thread scheduling device is improved.

本申请实施例中的线程调度装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtualreality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personalcomputer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personalcomputer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The thread scheduling apparatus in the embodiment of the present application may be an electronic device, or may be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or other devices other than the terminal. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR) device, robot, wearable device, ultra-mobile personal computer (ultra-mobile personalcomputer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, network attached storage (Network Attached Storage, NAS) , a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which are not specifically limited in this embodiment of the present application.

本申请实施例中的线程调度装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The thread scheduling device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.

本申请实施例提供的线程调度装置能够实现上述方法实施例实现的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The thread scheduling device provided by the embodiment of the present application can implement the various processes implemented by the above method embodiments, and can achieve the same technical effect. To avoid repetition, details are not repeated here.

可选地,如图8所示,本申请实施例还提供一种电子设备600,包括处理器601和存储器602,存储器602上存储有可在处理器601上运行的程序或指令,该程序或指令被处理器601执行时实现上述线程调度方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in FIG. 8 , the embodiment of the present application also provides an electronic device 600, including a processor 601 and a memory 602, and the memory 602 stores programs or instructions that can run on the processor 601. The program or When the instructions are executed by the processor 601, the various steps of the thread scheduling method embodiment described above can be achieved, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.

需要说明的是,本申请实施例中的电子设备包括上述的移动电子设备和非移动电子设备。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.

图8为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 8 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.

该电子设备100包括但不限于:射频单元101、网络模块102、音频输出单元103、输入单元104、传感器105、显示单元106、用户输入单元107、接口单元108、存储器109、以及处理器110等部件。The electronic device 100 includes but is not limited to: 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, etc. part.

本领域技术人员可以理解,电子设备100还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器110逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图9中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 100 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 110 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions. The structure of the electronic device shown in FIG. 9 does not constitute a limitation to the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine some components, or arrange different components, and details will not be repeated here. .

其中,上述处理器110,用于在显示目标应用的用户界面的情况下,获取第一信息;并在第一信息指示目标应用的用户界面处于界面更新状态的情况下,将目标线程由第一处理器核调度至第二处理器核上运行,目标线程用于显示目标应用的用户界面;其中,第一处理器核的工作频率小于第二处理器核的工作频率。Wherein, the above-mentioned processor 110 is configured to obtain the first information when the user interface of the target application is displayed; The processor core is scheduled to run on the second processor core, 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 lower than the operating frequency of the second processor core.

在本申请实施例提供的电子设备,将目标线程调度至工作频率更高的第二处理器核上运行,从而能够避免目标应用的用户界面在更新过程中会出现卡顿,提升电子设备显示用户界面过程中的流畅性。In the electronic device provided by the embodiment of the present application, the target thread is scheduled to run on the second processor core with a higher operating frequency, so as to avoid the user interface of the target application from being stuck during the update process, and to improve the user interface of the electronic device. Fluency in the interface process.

可选地,在本申请实施例中,上述第一信息包括第一处理器核的第一工作频率;上述处理器110,具体用于在第一工作频率大于或等于第二工作频率的情况下,将目标线程由第一处理器核调度至第二处理器核上运行;其中,第二工作频率包括以下任一项:预设工作频率、获取第一工作频率之前第一处理器核的工作频率。Optionally, in the 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 , the target thread is scheduled from the first processor core to run on the second processor core; wherein, the second operating frequency includes any of the following: preset operating frequency, the work of the first processor core before obtaining the first operating frequency frequency.

可选地,在本申请实施例中,上述第一信息包括用户界面的第一界面信息和第二界面信息,第一界面信息和第二界面信息为不同时刻获取的目标应用的用户界面的界面信息;上述处理器110,具体用于在第一界面信息和第二界面信息不匹配的情况下,将目标线程由第一处理器核调度至第二处理器核上运行。Optionally, in this embodiment of the present application, the above-mentioned first information includes the first interface information and the second interface information of the user interface, and the first interface information and the second interface information are interfaces of the user interface of the target application acquired at different times Information; the above processor 110 is specifically configured to schedule the target thread from the first processor core to run on the second processor core when the first interface information does not match the second interface information.

可选地,在本申请实施例中,上述目标线程包括以下至少一项:主线程、渲染线程。Optionally, in this embodiment of the present application, the aforementioned target thread includes at least one of the following: a main thread and a rendering thread.

可选地,在本申请实施例中,上述处理器110,还用于在将目标线程由第一处理器核调度至第二处理器核上运行之前,获取目标线程标识;并根据目标线程标识,获取目标线程;目标线程标识用于指示目标线程。Optionally, in the embodiment of the present application, the above-mentioned processor 110 is further configured to acquire the target thread ID before scheduling the target thread from the first processor core to the second processor core to run; and according to the target thread ID , to get the target thread; the target thread ID is used to indicate the target thread.

如此可知,由于电子设备可以根据目标线程标识获取目标线程,从而能够从多个线程中准确找到,用于显示目标应用的用户界面的目标线程,因此,能够提升电子设备获取目标线程的准确性。It can be seen that 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, and therefore, the accuracy of obtaining the target thread by the electronic device can be improved.

可选地,在本申请实施例中,上述处理器110,还用于在将目标线程由第一处理器核调度至第二处理器核上运行之前,调高目标线程的第一优先级;其中,第一优先级包括以下至少一项:被调度至第二处理器核上运行的调度优先级、被调度至第二处理器核后的运行优先级。Optionally, in the embodiment of the present application, the processor 110 is further configured 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: a scheduling priority scheduled to run on the second processor core, and an running priority after being scheduled to the second processor core.

如此可知,由于电子设备可以调高目标线程的优先级,这样使得目标线程可以优先调度到第二处理器核上运行,或者在第二处理器核上优先运行。从而能够加快目标线程对应的任务调度响应并得到第二处理器核的算力充分支持,因此,提升电子设备目标线程对应的任务执行速度。It can be seen that, 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. Therefore, the task scheduling response corresponding to the target thread can be accelerated and fully supported by the computing power of the second processor core, thus increasing the execution speed of the task corresponding to the target thread of the electronic device.

应理解的是,本申请实施例中,输入单元104可以包括图形处理器(GraphicsProcessing Unit,GPU)1041和麦克风1042,图形处理器1041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元106可包括显示面板1061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板1061。用户输入单元107包括触控面板1071以及其他输入设备1072中的至少一种。触控面板1071,也称为触摸屏。触控面板1071可包括触摸检测装置和触摸控制器两个部分。其他输入设备1072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that, in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042. Camera) to process the image data of still pictures or videos. 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, or the like. The user input unit 107 includes at least one of a touch panel 1071 and 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, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here.

存储器109可用于存储软件程序以及各种数据。存储器109可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器109可以包括易失性存储器或非易失性存储器,或者,存储器109可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器109包括但不限于这些和任意其它适合类型的存储器。The memory 109 can be used to store software programs as well as various data. The memory 109 can mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area can store an operating system, an application program or instructions required by at least one function (such as a sound playing function, image playback function, etc.), etc. Furthermore, memory 109 may include volatile memory or nonvolatile memory, or, memory 109 may include both volatile and nonvolatile memory. Wherein, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electronically programmable Erase Programmable Read-Only Memory (Electrically EPROM, EEPROM) or Flash. Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (Synch link DRAM , SLDRAM) and Direct Memory Bus Random Access Memory (Direct Rambus RAM, 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.

处理器110可包括一个或多个处理单元;可选的,处理器110集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器110中。The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the foregoing modem processor may not be integrated into the processor 110 .

本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述线程调度方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a readable storage medium. The readable storage medium stores programs or instructions. When the program or instructions are executed by the processor, the processes of the above-mentioned thread scheduling method embodiments are implemented, and the same To avoid repetition, the technical effects will not be repeated here.

其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiments. 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, and the like.

本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述线程调度方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application further provides a chip, the chip 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 above thread scheduling method embodiment Each process can achieve the same technical effect, so in order to avoid repetition, it will not be repeated here.

应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.

本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述线程调度方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application provides a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the various processes in the above thread scheduling method embodiment, and can achieve the same technical effect , to avoid repetition, it will not be repeated here.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element. In addition, it should be pointed out 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 reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present application can be embodied in the form of computer software products, which are stored in a storage medium (such as ROM/RAM, magnetic disk, etc.) , optical disc), including several instructions to enable a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from the purpose of this application and the scope of protection of the claims, many forms can also be made, all of which belong to the protection of this application.

Claims (14)

1. A method of thread scheduling, the method comprising:
acquiring first information under the condition of displaying a user interface of a target application;
scheduling a target thread from a first processor core to a second processor core for running under the condition that the first information indicates that the user interface of the target application is in an interface updating state, wherein the target thread is used for displaying 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.
2. The method of claim 1, wherein the first information comprises a first operating frequency of the first processor core;
the scheduling, by the first processor core to run on the second processor core, the target thread if the first information indicates that the user interface of the target application is in an interface update state, includes:
scheduling the target thread from a first processor core to run on the second processor core when the first operating frequency is greater than or equal to a second operating frequency;
wherein the second operating frequency comprises any one of: presetting a working frequency and acquiring the working frequency of the first processor core before the first working frequency.
3. The method of claim 1, wherein the first information includes first interface information and second interface information of the user interface, the first interface information and the second interface information being interface information of a user interface of the target application acquired at different times;
the scheduling, by the first processor core to run on the second processor core, the target thread if the first information indicates that the user interface of the target application is in an interface update state, includes:
and under the condition that the first interface information and the second interface information are not matched, scheduling the target thread to run on a second processor core by the first processor core.
4. The method of claim 1, wherein the target thread comprises at least one of: a main thread and a rendering thread.
5. The method of claim 1, wherein prior to said scheduling the target thread to run on the second processor core by the first processor core, the method further comprises:
acquiring a target thread identifier; the target thread identifier is used for indicating the target thread;
and acquiring the target thread according to the target thread identification.
6. The method of claim 1, wherein prior to said scheduling the target thread to run on a second processor core by a first processor core, the method further comprises;
raising a first priority of the target thread;
wherein the first priority comprises at least one of: scheduling priority of operation scheduled to the second processor core, and operation priority after being scheduled to the second processor core.
7. A thread scheduling apparatus, the apparatus comprising: the device comprises an acquisition module and a scheduling module, wherein:
the acquisition module is used for acquiring first information under the condition of displaying a user interface of a target application;
the scheduling module is used for scheduling a target thread from a first processor core to a second processor core for running when the first information acquired by the acquiring module indicates that the user interface of the target application is in an interface updating state, and the target thread is used for displaying 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.
8. The apparatus of claim 7, wherein the first information comprises a first operating frequency of the first processor core;
the scheduling module is specifically configured to schedule, when the first working frequency is greater than or equal to the second working frequency, the target thread to run on the second processor core from the first processor core;
wherein the second operating frequency comprises any one of: presetting a working frequency and acquiring the working frequency of the first processor core before the first working frequency.
9. The apparatus of claim 7, wherein the first information comprises first interface information and second interface information of the user interface, the first interface information and the second interface information being interface information of a user interface of the target application acquired at different times;
the scheduling module is specifically configured to schedule the target thread from the first processor core to the second processor core for running when the first interface information and the second interface information are not matched.
10. The apparatus of claim 7, wherein the target thread comprises at least one of: a main thread and a rendering thread.
11. The apparatus of claim 7, wherein the means for obtaining is further configured to obtain a target thread identification prior to the scheduling the target thread to run on a second processor core by a first processor core; acquiring the target thread according to the target thread identification; the target thread identification is used for indicating the target thread.
12. The apparatus of claim 7, wherein the apparatus further comprises: the heightening module is used for heightening the first priority of the target thread before the target thread is scheduled to run on the second processor core by the first processor core;
wherein the first priority comprises at least one of: scheduling priority of operation scheduled to the second processor core, and operation priority after being scheduled to the second processor core.
13. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the thread scheduling method of any one of claims 1 to 6.
14. A readable storage medium, characterized in that it stores thereon a program or instructions which, when executed by a processor, implement the steps of the thread scheduling method of any one of claims 1 to 6.
CN202310636399.1A 2023-05-31 2023-05-31 Thread scheduling method, device, electronic device and medium Pending CN116541151A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202310636399.1A CN116541151A (en) 2023-05-31 2023-05-31 Thread scheduling method, device, electronic device and medium
PCT/CN2024/095063 WO2024245117A1 (en) 2023-05-31 2024-05-24 Thread scheduling method and apparatus, and electronic device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310636399.1A CN116541151A (en) 2023-05-31 2023-05-31 Thread scheduling method, device, electronic device and medium

Publications (1)

Publication Number Publication Date
CN116541151A true CN116541151A (en) 2023-08-04

Family

ID=87450710

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310636399.1A Pending CN116541151A (en) 2023-05-31 2023-05-31 Thread scheduling method, device, electronic device and medium

Country Status (2)

Country Link
CN (1) CN116541151A (en)
WO (1) WO2024245117A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024245117A1 (en) * 2023-05-31 2024-12-05 维沃移动通信有限公司 Thread scheduling method and apparatus, and electronic device and medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8381004B2 (en) * 2010-05-26 2013-02-19 International Business Machines Corporation Optimizing energy consumption and application performance in a multi-core multi-threaded processor system
CN108647051B (en) * 2018-03-13 2021-03-09 Oppo广东移动通信有限公司 Optimization strategy acquisition method, provision method, device and equipment
CN115048209A (en) * 2021-03-09 2022-09-13 深圳市万普拉斯科技有限公司 CPU scheduling method, device, terminal equipment and storage medium
CN115904647A (en) * 2021-09-30 2023-04-04 荣耀终端有限公司 A task scheduling method, electronic equipment, chip system and storage medium
CN115016706B (en) * 2021-12-31 2023-05-30 荣耀终端有限公司 Thread scheduling method and electronic device
CN116541151A (en) * 2023-05-31 2023-08-04 维沃移动通信有限公司 Thread scheduling method, device, electronic device and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024245117A1 (en) * 2023-05-31 2024-12-05 维沃移动通信有限公司 Thread scheduling method and apparatus, and electronic device and medium

Also Published As

Publication number Publication date
WO2024245117A1 (en) 2024-12-05

Similar Documents

Publication Publication Date Title
CN110300328B (en) Video playing control method and device and readable storage medium
CN114296595A (en) A display method, device and electronic device
CN114911441A (en) Information display method and device
WO2023046106A1 (en) Desktop editing method and apparatus, and electronic device
CN113282213A (en) Interface display method and device
CN116302558A (en) Thread scheduling method and device and electronic equipment
CN116541151A (en) Thread scheduling method, device, electronic device and medium
CN115729412A (en) Interface display method and device
CN114756792A (en) Page display method and device, electronic equipment and readable storage medium
CN114327726A (en) Display control method, device, electronic device and storage medium
CN114222355A (en) Terminal power saving display method and device and electronic equipment
CN111610917B (en) Display method, display device, and electronic device
CN113485625A (en) Electronic equipment response method and device and electronic equipment
WO2024153027A1 (en) Application display method and application display apparatus
WO2022171058A1 (en) Application program processing method and apparatus, and electronic device
CN115718581A (en) Information display method and device, electronic equipment and storage medium
CN115729544A (en) Desktop component generation method, device, electronic device and readable storage medium
WO2023093661A1 (en) Interface control method and apparatus, and electronic device and storage medium
CN115586937A (en) Interface display method and device, electronic equipment and readable storage medium
CN115202524A (en) Display method and device
WO2021073549A1 (en) Screen rotation picture display method and apparatus, computer device, and storage medium
CN113672136A (en) Information display method, device, equipment and storage medium
CN113296849B (en) Application loading optimization method and device and electronic equipment
CN117290039A (en) Download control method and device and electronic equipment
CN120390002A (en) Information sharing method, device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination