[go: up one dir, main page]

CN116028211B - Display card scheduling method, electronic equipment and computer readable storage medium - Google Patents

Display card scheduling method, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116028211B
CN116028211B CN202210776076.8A CN202210776076A CN116028211B CN 116028211 B CN116028211 B CN 116028211B CN 202210776076 A CN202210776076 A CN 202210776076A CN 116028211 B CN116028211 B CN 116028211B
Authority
CN
China
Prior art keywords
app
power supply
started
graphics card
electronic device
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.)
Active
Application number
CN202210776076.8A
Other languages
Chinese (zh)
Other versions
CN116028211A (en
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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Publication of CN116028211A publication Critical patent/CN116028211A/en
Application granted granted Critical
Publication of CN116028211B publication Critical patent/CN116028211B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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

  • Stored Programmes (AREA)

Abstract

本申请涉及计算机技术领域,提供了一种显卡调度方法、电子设备和计算机可读存储介质,该方法包括:获取待启动APP的标识;获取电子设备的当前供电方式;基于预设的映射关系,确定待启动APP的标识和当前供电方式对应的目标显卡类型,目标显卡类型为待启动APP在运行过程中所调用的显卡的类型,映射关系中包括多种供电方式、多个APP的标识和多个显卡类型的对应关系,多种供电方式包括当前供电方式,多个APP的标识包括待启动APP的标识,多个显卡类型包括目标显卡类型。以上方法可以提高显卡调度的合理性。

The present application relates to the field of computer technology, and provides a graphics card scheduling method, an electronic device, and a computer-readable storage medium, the method comprising: obtaining the identifier of the APP to be started; obtaining the current power supply mode of the electronic device; based on a preset mapping relationship, determining the target graphics card type corresponding to the identifier of the APP to be started and the current power supply mode, the target graphics card type is the type of graphics card called by the APP to be started during operation, the mapping relationship includes a plurality of power supply modes, a plurality of APP identifiers, and a plurality of graphics card types. The plurality of power supply modes include the current power supply mode, the identifiers of the plurality of APPs include the identifier of the APP to be started, and the plurality of graphics card types include the target graphics card type. The above method can improve the rationality of graphics card scheduling.

Description

显卡调度方法、电子设备和计算机可读存储介质Graphics card scheduling method, electronic device and computer readable storage medium

本申请要求于2022年05月16日提交国家知识产权局、申请号为202210529195.3、申请名称为“显卡调度方法、电子设备和计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on May 16, 2022, with application number 202210529195.3 and application name “Graphics card scheduling method, electronic device and computer-readable storage medium”, the entire contents of which are incorporated by reference in this application.

技术领域Technical Field

本申请涉及计算机技术领域,具体涉及一种显卡调度方法、电子设备和计算机可读存储介质。The present application relates to the field of computer technology, and in particular to a graphics card scheduling method, an electronic device, and a computer-readable storage medium.

背景技术Background technique

随着电子设备的功能日渐丰富,人们使用电子设备的场景也越来越丰富,对图形画面的处理要求也越来越高。在一些电子设备中,常常会采用独立显卡加集成显卡的显卡方案。As the functions of electronic devices become more and more abundant, the scenarios in which people use electronic devices are also becoming more and more diverse, and the requirements for processing graphics images are also becoming higher and higher. In some electronic devices, a graphics card solution of independent graphics card plus integrated graphics card is often used.

通常,在图形类的应用程序(application,APP)运行过程中,电子设备需要调用GPU的资源来进行图像处理以达到相应的显示效果。针对图像处理的运算量大的APP,由于IGPU处理能力有限,无法满足正常的图形处理的需求,电子设备则会调用DGPU来执行图像处理的操作。而针对图像处理的运算量小的APP,电子设备则可以调用IGPU来执行图像处理。Usually, when a graphics application (APP) is running, the electronic device needs to call the GPU resources to perform image processing to achieve the corresponding display effect. For APPs with large image processing operations, since the IGPU processing capacity is limited and cannot meet the normal graphics processing requirements, the electronic device will call the DGPU to perform image processing operations. For APPs with small image processing operations, the electronic device can call the IGPU to perform image processing.

然而,传统的根据APP的图形处理运算量的大小来确定使用IGPU还是DGPU的方法,依据单一,使得显卡调度不合理。However, the traditional method of determining whether to use the IGPU or the DGPU based on the amount of graphics processing computation of the APP is based on a single basis, which makes graphics card scheduling unreasonable.

发明内容Summary of the invention

本申请提供了一种显卡调度方法、装置、芯片、电子设备、计算机可读存储介质和计算机程序产品,能够提高显卡调度的合理性。The present application provides a graphics card scheduling method, device, chip, electronic device, computer-readable storage medium and computer program product, which can improve the rationality of graphics card scheduling.

第一方面,提供了一种显卡调度方法,包括:获取待启动应用程序APP的标识;获取电子设备的当前供电方式;基于预设的映射关系,确定待启动APP的标识和当前供电方式对应的目标显卡类型,目标显卡类型为待启动APP在运行过程中所调用的显卡的类型,映射关系中包括多种供电方式、多个APP的标识和多个显卡类型的对应关系,多种供电方式中包括当前供电方式,多个APP的标识中包括待启动APP的标识,多个显卡类型中包括目标显卡类型。In a first aspect, a graphics card scheduling method is provided, comprising: obtaining an identifier of an application program APP to be started; obtaining a current power supply mode of an electronic device; and determining, based on a preset mapping relationship, a target graphics card type corresponding to the identifier of the APP to be started and the current power supply mode, wherein the target graphics card type is the type of graphics card called by the APP to be started during operation, and the mapping relationship includes a correspondence between multiple power supply modes, identifiers of multiple APPs, and multiple graphics card types, wherein the multiple power supply modes include the current power supply mode, the identifiers of multiple APPs include the identifier of the APP to be started, and the multiple graphics card types include the target graphics card type.

电子设备根据需要启动的APP的种类,结合电子设备的供电方式来确定当前所要启动的待启动APP是调用集成显卡还是独立显卡,从而对一些续航能力优先的场景下的功耗进行优化,以及确保一些高性能优先的场景下的性能,使得显卡的调度更为合理。The electronic device determines whether the current APP to be started should call the integrated graphics card or the independent graphics card according to the type of APP to be started and the power supply method of the electronic device, thereby optimizing the power consumption in some scenarios where battery life is prioritized, and ensuring the performance in some scenarios where high performance is prioritized, making the scheduling of the graphics card more reasonable.

在一些可能的实现方式中,多种供电方式中包括电池供电和电源供电,多个显卡类型中包括集成显卡和独立显卡,多个APP的标识中包括高性能类别的APP的标识和低性能类别的APP的标识,映射关系包括:低性能类别的APP的标识、电池供电和集成显卡对应;低性能类别的APP的标识、电源供电和独立显卡对应;高性能类别的APP的标识、电池供电和独立显卡对应;高性能类别的APP的标识、电源供电和独立显卡对应。In some possible implementations, the multiple power supply modes include battery power supply and power supply, the multiple graphics card types include integrated graphics card and independent graphics card, the multiple APP identifiers include identifiers of high-performance category APPs and identifiers of low-performance category APPs, and the mapping relationships include: the correspondence between the identifier of the low-performance category APP, battery power supply, and integrated graphics card; the identifier of the low-performance category APP, power supply power, and independent graphics card; the identifier of the high-performance category APP, battery power supply, and independent graphics card; the identifier of the high-performance category APP, power supply power, and independent graphics card.

上述映射关系使得,当APP为对图形处理要求不高的APP,即低性能要求的类别的APP时,电子设备能够结合供电方式来确定需要使用的显卡,使得在电源供电时调用独立显卡来优先保证性能,优化显示效果;在电池供电时,调用集成显卡以节约功耗,从而平衡不同使用场景下用户的体验。而当APP为对图形处理要求高的APP,即高性能要求的类别的APP时,电子设备无论是在电池供电还是在电源供电的情况下,都调用独立显卡来优先保证处理效果,确保高性能要求的APP正常运行,以保证用户体验。The above mapping relationship enables, when the APP is an APP with low requirements for graphics processing, that is, an APP of the category of low performance requirements, the electronic device can determine the graphics card to be used in combination with the power supply mode, so that when powered by the power supply, the independent graphics card is called to prioritize performance and optimize the display effect; when powered by the battery, the integrated graphics card is called to save power consumption, thereby balancing the user experience in different usage scenarios. When the APP is an APP with high requirements for graphics processing, that is, an APP of the category of high performance requirements, the electronic device will call the independent graphics card to prioritize the processing effect, whether it is powered by the battery or the power supply, to ensure the normal operation of the APP with high performance requirements, so as to ensure the user experience.

在一些可能的实现方式中,获取电子设备的当前供电方式之前,还包括:根据待启动APP的标识,确定待启动APP是否为预设名单中的APP,预设名单中的APP为携带高性能类别标识的APP或携带低性能类别标识的APP;若是,则继续执行上述显卡调度的流程。In some possible implementations, before obtaining the current power supply mode of the electronic device, it also includes: determining whether the APP to be started is an APP in a preset list based on the identifier of the APP to be started, and the APP in the preset list is an APP carrying a high-performance category identifier or an APP carrying a low-performance category identifier; if so, continue to execute the above-mentioned graphics card scheduling process.

上述预设名单为白名单,该白名单中的APP为预先确定了在什么样的场景下所要调用什么显卡类型的APP,即运行时分别处于电源供电和电池供电的场景下,是需要调用独立显卡或集成显卡的APP。可选地,白名单中可以包括多个APP,还可以包括这多个APP中每个APP所对应的显卡类型。可选地,显卡类型也可以用相应的标识进行区分,例如独立显卡使用DGPU表示,集成显卡使用IGPU表示。The above preset list is a whitelist, and the APPs in the whitelist are APPs that have predetermined what type of graphics card to call in what scenario, that is, when running in the scenarios of power supply and battery power supply, they are APPs that need to call independent graphics cards or integrated graphics cards. Optionally, the whitelist can include multiple APPs, and can also include the graphics card type corresponding to each of these multiple APPs. Optionally, the graphics card type can also be distinguished by corresponding identifiers, for example, independent graphics cards are represented by DGPU, and integrated graphics cards are represented by IGPU.

在一些可能的实现方式中,上述方法还包括:若待启动APP不是预设名单中的APP,则从预设配置文件中获取目标显卡类型。In some possible implementations, the method further includes: if the APP to be started is not an APP in a preset list, obtaining a target graphics card type from a preset configuration file.

如果待启动APP不是白名单中的APP,则可以从默认的预设配置文件中读取待启动APP所默认的显卡类型,作为目标显卡类型。使用默认的显卡的预设配置文件来调用对应显卡可以确保显卡的有序调用,即采用原始的默认的兜底的设计,因此不会出现上述映射关系中未覆盖到的场景下显卡调用混乱的问题。If the APP to be started is not in the whitelist, the default graphics card type of the APP to be started can be read from the default preset configuration file as the target graphics card type. Using the default graphics card preset configuration file to call the corresponding graphics card can ensure the orderly calling of the graphics card, that is, the original default fallback design is adopted, so there will be no problem of graphics card calling confusion in scenarios not covered by the above mapping relationship.

在一些可能的实现方式中,根据待启动APP的标识,确定待启动APP是否为预设名单中的APP之前,还包括:根据待启动APP的标识确定待启动APP是否为图形类APP;若是,则执行根据待启动APP的标识,确定待启动APP是否为预设名单中的APP步骤。In some possible implementations, before determining whether the APP to be launched is an APP in a preset list based on the identifier of the APP to be launched, the method further includes: determining whether the APP to be launched is a graphic APP based on the identifier of the APP to be launched; if so, executing the step of determining whether the APP to be launched is an APP in the preset list based on the identifier of the APP to be launched.

如果待启动APP是图形类APP,则可以确定此时涉及显卡调度的问题,因此可以继续执行上述显卡调度流程。如果待启动不是图形类APP,则确定并不涉及显卡调度的问题,则可以不再执行上述显卡调度流程,可以采用默认的显卡配置文件进行处理。If the APP to be started is a graphics APP, it can be determined that the graphics card scheduling issue is involved at this time, so the above graphics card scheduling process can be continued. If the APP to be started is not a graphics APP, it is determined that the graphics card scheduling issue is not involved, and the above graphics card scheduling process can be stopped, and the default graphics card configuration file can be used for processing.

在一些可能的实现方式中,在当前供电方式为电源供电,目标显卡类型为集成显卡时,方法还包括:接收用户输入的切换操作;响应于所述切换操作,将所述目标显卡类型由集成显卡切换为独立显卡。In some possible implementations, when the current power supply mode is power supply by electrical source and the target graphics card type is an integrated graphics card, the method further includes: receiving a switching operation input by a user; and in response to the switching operation, switching the target graphics card type from an integrated graphics card to an independent graphics card.

上述供电方式也可以描述为供电场景,例如电源的供电场景可以称为性能场景,电池供电场景可以称为续航场景定。用户可以通过点击“性能场景/续航场景”的按钮来切换供电场景。如果是在续航场景下,如果电池电量超过预设电量阈值,例如超过百分之五十,用户认为此时电量足够使用,那么用户可以通过手动操作,将供电场景由续航场景切换为性能场景,此时则可以调用DGPU来进行图形处理,优先确保显示效果,提升用户的使用体验。该方式也能够灵活切换供电场景,满足用户多种需要。The above power supply methods can also be described as power supply scenarios. For example, the power supply scenario of the power supply can be called a performance scenario, and the battery power supply scenario can be called a battery life scenario. Users can switch power supply scenarios by clicking the "Performance Scenario/Battery Life Scenario" button. If it is in the battery life scenario, if the battery power exceeds the preset power threshold, for example, more than 50%, and the user thinks that the power is sufficient at this time, then the user can manually switch the power supply scenario from the battery life scenario to the performance scenario. At this time, the DGPU can be called for graphics processing, giving priority to ensuring the display effect and improving the user experience. This method can also flexibly switch power supply scenarios to meet the various needs of users.

在一些可能的实现方式中,获取待启动APP的标识,包括:通过进程探针监听新建进程;根据新建进程,获取新建进程用于启动的待启动APP的标识。In some possible implementations, obtaining the identifier of the APP to be started includes: monitoring a newly created process through a process probe; and obtaining, according to the newly created process, the identifier of the APP to be started that is used to start the newly created process.

在一些可能的实现方式中,上述方法还包括:根据目标显卡类型更新预设配置文件,预设配置文件用于执行体根据预设配置文件中的目标显卡类型启动待启动APP。In some possible implementations, the method further includes: updating a preset configuration file according to the target graphics card type, the preset configuration file being used by the execution body to start the APP to be started according to the target graphics card type in the preset configuration file.

在一些可能的实现方式中,获取电子设备的当前供电方式,包括:通过场景识别引擎获取当前供电方式。In some possible implementations, obtaining the current power supply mode of the electronic device includes: obtaining the current power supply mode through a scene recognition engine.

在一些可能的实现方式中,基于预设的映射关系,确定待启动APP的标识和当前供电方式对应的目标显卡类型,包括:通过调度引擎基于映射关系,确定待启动APP的标识和当前供电方式对应的目标显卡类型。In some possible implementations, based on a preset mapping relationship, determining the target graphics card type corresponding to the identifier of the APP to be started and the current power supply mode, including: determining the target graphics card type corresponding to the identifier of the APP to be started and the current power supply mode based on the mapping relationship through a scheduling engine.

第二方面,提供了一种显卡调度装置,包括由软件和/或硬件组成的单元,该单元用于执行第一方面所述的技术方案中任意一种方法。In a second aspect, a graphics card scheduling device is provided, comprising a unit composed of software and/or hardware, and the unit is used to execute any one of the methods in the technical solution described in the first aspect.

第三方面,提供了一种电子设备,电子设备包括:处理器、存储器和接口;处理器、存储器和接口相互配合,使得电子设备执行第一方面所述的技术方案中任意一种方法。In a third aspect, an electronic device is provided, comprising: a processor, a memory and an interface; the processor, the memory and the interface cooperate with each other so that the electronic device executes any one of the methods in the technical solution described in the first aspect.

第四方面,本申请实施例提供一种芯片,包括处理器;处理器用于读取并执行存储器中存储的计算机程序,以执行第一方面所述的技术方案中任意一种方法。In a fourth aspect, an embodiment of the present application provides a chip, comprising a processor; the processor is used to read and execute a computer program stored in a memory to execute any one of the methods in the technical solution described in the first aspect.

可选地,所述芯片还包括存储器,存储器与处理器通过电路或电线连接。Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire.

进一步可选地,所述芯片还包括通信接口。Further optionally, the chip also includes a communication interface.

第五方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储了计算机程序,当所述计算机程序被处理器执行时,使得该处理器执行第一方面所述的技术方案中任意一种方法。In a fifth aspect, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the processor executes any one of the methods in the technical solution described in the first aspect.

第六方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码在电子设备上运行时,使得该电子设备执行第一方面所述的技术方案中任意一种方法。In a sixth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is run on an electronic device, the electronic device executes any one of the methods in the technical solution described in the first aspect.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请实施例提供的一种电子设备的结构示意图;FIG1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

图2为本申请实施例提供的一种软件模块架构示意图;FIG2 is a schematic diagram of a software module architecture provided in an embodiment of the present application;

图3为本申请实施例提供的软件模块间的交互示意图;FIG3 is a schematic diagram of interaction between software modules provided in an embodiment of the present application;

图4为本申请实施例提供的一种信号交互示意图;FIG4 is a schematic diagram of a signal interaction provided in an embodiment of the present application;

图5为本申请实施例提供的一种界面图;FIG5 is an interface diagram provided by an embodiment of the present application;

图6为本申请实施例提供的又一种信号交互示意图;FIG6 is another schematic diagram of signal interaction provided in an embodiment of the present application;

图7为本申请实施例提供的又一种信号交互示意图;FIG7 is another schematic diagram of signal interaction provided in an embodiment of the present application;

图8为本申请实施例提供的一例软件模块架构示意图;FIG8 is a schematic diagram of a software module architecture provided in an embodiment of the present application;

图9为本申请实施例提供的一例显卡调度方法的流程示意图;FIG9 is a flow chart of a graphics card scheduling method provided in an embodiment of the present application;

图10为本申请实施例提供的又一例显卡调度方法的流程示意图FIG. 10 is a flowchart of another graphics card scheduling method provided in an embodiment of the present application.

图11为本申请实施例提供的一例硬件模块架构示意图;FIG11 is a schematic diagram of a hardware module architecture provided in an embodiment of the present application;

图12为本申请实施例提供的一例显卡调度方法的流程示意图;FIG12 is a flow chart of a graphics card scheduling method provided in an embodiment of the present application;

图13为本申请实施例提供的一例显卡调度装置的结构示意图。FIG. 13 is a schematic diagram of the structure of a graphics card scheduling device provided in an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

以下,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、“第三”的特征可以明示或者隐含地包括一个或者更多个该特征。In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.

本申请实施例提供的显卡调度方法可以应用于平板电脑、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personaldigital assistant,PDA)等电子设备上,本申请实施例对电子设备的具体类型不作任何限制。The graphics card scheduling method provided in the embodiment of the present application can be applied to electronic devices such as tablet computers, vehicle-mounted devices, augmented reality (AR)/virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiment of the present application does not impose any restrictions on the specific types of electronic devices.

请参考图1,为本申请实施例提供的电子设备100的结构示意图。Please refer to FIG. 1 , which is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application.

如图1所示,电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,无线通信模块150,显示屏160等。As shown in FIG. 1 , the electronic device 100 may include: a processor 110 , an external memory interface 120 , an internal memory 121 , a universal serial bus (USB) interface 130 , a charging management module 140 , a power management module 141 , a battery 142 , a wireless communication module 150 , a display screen 160 , etc.

可以理解的是,本实施例示意的结构并不构成对电子设备100的具体限定。在另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括I2C接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulsecode modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或USB接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an I2C interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a USB interface, etc.

可以理解的是,本实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only for illustrative purposes and does not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 is charging the battery 142, it can also power the electronic device through the power management module 141.

电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏160,和无线通信模块150等供电。在一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 160, and the wireless communication module 150. In some embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

无线通信模块150可以提供应用在电子设备100上的包括WLAN(如Wi-Fi),蓝牙,全球导航卫星系统(global navigation satellite system,GNSS),调频(frequencymodulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。例如,本申请实施例中,电子设备100可以通过无线通信模块150与终端设备(如无线耳机)建立蓝牙连接。The wireless communication module 150 can provide wireless communication solutions including WLAN (such as Wi-Fi), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. For example, in the embodiment of the present application, the electronic device 100 can establish a Bluetooth connection with a terminal device (such as a wireless headset) through the wireless communication module 150.

无线通信模块150可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块150经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块150还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。The wireless communication module 150 may be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 150 may also receive a signal to be sent from the processor 110, modulate the frequency of the signal, amplify the signal, and convert it into electromagnetic waves for radiation via the antenna.

电子设备100通过GPU,显示屏160,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏160和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements the display function through a GPU, a display screen 160, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 160 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

显示屏160用于显示图像,视频等。该显示屏160包括显示面板。The display screen 160 is used to display images, videos, etc. The display screen 160 includes a display panel.

外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。例如,在本申请实施例中,处理器110可以通过执行存储在内部存储器121中的指令,内部存储器121可以包括存储程序区和存储数据区。The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.

其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universalflash storage,UFS)等。The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

上述电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Windows系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, a Windows system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

图2为本申请实施例的电子设备100的软件结构框图。FIG. 2 is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Windows系统分为用户态和内核态。其中,用户态包括应用层以及子系统动态链接库。内核态自下而上分为固件层、硬件抽象层(hardwareabstraction layer,HAL)、内核和驱动层及执行体。The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Windows system is divided into user state and kernel state. Among them, the user state includes the application layer and the subsystem dynamic link library. The kernel state is divided from bottom to top into the firmware layer, the hardware abstraction layer (HAL), the kernel and the driver layer and the executive body.

如图2所示,应用层包括音乐、视频、游戏、办公、社交等应用程序。应用层还包括环境子系统、场景识别引擎以及调度引擎等。其中,图中仅示出部分应用程序,应用层还可以包括其他应用程序,例如购物应用、浏览器等,本申请不做限定。As shown in Figure 2, the application layer includes applications such as music, video, games, office, and social networking. The application layer also includes an environment subsystem, a scene recognition engine, and a scheduling engine. Among them, only some applications are shown in the figure, and the application layer can also include other applications, such as shopping applications, browsers, etc., which are not limited in this application.

环境子系统可以将基本的执行体系统服务的某些子集以特定的形态展示给应用程序,为应用程序提供执行环境。The environment subsystem can present certain subsets of the basic executive system services to the application in a specific form, providing an execution environment for the application.

场景识别引擎可以识别电子设备100所处的用户场景,并确定与该用户场景匹配的基础调度策略(也可称为第二调度策略)。调度引擎可以获取电子设备100的负载情况,并结合电子设备100的负载情况及上述基础调度策略确定符合电子设备100实际运行情况的实际调度策略(也可称为第一调度策略)。其中,关于场景识别引擎和调度引擎的具体内容见后文,在此暂不描述。The scene recognition engine can identify the user scene in which the electronic device 100 is located, and determine the basic scheduling strategy (also referred to as the second scheduling strategy) that matches the user scene. The scheduling engine can obtain the load condition of the electronic device 100, and determine the actual scheduling strategy (also referred to as the first scheduling strategy) that conforms to the actual operation of the electronic device 100 in combination with the load condition of the electronic device 100 and the above-mentioned basic scheduling strategy. The specific contents of the scene recognition engine and the scheduling engine are described later and will not be described here for the time being.

子系统动态链接库包括API模块,该API模块包括Windows API,Windows原生API等。其中,Windows API,Windows原生API均可以为应用程序提供系统调用入口及内部函数支持,区别在于Windows原生API为Windows系统原生的API。例如,Windows API可包括user.dll、kernel.dll,Windows原生API可包括ntdll.dll。其中,user.dll是Windows用户界面接口,可用于执行创建窗口、发送消息等操作。kernel.dll用于为应用程序提供访问内核的接口。ntdll.dll是重要的Windows NT内核级文件,描述了windows本地NTAPI的接口。当Windows启动时,ntdll.dll就驻留在内存中特定的写保护区域,使别的程序无法占用这个内存区域。The subsystem dynamic link library includes an API module, which includes Windows API, Windows native API, etc. Among them, Windows API and Windows native API can both provide system call entry and internal function support for applications. The difference is that Windows native API is an API native to the Windows system. For example, Windows API may include user.dll and kernel.dll, and Windows native API may include ntdll.dll. Among them, user.dll is the Windows user interface interface, which can be used to perform operations such as creating windows and sending messages. Kernel.dll is used to provide applications with an interface to access the kernel. ntdll.dll is an important Windows NT kernel-level file that describes the interface of the Windows native NTAPI. When Windows starts, ntdll.dll resides in a specific write-protected area in the memory, so that other programs cannot occupy this memory area.

执行体包括进程管理器、虚拟内存管理器、安全引用监视器、I/O管理器、Windows管理规范(Windows management instrumentation,WMI)、电源管理器、系统事件驱动(operating system event driver,OsEventDriver)节点、系统与芯片驱动(operatingsystem to System on Chip,OS2SOC)节点等。The executive body includes the process manager, virtual memory manager, security reference monitor, I/O manager, Windows management instrumentation (WMI), power manager, operating system event driver (OsEventDriver) node, operating system to System on Chip (OS2SOC) node, etc.

进程管理器用于创建及中止进程和线程。The process manager is used to create and terminate processes and threads.

虚拟内存管理器实现“虚拟内存”。虚拟内存管理器也为高速缓存管理器提供基本的支持。The Virtual Memory Manager implements "virtual memory". The Virtual Memory Manager also provides basic support for the Cache Manager.

安全引用监视器可在本地计算机上执行安全策略,它保护了操作系统资源,执行运行时对象的保护和监视。The Security Reference Monitor enforces security policy on the local computer, protects operating system resources, and performs runtime object protection and monitoring.

I/O管理器执行独立于设备的输入/输出,并进一步处理调用适当的设备驱动程序。The I/O manager performs device-independent input/output and further processes calls appropriate device drivers.

电源管理器可管理所有支持电源状态更改的设备的电源状态更改。The power manager manages power state changes for all devices that support power state changes.

系统事件驱动节点可以与内核和驱动层进行交互,例如与显卡驱动进行交互,在确定存在GPU视频解码事件后,向场景识别引擎上报该GPU视频解码事件。The system event driven node can interact with the kernel and driver layer, for example, interact with the graphics card driver, and after determining that there is a GPU video decoding event, report the GPU video decoding event to the scene recognition engine.

系统与芯片驱动节点可供调度引擎向硬件设备发送调整信息,例如向CPU发送调整维持功率限值(sustained,power limite,SPL)(或PL1)和慢包功率跟踪(slow packagepower tracking,s-PPT)(或PL2)的信息。The system and chip driver nodes can be used by the scheduling engine to send adjustment information to the hardware device, such as sending information to the CPU to adjust the sustained power limit (SPL) (or PL1) and slow package power tracking (s-PPT) (or PL2).

内核和驱动层包括内核以及设备驱动程序。The kernel and driver layer includes the kernel and device drivers.

内核是对处理器体系结构的抽象,将执行体与处理器体系结构的差异相隔离,保证系统的可移植性。内核可以进行线程安排和调度、陷阱处理和异常调度、中断处理和调度等。The kernel is an abstraction of the processor architecture, isolating the executive body from the differences in the processor architecture to ensure the portability of the system. The kernel can perform thread scheduling and dispatching, trap handling and exception dispatching, interrupt handling and dispatching, etc.

设备驱动程序运行在内核模式下,为I/O系统和相关硬件之间的接口。设备驱动程序可包括显卡驱动、Intel DTT驱动、鼠标驱动、音视频驱动、摄像头驱动、键盘驱动等。例如,显卡驱动可以驱动GPU运行,Intel DTT驱动可以驱动CPU运行。Device drivers run in kernel mode and are interfaces between the I/O system and related hardware. Device drivers may include graphics card drivers, Intel DTT drivers, mouse drivers, audio and video drivers, camera drivers, keyboard drivers, etc. For example, a graphics card driver can drive the GPU to run, and an Intel DTT driver can drive the CPU to run.

HAL是一个核心态模块,可以隐藏各种与硬件有关的细节,例如I/O接口、中断控制器以及多处理器通信机制等,为运行Windows的不同硬件平台提供统一的服务接口,实现多种硬件平台上的可移植性。需要说明的是,为了维护Windows的可移植性,Windows内部组件和用户编写的设备驱动程序并不直接访问硬件,而是通过调用HAL中的例程。HAL is a kernel-state module that can hide various hardware-related details, such as I/O interfaces, interrupt controllers, and multi-processor communication mechanisms, and provide a unified service interface for different hardware platforms running Windows, achieving portability on multiple hardware platforms. It should be noted that in order to maintain the portability of Windows, Windows internal components and user-written device drivers do not directly access the hardware, but call routines in HAL.

固件层可以包括基本输入输出系统(basic input output system,BIOS),BIOS是一组固化到计算机主板上一个只读存储器(read only memory,ROM)芯片内的程序,它保存着计算机最重要的基本输入输出的程序、开机后自检程序和系统自启动程序,它可从互补金属氧化物半导体(complementary metal oxide semiconductor,CMOS)中读写系统设置的具体信息。其主要功能是为计算机提供最底层的、最直接的硬件设置和控制。Intel DTT驱动可以通过BIOS向CPU发送指令的。The firmware layer can include the basic input output system (BIOS). BIOS is a set of programs that are fixed to a read-only memory (ROM) chip on the computer motherboard. It stores the most important basic input and output programs of the computer, the self-test program after power-on, and the system self-starting program. It can read and write specific information of system settings from complementary metal oxide semiconductor (CMOS). Its main function is to provide the lowest-level and most direct hardware settings and control for the computer. The Intel DTT driver can send instructions to the CPU through the BIOS.

需要说明的是,本申请实施例仅以Windows系统举例来说明,在其他操作系统中(例如安卓系统,IOS系统,鸿蒙系统等),只要各个功能模块实现的功能和本申请的实施例类似也能实现本申请的方案。It should be noted that the embodiments of the present application are only illustrated using the Windows system as an example. In other operating systems (such as the Android system, the IOS system, the Hongmeng system, etc.), as long as the functions implemented by each functional module are similar to those of the embodiments of the present application, the solutions of the present application can also be implemented.

图3示出了电子设备100对资源进行调度的软件及硬件的工作流程示意图。FIG. 3 is a schematic diagram showing the software and hardware workflow of the electronic device 100 for scheduling resources.

如图3所示,应用层的场景识别引擎包括系统探针模块、场景识别模块及基础策略匹配管理器。场景识别模块可分别与系统探针模块及基础策略匹配管理器进行交互。场景识别模块可以向系统探针模块发送获取探针状态的请求。系统探针模块可以获取电子设备100的运行状态。例如,系统探针模块可以包括电源状态探针、外设状态探针、进程负载探针、音视频状态探针、系统负载探针及系统事件探针等。As shown in FIG3 , the scene recognition engine of the application layer includes a system probe module, a scene recognition module, and a basic strategy matching manager. The scene recognition module can interact with the system probe module and the basic strategy matching manager respectively. The scene recognition module can send a request to obtain the probe status to the system probe module. The system probe module can obtain the operating status of the electronic device 100. For example, the system probe module can include a power status probe, a peripheral status probe, a process load probe, an audio and video status probe, a system load probe, and a system event probe.

其中,电源状态探针可以向内核态订阅电源状态事件,根据内核态反馈的回调函数确定电源状态,电源状态包括电池(剩余)电量、电源模式等,电源模式可包括交流电源(alternating current,AC)和直流电源(direct current,DC)。例如,电源状态探针可向执行体层的OsEventDriver节点发送订阅电源状态事件的请求,由OsEventDriver节点向执行体层的电源管理器转发该请求。电源管理器可通过该OsEventDriver节点向电源状态探针反馈回调函数。Among them, the power state probe can subscribe to the power state event from the kernel state, and determine the power state according to the callback function fed back by the kernel state. The power state includes the battery (remaining) power, power mode, etc. The power mode may include alternating current (AC) and direct current (DC). For example, the power state probe can send a request to subscribe to the power state event to the OsEventDriver node of the executive layer, and the OsEventDriver node forwards the request to the power manager of the executive layer. The power manager can feed back the callback function to the power state probe through the OsEventDriver node.

外设状态探针可以向内核态订阅外设事件,根据内核态反馈的回调函数确定外设事件。外设事件包括鼠标滚轮滑动事件、鼠标点击事件、键盘输入事件、麦克风输入事件、摄像头输入事件等。The peripheral state probe can subscribe to peripheral events in the kernel state and determine the peripheral events according to the callback function fed back by the kernel state. Peripheral events include mouse wheel sliding events, mouse click events, keyboard input events, microphone input events, camera input events, etc.

进程负载探针可以向内核态订阅进程负载,根据内核态反馈的回调函数确定进程(例如,第一进程)的负载。The process load probe may subscribe to the process load in the kernel state, and determine the load of the process (eg, the first process) according to the callback function fed back by the kernel state.

系统负载探针可以向内核态订阅系统负载,根据内核态反馈的回调函数确定系统负载。The system load probe can subscribe to the system load in the kernel state and determine the system load based on the callback function fed back by the kernel state.

音视频状态探针可向内核态订阅音视频事件,根据内核态反馈的回调函数确定电子设备100当前存在的音视频事件。音视频事件可包括GPU解码事件等。例如,音视频状态探针可向执行体层的OsEventDriver节点发送订阅GPU解码事件的请求,由OsEventDriver节点向内核和驱动层的显卡驱动转发该请求。显卡驱动可以监控GPU的状态,在监控到GPU在进行解码操作后,通过该OsEventDriver节点向音视频状态探针反馈回调函数。The audio and video status probe can subscribe to audio and video events in the kernel state, and determine the audio and video events currently existing in the electronic device 100 according to the callback function fed back by the kernel state. Audio and video events may include GPU decoding events, etc. For example, the audio and video status probe can send a request to subscribe to GPU decoding events to the OsEventDriver node of the executive layer, and the OsEventDriver node forwards the request to the graphics card driver of the kernel and driver layer. The graphics card driver can monitor the status of the GPU, and after monitoring that the GPU is performing a decoding operation, it feeds back a callback function to the audio and video status probe through the OsEventDriver node.

系统事件探针可以向内核态订阅系统事件,根据内核态反馈的回调函数确定系统事件。系统事件可包括窗口变化事件、进程创建事件、线程创建事件等。例如,系统事件探针可向执行体层的OsEventDriver节点发送订阅进程创建事件的请求,由OsEventDriver节点向进程管理器转发该请求。进程管理器可在创建进程后,通过该OsEventDriver节点向系统事件探针反馈回调函数。又例如,系统事件探针还向API模块发送订阅焦点窗口变化事件,API模块可监控电子设备100的焦点窗口是否发生变化,并在监控到焦点窗口发生变化时,向系统事件探针反馈回调函数。The system event probe can subscribe to system events in the kernel state and determine the system events based on the callback function fed back by the kernel state. System events may include window change events, process creation events, thread creation events, etc. For example, the system event probe can send a request to subscribe to the process creation event to the OsEventDriver node of the executive layer, and the OsEventDriver node forwards the request to the process manager. After creating the process, the process manager can feed back the callback function to the system event probe through the OsEventDriver node. For another example, the system event probe also sends a subscription focus window change event to the API module. The API module can monitor whether the focus window of the electronic device 100 has changed, and when the focus window is monitored to change, it feeds back the callback function to the system event probe.

可见,系统探针模块通过向内核态订阅电子设备100的各种事件,再根据内核态反馈的回调函数确定电子设备100的运行状态,即得到探针状态。系统探针模块得到探针状态后,可向场景识别模块反馈该探针状态。场景识别模块接收到探针状态后,可根据该探针状态确定电子设备100所处的用户场景。该使用场景可包括视频场景、游戏场景、办公场景及社交场景等。用户场景可以反映用户当前的使用需求。例如,场景识别引擎在识别出焦点窗口为视频应用的窗口时,确定出电子设备100处于视频场景,这说明用户需要使用视频应用观看、浏览视频。又例如,场景识别引擎识在识别出焦点窗口为微信TM的聊天窗口时,确定电子设备100处于社交场景。场景识别模块还可向基础策略匹配管理器发送该用户场景。基础策略匹配管理器可根据该用户场景确定基础调度策略(也可称为第二调度策略,具体可以参见下文S301、S302中的说明)。基础策略匹配管理器可向场景识别模块反馈该基础调度策略。场景识别模块可向应用层的调度引擎发送该基础调度策略及用户场景。It can be seen that the system probe module subscribes to various events of the electronic device 100 in the kernel state, and then determines the running state of the electronic device 100 according to the callback function fed back by the kernel state, that is, obtains the probe state. After obtaining the probe state, the system probe module can feed back the probe state to the scene recognition module. After receiving the probe state, the scene recognition module can determine the user scene in which the electronic device 100 is located according to the probe state. The usage scene may include video scenes, game scenes, office scenes, and social scenes. The user scene can reflect the user's current usage needs. For example, when the scene recognition engine identifies that the focus window is a window of a video application, it determines that the electronic device 100 is in a video scene, which means that the user needs to use a video application to watch and browse videos. For another example, when the scene recognition engine identifies that the focus window is a chat window of WeChat TM, it determines that the electronic device 100 is in a social scene. The scene recognition module can also send the user scene to the basic policy matching manager. The basic policy matching manager can determine the basic scheduling strategy (also referred to as the second scheduling strategy) according to the user scenario, and specifically refer to the description in S301 and S302 below. The basic policy matching manager can feed back the basic scheduling strategy to the scene recognition module. The scenario recognition module may send the basic scheduling strategy and user scenario to the scheduling engine of the application layer.

如图3所示,调度引擎包括负载管控器、芯片策略融合器以及调度执行器。其中,负载管控器可接收场景识别模块发送的基础调度策略及用户场景。负载管控器还可从系统探针模块获取系统负载,并根据系统负载和用户场景对该基础调度策略进行调整,得到实际调度策略(也可称为第一调度策略,具体可以参见下文S310中的说明)。实际调度策略中包括OS调度策略和第一CPU功耗调度策略(也可称为第一子策略)。其中,负载管控器可向调度执行器发送该OS调度策略,由调度执行器基于该OS调度策略进行调度。OS调度策略用于调整焦点进程的进程优先级及I/O优先级。示例性的,调度执行器可向进程管理器发送调整焦点进程的进程优先级的指令,响应于该指令,进程管理器对焦点进程的进程优先级进行调整。又例如,调度执行器可向I/O管理器发送调整焦点进程的I/O优先级的指令,响应于该指令,I/O管理器对焦点进程的I/O优先级进行调整。As shown in FIG3 , the scheduling engine includes a load controller, a chip policy fusion device, and a scheduling executor. Among them, the load controller can receive the basic scheduling policy and user scenario sent by the scenario recognition module. The load controller can also obtain the system load from the system probe module, and adjust the basic scheduling policy according to the system load and the user scenario to obtain the actual scheduling policy (also referred to as the first scheduling policy, see the description in S310 below for details). The actual scheduling policy includes the OS scheduling policy and the first CPU power consumption scheduling policy (also referred to as the first sub-policy). Among them, the load controller can send the OS scheduling policy to the scheduling executor, and the scheduling executor performs scheduling based on the OS scheduling policy. The OS scheduling policy is used to adjust the process priority and I/O priority of the focus process. Exemplarily, the scheduling executor can send an instruction to adjust the process priority of the focus process to the process manager, and in response to the instruction, the process manager adjusts the process priority of the focus process. For another example, the scheduling executor can send an instruction to adjust the I/O priority of the focus process to the I/O manager, and in response to the instruction, the I/O manager adjusts the I/O priority of the focus process.

负载管控器还可向芯片策略融合器发送第一CPU功耗调度策略,芯片策略融合器可基于CPU的芯片平台类型及该第一CPU功耗调度策略,得到第二CPU功耗调度策略(也可称为第二子策略,具体可以参见下文S317~S325中的说明)。CPU的芯片平台类型主要分为两种,分别为(Advanced Micro Devices,AMD)的CPU和/> 的CPU,这两类CPU对于CPU功耗的调整方式并不相同,因此需要进行区分。The load controller can also send the first CPU power consumption scheduling strategy to the chip strategy fusion device, and the chip strategy fusion device can obtain the second CPU power consumption scheduling strategy (also called the second sub-strategy, see the description in S317 to S325 below) based on the CPU chip platform type and the first CPU power consumption scheduling strategy. There are two main types of CPU chip platforms: (Advanced Micro Devices, AMD) CPU and/> These two types of CPUs have different ways of adjusting CPU power consumption, so they need to be distinguished.

若CPU的芯片平台类型为AMD(也可以称为第一类型),调度执行器可以向电源管理器发送调整能源性能偏好(energy performance preference,EPP)的指令,以调整CPU的EPP。另外,调度执行器还可以向OS2SOC驱动节点发送调整SPL、s-PPT的指令,以调整CPU的PL1(在AMD平台中可以叫做SPL)和PL2(在AMD平台中可以叫做s-PPT)。If the chip platform type of the CPU is AMD (also called the first type), the scheduling executor can send an instruction to adjust the energy performance preference (EPP) to the power manager to adjust the EPP of the CPU. In addition, the scheduling executor can also send an instruction to adjust the SPL and s-PPT to the OS2SOC driver node to adjust the PL1 (which can be called SPL in the AMD platform) and PL2 (which can be called s-PPT in the AMD platform) of the CPU.

若CPU的芯片平台类型为调度执行器可以通过WMI插件向Intel DTT驱动发送该第二CPU功耗调度策略,第二CPU功耗调度策略可包括PL1的最小值、PL1的最大值、PL2、PL2的持续时间及EPP,由Intel DTT驱动CPU基于该第二CPU功耗调度策略运行。If the CPU chip platform type is The scheduling executor can send the second CPU power consumption scheduling policy to the Intel DTT driver through the WMI plug-in. The second CPU power consumption scheduling policy may include the minimum value of PL1, the maximum value of PL1, PL2, the duration of PL2 and EPP. The Intel DTT drives the CPU to run based on the second CPU power consumption scheduling policy.

本申请实施方式所提供的资源调度(包括显卡资源调度)方法,主要分为两个过程,分别为:(1)确定电子设备所处的用户场景;(2)根据电子设备所处的用户场景及电子设备的系统负载进行资源调度。下面将结合附图分别说明上述两个过程。The resource scheduling (including graphics card resource scheduling) method provided in the embodiment of the present application is mainly divided into two processes, namely: (1) determining the user scenario of the electronic device; (2) performing resource scheduling according to the user scenario of the electronic device and the system load of the electronic device. The above two processes will be described below in conjunction with the accompanying drawings.

下面将以电子设备处于视频播放场景为例,结合图4,对图3所示的电子设备中部分模块的交互过程进行说明。如图4所示,本申请实施例提供的一种资源调度方法,其确定电子设备所处的用户场景的流程如下:The following will take the electronic device in the video playback scenario as an example, and combine with Figure 4 to illustrate the interaction process of some modules in the electronic device shown in Figure 3. As shown in Figure 4, a resource scheduling method provided by an embodiment of the present application determines the user scenario in which the electronic device is located as follows:

S101、系统探针模块向OsEventDriver节点发送订阅进程创建事件的请求。S101. The system probe module sends a request for subscribing to a process creation event to an OsEventDriver node.

如图3所示,场景识别引擎包括系统探针模块,系统探针模块包括系统事件探针。在本申请实施例中,可以由系统事件探针向位于执行体层的OsEventDriver节点发送订阅进程创建事件的请求。其中,订阅进程创建事件的请求也可以称为第一请求。As shown in Figure 3, the scene recognition engine includes a system probe module, and the system probe module includes a system event probe. In an embodiment of the present application, the system event probe can send a request to subscribe to a process creation event to an OsEventDriver node located at the executive layer. The request to subscribe to a process creation event can also be referred to as a first request.

在一种可选的实施方式中,订阅进程创建事件的请求可以携带有进程名称。即场景识别引擎可以仅订阅指定进程的创建事件,减少不相干进程的创建事件的干扰。例如,指定进程可以为视频应用的进程、游戏应用的进程、办公应用的进程、社交应用的进程等等。当然,在其他实施方式中,场景识别引擎也可以不对订阅的进程创建事件做出限制。In an optional implementation, the request for subscribing to a process creation event may carry a process name. That is, the scene recognition engine may only subscribe to the creation event of a specified process, reducing interference from creation events of irrelevant processes. For example, the specified process may be a process of a video application, a process of a game application, a process of an office application, a process of a social application, and so on. Of course, in other implementations, the scene recognition engine may not impose restrictions on the subscribed process creation events.

S102、OsEventDriver节点向进程管理器发送订阅进程创建事件的请求。S102. The OsEventDriver node sends a request for subscribing to a process creation event to the process manager.

进程创建事件的请求可以参考S101的描述,在此不做赘述。The request for the process creation event can refer to the description of S101, which will not be repeated here.

也就是说,场景识别引擎的系统事件探针可以通过OsEventDriver节点向进程管理器发送订阅进程创建事件的请求。That is, the system event probe of the scene recognition engine can send a request to subscribe to the process creation event to the process manager through the OsEventDriver node.

可以理解地,OsEventDriver节点会向进程管理器注册一个回调,注册该回调的作用是当进程管理器创建进程后,可以向OsEventDriver节点返回该进程创建事件。It can be understood that the OsEventDriver node will register a callback with the process manager. The purpose of registering the callback is that after the process manager creates a process, the process creation event can be returned to the OsEventDriver node.

S103、系统探针模块向OsEventDriver节点发送订阅GPU解码事件的请求。S103: The system probe module sends a request to subscribe to GPU decoding events to the OsEventDriver node.

仍然如图3所示,系统探针模块还包括音视频状态探针。在本申请实施例中,可以由系统探针模块的音视频状态探针向OsEventDriver节点发送订阅GPU解码事件的请求。其中,订阅GPU解码事件的请求也可以称为第三请求。Still as shown in Figure 3, the system probe module also includes an audio and video status probe. In the embodiment of the present application, the audio and video status probe of the system probe module can send a request to subscribe to GPU decoding events to the OsEventDriver node. The request to subscribe to GPU decoding events can also be called a third request.

S104、OsEventDriver节点向显卡驱动发送订阅GPU解码事件的请求。S104. The OsEventDriver node sends a request to subscribe to GPU decoding events to the graphics card driver.

也就是说,场景识别引擎的音视频状态探针可以通过OsEventDriver节点向显卡驱动发送订阅GPU解码事件的请求。同样地,OsEventDriver节点可向显卡驱动注册一个回调,注册该回调的作用是当显卡驱动监控到GPU进行解码操作后,可以向OsEventDriver节点返回该GPU解码事件。That is to say, the audio and video status probe of the scene recognition engine can send a request to subscribe to GPU decoding events to the graphics driver through the OsEventDriver node. Similarly, the OsEventDriver node can register a callback with the graphics driver. The purpose of registering this callback is that when the graphics driver monitors the GPU for decoding operations, it can return the GPU decoding event to the OsEventDriver node.

S105、系统探针模块向API模块发送订阅焦点窗口变化事件的请求。S105. The system probe module sends a request for subscribing to a focus window change event to the API module.

API模块可包括由user32.dll实现的windows用户界面接口,该接口可用于创建窗口。在一种可选的实施方式中,可以由系统探针模块的系统事件探针向API模块的windows用户界面接口发送订阅焦点窗口变化事件的请求。其中,订阅焦点窗口变化事件的请求也可以称为第二请求。The API module may include a windows user interface implemented by user32.dll, which can be used to create a window. In an optional implementation, a system event probe of the system probe module may send a request to subscribe to a focus window change event to the windows user interface of the API module. The request to subscribe to a focus window change event may also be referred to as a second request.

同样地,该系统事件探针可向API模块注册一个回调,注册该回调的作用是当API模块(的windows用户界面接口)监控到焦点窗口发生变化时,可以向系统事件探针返回该焦点窗口变化事件。Similarly, the system event probe can register a callback with the API module. The purpose of registering the callback is that when the API module (windows user interface interface) monitors the focus window change, the focus window change event can be returned to the system event probe.

焦点窗口为拥有焦点的窗口,大概率为用户当前需要使用的窗口。因此,通过监控焦点窗口,可以确定用户的使用需求。例如,焦点窗口为视频应用的窗口,则表明用户需求为浏览、播放视频。又例如,焦点窗口为游戏应用的窗口,则表明用户需求为打游戏。通过监控焦点窗口是否发生变化,可以确定用户需求是否发生改变。例如,焦点窗口由视频应用的窗口变为游戏应用的窗口,则表明用户当前的需求由看视频变成了打游戏。The focus window is the window with focus, which is most likely the window that the user currently needs to use. Therefore, by monitoring the focus window, the user's usage needs can be determined. For example, if the focus window is the window of a video application, it indicates that the user's needs are to browse and play videos. For another example, if the focus window is the window of a game application, it indicates that the user's needs are to play games. By monitoring whether the focus window changes, it can be determined whether the user's needs have changed. For example, if the focus window changes from the window of a video application to the window of a game application, it indicates that the user's current needs have changed from watching videos to playing games.

需要说明的是,上述S101、S103及S105之间没有严格的先后顺序,其可以按照图4中所示的顺序依次执行,也可以同时执行,也可以按照S103、S101、S105的顺序依次执行、按照S103、S105、S101的顺序依次执行、按照S105、S101、S103的顺序依次执行或者按照S105、S103、S101的顺序依次执行。相应地,S102、S104及S106之间也没有严格的先后顺序,只要满足S102在S101之后执行、S104在S103之后执行以及S106在S105之后执行即可,在此不做具体限制。It should be noted that there is no strict order between the above S101, S103 and S105. They can be executed in sequence according to the order shown in FIG4, or they can be executed simultaneously, or they can be executed in the order of S103, S101, S105, S103, S105, S101, S105, S101, S103, or S105, S103, S101. Correspondingly, there is no strict order between S102, S104 and S106. As long as S102 is executed after S101, S104 is executed after S103, and S106 is executed after S105, no specific restrictions are made here.

S106、响应于接收到用户开启视频应用的操作,视频应用向进程管理器发送创建进程请求。S106: In response to receiving an operation of starting the video application from the user, the video application sends a request to create a process to the process manager.

其中,创建进程请求包括视频应用程序的存储地址。The create process request includes the storage address of the video application.

视频应用可以通过API模块的kernel32.dll接口及Ntdll.dll接口向进程管理器发送创建进程的请求(图未示)。The video application can send a request to create a process to the process manager through the kernel32.dll interface and the Ntdll.dll interface of the API module (not shown).

S107、进程管理器创建视频应用进程。S107: The process manager creates a video application process.

具体的,进程管理器可以通过该存储地址查询到视频应用程序的二进制文件。通过加载视频应用程序的二进制文件,可以创建进程运行的环境,启动视频应用进程。Specifically, the process manager can query the binary file of the video application program through the storage address. By loading the binary file of the video application program, an environment for process operation can be created to start the video application process.

其中,Windows操作系统将一个应用程序的一次运行定义为一个进程。一个进程可以拥有多个线程。窗口是窗口结构的实例,是一种图形用户界面(graphical userinterface,GUI)资源,窗口是由线程创建的,线程可以拥有它所创建的所有窗口。在本申请实施例中,电子设备运行视频应用,则进程管理器需创建该视频应用的进程,即视频应用进程(即第一进程)。视频应用进程包括多个线程,多个线程包括线程1,线程1可用于创建视频应用的主窗口,主窗口为集成有视频应用全部功能按键的窗口。Among them, the Windows operating system defines one run of an application as a process. A process can have multiple threads. A window is an instance of a window structure, which is a graphical user interface (GUI) resource. A window is created by a thread, and a thread can own all windows it creates. In an embodiment of the present application, an electronic device runs a video application, and the process manager needs to create a process for the video application, that is, a video application process (i.e., a first process). The video application process includes multiple threads, and the multiple threads include thread 1. Thread 1 can be used to create the main window of the video application, and the main window is a window that integrates all function keys of the video application.

S108、进程管理器向OsEventDriver节点上报进程创建事件。S108. The process manager reports the process creation event to the OsEventDriver node.

其中,进程创建事件可包括进程管理器所创建的进程的名称。在本申请实施例中,该进程的名称为视频应用进程的名称。当然,若进程管理器创建的是其他应用的进程,该进程的名称也对应为其他应用进程的名称。Among them, the process creation event may include the name of the process created by the process manager. In the embodiment of the present application, the name of the process is the name of the video application process. Of course, if the process manager creates a process of other applications, the name of the process also corresponds to the name of the other application process.

前文已经说明,OsEventDriver节点向进程管理器发送了订阅进程创建事件的请求,且注册了回调。因此,进程管理器在创建视频应用进程后可向OsEventDriver节点上报进程创建事件。As described above, the OsEventDriver node sends a request to the process manager to subscribe to the process creation event and registers a callback. Therefore, after creating the video application process, the process manager can report the process creation event to the OsEventDriver node.

S109、OsEventDriver节点向系统探针模块上报进程创建事件。S109. The OsEventDriver node reports the process creation event to the system probe module.

其中,关于进程创建事件的描述见S108,在此不再赘述。The description of the process creation event is shown in S108 and will not be repeated here.

在本申请实施例中,该OsEventDriver节点可向系统探针模块的系统事件探针上报该进程创建事件。In the embodiment of the present application, the OsEventDriver node may report the process creation event to the system event probe of the system probe module.

S110、系统探针模块向场景识别模块发送进程创建事件。S110: The system probe module sends a process creation event to the scene recognition module.

S111、响应于线程1的调用请求,API模块创建窗口1。S111 . In response to the calling request of thread 1 , the API module creates window 1 .

进程管理器创建视频应用进程后,视频应用进程的线程1主动调用API模块的windows用户界面接口创建窗口1。示例性的,如图5中(a)所示,电子设备可以显示窗口101,该窗口101可以为桌面,也可以称为主界面。该窗口101包括视频应用的图标102。电子设备可以接收用户点击该视频应用的图标102的操作,响应于该操作,如图5中的(b)所示,电子设备显示窗口103(即窗口1,也可以称为第一窗口)。在上述过程中,焦点窗口由原本的窗口101变为窗口103。After the process manager creates the video application process, thread 1 of the video application process actively calls the windows user interface interface of the API module to create window 1. Exemplarily, as shown in (a) of FIG. 5 , the electronic device can display window 101, which can be a desktop, or can also be called a main interface. The window 101 includes an icon 102 of the video application. The electronic device can receive an operation of a user clicking on the icon 102 of the video application, and in response to the operation, as shown in (b) of FIG. 5 , the electronic device displays window 103 (i.e., window 1, or can also be called a first window). In the above process, the focus window changes from the original window 101 to window 103.

S112、API模块向系统探针模块上报焦点窗口事件。S112. The API module reports the focus window event to the system probe module.

在本申请实施例中,API模块的windows用户界面接口创建窗口1后,可以获取第一进程(即焦点进程)的名称及第二进程的名称,第一进程为当前的焦点窗口(即窗口1)对应的进程,第二进程为上一个焦点窗口(例如,窗口2)对应的进程。示例性的,窗口1对应的进程为视频应用进程(第一进程),该进程的名称例如为hlive.exe,窗口2对应的进程为windows程序管理器的进程(第二进程),该进程的名称例如为explorer.exe。由于第一进程的名称与第二进程的名称不一致,API模块确定焦点窗口发生变化,向系统探针模块的系统事件探针上报焦点窗口事件。其中,焦点窗口变化事件包括第一进程(即焦点进程)的名称。示例性的,第一进程为视频应用进程,焦点窗口变化事件携带有视频应用进程的名称。In an embodiment of the present application, after the windows user interface of the API module creates window 1, the name of the first process (i.e., the focus process) and the name of the second process can be obtained. The first process is the process corresponding to the current focus window (i.e., window 1), and the second process is the process corresponding to the previous focus window (e.g., window 2). Exemplarily, the process corresponding to window 1 is a video application process (first process), and the name of the process is, for example, hlive.exe, and the process corresponding to window 2 is a process of the windows program manager (second process), and the name of the process is, for example, explorer.exe. Since the name of the first process is inconsistent with the name of the second process, the API module determines that the focus window has changed, and reports the focus window event to the system event probe of the system probe module. Among them, the focus window change event includes the name of the first process (i.e., the focus process). Exemplarily, the first process is a video application process, and the focus window change event carries the name of the video application process.

需要说明的是,在电子设备已经启动视频应用的情况下,电子设备可以不用执行S106~S111。在系统探针模块向API模块发送订阅焦点窗口变化事件的请求后,若用户将焦点窗口切换为视频应用的窗口,API模块同样可以检测到焦点窗口发生变化,并向系统探针模块上报焦点窗口事件。It should be noted that, if the electronic device has already started the video application, the electronic device does not need to execute S106 to S111. After the system probe module sends a request to subscribe to the focus window change event to the API module, if the user switches the focus window to the window of the video application, the API module can also detect the focus window change and report the focus window event to the system probe module.

S113、系统探针模块向场景识别模块发送焦点窗口事件。S113: The system probe module sends a focus window event to the scene recognition module.

S114、场景识别模块确定第一进程所属的类型为视频类。S114: The scene recognition module determines that the type of the first process is a video type.

电子设备可以预先配置有应用名单,场景识别模块可以查询应用名单中是否包括第一进程。若应用名单中包括第一进程,场景识别模块可以确定第一进程所属的类型。其中,应用名单包括每个应用的进程名称及应用所属的类型。示例性的,应用名单可以如表1所示:The electronic device may be pre-configured with an application list, and the scene recognition module may query whether the application list includes the first process. If the application list includes the first process, the scene recognition module may determine the type of the first process. The application list includes the process name of each application and the type of the application. Exemplarily, the application list may be as shown in Table 1:

表1Table 1

应用application 进程名称Process Name 类型type 视频video hlive.exehlive.exe 视频类Video WordWord word.exeword.exe 办公类Office 射击游戏shooting game shot.exeshot.exe 游戏类Games 微信WeChat wechat.exewechat.exe 社交类Social …… …… ……

例如,第一进程的名称为hlive.exe,则场景识别模块可以确定第一进程所属的类型为视频类。又例如,第一进程的名称为wechat.exe,则场景识别模块可以确定第一进程所属的类型为社交类。需要说明的是,上述表1仅作为示例,实际上表1还可包括更多应用的进程名称及其所属的类型。For example, if the name of the first process is hlive.exe, the scene recognition module can determine that the type of the first process is video. For another example, if the name of the first process is wechat.exe, the scene recognition module can determine that the type of the first process is social. It should be noted that the above Table 1 is only an example. In fact, Table 1 can also include process names of more applications and their types.

需要说明的是,此步骤的目的在于初步判断电子设备所处的用户场景。电子设备所处的用户场景可包括视频场景、游戏场景、社交场景、办公场景、浏览器场景等等。其中,视频场景进一步可包括视频播放场景、视频浏览场景。社交场景进一步可包括文字聊天场景、语音聊天场景、视频聊天场景等。办公场景进一步可包括文档编辑场景、文档浏览场景、视频会议场景等。浏览器场景可包括浏览网页场景及播放视频场景等。It should be noted that the purpose of this step is to preliminarily determine the user scenario in which the electronic device is located. The user scenario in which the electronic device is located may include video scenarios, game scenarios, social scenarios, office scenarios, browser scenarios, etc. Among them, the video scenario may further include video playback scenarios and video browsing scenarios. The social scenario may further include text chat scenarios, voice chat scenarios, video chat scenarios, etc. The office scenario may further include document editing scenarios, document browsing scenarios, video conferencing scenarios, etc. The browser scenario may include web browsing scenarios and video playback scenarios, etc.

在本步骤中,通过第一进程所属的类型,可以确定电子设备所处的用户场景的类型。例如,若确定第一进程所属的类型为视频类,则可以确定电子设备处于视频场景;又例如,若确定第一进程所属的类型为游戏类,则可以确定电子设备处于游戏场景。为了进一步分析用户需求,场景识别模块还可以进一步结合其他参数(例如,外设事件、GPU运行状态等)来分析电子设备所处的具体场景,以达到分析结果更加准确的效果,其具体内容参见后文,在此暂不描述。In this step, the type of user scenario in which the electronic device is located can be determined by the type to which the first process belongs. For example, if it is determined that the type to which the first process belongs is a video type, it can be determined that the electronic device is in a video scenario; for another example, if it is determined that the type to which the first process belongs is a game type, it can be determined that the electronic device is in a game scenario. In order to further analyze user needs, the scene recognition module can further combine other parameters (for example, peripheral events, GPU operating status, etc.) to analyze the specific scenario in which the electronic device is located, so as to achieve a more accurate analysis result. The specific content is described later and will not be described here.

S115,响应于接收到用户播放视频的操作,视频应用向API模块发送视频播放指令。S115 , in response to receiving the user's operation of playing the video, the video application sends a video playing instruction to the API module.

具体的,视频应用可向API模块的DirectX API发送该视频播放指令。该视频播放指令可包括视频的缓存地址。Specifically, the video application may send the video play instruction to the DirectX API of the API module. The video play instruction may include the cache address of the video.

S116、API模块读取视频文件。S116. The API module reads the video file.

API模块可根据视频播放指令中携带的缓存地址,读取对应的视频文件。The API module can read the corresponding video file according to the cache address carried in the video playback instruction.

S117、API模块向显卡驱动发送解码指令。S117. The API module sends a decoding instruction to the graphics card driver.

S118、显卡驱动向GPU发送启动指令。S118. The graphics card driver sends a startup instruction to the GPU.

S119、GPU进行解码。S119, GPU performs decoding.

具体的,GPU可通过GPU video processing引擎对该视频文件进行解码操作。Specifically, the GPU may perform a decoding operation on the video file through a GPU video processing engine.

S120、GPU向显卡驱动上报解码事件。S120. The GPU reports a decoding event to the graphics card driver.

S121、显卡驱动向OsEventDriver节点上报解码事件。S121. The graphics card driver reports a decoding event to the OsEventDriver node.

S122、OsEventDriver节点向系统探针模块上报解码事件。S122. The OsEventDriver node reports the decoding event to the system probe module.

具体的,OsEventDriver节点向系统探针模块的音视频状态探针上报该解码事件。Specifically, the OsEventDriver node reports the decoding event to the audio and video status probe of the system probe module.

S123、系统探针模块向场景识别模块发送解码事件。S123: The system probe module sends a decoding event to the scene recognition module.

S124、场景识别模块向系统探针模块发送指令1。S124. The scene recognition module sends instruction 1 to the system probe module.

其中,指令1指示系统探针模块获取第一进程的GPU占用率。该指令1可携带有第一进程的名称。Instruction 1 instructs the system probe module to obtain the GPU occupancy rate of the first process. The instruction 1 may carry the name of the first process.

S125、系统探针模块向进程管理器发送获取第一进程的GPU占用率的请求。S125. The system probe module sends a request to the process manager to obtain the GPU occupancy rate of the first process.

其中,该获取焦点进程的GPU占用率的请求可以包括第一进程的名称。The request for obtaining the GPU occupancy rate of the focus process may include the name of the first process.

在一种可选的实施方式中,可以由系统探针模块的音视频状态探针向进程管理器发送获取第一进程的GPU占用率的请求。In an optional implementation, the audio and video status probe of the system probe module may send a request for obtaining the GPU occupancy rate of the first process to the process manager.

S126、进程管理器采集第一进程的GPU占用率。S126: The process manager collects the GPU occupancy rate of the first process.

具体的,进程管理器可以通过显卡驱动的图像核心(graphics kernel)接口采集第一进程的GPU占用率。Specifically, the process manager may collect the GPU occupancy rate of the first process through a graphics kernel interface of a graphics card driver.

S127、进程管理器向系统探针模块发送第一进程的GPU占用率。S127: The process manager sends the GPU occupancy rate of the first process to the system probe module.

进程管理器可向系统探针模块的音视频状态探针发送第一进程的GPU占用率。The process manager may send the GPU occupancy rate of the first process to the audio and video status probe of the system probe module.

S128、系统探针模块向场景识别引擎发送第一进程的GPU占用率。S128. The system probe module sends the GPU occupancy rate of the first process to the scene recognition engine.

S129、场景识别模块判断第一进程的GPU占用率是否大于0。S129: The scene recognition module determines whether the GPU occupancy rate of the first process is greater than 0.

其中,若第一进程的GPU占用率大于0,则执行S130。If the GPU occupancy rate of the first process is greater than 0, S130 is executed.

通过第一进程的GPU占用率,可以确定第一进程在运行过程中是否使用GPU,若第一进程的GPU占用率大于0,则可以认为第一进程在运行过程中使用了GPU;若第一进程的GPU占用率为0,则表明第一进程在运行过程中未使用GPU。Through the GPU occupancy rate of the first process, it can be determined whether the first process uses the GPU during operation. If the GPU occupancy rate of the first process is greater than 0, it can be considered that the first process uses the GPU during operation; if the GPU occupancy rate of the first process is 0, it indicates that the first process does not use the GPU during operation.

S130、场景识别模块向系统探针模块发送指令2。S130. The scene recognition module sends instruction 2 to the system probe module.

其中,指令2指示系统探针模块获取第一进程的GPU引擎。该指令2可携带有第一进程的名称。Instruction 2 instructs the system probe module to obtain the GPU engine of the first process. The instruction 2 may carry the name of the first process.

S131、系统探针模块向进程管理器发送获取第一进程的GPU引擎的请求。S131. The system probe module sends a request to the process manager to obtain a GPU engine of a first process.

其中,可以由系统探针模块的音视频状态探针向进程管理器发送获取第一进程的GPU引擎的请求。获取第一进程的GPU引擎的请求包括第一进程的名称。The audio and video status probe of the system probe module may send a request to the process manager to obtain the GPU engine of the first process. The request to obtain the GPU engine of the first process includes the name of the first process.

GPU引擎包括GPU 3D引擎、GPU copy引擎、GPU video encode引擎、GPU videoprocessing引擎。其中,GPU 3D引擎主要负责处理2D或者3D图形。GPU copy引擎主要用于传输数据。GPU video encode引擎主要用于进行编码操作。GPU video processing引擎主要进行解码操作。在一些实施例中,GPU video processing引擎也可以由GPU video decode引擎代替。The GPU engine includes a GPU 3D engine, a GPU copy engine, a GPU video encode engine, and a GPU video processing engine. Among them, the GPU 3D engine is mainly responsible for processing 2D or 3D graphics. The GPU copy engine is mainly used to transmit data. The GPU video encode engine is mainly used to perform encoding operations. The GPU video processing engine mainly performs decoding operations. In some embodiments, the GPU video processing engine can also be replaced by a GPU video decode engine.

S132、进程管理器获取第一进程的GPU引擎。S132: The process manager obtains the GPU engine of the first process.

具体的,进程管理器可以通过显卡驱动的graphics kernel接口获取第一进程的GPU引擎。Specifically, the process manager may obtain the GPU engine of the first process through a graphics kernel interface of a graphics card driver.

S133、进程管理器向系统探针模块发送消息1,消息1指示第一进程的GPU引擎为GPU video processing引擎。S133. The process manager sends a message 1 to the system probe module, where the message 1 indicates that the GPU engine of the first process is a GPU video processing engine.

具体的,进程管理器可向系统探针模块的音视频状态探针发送该消息,再由音视频状态将该消息转发给场景识别模块。Specifically, the process manager may send the message to the audio and video status probe of the system probe module, and then the audio and video status forwards the message to the scene recognition module.

S134、系统探针模块向场景识别模块发送消息1。S134. The system probe module sends message 1 to the scene recognition module.

S135、场景识别模块判断第一进程的GPU引擎是否为GPU video processing引擎。S135. The scene recognition module determines whether the GPU engine of the first process is a GPU video processing engine.

若第一进程的GPU引擎为GPU video processing引擎,则执行S129;若第一进程的GPU引擎不为GPU video processing引擎,则执行S130。If the GPU engine of the first process is a GPU video processing engine, execute S129; if the GPU engine of the first process is not a GPU video processing engine, execute S130.

在S114步骤中,场景识别引擎已经确定第一进程所属的类型为视频类,即可以确定电子设备处于视频场景。通过步骤S135,场景识别引擎可以确定第一进程通过GPU执行的具体操作,进而确定用户在使用视频应用的具体操作。例如,若第一进程的GPU引擎为GPUvideo processing引擎,则表明第一进程在使用GPU进行解码操作,可以认为用户在使用视频应用播放视频。又例如,第一进程的GPU引擎不为GPU video processing引擎,则表明第一进程没有在使用GPU进行解码操作,那么用户大概率在视频应用上浏览视频资源,还未播放视频。In step S114, the scene recognition engine has determined that the type to which the first process belongs is a video class, that is, it can be determined that the electronic device is in a video scene. Through step S135, the scene recognition engine can determine the specific operations performed by the first process through the GPU, and then determine the specific operations of the user using the video application. For example, if the GPU engine of the first process is a GPU video processing engine, it indicates that the first process is using the GPU for decoding operations, and it can be considered that the user is using a video application to play the video. For another example, if the GPU engine of the first process is not a GPU video processing engine, it indicates that the first process is not using the GPU for decoding operations, then the user is most likely browsing video resources on the video application and has not yet played the video.

S136、场景识别模块根据第一进程的进程信息确定用户场景为视频播放场景。S136: The scene recognition module determines that the user scene is a video playback scene according to the process information of the first process.

其中,第一进程的进程信息包括第一进程的名称、第一进程所属的应用类型、第一进程的GPU占用率及第一进程使用的GPU引擎等信息。The process information of the first process includes information such as the name of the first process, the application type to which the first process belongs, the GPU occupancy rate of the first process, and the GPU engine used by the first process.

综合上述内容可知,若第一进程(焦点进程)的类型为视频类、第一进程的GPU占用率大于0且第一进程的GPU引擎为GPU video processing引擎,则可以确定电子设备处于视频播放场景。Based on the above content, if the type of the first process (focus process) is video type, the GPU occupancy of the first process is greater than 0, and the GPU engine of the first process is a GPU video processing engine, it can be determined that the electronic device is in a video playback scene.

需要说明的是,上述S101~S136仅以电子设备处于视频场景下的视频播放场景为例进行说明。实际上,电子设备还可以处于其他用户场景(例如,游戏场景、办公场景、社交场景、视频浏览场景等)。It should be noted that the above S101 to S136 are only described by taking the video playing scene of the electronic device in the video scene as an example. In fact, the electronic device can also be in other user scenes (for example, game scenes, office scenes, social scenes, video browsing scenes, etc.).

在一种可选的实施方式中,若场景识别引擎确定第一进程(焦点进程)的类型属于游戏类、CPU的电源模式变为游戏模式(game mode)、第一进程的GPU占用率大于0且第一进程的GPU引擎为GPU 3D引擎,则可以确定电子设备处于游戏场景。In an optional implementation, if the scene recognition engine determines that the type of the first process (focus process) belongs to the game category, the CPU power mode is changed to game mode, the GPU occupancy rate of the first process is greater than 0, and the GPU engine of the first process is a GPU 3D engine, then it can be determined that the electronic device is in a game scene.

其中,系统探针模块的电源状态探针可以向电源管理器发送订阅电源模式变化事件的请求。电源管理器可以在电源模块转换为游戏模式(game mode)时,向系统探针模块的电源状态探针上报该电源模式变化事件。如此,场景识别引擎可通过电源模式变化事件确定CPU的电源模式是否为game mode。The power status probe of the system probe module can send a request to subscribe to the power mode change event to the power manager. The power manager can report the power mode change event to the power status probe of the system probe module when the power module is switched to game mode. In this way, the scene recognition engine can determine whether the power mode of the CPU is game mode through the power mode change event.

另外,场景识别引擎获取第一进程的类型的过程可以参阅图4中S101、S102、S105、S106~S114,场景识别引擎判断第一进程的GPU占用率是否大于0且第一进程的GPU引擎是否为GPU 3D引擎的过程参阅S124~S135。区别在于将视频应用更换为游戏应用,在此不再赘述。In addition, the process of the scene recognition engine obtaining the type of the first process can refer to S101, S102, S105, S106-S114 in Figure 4, and the process of the scene recognition engine determining whether the GPU occupancy rate of the first process is greater than 0 and whether the GPU engine of the first process is a GPU 3D engine can refer to S124-S135. The difference is that the video application is replaced with a game application, which will not be repeated here.

下面,再结合图6简单说明电子设备处于办公场景时,其确定自身所处的用户场景的流程。需要说明的是,图6所示的流程图与图4所示的流程图,其原理及流程基本详细,下面仅具体说明两者的不同之处,类似之处不再赘述,详情参见图4中相关步骤的说明。图6示出了本申请实施例提供的一种资源调度方法,其确定电子设备所处的用户场景的流程如下:Next, in conjunction with FIG6, a brief description is given of the process of determining the user scenario in which the electronic device is located when it is in an office scenario. It should be noted that the principle and process of the flowchart shown in FIG6 and the flowchart shown in FIG4 are basically detailed. Only the differences between the two are specifically described below, and the similarities are not repeated. For details, please refer to the description of the relevant steps in FIG4. FIG6 shows a resource scheduling method provided in an embodiment of the present application, and the process of determining the user scenario in which the electronic device is located is as follows:

S201、系统探针模块向OsEventDriver节点发送订阅进程创建事件的请求。S201. The system probe module sends a request for subscribing to a process creation event to an OsEventDriver node.

S202、OsEventDriver节点向进程管理器发送订阅进程创建事件的请求。S202. The OsEventDriver node sends a request for subscribing to a process creation event to the process manager.

S203、系统探针模块向OsEventDriver节点发送订阅外设事件的请求。S203: The system probe module sends a request for subscribing to peripheral events to the OsEventDriver node.

如图3所示,系统探针模块还包括外设状态探针。在本申请实施例中,可以由系统探针模块的外设状态探针向OsEventDriver节点发送订阅外设事件的请求。其中,订阅外设事件的请求也可以称为第四请求。As shown in Figure 3, the system probe module also includes a peripheral status probe. In the embodiment of the present application, the peripheral status probe of the system probe module can send a request to subscribe to peripheral events to the OsEventDriver node. The request to subscribe to peripheral events can also be called a fourth request.

其中,外设事件包括鼠标滚轮滑动、鼠标点击、键盘输入、摄像头输入、麦克风输入等事件。Among them, peripheral events include mouse wheel sliding, mouse clicking, keyboard input, camera input, microphone input and other events.

S204、OsEventDriver节点向外设驱动发送订阅外设事件的请求。S204. The OsEventDriver node sends a request for subscribing to peripheral events to the peripheral driver.

需要说明的是,外设驱动为所有外设的驱动的统称,例如可以包括鼠标驱动、键盘驱动、摄像头驱动、麦克风驱动等。It should be noted that the peripheral driver is a general term for drivers of all peripherals, for example, it may include a mouse driver, a keyboard driver, a camera driver, a microphone driver, etc.

S205、系统探针模块向API模块发送订阅焦点窗口变化事件的请求。S205: The system probe module sends a request for subscribing to a focus window change event to the API module.

S206、响应于接收用户开启办公应用的操作,办公应用向进程管理器发送创建办公应用进程的请求。S206: In response to receiving the user's operation of starting the office application, the office application sends a request for creating an office application process to the process manager.

其中,创建办公应用进程的请求可包括办公应用程序的存储地址。The request for creating an office application process may include a storage address of the office application program.

S207、进程管理器创建办公应用进程。S207: The process manager creates an office application process.

具体的,进程管理器可以通过该存储地址查询到办公应用程序的二进制文件。通过加载办公应用程序的二进制文件,可以创建进程运行的环境,启动视频应用进程。另外,办公应用进程包括线程2,线程2可用于创建办公应用的主窗口。Specifically, the process manager can query the binary file of the office application through the storage address. By loading the binary file of the office application, an environment for process operation can be created to start the video application process. In addition, the office application process includes thread 2, which can be used to create the main window of the office application.

S208、进程管理器向OsEventDriver节点上报进程创建事件。S208. The process manager reports the process creation event to the OsEventDriver node.

S209、OsEventDriver节点向系统探针模块上报进程创建事件。S209. The OsEventDriver node reports the process creation event to the system probe module.

其中,该进程创建事件携带有办公应用进程的名称。The process creation event carries the name of the office application process.

S210、系统探针模块向场景识别模块发送进程创建事件。S210: The system probe module sends a process creation event to the scene recognition module.

S211、响应于线程2的调用请求,API模块创建办公应用窗口。S211. In response to the call request of thread 2, the API module creates an office application window.

S212、API模块向系统探针模块上报焦点窗口事件。S212. The API module reports the focus window event to the system probe module.

其中,焦点窗口事件中携带有第一进程(焦点进程)的名称。可以理解地,在本申请实施例中,第一进程即为办公应用进程。The focus window event carries the name of the first process (focus process). It can be understood that in the embodiment of the present application, the first process is the office application process.

S213、系统探针模块向场景识别模块发送焦点窗口事件。S213: The system probe module sends a focus window event to the scene recognition module.

S214、场景识别模块确定第一进程所属的类型为办公类。S214: The scene recognition module determines that the type of the first process is office type.

例如,第一进程的名称为word.exe,则可以确定第一进程所属的类型为办公类。For example, if the name of the first process is word.exe, it can be determined that the type of the first process is office type.

S215、响应于用户对外设的操作,外设驱动检测到外设事件。S215: In response to the user's operation on the peripheral device, the peripheral device driver detects a peripheral device event.

S216、外设驱动向OsEventDriver节点上报外设事件。S216: The peripheral driver reports the peripheral event to the OsEventDriver node.

S217、OsEventDriver节点向系统探针模块发送外设事件。S217. The OsEventDriver node sends a peripheral event to the system probe module.

S218、系统探针模块向场景识别模块发送外设事件。S218: The system probe module sends a peripheral event to the scene recognition module.

S219、场景识别模块根据外设事件及第一进程所属的类型确定用户场景。S219: The scene recognition module determines a user scene according to the peripheral event and the type of the first process.

在一种可选的实施方式中,若场景识别引擎确定第一进程(焦点进程)的类型属于办公类,且外设事件为鼠标滚轮滑动事件或点击事件,则可以确定电子设备具体处于办公场景下的文档浏览场景。又或者,若场景识别引擎确定第一进程(焦点进程)的类型属于办公类,且在接收到键盘输入事件后的预设时间(例如,10秒)内未再次接收到鼠标滚轮滑动事件、鼠标击事件、键盘输入事件,可以确定电子设备具体处于办公场景下的文档浏览场景。In an optional implementation, if the scene recognition engine determines that the type of the first process (focus process) belongs to the office category, and the peripheral event is a mouse wheel sliding event or a click event, it can be determined that the electronic device is specifically in a document browsing scene in an office scene. Alternatively, if the scene recognition engine determines that the type of the first process (focus process) belongs to the office category, and no mouse wheel sliding event, mouse click event, or keyboard input event is received again within a preset time (for example, 10 seconds) after receiving a keyboard input event, it can be determined that the electronic device is specifically in a document browsing scene in an office scene.

在一种可选的实施方式中,若场景识别引擎确定第一进程(焦点进程)的类型属于办公类,且接收到键盘输入事件,则可以确定电子设备具体处于办公场景下的文档编辑场景。In an optional implementation, if the scene recognition engine determines that the type of the first process (focus process) belongs to the office category and receives a keyboard input event, it can be determined that the electronic device is specifically in a document editing scene in an office scenario.

在一种可选的实施方式中,若场景识别引擎确定第一进程(焦点进程)的类型属于办公类,且接收到摄像头输入事件(即摄像头处于开启状态且存在视频流输入),可以确定电子设备具体处于办公场景下的视频会议场景。In an optional implementation, if the scene recognition engine determines that the type of the first process (focus process) belongs to the office type, and receives a camera input event (i.e., the camera is on and there is a video stream input), it can be determined that the electronic device is specifically in a video conferencing scene in an office scenario.

电子设备还可以处于社交场景。社交场景包括三个具体场景,分别为:文字聊天场景、语音聊天场景及视频聊天场景。判断电子设备处于社交场景的原理与判断电子设备处于办公场景的原理类似,在此暂不赘述,下面仅说明判断电子设备处于社交场景需要满足的条件。The electronic device can also be in a social scene. The social scene includes three specific scenes, namely: text chat scene, voice chat scene and video chat scene. The principle of judging whether the electronic device is in a social scene is similar to the principle of judging whether the electronic device is in an office scene. We will not go into details here. The following only explains the conditions that need to be met to judge whether the electronic device is in a social scene.

在一种可选的实施方式中,若场景识别引擎确定第一进程(焦点进程)的类型属于社交类,且接收到键盘输入事件,则可以确定电子设备具体处于社交场景下的文字聊天场景。In an optional implementation, if the scene recognition engine determines that the type of the first process (focus process) belongs to the social category and receives a keyboard input event, it can be determined that the electronic device is specifically in a text chat scene under a social scene.

在一种可选的实施方式中,若场景识别引擎确定第一进程(焦点进程)的类型属于社交类,且接收到麦克风输入事件且摄像头处于关闭状态,则可以确定电子设备具体处于社交场景下的语音聊天场景。In an optional implementation, if the scene recognition engine determines that the type of the first process (focus process) is social, and a microphone input event is received and the camera is in an off state, it can be determined that the electronic device is specifically in a voice chat scene in a social scene.

在一种可选的实施方式中,若场景识别引擎确定第一进程(焦点进程)的类型属于社交类,且接收到麦克风输入事件、摄像头输入事件,则可以确定电子设备具体处于社交场景下的视频聊天场景。In an optional implementation, if the scene recognition engine determines that the type of the first process (focus process) is social, and receives a microphone input event and a camera input event, it can be determined that the electronic device is specifically in a video chat scene in a social scene.

上述内容说明了如何识别电子设备所处的用户场景,在确定电子设备所处的用户场景后,电子设备还可根据自身所处的用户场景和系统负载进行资源调度,使得电子设备的CPU可以按照用户的实际需求进行运行,达到在不影响用户体验的情况下避免CPU出现性能过剩的效果。The above content explains how to identify the user scenario of an electronic device. After determining the user scenario of an electronic device, the electronic device can also schedule resources according to its own user scenario and system load, so that the CPU of the electronic device can operate according to the actual needs of the user, thereby avoiding CPU overperformance without affecting the user experience.

下面,继续以电子设备处于视频播放场景为例,说明电子设备的资源调度过程。如图7所示,本申请实施例提供的一种资源调度方法,其进行资源调度的流程如下:Next, we continue to take the electronic device in the video playback scenario as an example to illustrate the resource scheduling process of the electronic device. As shown in FIG7 , a resource scheduling method provided in an embodiment of the present application has the following process for performing resource scheduling:

如图7所示,本申请实施方式提供的资源调度方法还包括:As shown in FIG. 7 , the resource scheduling method provided in the embodiment of the present application further includes:

S301、场景识别模块向基础调度策略匹配管理器发送场景信息。S301. The scene recognition module sends scene information to the basic scheduling strategy matching manager.

其中,场景信息用于指示电子设备所处的用户场景。示例性的,电子设备可以预先为不同的用户场景分配唯一标识,该场景信息则可包括用户场景所的唯一标识。例如,该标识(例如为V01)可指示电子设备处于视频播放场景。又例如,该标识(例如为V02)可指示电子设备处于视频浏览场景。The scene information is used to indicate the user scene in which the electronic device is located. Exemplarily, the electronic device may pre-assign unique identifiers to different user scenes, and the scene information may include the unique identifier of the user scene. For example, the identifier (e.g., V01) may indicate that the electronic device is in a video playback scene. For another example, the identifier (e.g., V02) may indicate that the electronic device is in a video browsing scene.

关于场景识别模块确定电子设备所处的用户场景的过程,具体参阅S101~S136,在此不再赘述。Regarding the process of the scene recognition module determining the user scene in which the electronic device is located, please refer to S101 to S136 for details, which will not be repeated here.

S302、基础策略匹配管理器根据场景信息得到调度策略1。S302: The basic strategy matching manager obtains scheduling strategy 1 according to the scenario information.

其中,调度策略1包括OS调度策略1及CPU功耗调度策略1。OS调度策略1包括第一进程的第一进程优先级及第一I/O优先级。其中,调度策略1也可称为第二调度策略。The scheduling policy 1 includes the OS scheduling policy 1 and the CPU power consumption scheduling policy 1. The OS scheduling policy 1 includes the first process priority and the first I/O priority of the first process. The scheduling policy 1 may also be referred to as the second scheduling policy.

第一进程的优先级用于衡量第一进程抢占CPU的能力,其优先级越高,则可以优先满足其对CPU资源的占用需求,从而使得第一进程的运行流畅度越高。在一种可选的实施方式中,焦点进程的优先级从高到低依次包括等级:实时、高、高于正常、正常、低于正常、低。其中,第一进程的优先级也可以理解为焦点进程优先级(focus process priority,FPP)。The priority of the first process is used to measure the ability of the first process to seize the CPU. The higher its priority, the more preferentially it can meet its demand for CPU resources, thereby making the operation of the first process smoother. In an optional implementation, the priority of the focus process includes the following levels from high to low: real-time, high, above normal, normal, below normal, and low. Among them, the priority of the first process can also be understood as the focus process priority (FPP).

第一进程的I/O优先级用于衡量系统对第一进程的磁盘和I/O请求的响应度,优先级越高,则第一进程的磁盘和I/O请求的响应度越高,即响应速度越快。在一种可选的实施方式中,焦点进程I/O优先级从高到低依次包括等级:关键、高、正常、低、非常低。其中,第一进程的I/O优先级也可以理解为焦点进程I/O优先级(focus process IO priority,FPP_IO)。The I/O priority of the first process is used to measure the responsiveness of the system to the disk and I/O requests of the first process. The higher the priority, the higher the responsiveness of the disk and I/O requests of the first process, that is, the faster the response speed. In an optional embodiment, the focus process I/O priority includes the following levels from high to low: critical, high, normal, low, and very low. Among them, the I/O priority of the first process can also be understood as the focus process I/O priority (focus process IO priority, FPP_IO).

CPU功耗调度策略1包括CPU的第一PL1、第一PL2以及第一EPP。The CPU power consumption scheduling strategy 1 includes a first PL1 , a first PL2 , and a first EPP of the CPU.

可见,调度策略1可以调整第一进程的进程优先级、I/O优先级以及CPU功耗。It can be seen that scheduling strategy 1 can adjust the process priority, I/O priority, and CPU power consumption of the first process.

在一种可选的实施方式中,电子设备可以预先配置各种用户场景和其对应的调度策略。示例性的,各种用户场景和其对应的调度策略的对应关系可以如表2所示。In an optional implementation, the electronic device may pre-configure various user scenarios and their corresponding scheduling strategies. Exemplarily, the correspondence between various user scenarios and their corresponding scheduling strategies may be as shown in Table 2.

示例性的,若确定电子设备所处的用户场景为社交场景下的文字聊天场景,则调度策略1包括:第一进程的第一进程优先级为正常,第一进程的第一I/O优先级为正常,CPU的第一PL1为12W,第一PL2为60W,第一EPP为220。需要说明的是,表2中的调度策略仅作为示例,在实际应用中,进程优先级、I/O优先级、PL1、PL2及EPP的值可以与表2中的值不一致。另外,表2仅示出了部分场景的调度策略,实际电子设备还可配置比表2更多的调度策略。Exemplarily, if it is determined that the user scenario in which the electronic device is located is a text chat scenario in a social scenario, then the scheduling strategy 1 includes: the first process priority of the first process is normal, the first I/O priority of the first process is normal, the first PL1 of the CPU is 12W, the first PL2 is 60W, and the first EPP is 220. It should be noted that the scheduling strategies in Table 2 are only examples. In actual applications, the values of process priority, I/O priority, PL1, PL2 and EPP may be inconsistent with the values in Table 2. In addition, Table 2 only shows the scheduling strategies for some scenarios, and actual electronic devices can be configured with more scheduling strategies than Table 2.

需要说明的是,上述调度策略为默认电子设备处于轻负载状态时的调度策略,其可以为电子设备预先统计每个应用在对应的负载特征下的CPU功耗,并根据统计得到的负载特征及CPU功耗配置。因此,基础策略匹配管理器得到的调度策略1可作为电子设备进行调度的策略的参考方案,电子设备还可根据该调度策略1并结合实际的系统负载来得到实际的调度策略。It should be noted that the above scheduling strategy is the default scheduling strategy for electronic devices in a light load state, which can pre-count the CPU power consumption of each application under the corresponding load characteristics for the electronic device, and configure the load characteristics and CPU power consumption according to the statistics. Therefore, the scheduling strategy 1 obtained by the basic strategy matching manager can be used as a reference solution for the strategy of scheduling electronic devices, and the electronic device can also obtain the actual scheduling strategy based on the scheduling strategy 1 and the actual system load.

表2Table 2

S303、基础策略匹配管理器向场景识别模块发送调度策略1。S303: The basic strategy matching manager sends the scheduling strategy 1 to the scene recognition module.

S304、场景识别模块向负载管控器发送调度策略1和场景信息。S304. The scene recognition module sends scheduling strategy 1 and scene information to the load controller.

也即,基础策略匹配管理器确定调度策略1后,通过场景识别模块向负载管控器转发调度策略1。在一种可选的实施方式中,场景识别模块可以分两个步骤分别向负载管控器发送调度策略1和场景信息。That is, after the basic strategy matching manager determines the scheduling strategy 1, it forwards the scheduling strategy 1 to the load controller through the scene recognition module. In an optional implementation, the scene recognition module can send the scheduling strategy 1 and the scene information to the load controller in two steps.

S305、负载管控器向系统探针模块发送获取系统负载的请求。S305. The load controller sends a request to the system probe module to obtain the system load.

其中,系统负载是处于可运行状态的进程和不可中断状态的进程的平均数。可运行状态的进程指正在使用CPU或者等待使用CPU的进程。不可中断状态的进程为等待I/O访问(例如,磁盘I/O)的进程。The system load is the average number of processes in the runnable state and the processes in the uninterruptible state. The processes in the runnable state are the processes that are using the CPU or waiting to use the CPU. The processes in the uninterruptible state are the processes that are waiting for I/O access (for example, disk I/O).

S306、系统探针模块向进程管理器发送获取系统负载的请求。S306: The system probe module sends a request to the process manager to obtain the system load.

如图3所示,系统探针模块包括系统负载探针,可以由系统负载探针向进程管理器发送获取系统负载的请求。在一种可选的实施方式中,也可以由OsEventDriver节点向进程管理器转发系统负载探针的获取系统负载的请求(图未示)。As shown in Figure 3, the system probe module includes a system load probe, which can send a request to obtain the system load to the process manager. In an optional implementation, the OsEventDriver node can also forward the system load probe's request to obtain the system load to the process manager (not shown).

S307、进程管理器获取系统负载。S307: The process manager obtains the system load.

S308、进程管理器向系统探针模块发送系统负载。S308. The process manager sends the system load to the system probe module.

具体的,进程管理器可以向系统探针模块的系统负载探针发送该系统负载。在一种可选的实施方式中,也可以由OsEventDriver节点向系统负载探针转发该系统负载(图未示)。Specifically, the process manager may send the system load to the system load probe of the system probe module. In an optional implementation, the OsEventDriver node may also forward the system load to the system load probe (not shown).

S309、系统探针模块向负载管控器发送系统负载。S309. The system probe module sends the system load to the load controller.

S310、负载管控器根据系统负载、场景信息及调度策略1,得到调度策略2。S310. The load controller obtains scheduling strategy 2 according to the system load, scenario information and scheduling strategy 1.

调度策略2可包括OS调度策略2(也可以称为OS调度策略)和CPU功耗调度策略2(也可以称为第一子策略)。CPU功耗调度策略2包括PL1`、PL2`、EPP`,PL1`为负载管控器调整后的PL1,也可以称为第二PL1。PL2`为负载管控器调整后的PL2,也可以称为第二PL2。EPP`为负载管控器调整后的EPP,也可以称为第二EPP。其中,调度策略2也可以称为第一调度策略。Scheduling strategy 2 may include OS scheduling strategy 2 (also referred to as OS scheduling strategy) and CPU power consumption scheduling strategy 2 (also referred to as first sub-strategy). CPU power consumption scheduling strategy 2 includes PL1`, PL2`, and EPP`, where PL1` is PL1 adjusted by the load controller, and may also be referred to as the second PL1. PL2` is PL2 adjusted by the load controller, and may also be referred to as the second PL2. EPP` is EPP adjusted by the load controller, and may also be referred to as the second EPP. Among them, scheduling strategy 2 may also be referred to as the first scheduling strategy.

在一种可选的实施方式中,负载管控器可将系统负载划分为三个等级,分别为轻负载、中负载、重负载。电子设备可预先配置各种用户场景和其对应的调整策略。例如,调整策略可以如表3所示:In an optional implementation, the load controller can divide the system load into three levels, namely light load, medium load, and heavy load. The electronic device can pre-configure various user scenarios and their corresponding adjustment strategies. For example, the adjustment strategy can be shown in Table 3:

表3table 3

示例性的,若电子设备处于视频播放场景,且根据表2可知调度策略1为:视频应用进程的进程优先级为正常,视频应用进程的I/O优先级为正常,CPU的PL1(即第一PL1)为18W,PL2(即第一PL2)为60W,EPP(即第一EPP)为200。在这种情况下,若系统负载为轻负载,则不需要调整调度策略,即调度策略2为调度策略1。若系统负载为中负载,则需保持视频应用进程的进程优先级为正常,视频应用进程的I/O优先级为正常,PL1在18W的基础上增加22W,PL2在60W的基础上增加30W,EPP在200的基础上减少50,即调度策略2为:视频应用进程的进程优先级为正常、视频应用进程的I/O优先级为正常(OS调度策略2),PL1`为40W,PL2`为90W,EPP`为150(CPU调度策略2)。若系统负载为重负载,则需保持视频应用进程的进程优先级为正常,调整视频应用进程的I/O优先级为高,PL1在18W的基础上增加37W,PL2在60W的基础上增加45W,EPP在200的基础上减少100,即调度策略2为:视频应用进程的进程优先级为正常,视频应用进程的I/O优先级为高,PL1`为55W,PL2`为105W,EPP`为100。For example, if the electronic device is in a video playback scene, and according to Table 2, the scheduling strategy 1 is: the process priority of the video application process is normal, the I/O priority of the video application process is normal, the PL1 (i.e., the first PL1) of the CPU is 18W, the PL2 (i.e., the first PL2) is 60W, and the EPP (i.e., the first EPP) is 200. In this case, if the system load is a light load, there is no need to adjust the scheduling strategy, that is, the scheduling strategy 2 is the scheduling strategy 1. If the system load is a medium load, it is necessary to keep the process priority of the video application process normal, the I/O priority of the video application process normal, PL1 increases by 22W on the basis of 18W, PL2 increases by 30W on the basis of 60W, and EPP decreases by 50 on the basis of 200, that is, the scheduling strategy 2 is: the process priority of the video application process is normal, the I/O priority of the video application process is normal (OS scheduling strategy 2), PL1` is 40W, PL2` is 90W, and EPP` is 150 (CPU scheduling strategy 2). If the system load is heavy, the process priority of the video application process needs to be kept normal, and the I/O priority of the video application process is adjusted to high. PL1 is increased by 37W on the basis of 18W, PL2 is increased by 45W on the basis of 60W, and EPP is reduced by 100 on the basis of 200. That is, scheduling strategy 2 is: the process priority of the video application process is normal, the I/O priority of the video application process is high, PL1` is 55W, PL2` is 105W, and EPP` is 100.

需要说明的是,表3仅示出了部分用户场景及其对应的调整策略,电子设备还可配置比表3更多的调整策略,在此不做具体限制。It should be noted that Table 3 only shows some user scenarios and their corresponding adjustment strategies. The electronic device can also be configured with more adjustment strategies than those in Table 3, and no specific limitation is made here.

在一种可选的实施方式中,系统负载与CPU功耗之间满足特定的映射关系(例如通过特定算式进行映射),负载管控器也可以通过该特定算式和系统负载计算得到CPU功耗,进而得到调度策略2。In an optional implementation, the system load and the CPU power consumption satisfy a specific mapping relationship (for example, mapping through a specific formula), and the load controller can also calculate the CPU power consumption through the specific formula and the system load, and then obtain scheduling strategy 2.

S311、负载管控器向调度执行器发送OS调度策略2。S311. The load controller sends OS scheduling strategy 2 to the scheduling executor.

其中,OS调度策略2包括第一进程的第二进程优先级、第二I/O优先级。The OS scheduling policy 2 includes a second process priority and a second I/O priority of the first process.

S312、调度执行器向I/O管理器发送指令1。S312, the scheduling executor sends instruction 1 to the I/O manager.

其中,指令1携带有第一进程的第二I/O优先级。另外,如图3所示,调度执行器包括I/O优先级接口,可以由该I/O优先级接口向I/O管理器发送指令1。其中,该指令1也可以称为第二指令。Instruction 1 carries the second I/O priority of the first process. In addition, as shown in Figure 3, the scheduling executor includes an I/O priority interface, which can send instruction 1 to the I/O manager. Instruction 1 can also be called a second instruction.

S313、响应于指令1,I/O管理器调整第一进程的I/O优先级。S313: In response to instruction 1, the I/O manager adjusts the I/O priority of the first process.

也即,I/O管理器可将第一进程的I/O优先级调整为第二I/O优先级。如此,可以保证第一进程可以优先进行I/O访问,减少第一进程在I/O访问过程中的响应时间。That is, the I/O manager can adjust the I/O priority of the first process to the second I/O priority, so as to ensure that the first process can perform I/O access preferentially and reduce the response time of the first process during the I/O access process.

S314、调度执行器向进程管理器发送指令2。S314. The scheduling executor sends instruction 2 to the process manager.

其中,指令2携带有第一进程的第二进程优先级。另外,如图3所示,调度执行器还包括进程优先级接口,可以由该进程优先级接口向进程管理器发送指令2。其中,该指令2也可以称为第一指令。Instruction 2 carries the second process priority of the first process. In addition, as shown in Figure 3, the scheduling executor also includes a process priority interface, which can send instruction 2 to the process manager. Instruction 2 can also be called a first instruction.

S315、响应于接收到指令2,进程管理器调整第一进程的进程优先级。S315. In response to receiving instruction 2, the process manager adjusts the process priority of the first process.

也即,进程管理器可将第一进程的进程优先级调整为第二进程优先级。如此,第一进程可以优先占用CPU资源,保证第一进程能够流畅运行。That is, the process manager can adjust the process priority of the first process to the second process priority. In this way, the first process can take up CPU resources first, ensuring that the first process can run smoothly.

可见,通过调整第一进程的I/O优先级和进程优先级,可以优先保证第一进程的I/O访问以及对CPU资源的消耗,使得第一进程可以正常、流畅地运行,保证用户有良好的体验。It can be seen that by adjusting the I/O priority and process priority of the first process, the I/O access and CPU resource consumption of the first process can be prioritized, so that the first process can run normally and smoothly, ensuring that users have a good experience.

需要说明的是,S312与S314之间不存在严格的先后顺序,可以先执行S312再执行S314,也可以先执行S314再执行S312,也可以同时执行S314和S312。It should be noted that there is no strict order between S312 and S314. S312 may be executed first and then S314, or S314 may be executed first and then S312, or S314 and S312 may be executed simultaneously.

S316、负载管控器向芯片策略融合器发送CPU功耗调度策略2。S316. The load controller sends CPU power consumption scheduling strategy 2 to the chip strategy aggregator.

S317、芯片策略融合器判断CPU的芯片平台类型为或者/> S317, the chip strategy fusion device determines the CPU chip platform type is or/>

公司的CPU芯片和/>公司的CPU,对于CPU功耗的调整方式并不相同,因此需要进行区分。其中,若CPU的芯片平台类型为/>(也可以称为第一类型),则执行S318;若CPU的芯片平台类型为/>(也可以称为第二类型),则执行S325。 The company's CPU chips and/> The CPUs of different companies have different ways of adjusting CPU power consumption, so they need to be differentiated. Among them, if the CPU chip platform type is/> (also called the first type), then execute S318; if the CPU chip platform type is/> (also referred to as the second type), then execute S325.

S318,芯片策略融合器向调度执行器发送CPU功耗调度策略2。S318, the chip policy aggregator sends the CPU power consumption scheduling policy 2 to the scheduling executor.

其中,CPU功耗调度策略2包括PL1`、PL2`、EPP`。Among them, the CPU power consumption scheduling strategy 2 includes PL1`, PL2`, and EPP`.

S319,调度执行器向OS2SOC驱动节点发送指令3。S319, the scheduling executor sends instruction 3 to the OS2SOC driver node.

其中,指令3携带有PL1`、PL2`。也即,指令3用于调整CPU的PL1和PL2。其中,指令3也可以称为第三指令。Instruction 3 carries PL1' and PL2'. That is, instruction 3 is used to adjust PL1 and PL2 of the CPU. Instruction 3 can also be called the third instruction.

在一种可选的实施方式中,可以由调度执行器的CPU功耗调度接口向OS2SOC驱动节点发送指令3。In an optional implementation, the CPU power consumption scheduling interface of the scheduling executor may send instruction 3 to the OS2SOC driver node.

S320,OS2SOC驱动节点向CPU发送指令3。S320, the OS2SOC driver node sends instruction 3 to the CPU.

S321、响应于指令3,CPU调整PL1和PL2。S321 . In response to instruction 3 , the CPU adjusts PL1 and PL2 .

也即,CPU可将PL1调整为PL1`,将PL2调整为PL2`。That is, the CPU may adjust PL1 to PL1` and PL2 to PL2`.

S322、调度执行器向电源管理器发送指令4。S322. The scheduling executor sends instruction 4 to the power manager.

其中,指令4携带有EPP`。也即,指令4用于调整CPU的EPP。指令4也可以称为第四指令。Among them, instruction 4 carries EPP`. That is, instruction 4 is used to adjust the EPP of the CPU. Instruction 4 can also be called the fourth instruction.

S323、电源管理器向CPU发送指令4。S323: The power manager sends instruction 4 to the CPU.

S324、响应于指令4,CPU调整EPP。S324. In response to instruction 4, the CPU adjusts the EPP.

也即,CPU可将EPP调整为EPP`。That is, the CPU may adjust EPP to EPP`.

S325、芯片策略融合器根据CPU功耗调度策略2确定动态调谐技术策略号。S325 . The chip strategy aggregator determines the dynamic tuning technology strategy number according to CPU power consumption scheduling strategy 2 .

动态调谐技术(dynamic tuning technology,DTT)是公司在/>处理器和/>独立显卡之间自动并动态分配功耗,以优化性能并延长电池续航时间的技术,其可以使CPU和GPU的性能得到提升,智能混合工作负载功率平衡。Dynamic tuning technology (DTT) is The company is in/> Processor and /> A technology that automatically and dynamically allocates power consumption between discrete graphics cards to optimize performance and extend battery life. It can improve the performance of the CPU and GPU and balance power for intelligent mixed workloads.

可以理解地,DTT策略号与CPU功耗调度策略2可以存在映射关系。在BIOS中会构建一张DTT策略表,任何一条CPU功耗调度策略2都能通过其内的参数(PL1`、PL2`、EPP`)映射到DTT策略表中某个DTT策略号,如表4所示。It can be understood that there can be a mapping relationship between the DTT policy number and the CPU power consumption scheduling policy 2. A DTT policy table will be constructed in the BIOS, and any CPU power consumption scheduling policy 2 can be mapped to a DTT policy number in the DTT policy table through the parameters (PL1`, PL2`, EPP`) therein, as shown in Table 4.

其中,DTT策略号可用于标识一种DTT策略(也可以称为第二子策略),DTT策略号对应的DTT策略用于调整CPU的PL1_MINI、PL1_MAX、PL2、PL2_TIME、EPO Gear。PL1_MINI为PL1的最小值,PL1_MAX为PL1的最大值,PL2_TIME为PL2的持续时间。能效-性能优化挡位(Energy Performance Optimize Gear,EPO Gear)用来表征DTT调节CPU能效比(EPP)的力度,取值范围为1~5之间,值越大,调节EPP时越倾向能效;值越小,调节EPP时越倾向性能。Among them, the DTT policy number can be used to identify a DTT policy (also called the second sub-policy), and the DTT policy corresponding to the DTT policy number is used to adjust the CPU's PL1_MINI, PL1_MAX, PL2, PL2_TIME, and EPO Gear. PL1_MINI is the minimum value of PL1, PL1_MAX is the maximum value of PL1, and PL2_TIME is the duration of PL2. Energy Performance Optimize Gear (EPO Gear) is used to characterize the intensity of DTT's adjustment of the CPU energy efficiency ratio (EPP). The value range is between 1 and 5. The larger the value, the more energy efficiency is favored when adjusting EPP; the smaller the value, the more performance is favored when adjusting EPP.

需要说明的是,表4仅示出部分PL1'、PL2'、EPP'和DTT策略号的对应关系,实际上还可包括比表4更多的信息。示例性的,若CPU功耗调度策略2指示PL1`为-1,PL2`为-1且EPP`为-1,则可以确定DTT策略号为0,其对应的PL1_MINI为30,PL1_MAX为40,PL2为95,PL2_TIME为28,EPO Gear为3。It should be noted that Table 4 only shows the correspondence between some PL1', PL2', EPP' and DTT policy numbers, and may actually include more information than Table 4. For example, if the CPU power consumption scheduling policy 2 indicates that PL1' is -1, PL2' is -1 and EPP' is -1, it can be determined that the DTT policy number is 0, and its corresponding PL1_MINI is 30, PL1_MAX is 40, PL2 is 95, PL2_TIME is 28, and EPO Gear is 3.

S326、芯片策略融合器向调度执行器发送DTT策略号。S326. The chip strategy aggregator sends the DTT strategy number to the scheduling executor.

在一种可选的实施方式中,芯片策略融合器也可直接向调度执行器发送该DTT策略号对应的功DTT策略(即第二子策略)。In an optional implementation, the chip strategy aggregator may also directly send the functional DTT strategy (ie, the second sub-strategy) corresponding to the DTT strategy number to the scheduling executor.

表4Table 4

S327、调度执行器向Intel DTT驱动发送DTT策略号。S327, the scheduling executor sends the DTT policy number to the Intel DTT driver.

S328、Intel DTT驱动向CPU发送DTT策略号。S328, Intel DTT driver sends DTT policy number to CPU.

可以理解地,该Intel DTT驱动可通过BIOS向CPU发送DTT策略号。It can be understood that the Intel DTT driver can send the DTT policy number to the CPU through the BIOS.

S329、CPU基于DTT策略号运行。S329, the CPU runs based on the DTT strategy number.

可见,若CPU的芯片平台类型为芯片策略融合器可以通过调度执行器向电源管理器发送调整EPP的指令,电源管理器可调整CPU的EPP。另外,调度执行器还可以向OS2SOC驱动节点发送调整PL1、PL2的指令,OS2SOC驱动节点驱动CPU的PL1和PL2。It can be seen that if the CPU chip platform type is The chip strategy fusion can send an instruction to adjust the EPP to the power manager through the scheduling executor, and the power manager can adjust the EPP of the CPU. In addition, the scheduling executor can also send an instruction to adjust PL1 and PL2 to the OS2SOC driver node, and the OS2SOC driver node drives the PL1 and PL2 of the CPU.

若CPU的芯片平台类型为则芯片策略融合器可以确定CPU功耗调度策略2得到DTT策略号,并通过调度执行器通过bios向Intel DTT驱动发送DTT策略号,使得CPU基于该DTT策略号运行,达到调整功耗的效果。If the CPU chip platform type is The chip policy aggregator can then determine the CPU power consumption scheduling strategy 2 to obtain the DTT policy number, and send the DTT policy number to the Intel DTT driver through the scheduling executor via the BIOS, so that the CPU runs based on the DTT policy number to achieve the effect of adjusting power consumption.

可以理解地,本申请可以获取焦点窗口变化事件以及第一信息(包括焦点进程的进程信息、焦点进程对GPU的占用情况、外设事件以及电源模式等),并根据焦点窗口变化事件以及第一信息确定电子设备当前所处的用户场景,并结合用户场景和电子设备的系统负载确定第一调度策略,基于第一调度策略调整焦点进程的进程优先级、I/O优先级以及CPU的功耗,在流畅满足用户需求(保证焦点进程流畅运行)的情况下,降低电子设备的能耗。It can be understood that the present application can obtain the focus window change event and the first information (including the process information of the focus process, the occupancy of the GPU by the focus process, peripheral events and power mode, etc.), and determine the user scenario in which the electronic device is currently located based on the focus window change event and the first information, and determine the first scheduling strategy in combination with the user scenario and the system load of the electronic device, and adjust the process priority, I/O priority and CPU power consumption of the focus process based on the first scheduling strategy, so as to reduce the energy consumption of the electronic device while smoothly meeting user needs (ensuring smooth operation of the focus process).

以上为对本案涉及的整体框架和整体功能的介绍,上述软件架构还可以简化为图8所示的结构。如图8所示,该软件架构由上到下可以包括应用层,内核和驱动层,硬件层。The above is an introduction to the overall framework and overall functions involved in this case. The above software architecture can also be simplified to the structure shown in Figure 8. As shown in Figure 8, the software architecture can include an application layer, a kernel and driver layer, and a hardware layer from top to bottom.

具体的,应用层可以安装PC管家这一APP,该PC管家可以对PC的资源进行管理和调度。PC管家能够根据不同的探针识别出多种场景,例如音乐场景、视频场景、游戏场景、办公场景和社交场景等。该PC管家中包括场景识别引擎和调度引擎。Specifically, the application layer can install the PC Manager APP, which can manage and schedule PC resources. The PC Manager can identify a variety of scenarios based on different probes, such as music scenarios, video scenarios, game scenarios, office scenarios, and social scenarios. The PC Manager includes a scenario recognition engine and a scheduling engine.

内核和驱动层,包括显卡驱动,该显卡驱动中存储有显卡的配置文件,该显卡的配置文件用于在进程开启阶段提供该进程所使用的显卡的类型,是使用集成显卡(IGPU)还是独立显卡(DGPU)。集成显卡能耗较低,但是图形处理能力比独立显卡弱;独立显卡的图形处理能力强,但是能耗比集成显卡高。The kernel and driver layer include the graphics card driver, which stores the graphics card configuration file. The graphics card configuration file is used to provide the type of graphics card used by the process at the process startup stage, whether to use an integrated graphics card (IGPU) or a discrete graphics card (DGPU). Integrated graphics cards have lower energy consumption, but weaker graphics processing capabilities than discrete graphics cards; discrete graphics cards have stronger graphics processing capabilities, but higher energy consumption than integrated graphics cards.

硬件层,该硬件层包括中央处理器(central processing unit,CPU)、集成显卡(integrated graphics processing unit,IGPU)、独立显卡(discrete graphicsprocessing unit,DGPU)、内存(MEMORY)等硬件设备。The hardware layer includes the central processing unit (CPU), integrated graphics processing unit (IGPU), discrete graphics processing unit (DGPU), memory and other hardware devices.

为了便于理解,本申请以下实施例将以具有上文中所示结构的电子设备为例,结合附图和应用场景,对本申请实施例提供的显卡调度方法进行具体阐述。For ease of understanding, the following embodiments of the present application will take an electronic device having the structure shown above as an example, and combine the accompanying drawings and application scenarios to specifically explain the graphics card scheduling method provided in the embodiments of the present application.

通常,在图形类的APP运行过程中,需要调用GPU的资源来进行图像处理以达到相应的显示效果。针对图像处理的运算量大的APP,可以标记为高性能需求的APP,由于IGPU处理能力有限,无法满足正常的图形处理的需求,则会调用DGPU来执行图像处理。针对图像处理的运算量小的APP,则可以使用IGPU来执行图像处理,既可以满足使用需要,也可以节约能耗。因此电子设备只需要确定APP是否有标记高性能需求,如果有,则调用DGPU,如果没有,就调用IGPU。Usually, during the operation of graphics apps, it is necessary to call on the resources of the GPU to perform image processing to achieve the corresponding display effect. For apps with a large amount of image processing calculations, they can be marked as apps with high performance requirements. Since the processing power of the IGPU is limited and cannot meet the normal graphics processing requirements, the DGPU will be called to perform image processing. For apps with a small amount of image processing calculations, the IGPU can be used to perform image processing, which can not only meet usage needs but also save energy. Therefore, the electronic device only needs to determine whether the APP is marked with high-performance requirements. If so, the DGPU is called, and if not, the IGPU is called.

但是,根据APP是否有高性能需求来确定使用IGPU还是DGPU的方法,依据单一,无法合理的平衡性能和功耗,可能会导致一些情况下功耗的浪费。However, the method of determining whether to use IGPU or DGPU based on whether the APP has high performance requirements is single-based and cannot reasonably balance performance and power consumption, which may lead to waste of power consumption in some cases.

本申请的策略中,电子设备可以采用多种探针来获取当前电子设备所处的场景,然后根据所处的场景,结合电源的供电模式来确定当前APP是调用IGPU还是DGPU,从而对一些续航能力优先的场景下的功耗进行优化,以及确保一些高性能优先的场景下的性能。这里所说的场景可以包括电子设备运行的APP的种类、外接设备(鼠标、键盘、电源、耳机、摄像头等等)是否连接、电子设备是否连接外接电源(即是否电源供电(AC模式))、电量是否充足等等状态中的一种或者多种的结合。In the strategy of this application, the electronic device can use a variety of probes to obtain the scene in which the current electronic device is located, and then determine whether the current APP calls the IGPU or DGPU based on the scene in which it is located and the power supply mode of the power supply, so as to optimize the power consumption in some scenarios where battery life is prioritized, and ensure the performance in some scenarios where high performance is prioritized. The scenarios mentioned here may include one or more combinations of the type of APP running on the electronic device, whether the external device (mouse, keyboard, power supply, headphones, camera, etc.) is connected, whether the electronic device is connected to an external power supply (i.e., whether it is powered by the power supply (AC mode)), whether the power is sufficient, and so on.

在一些实施例中,显卡调度方法的流程示意图可以如9所示,包括:In some embodiments, a flowchart of a graphics card scheduling method may be shown as 9, including:

S901、获取待启动APP的标识。S901. Obtain the identifier of the APP to be started.

具体的,探测进程的探针探测到有新建的进程1,例如用户点击一个APP的图标来打开该APP,则电子设备响应用户的点击操作,新建一个进程来准备运行这个APP,称为待启动APP,并获取该待启动APP的标识。在一些实施例中,探测进程的探针将该待启动APP的标识发送至场景识别引擎,则场景识别引擎可以获取新建进程对应的待启动APP的标识。Specifically, the probe for detecting the process detects that there is a newly created process 1, for example, a user clicks on an APP icon to open the APP, then the electronic device responds to the user's click operation, creates a new process to prepare to run the APP, called the APP to be started, and obtains the identifier of the APP to be started. In some embodiments, the probe for detecting the process sends the identifier of the APP to be started to the scene recognition engine, and the scene recognition engine can obtain the identifier of the APP to be started corresponding to the newly created process.

S902、获取电子设备的当前供电方式。S902: Obtain the current power supply mode of the electronic device.

电子设备还可以根据各个探针上报的电子设备的供电方式来获取当前状态下的当前供电方式。例如可以是通过电源在位检测的探针获取电源插座是否在位,如果在位,则确定当前供电方式为电源供电,如果不在位,则确定当前供电方式为电池供电。The electronic device can also obtain the current power supply mode in the current state according to the power supply mode of the electronic device reported by each probe. For example, the probe for power supply detection can be used to obtain whether the power socket is in place, and if so, it is determined that the current power supply mode is power supply, and if not, it is determined that the current power supply mode is battery power supply.

S903、基于预设的映射关系,确定待启动APP的标识和当前供电方式对应的目标显卡类型,目标显卡类型为待启动APP在运行过程中所调用的显卡的类型,映射关系中包括多种供电方式、多个APP的标识和多个显卡类型的对应关系,多种供电方式中包括当前供电方式,多个APP的标识中包括待启动APP的标识,多个显卡类型中包括目标显卡类型。S903. Based on a preset mapping relationship, determine the target graphics card type corresponding to the identifier of the APP to be started and the current power supply mode. The target graphics card type is the type of graphics card called by the APP to be started during its operation. The mapping relationship includes a correspondence between multiple power supply modes, identifiers of multiple APPs, and multiple graphics card types. The multiple power supply modes include the current power supply mode, the identifiers of multiple APPs include the identifier of the APP to be started, and the multiple graphics card types include the target graphics card type.

上述映射关系可以是APP的标识--供电方式(也可以称为供电模式)--显卡类型的对应关系,电子设备通过在映射关系中查找待启动APP的标识和供电方式,从而获取到对应的显卡类型,并将该显卡类型作为目标显卡类型,以便运行待启动APP的时候进行调用。The above mapping relationship can be the correspondence between the APP identifier - power supply method (also known as power supply mode) - graphics card type. The electronic device obtains the corresponding graphics card type by searching for the identifier and power supply method of the APP to be started in the mapping relationship, and uses the graphics card type as the target graphics card type so that it can be called when running the APP to be started.

上述待启动APP的标识也可以是电子设备运行该待启动APP的应用场景,则上述映射关系可以为应用场景--供电模式--显卡类型的对应关系。电子设备通过查找应用场景的场景标识和供电模式,获取到对应的显卡类型,并将该显卡类型作为目标显卡类型,以便运行待启动APP的时候进行调用。The identifier of the APP to be started may also be the application scenario of the electronic device running the APP to be started, and the mapping relationship may be the corresponding relationship of application scenario-power mode-graphics card type. The electronic device obtains the corresponding graphics card type by searching the scenario identifier and power mode of the application scenario, and uses the graphics card type as the target graphics card type so as to call it when running the APP to be started.

上述图9所示的实施例中,由于结合当前的供电方式来确定该APP在后续运行时调用哪个显卡,从而根据供电方式来平衡显示性能和续航时间。例如针对图形处理要求较高的APP,使用IGPU则无法正常运行,所以直接调用DGPU来优先保证性能;而针对图形处理要求较低的APP,则可以在电池供电的模式下,调用IGPU来满足图形处理要求的同时,降低功耗,而在电源供电的模式下,则可以忽略续航的需求,调用DGPU。该方法提高了显卡调度的合理性,提升用户体验。In the embodiment shown in FIG. 9 above, the current power supply mode is combined to determine which graphics card the APP will call in subsequent operation, so as to balance the display performance and battery life according to the power supply mode. For example, for an APP with high requirements for graphics processing, the IGPU cannot run normally, so the DGPU is directly called to prioritize performance; for an APP with low requirements for graphics processing, the IGPU can be called in the battery-powered mode to meet the graphics processing requirements while reducing power consumption, and in the power supply mode, the battery life requirements can be ignored and the DGPU can be called. This method improves the rationality of graphics card scheduling and enhances user experience.

在一些实施例中,显卡调度方法的流程示意图可以如10所示,包括:In some embodiments, a flowchart of a graphics card scheduling method may be shown as 10, including:

S1001、获取新建进程对应的待启动APP的标识。S1001. Obtain the identifier of the APP to be started corresponding to the newly created process.

具体的,探测进程的探针探测到有新建进程1,即电子设备上即将打开一个新的APP,称为待启动APP,记作APP1,此时电子设备可以获取新建进程对应的即将启动的APP1。在一些实施例中,探测进程的探针探测到新建进程1,还可以根据该新建进程1的名称和新建进程1的签名信息,来确定此时需要启动的APP为APP1,并获取该APP1的标识。可选地,启动该APP1之前,电子设备还可以对根据新建进程1的签名信息来校验签名证书是否可用,如果可用,则继续执行后续步骤。之后电子设备将该APP1的标识发送至场景识别引擎,则场景识别引擎可以获取新建进程对应的待启动APP的标识。Specifically, the probe for detecting processes detects a newly created process 1, that is, a new APP is about to be opened on the electronic device, which is called the APP to be started, recorded as APP1. At this time, the electronic device can obtain the APP1 to be started corresponding to the newly created process. In some embodiments, the probe for detecting processes detects the newly created process 1, and can also determine that the APP to be started at this time is APP1 based on the name of the newly created process 1 and the signature information of the newly created process 1, and obtain the identifier of APP1. Optionally, before starting the APP1, the electronic device can also verify whether the signature certificate is available based on the signature information of the newly created process 1. If available, continue to execute subsequent steps. After that, the electronic device sends the identifier of APP1 to the scene recognition engine, and the scene recognition engine can obtain the identifier of the APP to be started corresponding to the newly created process.

S1002、根据待启动APP的标识确定待启动APP是否为预设的白名单中的APP。若是,则执行S1003A的步骤;若否,则执行S1003B。S1002: Determine whether the APP to be started is an APP in a preset whitelist according to the identifier of the APP to be started. If yes, execute step S1003A; if no, execute step S1003B.

需要说明的是,该白名单中的APP为预先确定了在什么样的场景下所要调用的显卡类型的APP,即运行时分别处于电源供电和电池供电的场景下,是需要调用独立显卡或集成显卡的APP。可选地,白名单中可以包括多个APP,还可以包括这多个APP中每个APP所对应的显卡类型。可选地,显卡类型也可以用相应的标识进行区分,例如独立显卡使用DGPU表示,集成显卡使用IGPU表示。可选地,该白名单可以存储在PC管家的配置文件中。It should be noted that the APPs in the whitelist are APPs that have predetermined the types of graphics cards to be called in what scenarios, that is, they are APPs that need to call independent graphics cards or integrated graphics cards when they are powered by power supply and battery power respectively during operation. Optionally, the whitelist may include multiple APPs, and may also include the graphics card type corresponding to each of these multiple APPs. Optionally, the graphics card type can also be distinguished by corresponding identifiers, for example, independent graphics cards are represented by DGPU, and integrated graphics cards are represented by IGPU. Optionally, the whitelist can be stored in the configuration file of PC Manager.

电子设备可以在预设的白名单中查找待启动APP的标识。例如电子设备在白名单中查找APP1的标识,如果能够查找到,就确定该待启动APP为白名单中的APP;如果没有查找到,则确定该待启动APP不在白名单内。The electronic device can search for the identifier of the APP to be started in the preset white list. For example, the electronic device searches for the identifier of APP1 in the white list. If it can be found, it is determined that the APP to be started is an APP in the white list; if it is not found, it is determined that the APP to be started is not in the white list.

在一些实施例中,电子设备可以通过场景识别引擎可以根据APP1的标识在白名单中进行查找,如果查找到APP1,则可以确定该APP1为白名单中的APP;如果没有查找到APP1,则确定该APP1不是该白名单中的APP。In some embodiments, the electronic device can use the scene recognition engine to search the whitelist according to the identifier of APP1. If APP1 is found, it can be determined that APP1 is an APP in the whitelist; if APP1 is not found, it can be determined that APP1 is not an APP in the whitelist.

上述白名单中还可以包括例如是高显示要求的如游戏类APP,还是低显示要求的如音乐APP。The above whitelist may also include, for example, apps with high display requirements, such as gaming apps, or apps with low display requirements, such as music apps.

S1003A、如果待启动APP为白名单中的APP,获取电子设备当前的供电方式。S1003A: If the APP to be started is an APP in the whitelist, obtain the current power supply mode of the electronic device.

电子设备还可以根据各个探针上报的电子设备的供电方式来获取当前是电源供电还是电池供电。The electronic device can also obtain whether it is currently powered by a mains supply or a battery according to the power supply mode of the electronic device reported by each probe.

在一些实施例中,各种场景的探针能够获取电子设备当前的各种状态,并将这些状态上报至场景识别引擎,电子设备通过场景识别引擎根据这些状态识别出当前的场景标识,该场景标识中可以携带电源的供电方式。可选地,上述场景标识还可以是场景名称、场景代码等其他类型的标识,本申请实施例对此并不做限定。In some embodiments, probes of various scenes can obtain various current states of electronic devices and report these states to the scene recognition engine. The electronic device identifies the current scene identifier based on these states through the scene recognition engine, and the scene identifier can carry the power supply mode. Optionally, the above scene identifier can also be other types of identifiers such as scene names and scene codes, which are not limited in the embodiments of the present application.

可选地,场景标识可以是场景号,该场景号中包括多个字段,不同的字段代表着不同探针探测得到的状态。例如,场景号中可以包括表征电源供电方式的字段,例如该供电方式的字段为0,则可以表示当前电子设备处于AC模式,即插入了电源,是使用电源供电的模式;如果该供电方式的字段为1,则可以表示当前电子设备处于电池供电(即DC模式),即没有插入电源,是使用电池进行供电的模式。Optionally, the scene identifier may be a scene number, which includes multiple fields, and different fields represent states detected by different probes. For example, the scene number may include a field representing the power supply mode. For example, if the power supply mode field is 0, it may indicate that the current electronic device is in AC mode, that is, a power supply is plugged in and it is a power supply mode; if the power supply mode field is 1, it may indicate that the current electronic device is in battery power supply (i.e., DC mode), that is, no power supply is plugged in and it is a battery-powered mode.

S1003B、如果待启动APP不在白名单中,则确定待启动APP在默认的显卡的配置文件中所对应的显卡为目标显卡。S1003B: If the APP to be started is not in the whitelist, determine that the graphics card corresponding to the APP to be started in the configuration file of the default graphics card is the target graphics card.

此时无需修改显卡的配置文件,使用默认的显卡的配置文件来调用对应显卡可以确保显卡的有序调用,即采用原始的默认的兜底的设计,因此不会出现上述对应关系中未覆盖到的场景下显卡调用混乱的问题。At this time, there is no need to modify the graphics card configuration file. Using the default graphics card configuration file to call the corresponding graphics card can ensure the orderly calling of the graphics card, that is, using the original default fallback design, so there will be no problem of graphics card calling confusion in scenarios not covered by the above correspondence.

S1004、根据待启动APP的标识和供电方式确定待启动APP运行时调用的目标显卡。S1004: Determine a target graphics card to be called when the APP to be started is running according to the identifier of the APP to be started and the power supply method.

电子设备还可以根据待启动APP的标识和供电方式在预设的映射关系中查找,得到待启动APP的标识和供电方式对应的目标显卡。该对应关系中可以包括白名单中的APP的标识、供电方式(AC和DC)以及显卡类型的对应关系。The electronic device can also search in a preset mapping relationship according to the identification and power supply mode of the APP to be started, and obtain the target graphics card corresponding to the identification and power supply mode of the APP to be started. The corresponding relationship may include the identification of the APP in the whitelist, the power supply mode (AC and DC), and the corresponding relationship of the graphics card type.

可选地,上述映射关系中还可以是多个场景标识和不同显卡的对应关系。其中,场景标识中包括表征电源的供电方式的信息。对应关系中的多个场景标识互不相同,但是每个场景标识所对应的显卡可能和其他的一些场景标识对应相同的显卡。当显卡类型包括IGPU和DGPU时,则不同的场景标识分别对应IGPU或DGPU。Optionally, the above mapping relationship may also be a correspondence between multiple scene identifiers and different graphics cards. The scene identifier includes information characterizing the power supply mode of the power supply. The multiple scene identifiers in the correspondence are different from each other, but the graphics card corresponding to each scene identifier may correspond to the same graphics card as some other scene identifiers. When the graphics card type includes IGPU and DGPU, different scene identifiers correspond to IGPU or DGPU respectively.

可选地,电子设备也可以获取当前场景下的场景标识,结合待启动APP的标识在对应关系中查找,来获取目标显卡。Optionally, the electronic device may also obtain a scene identifier in the current scene, and search in the corresponding relationship in combination with the identifier of the APP to be started to obtain the target graphics card.

在一些实施例中,电子设备还可以通过场景识别引擎将场景标识发送至调度引擎。例如是将场景号发送至调度引擎,也可以是将场景号中表征电源的供电方式的字段发送至调度引擎,对此本实施例不做限定。调度引擎根据场景标识所携带的供电方式确定当前的场景下待启动APP运行时需要调用的显卡类型,实现显卡调度的动态调整。In some embodiments, the electronic device may also send the scene identifier to the scheduling engine through the scene recognition engine. For example, the scene number may be sent to the scheduling engine, or the field representing the power supply mode of the power supply in the scene number may be sent to the scheduling engine, which is not limited in this embodiment. The scheduling engine determines the type of graphics card that needs to be called when the APP to be started is running in the current scene according to the power supply mode carried by the scene identifier, so as to realize dynamic adjustment of the graphics card scheduling.

可选地,可以预先设定一些场景标识和显卡类型的对应关系,例如是:场景号--显卡类型的对应关系,通常,场景号中可以携带供电模式的字段。调度引擎能够在对应关系中查找到场景号对应的显卡类型,然后将这个显卡类型写入显卡驱动的配置文件中,使得APP1在启动之后调用写入的显卡类型。Optionally, some correspondences between scene identifiers and graphics card types can be preset, such as: scene number--graphics card type correspondence, and usually, the scene number can carry a field for the power supply mode. The scheduling engine can find the graphics card type corresponding to the scene number in the correspondence, and then write this graphics card type into the configuration file of the graphics card driver, so that APP1 calls the written graphics card type after startup.

可选地,还可以预先设定一些APP和显卡类型的映射关系。例如,游戏类APP对应DGPU,评测类APP对应DGPU。再如,会议类APP对应IGPU,视频类APP对应IGPU,音乐类APP对应IGPU,社交类APP对应IGPU。这样的对应方式可以确保在图形处理要求高的APP运行时,调用图形处理能力强的DGPU以确保处理性能;以及在图形处理要求低的APP运行时,调用图形处理能力弱的IGPU来保证满足显示要求的同时,降低功耗。Optionally, some mapping relationships between APPs and graphics card types can also be pre-set. For example, game APPs correspond to DGPU, and evaluation APPs correspond to DGPU. For another example, conference APPs correspond to IGPU, video APPs correspond to IGPU, music APPs correspond to IGPU, and social APPs correspond to IGPU. This correspondence method can ensure that when an APP with high graphics processing requirements is running, the DGPU with strong graphics processing capabilities is called to ensure processing performance; and when an APP with low graphics processing requirements is running, the IGPU with weak graphics processing capabilities is called to ensure that the display requirements are met while reducing power consumption.

可选地,该对应关系中还可以包括当前的供电模式的映射关系,即对应关系为:应用场景--供电模式--显卡类型,三者的对应关系。例如,会议类APP、DC模式、IGPU对应;会议类APP、AC模式、DGPU对应;视频类APP、DC模式、IGPU对应;视频类APP、AC模式、DGPU对应;音乐类APP、DC模式、IGPU对应;音乐类APP、AC模式、DGPU对应;视频类APP、AC模式、DGPU对应;社交类APP、DC模式、IGPU对应;社交类APP、AC模式、DGPU对应;办公类APP、DC模式、IGPU对应;办公类APP、AC模式、DGPU对应;浏览器APP、DC模式、IGPU对应;浏览器APP、AC模式、DGPU对应。这样的对应关系使得,当APP为对图形处理要求不高的APP时,电子设备能够结合供电方式来确定需要使用的显卡,使得在电源供电时调用DGPU来优先保证性能,优化显示效果;在电池供电时,调用IGPU来节约功耗,从而平衡不同使用场景下用户的体验。Optionally, the corresponding relationship may also include a mapping relationship of the current power supply mode, that is, the corresponding relationship is: application scenario--power supply mode--graphics card type, the corresponding relationship among the three. For example, conference APP, DC mode, IGPU correspondence; conference APP, AC mode, DGPU correspondence; video APP, DC mode, IGPU correspondence; video APP, AC mode, DGPU correspondence; music APP, DC mode, IGPU correspondence; music APP, AC mode, DGPU correspondence; video APP, AC mode, DGPU correspondence; social APP, DC mode, IGPU correspondence; social APP, AC mode, DGPU correspondence; office APP, DC mode, IGPU correspondence; office APP, AC mode, DGPU correspondence; browser APP, DC mode, IGPU correspondence; browser APP, AC mode, DGPU correspondence. This correspondence allows the electronic device to determine the graphics card to be used based on the power supply method when the APP does not have high requirements for graphics processing, so that when powered by power supply, the DGPU is called to prioritize performance and optimize display effects; when powered by battery, the IGPU is called to save power consumption, thereby balancing the user experience in different usage scenarios.

电子设备可以根据场景号中表征的应用场景,结合电源的供电模式来确定待启动APP运行时所需要调用的显卡类型。在一些实施例中,可以参见下述对应关系:The electronic device can determine the type of graphics card that needs to be called when the APP to be started is running according to the application scenario represented by the scenario number and the power supply mode of the power supply. In some embodiments, the following corresponding relationship can be referred to:

当待启动APP为游戏类APP时,无论电源的供电模式为AC还是DC,对应的显卡类型都是DGPU;当应用场景为评测场景(例如跑分类的场景)时,无论电源的供电模式为AC还是DC,对应的显卡类型也都是DGPU,来优先保证性能。When the APP to be launched is a gaming APP, regardless of whether the power supply mode is AC or DC, the corresponding graphics card type is DGPU; when the application scenario is an evaluation scenario (such as a classification scenario), regardless of whether the power supply mode is AC or DC, the corresponding graphics card type is also DGPU to prioritize performance.

当待启动APP为办公类APP,且电源的供电模式为DC,对应的显卡类型为IGPU;当待启动APP为为音乐类APP,且电源的供电模式为DC,对应的显卡类型为IGPU;当待启动APP为为视频类APP,且电源的供电模式为DC,对应的显卡类型为IGPU;当待启动APP为为社交类APP,且电源的供电模式为DC,对应的显卡类型都是IGPU;当待启动APP为为会议类APP,且电源的供电模式为DC,对应的显卡类型都是IGPU,来优先保证电子设备的续航能力。When the APP to be started is an office APP and the power supply mode is DC, the corresponding graphics card type is IGPU; when the APP to be started is a music APP and the power supply mode is DC, the corresponding graphics card type is IGPU; when the APP to be started is a video APP and the power supply mode is DC, the corresponding graphics card type is IGPU; when the APP to be started is a social APP and the power supply mode is DC, the corresponding graphics card type is IGPU; when the APP to be started is a conference APP and the power supply mode is DC, the corresponding graphics card type is IGPU, to prioritize the battery life of the electronic device.

当待启动APP为办公类APP、音乐类APP、视频类APP、社交类APP和会议类APP等对图像处理的运算量较低的APP时,且电子设备的供电模式为AC,则电子设备认为电源供电模式下可以无需考虑功耗的问题,就采用各个APP原本默认的显卡类型,即不用修改显卡驱动的配置文件。When the APP to be started is an APP with low image processing computational complexity, such as office APP, music APP, video APP, social APP and conference APP, and the power supply mode of the electronic device is AC, the electronic device believes that there is no need to consider the power consumption issue in the power supply mode, and the original default graphics card type of each APP is adopted, that is, there is no need to modify the configuration file of the graphics card driver.

其他应用场景下,都可以调用默认的显卡类型,即不用修改显卡驱动的配置文件。In other application scenarios, the default graphics card type can be called, that is, there is no need to modify the graphics card driver configuration file.

上述设置方式是在图形处理要求较高的情况下(即高性能优先的情况下),如果使用IGPU则无法正常运行,所以直接调用DGPU来优先保证性能的;而在其他图形处理要求较低,且处于电池模式的情况下(即续航优先的情况下),调用IGPU来满足图形处理要求的同时,降低功耗。对上述特定场景进行设置,而其他的场景都采用默认的显卡类型是依据最小修改原则,能够优化特定场景的体验的同时,简化了设计,降低了设计难度,也降低了电子设备在研发过程中的人力成本和缩短了电子设备的研发周期。The above settings are for situations where the graphics processing requirements are high (i.e., high performance is prioritized). If IGPU is used, it cannot run normally, so DGPU is directly called to prioritize performance. In other situations where the graphics processing requirements are low and the system is in battery mode (i.e., battery life is prioritized), IGPU is called to meet the graphics processing requirements while reducing power consumption. The above specific scenarios are set, while the default graphics card type is used for other scenarios based on the principle of minimum modification. While optimizing the experience of specific scenarios, it simplifies the design, reduces the difficulty of design, reduces the labor cost of electronic equipment during the research and development process, and shortens the research and development cycle of electronic equipment.

上述图10所示的实施例中,由于白名单中的APP分别对应不同供电方式下调用的显卡类型,电子设备在启动白名单中APP过程中,就可以结合当前的供电方式来确定该APP在后续运行时调用哪个显卡,从而根据供电方式来平衡显示性能和续航时间。例如针对图形处理要求较高的APP,使用IGPU则无法正常运行,所以直接调用DGPU来优先保证性能;而针对图形处理要求较低的APP,则可以在电池供电的模式下,调用IGPU来满足图形处理要求的同时,降低功耗,而在电源供电的模式下,则可以忽略续航的需求,调用DGPU。该方法提高了显卡调度的合理性,提升用户体验。In the embodiment shown in FIG. 10 above, since the APPs in the whitelist correspond to the types of graphics cards called under different power supply modes, when the electronic device starts the APP in the whitelist, it can determine which graphics card the APP will call in the subsequent operation in combination with the current power supply mode, so as to balance the display performance and battery life according to the power supply mode. For example, for APPs with high requirements for graphics processing, the IGPU cannot run normally, so the DGPU is directly called to give priority to performance; for APPs with low requirements for graphics processing, the IGPU can be called in the battery-powered mode to meet the graphics processing requirements while reducing power consumption, and in the power supply mode, the battery life requirements can be ignored and the DGPU can be called. This method improves the rationality of graphics card scheduling and enhances user experience.

在一些实施例中,上述供电方式也可以描述为供电场景,例如电源供电场景可以称为性能场景,电池供电场景可以称为续航场景,对此本申请也不做限定。可选地,关于供电场景除了探针探测的结果之外,还可以手动进行设置。例如用户可以通过点击PC管家界面上“性能场景/续航场景”的按钮来切换供电场景。例如,在性能场景(即电源供电场景)下,电子设备当前运行的APP又是调用的IGPU的情况,那么用户可以通过点击PC管家界面上的“性能场景/续航场景”的按钮,从调用IGPU的场景切换为调用DGPU的状态来进行图形处理,从而提高图像处理能力,则无需关注功耗。In some embodiments, the above-mentioned power supply mode can also be described as a power supply scenario. For example, the power supply scenario can be called a performance scenario, and the battery power supply scenario can be called a battery life scenario, which is not limited in this application. Optionally, in addition to the results of the probe detection, the power supply scenario can also be set manually. For example, the user can switch the power supply scenario by clicking the "Performance Scenario/Battery Life Scenario" button on the PC housekeeper interface. For example, in a performance scenario (i.e., a power supply scenario), if the APP currently running on the electronic device is the case of calling the IGPU, the user can click the "Performance Scenario/Battery Life Scenario" button on the PC housekeeper interface to switch from the scene of calling the IGPU to the state of calling the DGPU for graphics processing, thereby improving the image processing capability, without having to pay attention to power consumption.

当调度引擎决策出待启动APP所需要调度的目标显卡后,可以通过执行体去修改内核和驱动层中显卡的配置文件。之后,显卡驱动读取这个修改后的配置文件,并按照显卡的修改后的配置文件中所指示的显卡类型,启动目标显卡来执行待启动APP的启动流程,使得待启动APP运行在决策出的目标显卡上。如果调度引擎决策出待启动APP所需要调度的显卡类型后,通过执行体去修改显卡驱动的配置文件时,发现所得到的新的显卡类型和原本的配置文件中的显卡类型相同,则可以保持显卡驱动的配置文件不做修改,这样在确保显卡调用合理的同时可以减少修改的操作,节约资源。例如,调度引擎决策出待启动APP所需要调度的为DGPU,则可以通过执行体去修改显卡的配置文件。如果原始的显卡的配置文件中,待启动APP配置的显卡类型为IGPU,则此时需要被修改为DGPU。如果原始的显卡的配置文件中,待启动APP配置的显卡类型为DGPU,则此时可以不用修改。When the scheduling engine determines the target graphics card that needs to be scheduled for the APP to be started, the configuration files of the graphics card in the kernel and driver layer can be modified through the execution body. After that, the graphics card driver reads the modified configuration file, and according to the graphics card type indicated in the modified configuration file of the graphics card, starts the target graphics card to execute the startup process of the APP to be started, so that the APP to be started runs on the determined target graphics card. If the scheduling engine determines the graphics card type that needs to be scheduled for the APP to be started, and when the configuration file of the graphics card driver is modified through the execution body, it is found that the new graphics card type obtained is the same as the graphics card type in the original configuration file, the configuration file of the graphics card driver can be kept unchanged, so that the modification operation can be reduced while ensuring the reasonableness of the graphics card call, saving resources. For example, if the scheduling engine determines that the APP to be started needs to be scheduled as DGPU, the configuration file of the graphics card can be modified through the execution body. If the graphics card type configured for the APP to be started in the original graphics card configuration file is IGPU, it needs to be modified to DGPU at this time. If the graphics card type configured for the APP to be started in the original graphics card configuration file is DGPU, it does not need to be modified at this time.

在一些实施例中,硬件层的结构示意图还可以参见图11所示。通常,针对DGPU会单独设置专门的存储器(Video Memory),当调用DGPU进行运算时,DGPU可以将运算结果通过高速串行计算机扩展总线标准通道(PCIE,peripheral component interconnectexpress)总线发送给CPU,由CPU传递至IGPU,最后通过IGPU传递至显示屏(Display)来送显。如果调用IGPU进行运算时,IGPU则可以直接将运算结果送显。在一些实施例中,DGPU也可以不通过IGPU,而是通过DGPU和显示屏之间的通道直接送显。In some embodiments, the structural diagram of the hardware layer can also be seen in Figure 11. Usually, a dedicated memory (Video Memory) is set up separately for the DGPU. When the DGPU is called for calculation, the DGPU can send the calculation result to the CPU through the high-speed serial computer expansion bus standard channel (PCIE, peripheral component interconnectexpress) bus, which is passed from the CPU to the IGPU, and finally passed to the display (Display) through the IGPU for display. If the IGPU is called for calculation, the IGPU can directly send the calculation result to the display. In some embodiments, the DGPU can also send the result directly to the display through the channel between the DGPU and the display instead of the IGPU.

为了更为清楚的描述本案的技术方案,此处以图12所示的具体流程对本申请实施例的技术方案进行说明,包括:In order to more clearly describe the technical solution of this case, the technical solution of the embodiment of the present application is described here with the specific process shown in FIG. 12, including:

S1201、注册应用(例如PC管家)启动监听。S1201. A registered application (eg, PC Manager) starts monitoring.

S1202、图形类APP(待启动APP)启动。S1202, the graphics APP (the APP to be started) is started.

S1203、接收到图形类APP的启动通知(即,监听到新建进程)。S1203: receiving a startup notification of a graphics APP (ie, monitoring a newly created process).

S1204、判断图形类APP是否为白名单中的APP。若是,执行S1205;若否,执行S1208。S1204: Determine whether the graphic app is an app in the whitelist. If yes, execute S1205; if no, execute S1208.

S1205、查询当前的场景为续航场景还是性能场景。S1205. Query whether the current scenario is a battery life scenario or a performance scenario.

S1206、根据当前的场景决策使用IGPU或DGPU。S1206: Decide whether to use the IGPU or the DGPU based on the current scenario.

S1207、根据决策结果修改配置文件。S1207. Modify the configuration file according to the decision result.

S1208、读取配置文件。S1208: Read the configuration file.

S1209、根据配置文件调度IGPU或DGPU。S1209: Schedule the IGPU or DGPU according to the configuration file.

图12实施例中各个步骤的实现原理和有益效果可以参见前述实施例中的描述,此处不再赘述。The implementation principles and beneficial effects of each step in the embodiment of Figure 12 can be found in the description of the previous embodiment, and will not be repeated here.

上文详细介绍了本申请提供的显卡调度方法的示例。可以理解的是,相应的装置为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The above describes in detail an example of the graphics card scheduling method provided by the present application. It is understandable that, in order to implement the above functions, the corresponding device includes a hardware structure and/or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

本申请可以根据上述方法示例对显卡调度装置进行功能模块的划分,例如,可以将各个功能划分为各个功能模块,也可以将两个或两个以上的功能集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The present application can divide the graphics card scheduling device into functional modules according to the above method example. For example, each function can be divided into each functional module, or two or more functions can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

图13为本申请实施例提供的一例显卡调度装置1300的结构示意图。该装置包括:FIG13 is a schematic diagram of a structure of a graphics card scheduling device 1300 provided in an embodiment of the present application. The device includes:

第一获取模块1301,用于获取待启动应用程序APP的标识。The first acquisition module 1301 is used to acquire the identifier of the application program APP to be started.

第二获取模块1302,用于获取电子设备的当前供电方式。The second acquisition module 1302 is used to acquire the current power supply mode of the electronic device.

确定模块1303,用于基于预设的映射关系,确定待启动APP的标识和当前供电方式对应的目标显卡类型,目标显卡类型为待启动APP在运行过程中所调用的显卡的类型,映射关系中包括多种供电方式、多个APP的标识和多个显卡类型的对应关系,多种供电方式中包括当前供电方式,多个APP的标识中包括待启动APP的标识,多个显卡类型中包括目标显卡类型。Determination module 1303 is used to determine the target graphics card type corresponding to the identifier of the APP to be started and the current power supply mode based on a preset mapping relationship. The target graphics card type is the type of graphics card called by the APP to be started during its operation. The mapping relationship includes the correspondence between multiple power supply modes, multiple APP identifiers and multiple graphics card types. The multiple power supply modes include the current power supply mode, the multiple APP identifiers include the identifier of the APP to be started, and the multiple graphics card types include the target graphics card type.

在一些实施例中,多种供电方式中包括电池供电和电源供电,多个显卡类型中包括集成显卡和独立显卡,多个APP的标识中包括高性能类别的APP的标识和低性能类别的APP的标识,映射关系包括:低性能类别的APP的标识、电池供电和集成显卡对应;低性能类别的APP的标识、电源供电和独立显卡对应;高性能类别的APP的标识、电池供电和独立显卡对应;高性能类别的APP的标识、电源供电和独立显卡对应。In some embodiments, the multiple power supply modes include battery power supply and power supply, the multiple graphics card types include integrated graphics card and independent graphics card, the multiple APP identifiers include identifiers of high-performance category APPs and identifiers of low-performance category APPs, and the mapping relationships include: the identifier of low-performance category APP, battery power supply and corresponding integrated graphics card; the identifier of low-performance category APP, power supply power and corresponding independent graphics card; the identifier of high-performance category APP, battery power supply and corresponding independent graphics card; the identifier of high-performance category APP, power supply power and corresponding independent graphics card.

在一些实施例中,第二获取模块1302,还用于获取电子设备的当前供电方式之前,根据待启动APP的标识,确定待启动APP是否为预设名单中的APP,预设名单中的APP为携带高性能类别标识的APP或携带低性能类别标识的APP;若是,则执行获取电子设备的当前供电方式的步骤。In some embodiments, the second acquisition module 1302 is also used to determine whether the APP to be started is an APP in a preset list based on the identifier of the APP to be started before acquiring the current power supply mode of the electronic device, and the APP in the preset list is an APP carrying a high-performance category identifier or an APP carrying a low-performance category identifier; if so, execute the step of obtaining the current power supply mode of the electronic device.

在一些实施例中,确定模块1303,还用于在待启动APP不是预设名单中的APP时,则从预设配置文件中获取目标显卡类型。In some embodiments, the determination module 1303 is further configured to obtain a target graphics card type from a preset configuration file when the APP to be started is not an APP in a preset list.

在一些实施例中,第二获取模块1302,还用于根据待启动APP的标识确定待启动APP是否为图形类APP;若是,则执行根据待启动APP的标识,确定待启动APP是否为预设名单中的APP步骤。In some embodiments, the second acquisition module 1302 is further used to determine whether the APP to be started is a graphic APP according to the identification of the APP to be started; if so, executing the step of determining whether the APP to be started is an APP in a preset list according to the identification of the APP to be started.

在一些实施例中,在当前供电方式为电源供电,目标显卡类型为集成显卡时,确定模块1303,还用于接收用户输入的切换操作,响应于切换操作,将目标显卡类型由集成显卡切换为独立显卡。In some embodiments, when the current power supply mode is power supply and the target graphics card type is an integrated graphics card, the determination module 1303 is also used to receive a switching operation input by the user, and in response to the switching operation, the target graphics card type is switched from an integrated graphics card to an independent graphics card.

在一些实施例中,第一获取模块1301,具体用于通过进程探针监听新建进程;根据新建进程,获取新建进程用于启动的待启动APP的标识。In some embodiments, the first acquisition module 1301 is specifically configured to monitor a newly created process through a process probe; and, based on the newly created process, acquire an identifier of an APP to be started that is used by the newly created process to start.

在一些实施例中,第二获取模块1302,具体用于通过场景识别引擎获取当前供电方式。In some embodiments, the second acquisition module 1302 is specifically configured to acquire the current power supply mode through a scene recognition engine.

在一些实施例中,确定模块1303,具体用于通过调度引擎基于映射关系,确定待启动APP的标识和当前供电方式对应的目标显卡类型。In some embodiments, the determination module 1303 is specifically configured to determine, through a scheduling engine based on a mapping relationship, the identifier of the APP to be started and the target graphics card type corresponding to the current power supply mode.

在一些实施例中,确定模块1303,还用于根据目标显卡类型更新预设配置文件,预设配置文件用于执行体根据预设配置文件中的目标显卡类型启动待启动APP。In some embodiments, the determination module 1303 is further used to update a preset configuration file according to the target graphics card type, and the preset configuration file is used for the execution body to start the to-be-started APP according to the target graphics card type in the preset configuration file.

显卡调度装置执行显卡调度方法的具体方式以及产生的有益效果可以参见方法实施例中的相关描述,此处不再赘述。The specific manner in which the graphics card scheduling device executes the graphics card scheduling method and the beneficial effects produced can be found in the relevant description in the method embodiment, which will not be repeated here.

本申请实施例还提供了一种电子设备,包括上述处理器。本实施例提供的电子设备可以如图1所示,为终端设备,例如笔记本电脑,用于执行上述显卡调度方法。在采用集成的单元的情况下,终端设备可以包括处理模块、存储模块和通信模块。其中,处理模块可以用于对终端设备的动作进行控制管理,例如,可以用于支持终端设备执行显示单元、检测单元和处理单元执行的步骤。存储模块可以用于支持终端设备执行存储程序代码和数据等。通信模块,可以用于支持终端设备与其它设备的通信。An embodiment of the present application also provides an electronic device, including the above-mentioned processor. The electronic device provided in this embodiment can be a terminal device as shown in Figure 1, such as a laptop computer, used to execute the above-mentioned graphics card scheduling method. In the case of an integrated unit, the terminal device may include a processing module, a storage module and a communication module. Among them, the processing module can be used to control and manage the actions of the terminal device, for example, it can be used to support the terminal device to execute the steps performed by the display unit, the detection unit and the processing unit. The storage module can be used to support the terminal device to execute stored program codes and data, etc. The communication module can be used to support the communication between the terminal device and other devices.

其中,处理模块可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理(digital signal processing,DSP)和微处理器的组合等等。存储模块可以是存储器。通信模块具体可以为射频电路、蓝牙芯片、Wi-Fi芯片等与其它终端设备交互的设备。Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other terminal devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

在一个实施例中,当处理模块为处理器,存储模块为存储器时,本实施例所涉及的终端设备可以为具有图1所示结构的设备。In one embodiment, when the processing module is a processor and the storage module is a memory, the terminal device involved in this embodiment may be a device having the structure shown in FIG. 1 .

本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储了计算机程序,当所述计算机程序被处理器执行时,使得处理器执行上述任一实施例所述的显卡调度方法。An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the graphics card scheduling method described in any of the above embodiments.

本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的显卡调度方法。The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the graphics card scheduling method in the above-mentioned embodiment.

其中,本实施例提供的电子设备、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,更换的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, the replaced units may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims (6)

1. The display card scheduling method is applied to the electronic equipment and is characterized by comprising the following steps of:
The probe of the detection process detects that a new process exists, and whether the signature certificate is available or not is checked according to the signature information of the new process;
If the application program APP is available, the identification of the application program APP corresponding to the new process is sent to a scene recognition engine, and the APP corresponding to the new process is the APP to be started;
The scene recognition engine receives the identification of the APP to be started, which is detected by the probe of the detection process;
Determining whether the APP to be started is an APP in a preset list according to the identification of the APP to be started, wherein the APP in the preset list is the APP carrying the high-performance type identification or the APP carrying the low-performance type identification;
If yes, the probe for the power supply in-place detection reports the current power supply mode in the current state to the scene recognition engine;
Searching an identification of the APP to be started and the current power supply mode in a preset mapping relation, wherein the mapping relation comprises a plurality of power supply modes, a plurality of identifications of the APP and a plurality of corresponding relations of display card types, the plurality of power supply modes comprise the current power supply mode, the plurality of identifications of the APP comprise the identification of the APP to be started, the plurality of display card types comprise target display card types, and the target display card types are types of display cards called by the APP to be started in the operation process;
When the identification of the APP to be started is the identification of the APP with low performance class and the current power supply mode is battery power supply, determining the integrated display card as a target display card type;
When the identification of the APP to be started is the identification of the APP with low performance class and the current power supply mode is power supply, determining the independent display card as a target display card type;
When the identification of the APP to be started is the identification of the APP with high performance class and the current power supply mode is battery power supply, determining the independent display card as a target display card type;
when the identification of the APP to be started is the identification of the APP with high performance class and the current power supply mode is power supply, determining the independent display card as a target display card type;
If the APP to be started is not the APP in the preset list, acquiring the target video card type from a preset configuration file;
the integrated display card and the independent display card are arranged inside the electronic equipment.
2. The method of claim 1, wherein before determining whether the APP to be started is an APP in a preset list according to the identification of the APP to be started, further comprises:
determining whether the APP to be started is a graph type APP or not according to the identification of the APP to be started;
if yes, executing the step of determining whether the APP to be started is the APP in the preset list according to the identification of the APP to be started.
3. The method according to claim 1 or 2, wherein when the current power supply mode is power supply, and the target graphics card type is an integrated graphics card, the method further comprises:
Receiving switching operation input by a user;
And responding to the switching operation, and switching the type of the target display card from an integrated display card to an independent display card.
4. The method according to claim 1, wherein the method further comprises:
And updating a preset configuration file according to the target display card type, wherein the preset configuration file is used for an executive body to start the APP to be started according to the target display card type in the preset configuration file.
5. An electronic device, comprising: a processor, a memory, and an interface;
The processor, the memory and the interface cooperate to cause the electronic device to perform the method of any of claims 1 to 4.
6. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, causes the processor to perform the method of any of claims 1 to 4.
CN202210776076.8A 2022-05-16 2022-06-29 Display card scheduling method, electronic equipment and computer readable storage medium Active CN116028211B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210529195 2022-05-16
CN2022105291953 2022-05-16

Publications (2)

Publication Number Publication Date
CN116028211A CN116028211A (en) 2023-04-28
CN116028211B true CN116028211B (en) 2024-06-21

Family

ID=86071044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210776076.8A Active CN116028211B (en) 2022-05-16 2022-06-29 Display card scheduling method, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116028211B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116521112B (en) * 2023-05-15 2024-08-06 摩尔线程智能科技(北京)有限责任公司 Parameter adjustment method, graphics card, electronic device and storage medium
CN118474239B (en) * 2023-10-31 2025-03-14 荣耀终端股份有限公司 Power-on method of Subscriber Identity Module (SIM) card and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2763895Y (en) * 2005-02-23 2006-03-08 惠州市Tcl电脑科技有限责任公司 Notebook computer with double display card
CN112433768A (en) * 2020-11-05 2021-03-02 联宝(合肥)电子科技有限公司 Display card control method, equipment and computer storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102759983A (en) * 2011-05-10 2012-10-31 任少华 Computer provided with multiple work modes and operating system thereof
CN103092304B (en) * 2011-10-31 2015-11-18 宏碁股份有限公司 Power supply control method of dual graphics card module and computer device using the method
GB2518575B (en) * 2012-09-28 2020-07-08 Hewlett Packard Development Co Selectable graphics controllers to display output
CN112612432A (en) * 2020-12-01 2021-04-06 合肥联宝信息技术有限公司 Method and device for switching computer modes and readable storage medium
CN114443256B (en) * 2022-04-07 2022-08-30 荣耀终端有限公司 Resource scheduling method and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2763895Y (en) * 2005-02-23 2006-03-08 惠州市Tcl电脑科技有限责任公司 Notebook computer with double display card
CN112433768A (en) * 2020-11-05 2021-03-02 联宝(合肥)电子科技有限公司 Display card control method, equipment and computer storage medium

Also Published As

Publication number Publication date
CN116028211A (en) 2023-04-28

Similar Documents

Publication Publication Date Title
CN114443256B (en) Resource scheduling method and electronic equipment
CN116028205B (en) Resource scheduling method and electronic equipment
CN116028210B (en) Resource scheduling method, electronic equipment and storage medium
CN116027880B (en) Resource scheduling method and electronic device
CN117112191B (en) Information processing method and electronic device
CN116028211B (en) Display card scheduling method, electronic equipment and computer readable storage medium
CN116028206A (en) Resource scheduling method, electronic device and storage medium
CN116028209B (en) Resource scheduling method, electronic equipment and storage medium
CN116025580B (en) Method and electronic device for adjusting fan speed
CN117130772A (en) Resource scheduling method, electronic equipment and storage medium
CN116027879B (en) Methods, electronic devices and computer-readable storage media for determining parameters
CN116089055B (en) Resource scheduling method and device
CN117130454B (en) Power consumption adjustment method and electronic equipment
CN116028005B (en) Audio session acquisition method, device, equipment and storage medium
CN116700816B (en) Resource management method and electronic equipment
CN116028314B (en) Temperature parameter reading method, electronic device and computer-readable storage medium
CN116027878B (en) Power consumption adjustment method and electronic device
CN116055443B (en) Method for identifying social scene, electronic equipment and computer readable storage medium
CN116028208B (en) System load determining method, device, equipment and storage medium
CN117950935B (en) Performance control method and electronic equipment
WO2024216999A1 (en) Resource scheduling method and apparatus
CN120255741A (en) Performance adjustment method and electronic equipment
WO2025180531A1 (en) Electronic device control method and electronic device
WO2025118717A1 (en) System shutdown control method and apparatus, electronic device, and readable 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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China