CN116028207A - Scheduling policy determination method, device, equipment and storage medium - Google Patents

Scheduling policy determination method, device, equipment and storage medium Download PDF

Info

Publication number
CN116028207A
CN116028207A CN202210735811.0A CN202210735811A CN116028207A CN 116028207 A CN116028207 A CN 116028207A CN 202210735811 A CN202210735811 A CN 202210735811A CN 116028207 A CN116028207 A CN 116028207A
Authority
CN
China
Prior art keywords
key value
scene
application
scheduling
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.)
Granted
Application number
CN202210735811.0A
Other languages
Chinese (zh)
Other versions
CN116028207B (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 CN116028207A publication Critical patent/CN116028207A/en
Application granted granted Critical
Publication of CN116028207B publication Critical patent/CN116028207B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

本申请公开了一种调度策略确定方法、装置、设备和存储介质,属于计算机技术领域。该方法包括:确定电子设备当前所处的用户场景、电源状态、系统负载,获取用户场景对应的第一关键值、电源状态对应的第二关键值、系统负载对应的第三关键值,根据第一关键值、第二关键值和第三关键值确定目标关键值。在关键值与调度策略之间的对应关系中获取目标关键值对应的调度策略。本申请中确定调度策略时的参考因素比较全面,因而后续基于该调度策略所进行的资源调度可准确实现对电子设备的资源的合理分配,从而不仅能满足用户需求,还可兼顾电子设备本身的系统需求,进而可在降低电子设备的能耗,提升电子设备的续航能力的情况下,保证电子设备的稳定运行。

Figure 202210735811

The present application discloses a scheduling policy determination method, device, equipment and storage medium, belonging to the technical field of computers. The method includes: determining the current user scene, power state, and system load of the electronic device, obtaining a first key value corresponding to the user scene, a second key value corresponding to the power state, and a third key value corresponding to the system load, according to the first key value The first key value, the second key value and the third key value determine the target key value. The scheduling strategy corresponding to the target key value is obtained from the corresponding relationship between the key value and the scheduling strategy. The reference factors for determining the scheduling strategy in this application are relatively comprehensive, so the subsequent resource scheduling based on the scheduling strategy can accurately realize the reasonable allocation of resources for electronic devices, so as to not only meet the needs of users, but also take into account the needs of the electronic devices themselves. The system requirements can further ensure the stable operation of the electronic equipment while reducing the energy consumption of the electronic equipment and improving the battery life of the electronic equipment.

Figure 202210735811

Description

调度策略确定方法、装置、设备和存储介质Scheduling strategy determination method, device, equipment and storage medium

本申请要求于2022年05月16日提交的申请号为202210529304.1、申请名称为“调度策略确定方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202210529304.1 and the application name "Scheduling Strategy Determination Method" filed on May 16, 2022, the entire contents of which are incorporated in this application by reference.

技术领域technical field

本申请涉及计算机技术领域,特别涉及一种调度策略确定方法、装置、设备和存储介质。The present application relates to the field of computer technology, and in particular to a method, device, device and storage medium for determining a scheduling policy.

背景技术Background technique

随着电子设备性能的提升,电子设备的功耗也越来越高,但是电池容量的提升却十分缓慢,导致电子设备的续航无法满足用户的需求,降低了用户的使用体验。为此,需要对电子设备进行精准的资源调度,以在保证电子设备性能的同时满足用户的长续航体验。With the improvement of the performance of electronic equipment, the power consumption of electronic equipment is also getting higher and higher, but the battery capacity is increased very slowly, resulting in the battery life of electronic equipment cannot meet the needs of users, reducing the user experience. For this reason, it is necessary to perform precise resource scheduling on the electronic device, so as to satisfy the user's long battery life experience while ensuring the performance of the electronic device.

目前,在对电子设备进行资源调度时,根据电子设备正在运行的应用程序来确定对应的调度策略,并根据该调度策略进行资源调度,以期在电子设备性能满足应用程序的资源需求的同时,降低电子设备的能耗,提升电子设备的续航能力。At present, when performing resource scheduling on electronic devices, the corresponding scheduling strategy is determined according to the application program that the electronic device is running, and resource scheduling is performed according to the scheduling strategy, in order to reduce the resource requirements while the performance of the electronic device meets the resource requirements of the application program. Reduce the energy consumption of electronic equipment and improve the battery life of electronic equipment.

然而,上述方式在进行资源调度时,仅考虑了电子设备正在运行的应用程序,比较局限,不能准确实现对电子设备的资源的合理分配。However, the above method only considers the running application program of the electronic device when performing resource scheduling, which is relatively limited, and cannot accurately realize a reasonable allocation of resources of the electronic device.

发明内容Contents of the invention

本申请提供了一种调度策略确定方法、装置、设备和存储介质,可以实现准确实现对电子设备的资源的合理分配。所述方案如下:The present application provides a method, device, device and storage medium for determining a scheduling strategy, which can realize accurate and reasonable allocation of resources of electronic devices. The scheme is as follows:

第一方面,提供了一种调度策略确定方法,在该方法中,确定电子设备当前所处的用户场景,以及确定电子设备的电源状态和系统负载。之后,获取用户场景对应的第一关键值,获取电源状态对应的第二关键值,获取系统负载对应的第三关键值,根据第一关键值、第二关键值和第三关键值,确定目标关键值。在关键值与调度策略之间的对应关系中,获取目标关键值对应的调度策略。该调度策略用于对该电子设备进行资源调度。In a first aspect, a method for determining a scheduling strategy is provided, in which method, the current user scenario of the electronic device is determined, and the power state and system load of the electronic device are determined. Afterwards, obtain the first key value corresponding to the user scenario, obtain the second key value corresponding to the power state, obtain the third key value corresponding to the system load, and determine the target according to the first key value, the second key value and the third key value key value. In the corresponding relationship between the key value and the scheduling policy, the scheduling policy corresponding to the target key value is obtained. The scheduling strategy is used for resource scheduling of the electronic device.

本申请中,确定调度策略时的参考因素比较全面,因而后续基于该调度策略对电子设备所进行的资源调度可以准确实现对电子设备的资源的合理分配,从而不仅能满足用户需求,还可以兼顾电子设备本身的系统需求,进而可以在降低电子设备的能耗,提升电子设备的续航能力的情况下,保证电子设备的稳定运行。并且,本申请中将各种参考因素转换为对应的关键值,然后根据关键值直接获取对应的调度策略,操作过程简单,可以降低系统处理压力,进一步保证电子设备的稳定运行。In this application, the reference factors for determining the scheduling strategy are relatively comprehensive, so the subsequent resource scheduling for electronic devices based on the scheduling strategy can accurately achieve a reasonable allocation of resources for electronic devices, so that not only can meet user needs, but also can take into account The system requirements of the electronic equipment itself can further ensure the stable operation of the electronic equipment while reducing the energy consumption of the electronic equipment and improving the battery life of the electronic equipment. Moreover, in this application, various reference factors are converted into corresponding key values, and then the corresponding scheduling strategy is directly obtained according to the key values. The operation process is simple, which can reduce system processing pressure and further ensure the stable operation of electronic equipment.

可选地,确定电子设备当前所处的用户场景的操作可以为:获取该电子设备的应用运行信息,根据该应用运行信息确定用户场景。Optionally, the operation of determining the current user scenario of the electronic device may be: acquiring application running information of the electronic device, and determining the user scenario according to the application running information.

该应用运行信息可以包括焦点应用信息,进一步还可以包括非焦点应用信息、后台应用信息等应用信息。本申请中,某个应用的应用信息可以包括这个应用的应用名、应用类型、应用运行状态等。The application running information may include focus application information, and may further include application information such as non-focus application information and background application information. In this application, the application information of an application may include the application name, application type, application running status, etc. of the application.

该用户场景是指用户的使用场景,即用户正在使用电子设备做什么事情。该用户场景可以反映用户需求。由于用户使用电子设备时往往是使用电子设备中安装的各种应用,所以本申请中可以根据应用运行信息来确定用户场景,据此确定出的用户场景比较准确。The user scenario refers to the usage scenario of the user, that is, what the user is doing with the electronic device. This user scenario can reflect user needs. Since the user often uses various applications installed in the electronic device when using the electronic device, the user scenario can be determined according to the application running information in this application, and the determined user scenario is relatively accurate.

作为一种示例,根据该应用运行信息确定用户场景的操作可以为:根据该焦点应用信息中的应用类型确定主场景;根据该主场景、该焦点应用信息中的应用运行状态、该非焦点应用信息和该后台应用信息,确定至少一个子场景;从该至少一个子场景中选择优先级最高的一个子场景,该主场景和选择出的一个子场景为用户场景。As an example, the operation of determining the user scenario according to the application running information may be: determining the main scenario according to the application type in the focused application information; Information and the background application information, determine at least one sub-scene; select a sub-scene with the highest priority from the at least one sub-scene, and the main scene and the selected sub-scene are user scenes.

电子设备中可以预先设置各个子场景的优先级,各个子场景的优先级可以由技术人员根据使用需求预先进行设置,如技术人员可以根据各个子场景对电子设备的续航能力的影响程度来设置各个子场景的优先级,其中对电子设备的续航能力的影响程度越大的,优先级越高,对电子设备的续航能力的影响程度越小的,优先级越低。The priority of each sub-scene can be set in advance in the electronic device, and the priority of each sub-scene can be set in advance by the technician according to the usage requirements. For example, the technician can set each The priority of the sub-scenes, the greater the impact on the battery life of the electronic device, the higher the priority, and the smaller the impact on the battery life of the electronic device, the lower the priority.

如此,在根据该主场景、该焦点应用信息中的应用运行状态、该非焦点应用信息和该后台应用信息确定至少一个子场景后,可以从中选择优先级最高的一个子场景,以便后续可以根据该子场景确定出最为合理的调度策略,以最大程度的提升电子设备的续航能力。In this way, after at least one sub-scene is determined according to the main scene, the application running state in the focused application information, the non-focused application information, and the background application information, a sub-scene with the highest priority can be selected, so that the following can be based on This sub-scenario determines the most reasonable scheduling strategy to maximize the battery life of electronic devices.

作为另一种示例,还可以检测系统工作状态。这种情况下,根据该应用运行信息确定用户场景的操作可以为:若该系统工作状态变更为空闲状态,则在该应用运行信息指示应用均处于用户未使用的状态时,确定用户场景为空闲场景。As another example, system operating status may also be detected. In this case, the operation of determining the user scenario according to the application running information may be as follows: if the system working state is changed to an idle state, when the application running information indicates that the applications are not in use by the user, determine that the user scenario is idle Scenes.

系统工作状态是指系统当前的工作状态,可以分为空闲状态和其他状态。该空闲状态是指系统长时间未被用户操作的状态。The system working state refers to the current working state of the system, which can be divided into idle state and other states. The idle state refers to a state in which the system has not been operated by a user for a long time.

用户场景为空闲场景,代表用户当前未使用电子设备(即未进行操作且未使用应用),据此可以在后续确定适用于此情况的调度策略。The user scene is an idle scene, which means that the user is not currently using the electronic device (that is, not operating and not using the application), and accordingly a scheduling strategy applicable to this situation can be subsequently determined.

作为又一种示例,根据该应用运行信息确定用户场景的操作可以为:获取IO负载信息,根据该应用运行信息和该IO负载信息,确定用户场景。As yet another example, the operation of determining the user scenario according to the application running information may be: acquiring IO load information, and determining the user scenario according to the application running information and the IO load information.

IO负载信息用于体现IO负载情况。示例地,IO负载信息可以包括IO时间比率,IO时间比率是指周期内用于IO操作的时间比率,即指示一秒中有百分之多少的时间用于IO操作。IO时间比率可以体现IO负载的高低。也即,IO时间比率越高,说明IO负载越高;IO时间比率越低,说明IO负载越低。The IO load information is used to reflect the IO load status. Exemplarily, the IO load information may include an IO time ratio, and the IO time ratio refers to a time ratio used for IO operations in a period, that is, indicates what percentage of a second is used for IO operations. The IO time ratio can reflect the level of IO load. That is, the higher the IO time ratio, the higher the IO load; the lower the IO time ratio, the lower the IO load.

本申请中根据IO负载信息可以推测用户行为,继而有助于确定用户场景。比如,IO负载信息持续性处于30%以上,可以认为用户在拷贝文件,或者,IO负载信息持续性处于10%到30%之间,可以认为用户在解压文件。In this application, user behavior can be inferred based on IO load information, which in turn helps to determine user scenarios. For example, if the persistence of the IO load information is above 30%, it can be considered that the user is copying files; or, if the persistence of the IO load information is between 10% and 30%, it can be considered that the user is decompressing files.

可选地,该电源状态包括电源模式和电源计划,确定该电子设备的电源状态的操作可以为:若检测到电源模式变化事件和电源计划变化事件,则根据该电源模式变化事件和该电源计划变化事件确定电源状态。Optionally, the power state includes a power mode and a power plan, and the operation of determining the power state of the electronic device may be: if a power mode change event and a power plan change event are detected, then according to the power mode change event and the power plan Change events determine the state of the power supply.

在电子设备的运行过程中,若电源模式发生改变则会触发电源模式变化事件,电源模式变化事件用于指示变化后最新的电源模式。在电子设备的运行过程中,若电源计划发生改变则会触发电源计划变化事件,电源计划变化事件用于指示变化后最新的电源计划。如此,根据该电源模式变化事件和该电源计划变化事件可以快速准确的确定电源状态。During the operation of the electronic device, if the power mode changes, a power mode change event will be triggered, and the power mode change event is used to indicate the latest power mode after the change. During the operation of the electronic device, if the power plan changes, a power plan change event will be triggered, and the power plan change event is used to indicate the latest power plan after the change. In this way, the power state can be quickly and accurately determined according to the power mode change event and the power plan change event.

可选地,根据第一关键值、第二关键值和第三关键值,确定目标关键值的操作可以为:将第一关键值、第二关键值和第三关键值进行拼接,得到目标关键值。示例地,可以按照预设的拼接方式将第一关键值、第二关键值和第三关键值进行拼接,比如,可以将第二关键值拼接在第一关键值的末尾,再将第三关键值拼接在第二关键值的末尾,以得到目标关键值。Optionally, according to the first key value, the second key value and the third key value, the operation of determining the target key value may be: concatenating the first key value, the second key value and the third key value to obtain the target key value value. For example, the first key value, the second key value and the third key value can be spliced according to the preset splicing method, for example, the second key value can be spliced at the end of the first key value, and then the third key value value is concatenated at the end of the second key value to obtain the target key value.

可选地,若该用户场景、该电源状态、该系统负载中的任意一项或多项发生变化,则重新执行获取该用户场景对应的第一关键值,获取该电源状态对应的第二关键值,以及获取该系统负载对应的第三关键值的步骤及后续步骤。也即,重新确定这三者对应的关键值,并将这三者对应的关键值拼接得到目标关键值,并据此重新确定调度策略。如此,可以保证确定出的调度策略能够适应电子设备的最新状态,从而根据该调度策略就可以准确实现对电子设备的资源的合理分配。Optionally, if any one or more of the user scenario, the power state, and the system load changes, re-execute the acquisition of the first key value corresponding to the user scenario, and the acquisition of the second key value corresponding to the power state. value, and the step of obtaining the third key value corresponding to the system load and subsequent steps. That is, re-determine the key values corresponding to the three, and splicing the key values corresponding to the three to obtain the target key value, and re-determine the scheduling strategy accordingly. In this way, it can be ensured that the determined scheduling strategy can adapt to the latest state of the electronic device, so that the resource allocation of the electronic device can be accurately and reasonably allocated according to the scheduling strategy.

本申请中,可以在电子设备的运行过程中持续确定电子设备当前所处的用户场景、电子设备的电源状态和系统负载,也即,可以动态识别用户场景、电源状态和系统负载,并根据该用户场景、该电源状态和该系统负载的变化动态确定调度策略,据此进行资源的动态调优。In this application, the current user scene, power state and system load of the electronic device can be continuously determined during the operation of the electronic device, that is, the user scene, power state and system load can be dynamically identified, and based on the Changes in the user scenario, the power supply status and the system load dynamically determine the scheduling strategy, and dynamically optimize resources accordingly.

第二方面,提供了一种调度策略确定装置,所述调度策略确定装置具有实现上述第一方面中调度策略确定方法行为的功能。所述调度策略确定装置包括至少一个模块,所述至少一个模块用于实现上述第一方面所提供的调度策略确定方法。In a second aspect, a scheduling strategy determining device is provided, and the scheduling strategy determining device has a function of realizing the behavior of the scheduling strategy determining method in the above first aspect. The device for determining a scheduling policy includes at least one module, and the at least one module is configured to implement the method for determining a scheduling policy provided in the first aspect above.

第三方面,提供了一种调度策略确定装置,所述调度策略确定装置的结构中包括处理器和存储器,所述存储器用于存储支持调度策略确定装置执行上述第一方面所提供的调度策略确定方法的程序,以及存储用于实现上述第一方面所述的调度策略确定方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。所述调度策略确定装置还可以包括通信总线,所述通信总线用于在所述处理器与所述存储器之间建立连接。The third aspect provides a dispatching policy determination device, the structure of the dispatching policy determination device includes a processor and a memory, and the memory is used to store and support the dispatching policy determination device to perform the dispatching policy determination provided in the first aspect above The program of the method, and stores the data involved in implementing the method for determining the scheduling strategy described in the first aspect above. The processor is configured to execute programs stored in the memory. The scheduling policy determination device may further include a communication bus for establishing a connection between the processor and the memory.

第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的调度策略确定方法。In a fourth aspect, a computer-readable storage medium is provided, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, it causes the computer to execute the scheduling policy determination method described in the above-mentioned first aspect.

第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的调度策略确定方法。According to a fifth aspect, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to execute the scheduling policy determination method described in the first aspect above.

上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。The technical effects obtained by the above-mentioned second aspect, third aspect, fourth aspect and fifth aspect are similar to those obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here.

附图说明Description of drawings

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

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

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

图4是本申请实施例提供的另一种软件模块架构示意图;FIG. 4 is a schematic diagram of another software module architecture provided by the embodiment of the present application;

图5是本申请实施例提供的另一种软件模块间的交互示意图;FIG. 5 is a schematic diagram of interaction between another software module provided by the embodiment of the present application;

图6是本申请实施例提供的一种调度策略确定方法的流程图;FIG. 6 is a flow chart of a method for determining a scheduling policy provided in an embodiment of the present application;

图7是本申请实施例提供的一种确定用户场景的示意图;FIG. 7 is a schematic diagram of determining a user scenario provided by an embodiment of the present application;

图8是本申请实施例提供的一种确定电源状态的示意图;FIG. 8 is a schematic diagram of determining a power state provided by an embodiment of the present application;

图9是本申请实施例提供的一种确定调度策略的示意图;FIG. 9 is a schematic diagram of determining a scheduling strategy provided by an embodiment of the present application;

图10是本申请实施例提供的一种调度策略确定装置的结构示意图。Fig. 10 is a schematic structural diagram of an apparatus for determining a scheduling policy provided by an embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请的实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manner of the present application will be further described in detail below in conjunction with the accompanying drawings.

应当理解的是,本申请提及的“多个”是指两个或两个以上。在本申请的描述中,除非另有说明,“/”表示或的意思,比如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,比如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。It should be understood that the "plurality" mentioned in this application means two or more. In the description of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in this article is just a description of the relationship between associated objects, It means that there can be three kinds of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in order to clearly describe the technical solution of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same function and effect. Those skilled in the art can understand that words such as "first" and "second" do not limit the number and execution order, and words such as "first" and "second" do not necessarily limit the difference.

在本申请中描述的“一个实施例”或“一些实施例”等语句意味着在本申请的一个或多个实施例中包括该实施例描述的特定特征、结构或特点。由此,在本申请中的不同之处出现的“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等语句不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。此外,术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Phrases such as "one embodiment" or "some embodiments" described in this application mean that a particular feature, structure, or characteristic described by the embodiment is included in one or more embodiments of the present application. Thus, appearances of "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this application are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. In addition, the terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless specifically stated otherwise.

为了各实施例的描述清楚简洁,下面给出相关概念或技术的简要介绍:In order to make the description of each embodiment clear and concise, a brief introduction of related concepts or technologies is given below:

1、焦点窗口(focus window),指拥有焦点的窗口。焦点窗口是唯一可以接收键盘输入的窗口。焦点窗口的确定方式与系统的焦点模式(focus mode)关联。焦点窗口的顶层窗口被称为活动窗口(active window)。同一时间只有一个窗口可以是活动窗口。焦点窗口大概率为用户当前需要使用的窗口。1. Focus window refers to the window with focus. The focused window is the only window that can receive keyboard input. The way to determine the focus window is associated with the focus mode of the system. The top-level window of the focused window is called the active window. Only one window can be active at a time. The focus window is probably the window that the user needs to use currently.

2、焦点应用,指焦点窗口所属的应用,焦点应用是当前前台运行可接收键盘输入和鼠标操作等操作的应用。2. The focus application refers to the application to which the focus window belongs, and the focus application is an application that is currently running in the foreground and can receive operations such as keyboard input and mouse operations.

3、非焦点应用,指前台运行但是当前不能接收键盘输入和鼠标操作等操作的应用,即一般是指运行在前台但是用户没有操作的应用。3. A non-focus application refers to an application that runs in the foreground but cannot currently receive keyboard input and mouse operations, that is, generally refers to an application that runs in the foreground but is not operated by the user.

4、后台应用,指已经最小化至后台运行的应用。4. Background applications refer to applications that have been minimized to run in the background.

5、焦点模式,可用于决定鼠标如何使一个窗口获得焦点。一般地,焦点模式可包括三种,分别为:5. Focus mode, which can be used to determine how the mouse makes a window focus. Generally, there are three types of focus modes, namely:

(1)点击聚焦(click-to focus),在这种模式下,鼠标点击的窗口即可获得焦点。也即,当鼠标点击一个可以获得焦点的窗口的任意位置,即可激活这个窗口,这个窗口便被置于所有窗口的最前面,并接收键盘输入。当鼠标点击其他窗口时,这个窗口会失去焦点。(1) Click-to-focus, in this mode, the window clicked by the mouse can get the focus. That is, when the mouse clicks on any position of a window that can get the focus, this window can be activated, and this window is placed at the front of all windows and receives keyboard input. When the mouse clicks on other windows, this window loses focus.

(2)焦点跟随鼠标(focus-follow-mouse),在这种模式下,鼠标下的窗口可以获取焦点。也即,当鼠标移到一个可以获得焦点的窗口的范围内,用户不需要点击窗口的某个地方就可以激活这个窗口,接收键盘输入,但这个窗口不一定被置于所有窗口的最前面。当鼠标移出这个窗口的范围时,这个窗口也会随之失去焦点。(2) Focus follows the mouse (focus-follow-mouse), in this mode, the window under the mouse can get the focus. That is, when the mouse moves within the scope of a window that can get the focus, the user does not need to click somewhere in the window to activate this window and receive keyboard input, but this window is not necessarily placed at the front of all windows. When the mouse moves out of the scope of this window, this window will also lose focus.

(3)草率聚焦(sloppy focus),这种焦点模式与focus-follow-mouse比较类似,当鼠标移到一个可以获得焦点的窗口的范围内,用户不需要点击窗口的某个地方就可以激活这个窗口,接收键盘输入,但这个窗口不一定被置于所有窗口的最前面。与focus-follow-mouse不同的是,当鼠标移出这个窗口的范围时,焦点并不会随之改变,只有当鼠标移动到别的可以接收焦点的窗口时,焦点才改变。(3) Sloppy focus, this focus mode is similar to focus-follow-mouse, when the mouse moves to a window that can get the focus, the user does not need to click somewhere in the window to activate this A window that receives keyboard input, but this window is not necessarily placed on top of all windows. Different from focus-follow-mouse, when the mouse moves out of the scope of this window, the focus will not change accordingly, only when the mouse moves to another window that can receive the focus, the focus will change.

6、进程,包括多个线程,线程可以创建窗口。焦点进程为创建焦点窗口的线程所属的进程。6. Processes, including multiple threads, threads can create windows. The focus process is the process to which the thread that created the focus window belongs.

7、长时睿频功耗(power limit1,PL1),指中央处理器(central processingunit,CPU)在正常负载下的功耗,相当于热设计功耗,CPU绝大部分时间的运行功耗不超过PL1。7. Long-term turbo frequency power consumption (power limit1, PL1) refers to the power consumption of the central processing unit (CPU) under normal load, which is equivalent to the thermal design power consumption. The operating power consumption of the CPU most of the time is not Exceed PL1.

8、短时睿频功耗(power limit2,PL2),指CPU在短时间内可达到的最高功耗,其具有持续时间限制。一般地,PL2大于PL1。8. Short-term turbo frequency power consumption (power limit2, PL2) refers to the highest power consumption that the CPU can achieve in a short period of time, and it has a duration limit. Generally, PL2 is greater than PL1.

值得注意的是,PL1和PL2是英特尔(Intel)

Figure BDA0003715386280000051
平台的名称。在超威半导体公司(Advanced Micro Devices,AMD)
Figure BDA0003715386280000052
平台,PL1称为SPL(sustained power limit),PL2的一阶段称为FPPT(fast ppt limit),PL2的二阶段称为SPPT(slow ppt limit)。It is worth noting that PL1 and PL2 are Intel
Figure BDA0003715386280000051
The name of the platform. At Advanced Micro Devices (AMD)
Figure BDA0003715386280000052
Platform, PL1 is called SPL (sustained power limit), the first stage of PL2 is called FPPT (fast ppt limit), and the second stage of PL2 is called SPPT (slow ppt limit).

9、CPU能效比(energy performance preference,EPP),用于反映CPU的调度倾向,其取值范围为0~255。CPU能效比越小,则表明CPU趋向于高性能;CPU能效比越高,则表明CPU趋向于低功耗。9. CPU energy performance preference (EPP), which is used to reflect the scheduling tendency of the CPU, and its value ranges from 0 to 255. The smaller the CPU energy efficiency ratio, the CPU tends to be high-performance; the higher the CPU energy efficiency ratio, the CPU tends to low power consumption.

10、能效-性能优化挡位(energy performance optimize gear,EPO Gear),用来表征调节EPP的力度,取值范围可以是1~5;值越大,调节EPP时越倾向能效;值越小,调节EPP时越倾向性能。10. Energy efficiency-performance optimization gear (energy performance optimize gear, EPO Gear), used to represent the intensity of EPP adjustment, the value range can be 1 to 5; the larger the value, the more energy-efficient when adjusting EPP; the smaller the value, The more inclined to performance when adjusting EPP.

下面对本申请实施例涉及的电子设备予以说明。The electronic equipment involved in the embodiments of the present application will be described below.

电子设备可以是平板电脑、笔记本电脑、超级移动个人计算机(ultra-mobilepersonal computer,UMPC)、台式机、个人数字助理(personal digital assistant,PDA)等设备。The electronic device may be a tablet computer, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a desktop computer, a personal digital assistant (personal digital assistant, PDA) and other devices.

图1是本申请实施例提供的一种电子设备100的结构示意图。如图1所示,电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universalserial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,无线通信模块150,显示屏160等。FIG. 1 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application. As shown in Figure 1, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, and a battery 142 , a wireless communication module 150, a display screen 160, and the like.

可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件、软件、或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components may be realized 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 (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor ( image signal processor (ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.

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

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

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

可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of 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为电子设备100供电。The charging management module 140 is configured to receive a charging input from a charger. Wherein, the charger may be a wireless charger or a wired charger. While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device 100 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 for connecting the battery 142 , the charging management module 140 and the processor 110 . The power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for 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上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。例如,本申请实施例中,电子设备100可以通过无线通信模块150与诸如无线耳机等设备建立蓝牙连接。无线通信模块150可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块150经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块150还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。The wireless communication module 150 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system, etc. (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. For example, in the embodiment of the present application, the electronic device 100 can establish a Bluetooth connection with a device such as a wireless earphone through the wireless communication module 150 . 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 through the antenna, frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 150 can also receive the signal to be transmitted from the processor 110, perform frequency modulation on it, amplify it, and convert it into electromagnetic wave and radiate it through the antenna.

电子设备100通过GPU,显示屏160,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏160和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through the GPU, the display screen 160 , and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 160 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. 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 for displaying images, videos and the like. 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, so as 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 saving music, video and other files in the external memory card.

内部存储器121可以用于存储计算机可执行程序代码,该可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,来执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer-executable program codes including instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 . The internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like. 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 magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.

接下来对电子设备100的一种可能的软件系统予以说明。Next, a possible software system of the electronic device 100 will be described.

电子设备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 application, the software system of the electronic device 100 is exemplarily described by taking a Windows system with a layered architecture as an example.

图2是本申请实施例提供的一种电子设备100的软件系统的框图。参见图2,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Windows系统分为用户态和内核态。其中,用户态包括应用层以及子系统动态链接库。内核态自下而上分为固件层、硬件抽象层(hardware abstraction layer,HAL)、内核(kernel)和驱动层及执行体。FIG. 2 is a block diagram of a software system of an electronic device 100 provided by an embodiment of the present application. Referring to Figure 2, the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Windows system is divided into user mode and kernel mode. Wherein, the user state includes the application layer and the subsystem dynamic link library. The kernel state is divided into firmware layer, hardware abstraction layer (hardware abstraction layer, HAL), kernel (kernel), driver layer and executive body from bottom to top.

如图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 system probe module, a first scene recognition engine, a first scheduling engine, and the like. Wherein, only some application programs are shown in the figure, and the application layer may also include other application programs, such as shopping applications, browsers, etc., which are not limited in this embodiment of the present application.

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

系统探针模块用于向第一场景识别引擎进行状态上报。第一场景识别引擎用于根据系统探针模块上报的状态完成用户场景的识别,并根据识别到的用户场景,确定调度策略。第一调度引擎用于根据调度策略对固件层进行调度。The system probe module is used to report the status to the first scene recognition engine. The first scene recognition engine is used to complete the recognition of the user scene according to the status reported by the system probe module, and determine the scheduling strategy according to the recognized user scene. The first scheduling engine is used to schedule the firmware layer according to the scheduling policy.

在一些实施例中,第一场景识别引擎可以识别电子设备100所处的用户场景,并确定与该用户场景匹配的基础调度策略。第一调度引擎可以获取电子设备100的负载情况,并结合电子设备100的负载情况及上述基础调度策略确定符合电子设备100实际运行情况的实际调度策略。其中,关于第一场景识别引擎和第一调度引擎的具体内容见后文,在此暂不描述。In some embodiments, the first scene identification engine can identify the user scene in which the electronic device 100 is located, and determine a basic scheduling policy matching the user scene. The first dispatching engine may acquire the load condition of the electronic device 100, and determine an actual dispatching strategy that conforms to the actual operating condition of the electronic device 100 in combination with the load condition of the electronic device 100 and the above-mentioned basic scheduling strategy. Among them, the specific content of the first scene recognition engine and the first scheduling engine will be described later, and will not be described here.

子系统动态链接库包括应用编程接口(application programming interface,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 application programming interface (application programming interface, API) module, and the API module includes a Windows (window) API, a Windows native API, and the like. Among them, Windows API and Windows native API can provide system call entry and internal function support for applications, the difference is that Windows native API is the native API of Windows system. For example, Windows API may include user.dll, kernel.dll, and Windows native API may include ntdll.dll. Among them, user.dll is a Windows user interface interface, which can be used to perform operations such as creating a window and sending a message. 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 Windows native NTAPI interface. When Windows starts, ntdll.dll resides in a specific write-protected area of memory, preventing other programs from occupying this memory area.

执行体包括进程管理器、虚拟内存管理器、安全引用监视器、输入/输出(Input/Output,I/O)管理器、Windows管理规范(Windows management instrumentation,WMI)插件、电源管理器、系统事件驱动(operating system event driver,OsEventDriver)节点(也可称为事件驱动(Event driver,Event驱动)节点)、系统与芯片驱动(operatingsystem to System on Chip,OS2SOC)节点等。Execution body includes process manager, virtual memory manager, security reference monitor, input/output (Input/Output, I/O) manager, Windows management instrumentation (Windows management instrumentation, WMI) plug-in, power manager, system event Driver (operating system event driver, OsEventDriver) node (also called event driver (Event driver, Event driver) node), system and chip driver (operating system to System on Chip, OS2SOC) node, etc.

进程管理器用于创建及中止进程和线程。虚拟内存管理器实现“虚拟内存”。虚拟内存管理器也为高速缓存管理器提供基本的支持。安全引用监视器可在本地计算机上执行安全策略,它保护了操作系统资源,执行运行时对象的保护和监视。I/O管理器执行独立于设备的输入/输出,并进一步处理调用适当的设备驱动程序。电源管理器可管理所有支持电源状态更改的设备的电源状态更改。OsEventDriver节点可以与内核和驱动层进行交互,如与显卡驱动进行交互,在确定存在GPU视频解码事件后,向系统探针模块上报该GPU视频解码事件。OS2SOC节点可供第一调度引擎向硬件设备发送调整信息,如向CPU发送调整PL1和PL2的信息。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 policies on the local computer, it protects operating system resources, and performs runtime object protection and monitoring. The I/O Manager performs device-independent I/O and further processing calls appropriate device drivers. Power Manager manages power state changes for all devices that support power state changes. The OsEventDriver node can interact with the kernel and the driver layer, such as interacting with the graphics card driver. After determining that there is a GPU video decoding event, it reports the GPU video decoding event to the system probe module. The OS2SOC node can be used by the first scheduling engine to send adjustment information to the hardware device, for example, send adjustment information on PL1 and PL2 to the CPU.

内核和驱动层包括内核以及设备驱动程序。内核是对处理器体系结构的抽象,将执行体与处理器体系结构的差异相隔离,保证系统的可移植性。内核可以进行线程安排和调度、陷阱处理和异常调度、中断处理和调度等。设备驱动程序运行在内核模式下,为I/O系统和相关硬件之间的接口。设备驱动程序可包括显卡驱动、

Figure BDA0003715386280000081
动态调谐技术(dynamictuning technology,DTT)驱动、鼠标驱动、音视频驱动、摄像头驱动、键盘驱动等。例如,显卡驱动可以驱动GPU运行,Intel DTT驱动可以驱动CPU运行。The kernel and driver layer includes the kernel and device drivers. The kernel is an abstraction of the processor architecture, which isolates the difference between the execution body and the processor architecture, and ensures the portability of the system. The kernel can perform thread arrangement and scheduling, trap handling and exception scheduling, interrupt handling and scheduling, etc. Device drivers run in kernel mode and serve as the interface between the I/O system and related hardware. Device drivers can include graphics drivers,
Figure BDA0003715386280000081
Dynamic tuning technology (dynamictuning technology, DTT) driver, mouse driver, audio and video driver, camera driver, keyboard driver, etc. For example, the graphics card driver can drive the GPU to run, and the Intel DTT driver can drive the CPU to run.

HAL是一个核心态模块,可以隐藏各种与硬件有关的细节,如I/O接口、中断控制器以及多处理器通信机制等,为运行Windows的不同硬件平台提供统一的服务接口,实现多种硬件平台上的可移植性。需要说明的是,为了维护Windows的可移植性,Windows内部组件和用户编写的设备驱动程序并不直接访问硬件,而是通过调用HAL中的例程。HAL is a core mode module that can hide various hardware-related details, such as I/O interfaces, interrupt controllers, and multi-processor communication mechanisms, etc. It provides a unified service interface for different hardware platforms running Windows, and realizes various Portability across 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 the 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 basic input output system (basic input output system, BIOS), BIOS is a set of programs solidified into a read only memory (ROM) chip on the computer motherboard, which stores the most important basic information of the computer. The input and output program, the self-test program after booting and the system self-starting program, it can read and write the specific information of the system setting from the complementary metal oxide semiconductor (CMOS). Its main function is to provide the computer with the lowest and most direct hardware setting and control. The Intel DTT driver can send instructions to the CPU through the BIOS.

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

接下来对上文图2实施例所述的电子设备100对资源进行调度的软件及硬件的工作流程予以说明。Next, the workflow of software and hardware for scheduling resources by the electronic device 100 described in the embodiment of FIG. 2 above will be described.

图3是本申请实施例提供的一种电子设备100对资源进行调度的软件及硬件的工作流程示意图。FIG. 3 is a schematic diagram of a workflow of software and hardware for scheduling resources by an electronic device 100 provided in an embodiment of the present application.

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

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

外设状态探针可以向内核态订阅外设事件,根据内核态反馈的回调函数确定外设事件。外设事件包括鼠标滚轮滑动事件、鼠标点击事件、键盘输入事件、麦克风输入事件、摄像头输入事件等。The peripheral state probe can subscribe peripheral events to the kernel state, and determine the peripheral events according to the callback function fed back from 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 can subscribe the process load to the kernel state, and determine the load of the process (for example, the focus process) according to the callback function fed back by the kernel state.

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

音视频状态探针可向内核态订阅音视频事件,根据内核态反馈的回调函数确定电子设备100当前存在的音视频事件。音视频事件可包括GPU解码事件等。例如,音视频状态探针可向执行体层的OsEventDriver节点发送订阅GPU解码事件的请求,由OsEventDriver节点向内核和驱动层的显卡驱动转发该请求。显卡驱动可以监控GPU的状态,在监控到GPU在进行解码操作后,通过OsEventDriver节点向音视频状态探针反馈回调函数。The audio and video state probe can subscribe to the 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 from the kernel state. Audio and video events may include GPU decoding events, etc. For example, the audio and video state 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. After monitoring that the GPU is performing decoding operations, it will feed back the callback function to the audio and video status probe through the OsEventDriver node.

系统事件探针可以向内核态订阅系统事件,根据内核态反馈的回调函数确定系统事件。系统事件可包括窗口变化事件、进程创建事件、线程创建事件等。例如,系统事件探针可向执行体层的OsEventDriver节点发送订阅进程创建事件的请求,由OsEventDriver节点向进程管理器转发该请求。进程管理器可在创建进程后,通过OsEventDriver节点向系统事件探针反馈回调函数。又例如,系统事件探针还可以向API模块发送订阅焦点窗口变化事件的请求,API模块可监控电子设备100的焦点窗口是否发生变化,并在监控到焦点窗口发生变化时,向系统事件探针反馈回调函数。System event probes can subscribe to system events from the kernel state, and determine system events according to the callback function fed back from the kernel state. System events may include window change events, process creation events, thread creation events, and the like. For example, the system event probe may send a request for subscribing 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 the process is created, 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 can also send a request to subscribe to the focus window change event to the API module, and the API module can monitor whether the focus window of the electronic device 100 changes, and when the focus window is monitored to Feedback callback function.

可见,系统探针模块通过向内核态订阅电子设备100的各种事件,再根据内核态反馈的回调函数确定电子设备100的运行状态,即得到探针状态。系统探针模块得到探针状态后,可向场景识别模块反馈该探针状态。场景识别模块接收到探针状态后,可根据该探针状态确定电子设备100所处的用户场景。该用户场景可包括视频场景、游戏场景、办公场景及社交场景等。该用户场景可以反映用户当前的使用需求。例如,场景识别模块在识别出焦点窗口为视频应用的窗口时,确定出电子设备100处于视频场景,这说明用户需要使用视频应用观看、浏览视频。又例如,场景识别模块在识别出焦点窗口为即时通讯应用的聊天窗口时,确定电子设备100处于社交场景。场景识别模块还可向基础策略匹配管理器发送该用户场景。基础策略匹配管理器可根据该用户场景确定基础调度策略。基础策略匹配管理器可向场景识别模块反馈该基础调度策略。场景识别模块可向应用层的第一调度引擎发送该基础调度策略及该用户场景。It can be seen that the system probe module subscribes various events of the electronic device 100 to the kernel state, and then determines the running state of the electronic device 100 according to the callback function fed back from the kernel state, that is, obtains the probe state. After the system probe module obtains the probe status, it can feed back the probe status to the scene recognition module. After the scene recognition module receives the probe state, it can determine the user scene where the electronic device 100 is located according to the probe state. The user scene may include a video scene, a game scene, an office scene, a social scene, and the like. The user scenario can reflect the current usage needs of the user. For example, when the scene recognition module recognizes that the focused window is a window of a video application, it determines that the electronic device 100 is in a video scene, which indicates that the user needs to use the video application to watch and browse videos. For another example, when the scene recognition module recognizes that the focus window is a chat window of an instant messaging application, it determines that the electronic device 100 is in a social scene. The context recognition module may also send the user context to the base policy matching manager. The basic policy matching manager can determine the basic scheduling policy according to the user scenario. The basic policy matching manager can feed back the basic scheduling policy to the scene identification module. The scenario recognition module can send the basic scheduling policy and the user scenario to the first scheduling engine of the application layer.

如图3所示,第一调度引擎包括负载管控器、芯片策略融合器以及调度执行器。其中,负载管控器可接收场景识别模块发送的该基础调度策略及该用户场景。负载管控器还可从系统探针模块获取系统负载,并根据系统负载和该用户场景对该基础调度策略进行调整,得到实际调度策略。实际调度策略中包括操作系统(Operating System,OS)调度策略和第一CPU功耗调度策略。As shown in FIG. 3 , the first scheduling engine includes a load controller, a chip policy fuser, and a scheduling executor. Wherein, the load controller can receive the basic scheduling policy and the user scenario sent by the scenario identification 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. The actual scheduling policy includes an operating system (Operating System, OS) scheduling policy and a first CPU power consumption scheduling policy.

其中,负载管控器可向调度执行器发送该OS调度策略,由调度执行器基于该OS调度策略进行调度。OS调度策略用于调整焦点进程的进程优先级及I/O优先级。示例性的,调度执行器可向进程管理器发送调整焦点进程的进程优先级的指令,响应于该指令,进程管理器对焦点进程的进程优先级进行调整。又例如,调度执行器可向I/O管理器发送调整焦点进程的I/O优先级的指令,响应于该指令,I/O管理器对焦点进程的I/O优先级进行调整。Wherein, the load controller may 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 may 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 may 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功耗调度策略。示例地,CPU的芯片平台类型主要分为两种,分别为

Figure BDA0003715386280000101
的CPU和
Figure BDA0003715386280000102
的CPU,这两类CPU对于CPU功耗的调整方式并不相同,因此需要进行区分。The load controller can also send the first CPU power consumption scheduling policy to the chip policy fuser, and the chip policy fuser can obtain the second CPU power consumption scheduling policy based on the chip platform type of the CPU and the first CPU power consumption scheduling policy. For example, CPU chip platform types are mainly divided into two types, namely
Figure BDA0003715386280000101
CPU and
Figure BDA0003715386280000102
The two types of CPUs have different adjustment methods for CPU power consumption, so they need to be distinguished.

若CPU的芯片平台类型为

Figure BDA0003715386280000103
调度执行器可以向电源管理器发送调整EPP的指令,以调整CPU的EPP。另外,调度执行器还可以向OS2SOC驱动节点发送调整PL1、PL2的指令,以调整CPU的PL1和PL2。If the chip platform type of the CPU is
Figure BDA0003715386280000103
The scheduling executor can send an instruction to adjust the EPP to the power manager to 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, so as to adjust PL1 and PL2 of the CPU.

若CPU的芯片平台类型为

Figure BDA0003715386280000104
调度执行器可以通过WMI插件向Intel DTT驱动发送第二CPU功耗调度策略,第二CPU功耗调度策略可包括PL1的最小值(PL1_mini)、PL1的最大值(PL1_max)、PL2、PL2的持续时间(PL2_time)及EPO Gear,由Intel DTT驱动指示CPU基于第二CPU功耗调度策略运行。If the chip platform type of the CPU is
Figure BDA0003715386280000104
The scheduling executor can send the second CPU power consumption scheduling policy to the Intel DTT driver through the WMI plug-in, and the second CPU power consumption scheduling policy can include the minimum value of PL1 (PL1_mini), the maximum value of PL1 (PL1_max), PL2, and the continuation of PL2 Time (PL2_time) and EPO Gear are driven by Intel DTT to instruct the CPU to run based on the second CPU power consumption scheduling policy.

接下来对电子设备100的另一种可能的软件系统予以说明。Next, another possible software system of the electronic device 100 will be described.

电子设备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 application, the software system of the electronic device 100 is exemplarily described by taking a Windows system with a layered architecture as an example.

图4是本申请实施例提供的一种电子设备100的软件系统的框图。参见图4,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,Windows系统包括应用层、子系统动态链接库、驱动层和固件层。FIG. 4 is a block diagram of a software system of an electronic device 100 provided by an embodiment of the present application. Referring to Figure 4, the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Windows system includes an application layer, a subsystem dynamic link library, a driver layer and a firmware layer.

如图4所示,应用层包括音乐、视频、游戏、办公、社交等应用程序。应用层还包括系统探针模块、第二场景识别引擎、第二调度引擎、策略配置模块、管家界面模块等。其中,图中仅示出部分应用程序,应用层还可以包括其他应用程序,如购物应用、浏览器等,本申请实施例对此不作限定。As shown in Figure 4, the application layer includes applications such as music, video, games, office, and social networking. The application layer also includes a system probe module, a second scene recognition engine, a second scheduling engine, a policy configuration module, a housekeeper interface module, and the like. Wherein, only some application programs are shown in the figure, and the application layer may also include other application programs, such as shopping applications, browsers, etc., which are not limited in this embodiment of the present application.

系统探针模块用于向第二场景识别引擎进行状态上报。第二场景识别引擎用于根据系统探针模块上报的状态完成用户场景的识别,并根据识别到的用户场景,确定调度策略。第二调度引擎用于根据调度策略对固件层进行调度。The system probe module is used to report the status to the second scene recognition engine. The second scenario identification engine is used to complete the identification of user scenarios according to the status reported by the system probe module, and determine the scheduling strategy according to the identified user scenarios. The second scheduling engine is used to schedule the firmware layer according to the scheduling policy.

策略配置模块用于向第二场景识别引擎发送预先配置的多种调度策略,第二场景识别引擎在识别到用户场景后,从多种调度策略中查找与识别到的用户场景匹配的调度策略。管家界面模块用于向第二场景识别模块提供当前使用的电源模式,第二场景识别引擎可以选择与当前使用的电源模式和当前所处的用户场景相匹配的调度策略。The policy configuration module is used to send multiple pre-configured scheduling policies to the second scene recognition engine. After the second scene recognition engine recognizes the user scene, it searches for a scheduling policy that matches the recognized user scene from the various scheduling policies. The housekeeper interface module is used to provide the currently used power mode to the second scene recognition module, and the second scene recognition engine can select a scheduling strategy that matches the currently used power mode and the current user scene.

子系统动态链接库包括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, and the API module includes a Windows API, a Windows native API, and the like. Among them, Windows API and Windows native API can provide system call entry and internal function support for applications, the difference is that Windows native API is the native API of Windows system. For example, Windows API may include user.dll, kernel.dll, and Windows native API may include ntdll.dll. Among them, user.dll is a Windows user interface interface, which can be used to perform operations such as creating a window and sending a message. 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 Windows native NTAPI interface. When Windows starts, ntdll.dll resides in a specific write-protected area of memory, preventing other programs from occupying this memory area.

驱动层可以包括进程管理器、虚拟内存管理器、安全引用监视器、I/O管理器、电源管理器、WMI插件、Event驱动节点、OS2SOC驱动节点。The driver layer may include a process manager, a virtual memory manager, a security reference monitor, an I/O manager, a power manager, a WMI plug-in, an Event driver node, and an OS2SOC driver node.

进程管理器用于创建及中止进程和线程。虚拟内存管理器实现“虚拟内存”。虚拟内存管理器也为高速缓存管理器提供基本的支持。安全引用监视器可在本地计算机上执行安全策略,它保护了操作系统资源,执行运行时对象的保护和监视。I/O管理器执行独立于设备的输入/输出,并进一步处理调用适当的设备驱动程序。电源管理器可管理所有支持电源状态更改的设备的电源状态更改。WMI插件可供第二调度引擎向固件层发送调度策略;Event驱动节点可以与显卡驱动、音视频驱动、摄像头驱动和键盘驱动等进行交互,以使得系统探针模块可以探测到各种事件(也可以称为数据或信息),例如与显卡驱动进行交互,使得系统探针模块可以监测到GPU视频解码事件。OS2SOC驱动节点可供第二调度引擎向固件层发送调度策略。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 policies on the local computer, it protects operating system resources, and performs runtime object protection and monitoring. The I/O Manager performs device-independent I/O and further processing calls appropriate device drivers. Power Manager manages power state changes for all devices that support power state changes. The WMI plug-in can be used for the second scheduling engine to send scheduling policies to the firmware layer; the Event driver node can interact with graphics card drivers, audio and video drivers, camera drivers and keyboard drivers, so that the system probe module can detect various events (also It can be referred to as data or information), such as interacting with the graphics card driver, so that the system probe module can monitor GPU video decoding events. The OS2SOC driver node can be used by the second scheduling engine to send scheduling policies to the firmware layer.

固件层包括为电子设备100配置的各种硬件和硬件驱动,如固件层可以包括CPU、鼠标等,固件层还包括鼠标驱动。电子设备100配置的硬件所属硬件平台可能不同,如硬件平台包括:

Figure BDA0003715386280000111
Figure BDA0003715386280000112
等,这三个硬件平台的调度策略可以不同,因此第二调度引擎在确定调度策略时可以区分硬件平台类型。这种情况下,固件层还可以包括Intel DTT、AMD电源管理框架(power management framework,PMF)、NVIDIA数据库(database,DB)等。The firmware layer includes various hardware and hardware drivers configured for the electronic device 100. For example, the firmware layer may include a CPU, a mouse, etc., and the firmware layer also includes a mouse driver. The hardware platform of the hardware configured by the electronic device 100 may be different. For example, the hardware platform includes:
Figure BDA0003715386280000111
and
Figure BDA0003715386280000112
etc., the scheduling policies of the three hardware platforms may be different, so the second scheduling engine may distinguish the types of hardware platforms when determining the scheduling policy. In this case, the firmware layer may also include Intel DTT, AMD power management framework (power management framework, PMF), NVIDIA database (database, DB) and so on.

需要说明的是,本申请实施例仅以Windows系统为例来说明,在其他操作系统中(例如Android系统,IOS系统等),只要各个功能模块实现的功能和本申请实施例类似也能实现本申请的方案。It should be noted that the embodiment of the present application only uses the Windows system as an example to illustrate, in other operating systems (such as Android system, IOS system, etc.), as long as the functions realized by each functional module are similar to the embodiment of the present application, the present application can also be realized. application program.

接下来对上文图4实施例所述的电子设备100对资源进行调度的软件及硬件的工作流程予以说明。Next, the workflow of software and hardware for scheduling resources by the electronic device 100 described in the embodiment of FIG. 4 above will be described.

图5是本申请实施例提供的一种电子设备100对资源进行调度的软件及硬件的工作流程示意图。FIG. 5 is a schematic diagram of a workflow of software and hardware for scheduling resources by an electronic device 100 provided in an embodiment of the present application.

如图5所示,电子设备100的操作系统包括系统探针模块、第二场景识别引擎、第二调度引擎和芯片调度引擎。系统探针模块、第二场景识别引擎和第二调度引擎位于应用层,第二场景识别引擎可以作为插件运行,第二调度引擎可以作为服务运行。芯片调度引擎位于驱动层,且芯片调度引擎可以作为服务运行。As shown in FIG. 5 , the operating system of the electronic device 100 includes a system probe module, a second scene recognition engine, a second scheduling engine, and a chip scheduling engine. The system probe module, the second scene recognition engine and the second scheduling engine are located at the application layer, the second scene recognition engine can run as a plug-in, and the second scheduling engine can run as a service. The chip scheduling engine is located in the driver layer, and the chip scheduling engine can run as a service.

第二场景识别引擎可以与系统探针模块进行交互,以根据系统探针模块反馈的电子设备100的运行状态识别用户场景。第二场景识别引擎可以与第二调度引擎进行交互,第二场景识别引擎识别出用户场景后,根据用户场景确定调度策略,将调度策略下发给第二调度引擎。第二调度引擎接收到调度策略后,向第二场景识别引擎返回接收结果,以通知第二场景识别引擎自身已成功接收到调度策略。然后,第二调度引擎向芯片调度引擎发送调度策略,由芯片调度引擎执行调度策略。The second scene identification engine can interact with the system probe module to identify the user scene according to the operating status of the electronic device 100 fed back by the system probe module. The second scene recognition engine can interact with the second scheduling engine. After the second scene recognition engine recognizes the user scene, it determines a scheduling policy according to the user scene, and sends the scheduling policy to the second scheduling engine. After receiving the scheduling policy, the second scheduling engine returns a receiving result to the second scene recognition engine, so as to notify the second scene recognition engine that it has successfully received the scheduling policy. Then, the second scheduling engine sends a scheduling policy to the chip scheduling engine, and the chip scheduling engine executes the scheduling policy.

第二场景识别引擎包括场景识别模块、场景库、策略调度模块和策略库。第二调度引擎包括场景交互模块、调度策略融合模块和调度执行器。芯片调度引擎包括WMI插件、Event驱动节点和OS2SOC驱动节点。固件层包括Intel DTT、AMD PMF、NVIDIA DB等。The second scene recognition engine includes a scene recognition module, a scene library, a strategy scheduling module and a strategy library. The second scheduling engine includes a scene interaction module, a scheduling policy fusion module and a scheduling executor. The chip scheduling engine includes WMI plug-in, Event driver node and OS2SOC driver node. The firmware layer includes Intel DTT, AMD PMF, NVIDIA DB, etc.

如图5所示,第二场景识别引擎可以分别与系统探针模块、策略配置模块、管家界面模块、第二调度引擎进行交互。As shown in FIG. 5 , the second scene recognition engine can interact with the system probe module, the policy configuration module, the housekeeper interface module, and the second scheduling engine respectively.

管家界面模块可以向第二场景识别引擎发送电子设备当前使用的电源模式,电源模式可以辅助第二场景识别引擎确定调度策略;策略配置模块用于向第二场景识别引擎发送预先配置的多种调度策略。The housekeeper interface module can send the power mode currently used by the electronic device to the second scene recognition engine, and the power mode can assist the second scene recognition engine to determine a scheduling strategy; the policy configuration module is used to send a variety of pre-configured scheduling strategies to the second scene recognition engine Strategy.

系统探针模块可以获取电子设备100的运行状态。例如,系统探针模块可以包括电源状态探针、外设状态探针、音视频状态探针、应用切换探针、系统负载探针、系统工作状态探针等。The system probe module can acquire the running status of the electronic device 100 . For example, the system probe module may include power supply status probes, peripheral device status probes, audio and video status probes, application switching probes, system load probes, system working status probes, and the like.

其中,电源状态探针用于检测电源状态,电源状态包括电池(剩余)电量、电源模式、电源计划等,电源模式可以包括AC状态和DC状态,电源计划可以包括能效计划、平衡计划、性能计划等。外设状态探针用于检测外设事件,外设事件包括鼠标滚轮滑动事件、鼠标点击事件、键盘输入事件、麦克风输入事件、摄像头输入事件等。音视频状态探针用于检测电子设备100当前存在的音频事件和视频事件。应用切换探针用于检测电子设备100当前运行的应用,即检测焦点应用、非焦点应用、后台应用等,其中,焦点应用为焦点窗口所属的应用,非焦点应用为当前打开的窗口中不是焦点窗口但也未被最小化的窗口所属的应用,后台应用为后台运行的应用。系统负载探针用于检测系统当前的负载等级。系统工作状态探针用于检测系统当前的工作状态,即检测系统当前是否为idle(空闲)状态。Among them, the power state probe is used to detect the power state. The power state includes battery (remaining) power, power mode, power plan, etc. The power mode can include AC state and DC state, and the power plan can include energy efficiency plan, balance plan, and performance plan. wait. Peripheral status probes are used to detect peripheral events, including mouse wheel sliding events, mouse click events, keyboard input events, microphone input events, camera input events, etc. The audio and video status probe is used to detect audio events and video events that currently exist in the electronic device 100 . The application switching probe is used to detect the applications currently running on the electronic device 100, that is, to detect focus applications, non-focus applications, background applications, etc., wherein the focus application is the application to which the focus window belongs, and the non-focus application is the currently opened window that is not the focus The window is the application to which the window is not minimized, and the background application is the application running in the background. The system load probe is used to detect the current load level of the system. The system working state probe is used to detect the current working state of the system, that is, to detect whether the system is currently in an idle state.

系统探针模块通过各种探针检测电子设备100的运行状态,即得到探针状态。第二场景识别引擎可以向系统探针模块订阅探针状态。这种情况下,系统探针模块得到探针状态后,可向第二场景识别引擎上报探针状态。The system probe module detects the running status of the electronic device 100 through various probes, that is, obtains the status of the probes. The second scene recognition engine may subscribe to the probe status to the system probe module. In this case, after obtaining the probe status, the system probe module may report the probe status to the second scene recognition engine.

第二场景识别引擎中的场景库用于存储多个用户场景,如用户场景包括社交场景、办公场景和浏览器场景等多个主场景,每个主场景下可以划分多个子场景,如浏览器场景包括浏览器上网场景、浏览器音频播放场景和浏览器视频播放场景等。第二场景识别引擎中的策略库用于存储策略配置模块发送的多种调度策略。例如,调度策略包括大小核调度和办公策略库等,办公策略库中记录与办公应用相关的调度策略,大小核调度是

Figure BDA0003715386280000121
第12代平台的架构提供的大小核调度能力,指示优先使用大核(偏性能)还是小核(偏能效)进行的策略配置。The scene library in the second scene recognition engine is used to store multiple user scenes. For example, user scenes include multiple main scenes such as social scenes, office scenes, and browser scenes. Each main scene can be divided into multiple sub-scenes, such as browser Scenarios include browser surfing the web, browser audio playback, and browser video playback. The policy library in the second scene recognition engine is used to store various scheduling policies sent by the policy configuration module. For example, scheduling policies include big and small core scheduling and office policy library, etc. The office policy library records scheduling policies related to office applications. Big and small core scheduling is
Figure BDA0003715386280000121
The large and small core scheduling capabilities provided by the architecture of the 12th generation platform indicate the policy configuration of using large cores (biased performance) or small cores (biased energy efficiency).

策略调度模块可以向场景识别模块发送查询订阅场景请求,查询订阅场景请求用于触发场景识别模块进行场景识别,查询订阅场景请求可以在电子设备100开机后立即发送,也可以定期发送,本申请实施例对此不作限定。The policy scheduling module can send a scene query and subscription request to the scene recognition module. The query and subscription scene request is used to trigger the scene recognition module to perform scene recognition. The query and subscription scene request can be sent immediately after the electronic device 100 is turned on, or can be sent periodically. This application implements Examples are not limited to this.

场景识别模块在接收到查询订阅场景请求后,向系统探针模块发送查询订阅状态请求,查询订阅状态请求用于指示系统探针模块中的各探针进行状态探测/状态确定等,然后系统探针模块可以向场景识别模块上报电子设备100的状态。场景识别模块根据电子设备的状态,从场景库中确定出电子设备100当前所处的用户场景,向策略调度模块上报用户场景。策略调度模块可以根据电子设备100当前所处的用户场景,从策略库中确定调度策略。After receiving the query subscription scene request, the scene recognition module sends a query subscription status request to the system probe module. The query subscription status request is used to instruct each probe in the system probe module to perform status detection/status determination, etc. The needle module can report the state of the electronic device 100 to the scene recognition module. The scene recognition module determines the current user scene of the electronic device 100 from the scene library according to the state of the electronic device, and reports the user scene to the policy scheduling module. The policy scheduling module can determine the scheduling policy from the policy library according to the current user scenario of the electronic device 100 .

此外,策略调度模块还可以接收管家界面模块下发的电源模式,电源模式可根据管家界面模块下发的用户开关标识确定。策略调度模块在确定调度策略时可以参照电源模式,如确定与当前使用的电源模式和当前所处的用户场景相匹配的调度策略。或者,电源模式作为策略调度模块是否确定调度策略的条件,在电源模式为预设模式时,策略调度模块根据用户场景确定调度策略。In addition, the policy scheduling module can also receive the power mode delivered by the housekeeper interface module, and the power supply mode can be determined according to the user switch identification sent by the housekeeper interface module. The policy scheduling module may refer to the power mode when determining the scheduling policy, for example, determining a scheduling policy that matches the currently used power mode and the current user scenario. Alternatively, the power mode is used as a condition for whether the policy scheduling module determines the scheduling policy. When the power mode is a preset mode, the policy scheduling module determines the scheduling policy according to the user scenario.

策略调度模块将调度策略发送给场景交互模块,场景交互模块在接收到调度策略后,向策略调度模块返回接收结果,接收结果用于通知策略调度模块自身已成功接收到调度策略。场景交互模块将调度策略发送给调度策略融合模块,由调度策略融合模块对调度策略进行解析转义,以将调度策略中的策略参数解析转义成硬件平台识别的参数。调度策略融合模块将解析转义后的调度策略发送给调度执行器。调度执行器根据硬件平台类型发送解析转义后的调度策略。The policy scheduling module sends the scheduling policy to the scene interaction module. After receiving the scheduling policy, the scene interaction module returns the receiving result to the policy scheduling module. The receiving result is used to notify the policy scheduling module that it has successfully received the scheduling policy. The scene interaction module sends the scheduling policy to the scheduling policy fusion module, and the scheduling policy fusion module analyzes and escapes the scheduling policy, so as to parse and escape the policy parameters in the scheduling policy into parameters recognized by the hardware platform. The dispatch policy fusion module sends the parsed and escaped dispatch policy to the dispatch executor. The scheduling executor sends the scheduling policy after parsing and escaping according to the hardware platform type.

例如,如果硬件平台类型为

Figure BDA0003715386280000131
调度执行器可以向OS2SOC驱动节点发送解析转义后的调度策略;如果硬件平台类型为
Figure BDA0003715386280000132
调度执行器可以通过WMI插件向IntelDTT驱动发送解析转义后的调度策略。在本申请实施例中,调度策略可以是芯片调度策略,通过调整芯片的能效比,实现功耗的最佳平衡。例如,调度策略可以是CPU的功耗调度策略。For example, if the hardware platform type is
Figure BDA0003715386280000131
The scheduling executor can send the scheduling policy after parsing and escaping to the OS2SOC driver node; if the hardware platform type is
Figure BDA0003715386280000132
The scheduling executor can send the parsed and escaped scheduling policy to the IntelDTT driver through the WMI plug-in. In the embodiment of the present application, the scheduling policy may be a chip scheduling policy, and an optimal balance of power consumption is achieved by adjusting the energy efficiency ratio of the chip. For example, the scheduling policy may be a power consumption scheduling policy of the CPU.

如果硬件平台类型为

Figure BDA0003715386280000133
调度执行器可以向电源管理器发送调度策略中的用于调整CPU的EPP的指令。另外,调度执行器还可以向OS2SOC驱动节点发送调度策略中的用于调整CPU的PL1、PL2的指令。若硬件平台类型为
Figure BDA0003715386280000134
调度执行器可以通过WMI插件向Intel DTT驱动发送调度策略,其中可包括PL1的最小值、PL1的最大值、PL2、PL2的持续时间及EPO Gear,由Intel DTT驱动指示CPU基于该调度策略运行。WMI插件、Intel DTT和OS2SOC驱动节点在接收到调度策略后,可以返回接收结果,接收结果用于指示自身已成功接收到调度策略。If the hardware platform type is
Figure BDA0003715386280000133
The scheduling executor may send an instruction for adjusting the EPP of the CPU in the scheduling policy to the power manager. In addition, the scheduling executor may also send instructions for adjusting PL1 and PL2 of the CPU in the scheduling policy to the OS2SOC driver node. If the hardware platform type is
Figure BDA0003715386280000134
The scheduling executor can send the scheduling policy to the Intel DTT driver through the WMI plug-in, which can include the minimum value of PL1, the maximum value of PL1, PL2, the duration of PL2, and EPO Gear, and the Intel DTT driver instructs the CPU to run based on the scheduling policy. After receiving the scheduling policy, the WMI plug-in, Intel DTT and OS2SOC driver nodes can return the receiving result, which is used to indicate that they have successfully received the scheduling policy.

需要说明的是,在上文图2-图3实施例中,第一场景识别引擎可以根据用户场景确定调度策略。类似的,在上文图4-图5实施例中,第二场景识别引擎可以根据用户场景确定调度策略。然而,若仅考虑用户场景来确定调度策略,则确定出的调度策略比较局限,不能准确实现对电子设备的资源的合理分配。It should be noted that, in the above embodiments of FIG. 2-FIG. 3, the first scene recognition engine may determine the scheduling policy according to the user scene. Similarly, in the above embodiments of FIG. 4-FIG. 5, the second scene recognition engine may determine the scheduling policy according to the user scene. However, if only user scenarios are considered to determine the scheduling strategy, the determined scheduling strategy is relatively limited, and cannot accurately and reasonably allocate resources of electronic devices.

为此,本申请实施例提供了一种调度策略确定方法,可以结合电子设备当前所处的用户场景、电子设备的电源状态和系统负载来确定调度策略,如此确定调度策略时的参考因素比较全面,因而后续基于该调度策略所进行的资源调度可以准确实现对电子设备的资源的合理分配,从而不仅能满足用户需求,还可以兼顾电子设备本身的系统需求,进而可以在降低电子设备的能耗,提升电子设备的续航能力的情况下,保证电子设备的稳定运行。For this reason, the embodiment of the present application provides a scheduling policy determination method, which can determine the scheduling policy in combination with the current user scenario of the electronic device, the power state of the electronic device, and the system load. The reference factors for determining the scheduling policy in this way are more comprehensive , so the subsequent resource scheduling based on this scheduling strategy can accurately realize the reasonable allocation of resources of electronic equipment, so as to not only meet the needs of users, but also take into account the system requirements of the electronic equipment itself, thereby reducing the energy consumption of electronic equipment. To ensure the stable operation of the electronic equipment while improving the battery life of the electronic equipment.

下面对本申请实施例提供的调度策略确定方法进行详细地解释说明。The method for determining the scheduling policy provided by the embodiment of the present application is explained in detail below.

图6是本申请实施例提供的一种调度策略确定方法的流程图。参见图6,该方法包括以下步骤:Fig. 6 is a flow chart of a method for determining a scheduling policy provided by an embodiment of the present application. Referring to Figure 6, the method comprises the following steps:

步骤601:电子设备确定电子设备当前所处的用户场景。Step 601: The electronic device determines the current user scene where the electronic device is located.

该用户场景是指用户的使用场景,即用户正在使用电子设备做什么事情。该用户场景可以反映用户需求。The user scenario refers to the usage scenario of the user, that is, what the user is doing with the electronic device. This user scenario can reflect user needs.

具体地,步骤601的操作可以为:电子设备获取电子设备的应用运行信息,根据该应用运行信息确定电子设备所处的用户场景。Specifically, the operation of step 601 may be: the electronic device obtains application running information of the electronic device, and determines the user scenario where the electronic device is located according to the application running information.

由于用户使用电子设备时往往是使用电子设备中安装的各种应用,所以本申请实施例中可以根据应用运行信息来确定用户场景,据此确定出的用户场景比较准确。Since the user often uses various applications installed in the electronic device when using the electronic device, the user scenario can be determined according to the application running information in the embodiment of the present application, and the determined user scenario is relatively accurate.

该应用运行信息可以包括焦点应用信息,进一步还可以包括非焦点应用信息、后台应用信息等应用信息。本申请实施例中,某个应用的应用信息可以包括这个应用的应用名、应用类型、应用运行状态等。The application running information may include focus application information, and may further include application information such as non-focus application information and background application information. In this embodiment of the present application, the application information of an application may include the application name, application type, application running status, etc. of the application.

在一些实施例中,可以通过上文图2-图5实施例中的系统探针模块获取应用运行信息。系统探针模块可以将获取到的应用运行信息上报给场景识别模块,场景识别模块可以根据该应用运行信息识别用户场景。In some embodiments, the application running information can be obtained through the system probe module in the embodiments of FIGS. 2-5 above. The system probe module can report the obtained application operation information to the scene identification module, and the scene identification module can identify the user scene according to the application operation information.

比如,在上文图2-图3实施例中,系统探针模块中可以包括系统事件探针,系统事件探针中可以包括焦点窗口探针。焦点窗口探针用于在焦点窗口变化时确定最新的焦点窗口。焦点窗口探针可以向系统事件探针上报焦点窗口变化事件。系统事件探针可以根据焦点窗口探针上报的焦点窗口变化事件确定当前的焦点应用、非焦点应用、后台应用等应用的应用信息,以得到应用运行信息。然后系统事件探针可以将该应用运行信息上报给场景识别模块,以供场景识别模块据此识别用户场景。For example, in the embodiments shown in FIGS. 2-3 above, the system probe module may include a system event probe, and the system event probe may include a focus window probe. The focus window probe is used to determine the latest focus window when the focus window changes. The focus window probe can report the focus window change event to the system event probe. The system event probe can determine the application information of the current focus application, non-focus application, background application and other applications according to the focus window change event reported by the focus window probe, so as to obtain application running information. Then the system event probe can report the application running information to the scene identification module, so that the scene identification module can identify the user scene accordingly.

又比如,在上文图4-图5实施例中,系统探针模块中可以包括应用切换探针,应用切换探针中可以包括焦点窗口探针。焦点窗口探针用于在焦点窗口变化时确定最新的焦点窗口,焦点窗口探针可以向应用切换探针上报焦点窗口变化事件。应用切换探针可以根据焦点窗口探针上报的焦点窗口变化事件确定当前的焦点应用、非焦点应用、后台应用等应用的应用信息,以得到应用运行信息。然后应用切换探针可以将该应用运行信息上报给场景识别模块,以供场景识别模块据此识别用户场景。For another example, in the embodiments of FIGS. 4-5 above, the system probe module may include an application switching probe, and the application switching probe may include a focus window probe. The focus window probe is used to determine the latest focus window when the focus window changes, and the focus window probe can report the focus window change event to the application switching probe. The application switching probe can determine the application information of the current focus application, non-focus application, background application and other applications according to the focus window change event reported by the focus window probe, so as to obtain application running information. Then the application switching probe can report the application running information to the scene identification module, so that the scene identification module can identify the user scene accordingly.

上述系统事件探针或应用切换探针根据焦点窗口探针上报的焦点窗口变化事件确定当前的焦点应用、非焦点应用、后台应用等应用的应用信息时,可以在接收到焦点窗口探针上报的焦点窗口变化事件后,根据系统探针模块中的其他探针检测到的进程创建事件、进程退出事件、窗口事件等来确定当前的焦点应用、非焦点应用、后台应用等应用,即确定各个应用的应用名和应用类型,然后再结合系统探针模块中的其他探针检测到的外设状态、音频状态、视频状态、进程负载等确定各个应用的应用运行状态,如此可以得到当前的焦点应用、非焦点应用、后台应用等应用的应用信息,即得到应用运行信息。When the above-mentioned system event probe or application switching probe determines the application information of the current focus application, non-focus application, background application and other applications according to the focus window change event reported by the focus window probe, it can receive the information reported by the focus window probe. After the focus window change event, determine the current focus application, non-focus application, background application and other applications according to the process creation event, process exit event, window event, etc. detected by other probes in the system probe module, that is, determine each application The application name and application type, and then combine the peripheral status, audio status, video status, process load, etc. detected by other probes in the system probe module to determine the application running status of each application, so that the current focus application, The application information of applications such as non-focus applications and background applications is to obtain application running information.

其中,该窗口事件可以包括窗口全屏事件、窗口最小化事件、焦点获得事件、焦点失去事件等。窗口全屏事件用于指示某个窗口被全屏化了。窗口最小化事件用于指示某个窗口被最小化了。焦点获得事件用于指示某个窗口获得焦点。焦点失去事件用于指示某个窗口失去焦点。获得焦点的窗口即是焦点窗口。而失去焦点的窗口则是上一次获得焦点的窗口,即是上一个历史焦点窗口。Wherein, the window event may include a window full screen event, a window minimize event, a focus gain event, a focus loss event, and the like. The window fullscreen event is used to indicate that a window is fullscreened. The window minimize event is used to indicate that a window has been minimized. The focus event is used to indicate that a window has focus. The focus lost event is used to indicate that a window has lost focus. The window that gets the focus is the focused window. The window that loses focus is the window that gained focus last time, that is, the last historical focus window.

可选地,电子设备(如上述场景识别模块)根据该应用运行信息确定电子设备所处的用户场景的操作可以通过如下方式1、方式2、或方式3实现。Optionally, the operation of the electronic device (such as the above-mentioned scene recognition module) determining the user scene where the electronic device is located according to the application running information may be implemented through the following method 1, method 2, or method 3.

方式1,电子设备根据焦点应用信息中的应用类型(即焦点应用的应用类型)确定主场景,再根据该主场景、焦点应用信息中的应用运行状态(即焦点应用的应用运行状态)确定子场景,该主场景和该子场景为用户场景。Method 1: The electronic device determines the main scene according to the application type in the focus application information (that is, the application type of the focus application), and then determines the sub-scene according to the main scene and the application running state in the focus application information (that is, the application running state of the focus application). scene, the main scene and the sub-scene are user scenes.

可选地,电子设备中可以预先设置焦点应用类型与主场景之间的对应关系。这种情况下,电子设备可以根据焦点应用信息中的应用类型,从焦点应用类型与主场景之间的对应关系中,获取对应的主场景。Optionally, the correspondence between the focus application type and the main scene may be preset in the electronic device. In this case, the electronic device may obtain the corresponding main scene from the correspondence between the focused application type and the main scene according to the application type in the focused application information.

比如,焦点应用类型与主场景之间的对应关系可以如下表1所示。这种情况下,若焦点应用信息中的应用类型为视频类,则根据表1可以确定主场景为视频场景;若焦点应用信息中的应用类型为办公类,则根据表1可以确定主场景为办公场景;若焦点应用信息中的应用类型为游戏类,则根据表1可以确定主场景为游戏场景;若焦点应用信息中的应用类型为社交类,则根据表1可以确定主场景为社交场景;若焦点应用信息中的应用类型为浏览器类,则根据表1可以确定主场景为浏览器场景。For example, the corresponding relationship between the focus application type and the main scene may be shown in Table 1 below. In this case, if the application type in the focus application information is video, it can be determined according to Table 1 that the main scene is a video scene; if the application type in the focus application information is office, then according to Table 1 it can be determined that the main scene is Office scene; if the application type in the focus application information is a game, then it can be determined that the main scene is a game scene according to Table 1; if the application type in the focus application information is a social type, then according to Table 1, it can be determined that the main scene is a social scene ; If the application type in the focus application information is a browser class, then according to Table 1, it can be determined that the main scene is a browser scene.

表1Table 1

焦点应用类型Focus application type 主场景main scene 视频类video class 视频场景video scene 办公类Office 办公场景Office scene 游戏类games 游戏场景game scene 社交类social class 社交场景social scene 浏览器类browser class 浏览器场景browser scene ……... ……...

本申请实施例中仅以上表1为例来对焦点应用类型与主场景之间的对应关系进行示例性说明,上表1并不对本申请实施例构成限定。In the embodiment of the present application, only the above Table 1 is taken as an example to illustrate the corresponding relationship between the focus application type and the main scene, and the above Table 1 does not limit the embodiment of the present application.

作为一种示例,电子设备可以根据该主场景和焦点应用信息中的应用运行状态直接确定子场景。As an example, the electronic device may directly determine the sub-scene according to the main scene and the running state of the application in the focus application information.

可选地,电子设备中可以预先设置主场景、焦点应用运行状态与子场景之间的对应关系。这种情况下,电子设备可以根据该主场景和焦点应用信息中的应用运行状态,从主场景、焦点应用运行状态与子场景之间的对应关系中,获取对应的子场景。Optionally, the correspondence between the main scene, the running state of the focus application and the sub-scenes may be preset in the electronic device. In this case, the electronic device may obtain the corresponding sub-scene from the correspondence between the main scene, the running state of the focused application, and the sub-scene according to the main scene and the application running state in the focus application information.

比如,主场景、焦点应用运行状态与子场景之间的对应关系可以如下表2所示。这种情况下,若该主场景为办公场景,焦点应用信息中的应用运行状态为接收鼠标输入,则根据表2可以确定子场景为办公场景下的文档浏览场景。若该主场景为办公场景,焦点应用信息中的应用运行状态为接收键盘输入,则根据表2可以确定子场景为办公场景下的文档编辑场景。若该主场景为办公场景,焦点应用信息中的应用运行状态为使用摄像头,则根据表2可以确定子场景为办公场景下的视频会议场景。若该主场景为社交场景,焦点应用信息中的应用运行状态为接收键盘输入,则根据表2可以确定子场景为社交场景下的文字聊天场景。若该主场景为社交场景,焦点应用信息中的应用运行状态为使用麦克风且未使用摄像头,则根据表2可以确定子场景为社交场景下的语音聊天场景。若该主场景为社交场景,焦点应用信息中的应用运行状态为使用麦克风且使用摄像头,则根据表2可以确定子场景为社交场景下的视频聊天场景。For example, the correspondence between the main scene, the running state of the focus application and the sub-scenes may be shown in Table 2 below. In this case, if the main scene is an office scene, and the application running state in the focus application information is receiving mouse input, then according to Table 2, it can be determined that the sub-scene is a document browsing scene in the office scene. If the main scene is an office scene, and the application running state in the focus application information is receiving keyboard input, then according to Table 2, it can be determined that the sub-scene is a document editing scene in the office scene. If the main scene is an office scene, and the application running state in the focus application information is using a camera, then according to Table 2, it can be determined that the sub-scene is a video conference scene in the office scene. If the main scene is a social scene, and the application running state in the focus application information is receiving keyboard input, then according to Table 2, it can be determined that the sub-scene is a text chat scene in a social scene. If the main scene is a social scene, and the application running state in the focus application information is using a microphone and not using a camera, then according to Table 2, it can be determined that the sub-scene is a voice chat scene in a social scene. If the main scene is a social scene, and the application running state in the focus application information is using a microphone and a camera, then according to Table 2, it can be determined that the sub-scene is a video chat scene in a social scene.

表2Table 2

Figure BDA0003715386280000151
Figure BDA0003715386280000151

本申请实施例中仅以上表2为例来对主场景、焦点应用运行状态与子场景之间的对应关系进行示例性说明,上表2并不对本申请实施例构成限定。In the embodiment of the present application, only the above Table 2 is used as an example to illustrate the corresponding relationship between the main scene, the running state of the focus application and the sub-scene, and the above Table 2 does not limit the embodiment of the present application.

作为另一种示例,电子设备可以根据该主场景、焦点应用信息中的应用运行状态、非焦点应用信息和后台应用信息确定至少一个子场景,然后再从该至少一个子场景中选择出优先级最高的一个子场景。As another example, the electronic device may determine at least one sub-scene according to the main scene, the application running state in the focused application information, the non-focused application information, and the background application information, and then select a priority from the at least one sub-scene The highest subscene.

电子设备中可以预先设置各个子场景的优先级,各个子场景的优先级可以由技术人员根据使用需求预先进行设置,如技术人员可以根据各个子场景对电子设备的续航能力的影响程度来设置各个子场景的优先级,其中对电子设备的续航能力的影响程度越大的,优先级越高,对电子设备的续航能力的影响程度越小的,优先级越低。如此,在根据该主场景、焦点应用信息中的应用运行状态、非焦点应用信息和后台应用信息确定至少一个子场景后,可以从中选择优先级最高的一个子场景,以便后续可以根据该子场景确定出最为合理的调度策略,以最大程度的提升电子设备的续航能力。The priority of each sub-scene can be set in advance in the electronic device, and the priority of each sub-scene can be set in advance by the technician according to the usage requirements. For example, the technician can set each The priority of the sub-scenes, the greater the impact on the battery life of the electronic device, the higher the priority, and the smaller the impact on the battery life of the electronic device, the lower the priority. In this way, after at least one sub-scene is determined according to the main scene, the application running state in the focused application information, the non-focused application information, and the background application information, a sub-scene with the highest priority can be selected, so that the following can be based on the sub-scene The most reasonable scheduling strategy is determined to maximize the battery life of the electronic equipment.

可选地,电子设备中可以预先设置主场景、焦点应用运行状态、非焦点应用信息、后台应用信息与子场景之间的对应关系。这种情况下,电子设备可以根据该主场景、焦点应用信息中的应用运行状态、非焦点应用信息和后台应用信息,从主场景、焦点应用运行状态、非焦点应用信息、后台应用信息与子场景之间的对应关系中,获取对应的至少一个子场景。Optionally, the correspondence between the main scene, the running status of the focused application, the information of the non-focused application, the information of the background application and the sub-scenes may be preset in the electronic device. In this case, the electronic device can, according to the main scene, the application running state in the focus application information, the non-focus application information and the background application information, from the main scene, the focus application running state, the non-focus application information, the background application information and the sub- In the corresponding relationship between scenes, at least one corresponding sub-scene is acquired.

比如,主场景、焦点应用运行状态、非焦点应用信息、后台应用信息与子场景之间的对应关系可以如下表3所示。For example, the correspondence between the main scene, the running state of the focus application, the information of the non-focus application, the information of the background application and the sub-scenes may be shown in Table 3 below.

表3table 3

Figure BDA0003715386280000161
Figure BDA0003715386280000161

本申请实施例中仅以上表3为例来对主场景、焦点应用运行状态、非焦点应用信息、后台应用信息与子场景之间的对应关系进行示例性说明,上表3并不对本申请实施例构成限定。In the embodiment of this application, only the above Table 3 is taken as an example to illustrate the corresponding relationship between the main scene, the running state of the focus application, the information of the non-focus application, the information of the background application and the sub-scene, and the above Table 3 does not apply to the implementation of this application. Examples constitute limitations.

这种情况下,若主场景为浏览器场景,焦点应用信息中的应用运行状态为无,非焦点应用信息中的应用名为word、应用类型为办公类、应用运行状态为无,后台应用信息中的应用名为xx音乐、应用类型为音乐类、应用运行状态为输出音频,则根据表3可以确定子场景有两个,一个是浏览器场景下的办公资料查询场景,另一个是浏览器场景下的后台听音乐场景。假设浏览器场景下的办公资料查询场景的优先级高于浏览器场景下的后台听音乐场景的优先级,则可以选择浏览器场景下的办公资料查询场景。In this case, if the main scene is a browser scene, the application running status in the focus application information is None, the application name in the non-focus application information is word, the application type is office, and the application running status is None, and the background application information The application named xx music, the application type is music, and the application running status is output audio. According to Table 3, it can be determined that there are two sub-scenes, one is the office data query scene in the browser scene, and the other is the browser scene. The scene under the background listening to the music scene. Assuming that the priority of the office data query scene in the browser scene is higher than that of listening to music in the background in the browser scene, the office data query scene in the browser scene can be selected.

若主场景为办公场景,焦点应用信息中的应用运行状态为接收键盘输入,非焦点应用信息中的应用名为xx交友、应用类型为社交类、应用运行状态为使用麦克风,后台应用信息中的应用名为xx浏览器、应用类型为浏览器类、应用运行状态为无,则根据表3可以确定子场景有两个,一个是办公场景下的语音聊天场景,另一个是办公场景下的文档编辑场景。假设办公场景下的语音聊天场景的优先级高于办公场景下的文档编辑场景的优先级,则可以选择办公场景下的语音聊天场景。If the main scene is an office scene, the application running status in the focus application information is receiving keyboard input, the application name in the non-focus application information is xx making friends, the application type is social, and the application running status is using the microphone. The application name is xx browser, the application type is browser class, and the application running status is none. According to Table 3, it can be determined that there are two sub-scenarios, one is the voice chat scene in the office scene, and the other is the document in the office scene Edit the scene. Assuming that the voice chat scene in the office scene has a higher priority than the document editing scene in the office scene, the voice chat scene in the office scene can be selected.

方式2,电子设备根据该应用运行信息和系统工作状态确定用户场景。Mode 2, the electronic device determines the user scenario according to the application running information and system working status.

电子设备可以检测系统工作状态。系统工作状态是指系统当前的工作状态,可以分为空闲状态和其他状态。该空闲状态是指系统长时间未被用户操作的状态。Electronic devices can detect system operating status. The system working state refers to the current working state of the system, which can be divided into idle state and other states. The idle state refers to a state in which the system has not been operated by a user for a long time.

若系统工作状态为除空闲状态之外的其他状态,则电子设备可以按照上述方式1确定用户场景,即直接根据该应用运行信息确定用户场景。If the working state of the system is other than the idle state, the electronic device may determine the user scenario according to the above method 1, that is, determine the user scenario directly according to the application running information.

在一些实施例中,在上文图2-图5实施例中,系统探针模块中可以包括系统工作状态探针,系统工作状态探针用于检测系统当前的工作状态(即系统工作状态),即检测系统当前是否为空闲状态,并在系统工作状态为空闲状态时将系统工作状态上报给场景识别模块。场景识别模块接收到系统工作状态后,可以根据系统工作状态和该应用运行信息确定用户场景。In some embodiments, in the embodiments of Fig. 2-Fig. 5 above, the system probe module may include a system working state probe, which is used to detect the current working state of the system (that is, the system working state) , that is, to detect whether the system is currently idle, and report the system working status to the scene recognition module when the system working status is idle. After receiving the working state of the system, the scene identification module can determine the user scene according to the working state of the system and the running information of the application.

换句话说,在系统工作状态为除空闲状态之外的其他状态时,系统工作状态探针并不会将系统工作状态上报给场景识别模块,则此时场景识别模块是按照上述方式1来确定用户场景,即直接根据该应用运行信息确定用户场景。而当系统工作状态变更为空闲状态时,系统工作状态探针会将系统工作状态上报给场景识别模块,场景识别模块接收到系统工作状态探针上报的系统工作状态后,即可获知系统工作状态变更为了空闲状态,此时场景识别模块可以根据系统工作状态和该应用运行信息确定用户场景。In other words, when the system working state is other than the idle state, the system working state probe will not report the system working state to the scene recognition module, then the scene recognition module will determine according to the above method 1 The user scenario is to determine the user scenario directly according to the running information of the application. When the system working status changes to idle status, the system working status probe will report the system working status to the scene recognition module, and the scene recognition module can know the system working status after receiving the system working status reported by the system working status probe Changed to the idle state, at this time the scene recognition module can determine the user scene according to the system working state and the application running information.

可选地,系统工作状态探针在获取系统工作状态时,可以根据设备合盖状态、设备亮屏状态、系统锁定状态和鼠标键盘外设状态等来确定系统工作状态。示例地,若在设备未合盖、设备亮屏且设备未被锁定的情况下,长时间无鼠标键盘输入,则可以确定系统工作状态为空闲状态;否则,可以确定系统工作状态为除空闲状态之外的其他状态。Optionally, when the system working status probe acquires the system working status, it can determine the system working status according to the device cover status, device screen bright status, system lock status, mouse and keyboard peripheral status, etc. For example, if there is no mouse and keyboard input for a long time when the device is not closed, the screen is on and the device is not locked, it can be determined that the system working state is the idle state; otherwise, it can be determined that the system working state is other than the idle state other states.

可选地,根据系统工作状态和该应用运行信息确定用户场景时,若系统工作状态变更为空闲状态,而该应用运行信息中指示存在应用处于用户使用的状态,则电子设备可以按照上述方式1确定用户场景,即直接根据该应用运行信息确定用户场景。比如,若系统工作状态为空闲状态,而焦点应用信息、非焦点应用信息、后台应用信息等应用信息中的至少一个应用信息中的应用运行状态指示正在使用麦克风、正在使用摄像头、正在输出视频、正在输出音频、或正在使用其他外设,说明用户正在使用某些应用,则电子设备可以按照上述方式1确定用户场景,即直接根据该应用运行信息确定用户场景。Optionally, when the user scenario is determined according to the system working state and the application running information, if the system working state changes to an idle state, and the application running information indicates that there is an application in use by the user, the electronic device can follow the above method 1 Determining the user scenario means determining the user scenario directly based on the application running information. For example, if the working state of the system is idle, and the application running state in at least one of the application information such as the focused application information, the non-focused application information, and the background application information indicates that the microphone is being used, the camera is being used, the video is being output, Audio is being output, or other peripherals are being used, indicating that the user is using certain applications, and the electronic device can determine the user scenario according to the above method 1, that is, directly determine the user scenario based on the application running information.

或者,若系统工作状态变更为空闲状态,而该应用运行信息中指示应用均处于用户未使用的状态,则电子设备可以确定主场景为空闲场景,此时无需确定子场景,直接将该主场景作为用户场景。比如,若系统工作状态为空闲状态,而焦点应用信息、非焦点应用信息、后台应用信息等应用信息中的应用运行状态均指示未使用麦克风、未使用摄像头、未输出视频、未输出音频以及未使用其他外设,说明用户没有使用应用,则电子设备可以确定主场景为空闲场景,即确定用户场景为空闲场景。用户场景为空闲场景,代表用户当前未使用电子设备(即未进行操作且未使用应用),据此可以在后续确定适用于此情况的调度策略。Alternatively, if the system working state changes to an idle state, and the application running information indicates that the applications are not in use by the user, the electronic device can determine that the main scene is an idle scene. as a user scenario. For example, if the system working status is idle, and the application running status in the application information such as focused application information, non-focused application information, and background application information all indicate that the microphone is not used, the camera is not used, the video is not output, the audio is not output, and the Using other peripherals means that the user does not use the application, and the electronic device can determine that the main scene is an idle scene, that is, determine that the user scene is an idle scene. The user scene is an idle scene, which means that the user is not currently using the electronic device (that is, not operating and not using the application), and accordingly a scheduling strategy applicable to this situation can be subsequently determined.

方式3,电子设备根据该应用运行信息和IO负载信息确定电子设备所处的用户场景。Mode 3, the electronic device determines the user scenario where the electronic device is located according to the application running information and the IO load information.

电子设备可以获取IO负载信息。在一些实施例中,在上文图2-图5实施例中,系统探针模块中可以包括系统负载探针,系统负载探针可以检测IO负载信息,并将IO负载信息上报给场景识别模块,以供场景识别模块据此确定用户场景。Electronic devices can obtain IO load information. In some embodiments, in the above embodiments of Figure 2-Figure 5, the system probe module may include a system load probe, the system load probe can detect IO load information, and report the IO load information to the scene identification module , for the scene recognition module to determine the user scene accordingly.

IO负载信息用于体现IO负载情况。示例地,IO负载信息可以包括IO时间比率,IO时间比率是指周期内用于IO操作的时间比率,即指示一秒中有百分之多少的时间用于IO操作。IO时间比率可以体现IO负载的高低。也即,IO时间比率越高,说明IO负载越高;IO时间比率越低,说明IO负载越低。在一些实施例中,可以通过IO吞吐量统计服务来获取IO时间比率,当然,也可以通过其他方式来获取IO时间比率,本申请实施例对此不作限定。The IO load information is used to reflect the IO load status. Exemplarily, the IO load information may include an IO time ratio, and the IO time ratio refers to a time ratio used for IO operations in a period, that is, indicates what percentage of a second is used for IO operations. The IO time ratio can reflect the level of IO load. That is, the higher the IO time ratio, the higher the IO load; the lower the IO time ratio, the lower the IO load. In some embodiments, the IO time ratio can be obtained through the IO throughput statistics service, and of course, the IO time ratio can also be obtained in other ways, which is not limited in this embodiment of the present application.

本申请实施例中根据IO负载信息可以推测用户行为,继而有助于确定用户场景。比如,IO负载信息持续性处于30%以上,可以认为用户在拷贝文件,或者,IO负载信息持续性处于10%到30%之间,可以认为用户在解压文件。In the embodiment of the present application, the user behavior can be inferred according to the IO load information, which in turn helps to determine the user scenario. For example, if the persistence of the IO load information is above 30%, it can be considered that the user is copying files; or, if the persistence of the IO load information is between 10% and 30%, it can be considered that the user is decompressing files.

可选地,电子设备可以根据该应用运行信息中的焦点应用信息中的应用类型确定主场景,然后再根据该主场景和该IO负载信息确定子场景,该主场景和该子场景即为用户场景。Optionally, the electronic device may determine the main scene according to the application type in the focus application information in the application running information, and then determine the sub-scene according to the main scene and the IO load information, and the main scene and the sub-scene are user Scenes.

比如,电子设备中可以预先设置主场景、IO负载信息和子场景之间的对应关系。这种情况下,电子设备可以根据该主场景和该IO负载信息,从该对应关系中获取对应的子场景。For example, the correspondence between the main scene, IO load information and sub-scenes may be preset in the electronic device. In this case, the electronic device can obtain the corresponding sub-scene from the corresponding relationship according to the main scene and the IO load information.

值得注意的是,电子设备不仅可以根据该主场景和该IO负载信息来确定子场景,还可以结合其他信息,如结合该应用运行信息中的焦点应用信息中的应用运行状态、非焦点应用信息、后台应用信息等来确定子场景,如此可以使得确定出的子场景更为准确。It is worth noting that the electronic device can not only determine the sub-scene according to the main scene and the IO load information, but also combine other information, such as combining the application running status and non-focus application information in the application running information in the focus application information , background application information, etc. to determine the sub-scene, which can make the determined sub-scene more accurate.

下面以图7为例来对上述步骤601中确定用户场景的过程进行示例性说明。The following takes FIG. 7 as an example to illustrate the process of determining the user scene in step 601 above.

图7是本申请实施例提供的一种确定用户场景的示意图。FIG. 7 is a schematic diagram of determining a user scenario provided by an embodiment of the present application.

参见图7,在焦点窗口发生变化时,可以获取到当前的焦点应用信息、非焦点应用信息和后台应用信息,然后可以根据焦点应用信息中的应用类型确定主场景。之后,可以进行场景抖动过滤,具体为:若最新确定出的主场景与上一次确定出的主场景相同,且最新获取到的焦点应用信息中的应用运行状态与上一次获取到的焦点应用信息中的应用运行状态相同,则不重新确定用户场景,结束操作,否则,继续确定子场景。Referring to FIG. 7 , when the focused window changes, the current focused application information, non-focused application information and background application information can be obtained, and then the main scene can be determined according to the application type in the focused application information. Afterwards, scene jitter filtering can be performed, specifically: if the newly determined main scene is the same as the last determined main scene, and the application running status in the newly obtained focus application information is the same as the focus application information obtained last time If the running status of the applications in is the same, the user scenario is not re-determined, and the operation ends; otherwise, continue to determine the sub-scenario.

在系统工作状态发生变化时,可以获取到当前的系统工作状态。若系统工作状态不为空闲状态,则不重新确定用户场景,结束操作。若系统工作状态为空闲状态,则根据当前的焦点应用信息、非焦点应用信息、后台应用信息中的应用运行状态确定主场景是否为空闲场景。若焦点应用信息、非焦点应用信息、后台应用信息中的应用运行状态均指示未使用麦克风、未使用摄像头、未输出视频、未输出音频以及未使用其他外设,则可以确定主场景为空闲场景,即确定用户场景为空闲场景。而若焦点应用信息、非焦点应用信息、后台应用信息中的应用运行状态指示正在使用麦克风、正在使用摄像头、正在输出视频、正在输出音频、或正在使用其他外设,则在焦点窗口当前未发生变化时,不重新确定用户场景,结束操作,在焦点窗口当前发生变化且在已根据焦点应用信息中的应用类型确定主场景的情况下,继续确定子场景。When the working state of the system changes, the current working state of the system can be obtained. If the working state of the system is not idle, the user scenario is not re-determined, and the operation ends. If the working state of the system is the idle state, then determine whether the main scene is an idle scene according to the application running state in the current focus application information, non-focus application information, and background application information. If the application running status in the focus application information, non-focus application information, and background application information indicates that the microphone is not used, the camera is not used, the video is not output, the audio is not output, and other peripherals are not used, it can be determined that the main scene is an idle scene , that is, it is determined that the user scene is an idle scene. However, if the application running status in the focused application information, non-focused application information, and background application information indicates that the microphone is being used, the camera is being used, video is being output, audio is being output, or other peripherals are being used, then the focus window does not currently occur When changing, do not redefine the user scene, end the operation, and continue to determine the sub-scene when the focus window changes and the main scene has been determined according to the application type in the focus application information.

确定子场景时,可以根据主场景、焦点应用信息中的应用运行状态、非焦点应用信息和后台应用信息确定至少一个子场景,比如,可以结合主场景,对焦点应用信息、非焦点应用信息和后台应用信息中的应用运行状态进行解析,得到至少一个子场景。然后再对该至少一个子场景进行优先级比较,从中选择出优先级最高的一个子场景,将主场景和选择出的子场景确定为用户场景。When determining the sub-scene, at least one sub-scene can be determined according to the main scene, the application running state in the focus application information, the non-focus application information and the background application information. For example, in combination with the main scene, the focus application information, the non-focus application information and The application running state in the background application information is analyzed to obtain at least one sub-scenario. Then compare the priority of the at least one sub-scene, select the sub-scene with the highest priority, and determine the main scene and the selected sub-scene as the user scene.

步骤602:电子设备确定电子设备的电源状态。Step 602: the electronic device determines a power state of the electronic device.

电源状态可以包括电源模式、电源计划等,电源模式可以包括AC状态和DC状态,电源计划可以包括能效计划、平衡计划、性能计划等。The power state may include a power mode, a power plan, etc., the power mode may include an AC state and a DC state, and the power plan may include an energy efficiency plan, a balance plan, a performance plan, and the like.

在一些实施例中,在上文图2-图5实施例中,系统探针模块中可以包括电源状态探针,电源状态探针用于检测电源状态,并将电源状态上报给场景识别模块。In some embodiments, in the embodiments shown in FIGS. 2-5 above, the system probe module may include a power state probe, which is used to detect the power state and report the power state to the scene recognition module.

可选地,电源状态探针在确定电源状态时,可以根据电源模式变化事件和电源计划变化事件来确定当前的电源状态。在电子设备的运行过程中,若电源模式发生改变则会触发电源模式变化事件,电源模式变化事件用于指示变化后最新的电源模式。在电子设备的运行过程中,若电源计划发生改变则会触发电源计划变化事件,电源计划变化事件用于指示变化后最新的电源计划。Optionally, when determining the power state, the power state probe may determine the current power state according to the power mode change event and the power plan change event. During the operation of the electronic device, if the power mode changes, a power mode change event will be triggered, and the power mode change event is used to indicate the latest power mode after the change. During the operation of the electronic device, if the power plan changes, a power plan change event will be triggered, and the power plan change event is used to indicate the latest power plan after the change.

值得注意的是,在一些情况中,电子设备开机启动时会直接触发电源模式变化事件和电源计划变化事件,此时电源状态探针可以直接检测到电源模式变化事件和电源计划变化事件来确定当前的电源状态。然而,在另一些情况中,电子设备开机启动时并不会触发电源模式变化事件和电源计划变化事件,此时电源状态探针并不能直接检测到电源模式变化事件和电源计划变化事件。这种情况下,为了保证在开机启动时对电源状态的正常确定,电子设备可以在开机启动时主动确定电源状态。It is worth noting that in some cases, the power mode change event and the power plan change event will be directly triggered when the electronic device is turned on. At this time, the power status probe can directly detect the power mode change event and the power plan change event to determine the current the power state of . However, in some other cases, the power mode change event and the power plan change event are not triggered when the electronic device is started, and the power state probe cannot directly detect the power mode change event and the power plan change event at this time. In this case, in order to ensure normal determination of the power state when starting up, the electronic device may actively determine the power state when starting up.

下面以图8为例来对上述步骤602中确定电源状态的过程进行示例性说明。The following uses FIG. 8 as an example to illustrate the process of determining the power state in step 602 above.

图8是本申请实施例提供的一种确定电源状态的示意图。FIG. 8 is a schematic diagram of determining a power state provided by an embodiment of the present application.

参见图8,电子设备在开机启动时,主动获取电源模式信息;若未获取到电源模式信息,即获取失败,则不确定电源状态,结束操作;若获取到电源模式信息,即获取成功,则继续获取电源计划信息。之后,若未获取到电源计划信息,即获取失败,则设置电源计划为平衡计划,然后执行电源计划过滤操作;若获取到电源计划信息,即获取成功,则执行电源计划过滤操作。Referring to Figure 8, the electronic device actively obtains the power mode information when it is turned on; if the power mode information is not obtained, that is, the acquisition fails, the power state is not determined, and the operation ends; if the power mode information is obtained, that is, the acquisition is successful, then Continue to Get Power Plan Information. Afterwards, if the power plan information is not obtained, that is, the acquisition fails, then the power plan is set as a balanced plan, and then the power plan filtering operation is performed; if the power plan information is obtained, that is, the acquisition is successful, the power plan filtering operation is performed.

在电子设备正常运行过程中,电源状态探针可以通过电源模式探针确定电源模式,且可以通过电源计划探针确定电源计划。电源模式探针可以检测电源模式变化事件。电源计划探针可以检测电源计划变化事件。如此,在发生电源模式变化时和/或发生电源计划变化时,电源状态探针就可以获取到变化后的电源模式和/或变化后的电源计划,然后执行电源计划过滤操作。During normal operation of the electronic device, the power state probe can determine the power mode through the power mode probe, and can determine the power plan through the power plan probe. The power mode probe can detect power mode change events. The power plan probe can detect power plan change events. In this way, when the power mode changes and/or the power plan changes, the power status probe can obtain the changed power mode and/or the changed power plan, and then perform the power plan filtering operation.

在进行电源计划过滤操作时,若最新确定出的电源计划相比于上一次确定出的电源计划未发生变化,则结束操作,不重新确定电源状态;若最新确定出的电源计划相比于上一次确定出的电源计划发生变化,则进行电源状态抖动过滤,具体为:在最新确定出的电源计划与当前的电源状态中的电源计划相同,且最新确定出的电源模式与当前的电源状态中的电源模式相同的情况下,结束操作,不重新确定电源状态;在最新确定出的电源计划与当前的电源状态中的电源计划不同,和/或,最新确定出的电源模式与当前的电源状态中的电源模式不同的情况下,重新确定电源状态,即将最新确定出的电源计划和电源模式确定为电源状态。When performing the power plan filtering operation, if the newly determined power plan has not changed compared with the last determined power plan, the operation will end without re-determining the power state; Once the determined power plan changes, power state jitter filtering is performed, specifically: the newly determined power plan is the same as the power plan in the current power state, and the newly determined power mode is the same as the current power state In the case of the same power mode, end the operation without re-determining the power state; if the newly determined power plan is different from the power plan in the current power state, and/or, the newly determined power mode is different from the current power state If the power modes in the system are different, the power state is re-determined, that is, the newly determined power plan and power mode are determined as the power state.

步骤603:电子设备确定电子设备的系统负载。Step 603: the electronic device determines the system load of the electronic device.

在一些实施例中,在上文图2-图5实施例中,系统探针模块中可以包括系统负载探针,系统负载探针用于检测系统负载,并将系统负载上报给场景识别模块。In some embodiments, in the embodiments shown in FIGS. 2-5 above, the system probe module may include a system load probe, which is used to detect the system load and report the system load to the scene recognition module.

示例地,电子设备的系统负载可以用负载等级表示。负载等级用于体现系统整体的负载情况。示例地,负载等级可以为轻、中、重。负载等级为轻说明系统负载较低;负载等级为中说明系统负载较为适中;负载等级为重说明系统负载较高。Exemplarily, the system load of an electronic device may be represented by a load level. The load level is used to reflect the overall load condition of the system. For example, the load levels may be light, medium, and heavy. A load rating of light indicates that the system load is low; a load rating of medium indicates that the system load is moderate; a load rating of heavy indicates that the system load is relatively high.

可选地,电子设备(如系统负载模块)可以根据电子设备当前的设备性能指数,确定电子设备当前的负载等级。比如,可以根据CPU负载信息和IO负载信息确定负载等级。Optionally, the electronic device (such as the system load module) may determine the current load level of the electronic device according to the current device performance index of the electronic device. For example, the load level may be determined according to CPU load information and IO load information.

CPU负载信息用于体现CPU负载情况。示例地,CPU负载信息可以包括系统丢帧率。系统丢帧率可以体现CPU负载的高低。也即,系统丢帧率越高,说明CPU负载越高;系统丢帧率越低,说明CPU负载越低。在一些实施例中,可以通过SurfaceFlinger服务中用于获取帧信息的相关接口来获取系统丢帧率,当然,也可以通过其他方式来获取系统丢帧率,本申请实施例对此不作限定。The CPU load information is used to reflect the CPU load. Exemplarily, the CPU load information may include a system frame loss rate. The frame loss rate of the system can reflect the level of CPU load. That is, the higher the system frame loss rate, the higher the CPU load; the lower the system frame loss rate, the lower the CPU load. In some embodiments, the system frame loss rate can be obtained through the relevant interface used to obtain frame information in the SurfaceFlinger service. Of course, the system frame loss rate can also be obtained through other methods, which is not limited in this embodiment of the present application.

IO负载信息用于体现IO负载情况。示例地,IO负载信息可以包括IO时间比率,IO时间比率是指周期内用于IO操作的时间比率,即指示一秒中有百分之多少的时间用于IO操作。IO时间比率可以体现IO负载的高低。也即,IO时间比率越高,说明IO负载越高;IO时间比率越低,说明IO负载越低。在一些实施例中,可以通过IO吞吐量统计服务来获取IO时间比率,当然,也可以通过其他方式来获取IO时间比率,本申请实施例对此不作限定。The IO load information is used to reflect the IO load status. Exemplarily, the IO load information may include an IO time ratio, and the IO time ratio refers to a time ratio used for IO operations in a period, that is, indicates what percentage of a second is used for IO operations. The IO time ratio can reflect the level of IO load. That is, the higher the IO time ratio, the higher the IO load; the lower the IO time ratio, the lower the IO load. In some embodiments, the IO time ratio can be obtained through the IO throughput statistics service, and of course, the IO time ratio can also be obtained in other ways, which is not limited in this embodiment of the present application.

可选地,根据CPU负载信息和IO负载信息确定负载等级的操作可以为:若系统丢帧率大于或等于第一丢帧率阈值,或者IO时间比率大于或等于第一时间比率阈值,则确定负载等级为重;若系统丢帧率大于第二丢帧率阈值且小于第一丢帧率阈值,以及IO时间比率大于第二时间比率阈值且小于第一时间比率阈值,则确定负载等级为中;若系统丢帧率小于或等于第二丢帧率阈值,或者IO时间比率小于或等于第二时间比率阈值,则确定负载等级为轻。Optionally, the operation of determining the load level according to the CPU load information and the IO load information may be: if the system frame loss rate is greater than or equal to the first frame loss rate threshold, or the IO time ratio is greater than or equal to the first time ratio threshold, then determine The load level is heavy; if the system frame loss rate is greater than the second frame loss rate threshold and less than the first frame loss rate threshold, and the IO time ratio is greater than the second time ratio threshold and less than the first time ratio threshold, the load level is determined to be medium ; If the system frame loss rate is less than or equal to the second frame loss rate threshold, or the IO time ratio is less than or equal to the second time ratio threshold, determine that the load level is light.

第一丢帧率阈值和第二丢帧率阈值均可以预先进行设置,第一丢帧率阈值和第二丢帧率阈值是用来判断系统丢帧率的高低的阈值,第一丢帧率阈值大于第二丢帧率阈值。比如,第一丢帧率阈值可以为1%、2%等,第二丢帧率阈值可以为0%、0.1%等。当系统丢帧率大于或等于第一丢帧率阈值时,说明系统丢帧率较高,即CPU负载较高。当系统丢帧率小于或等于第二丢帧率阈值时,说明系统丢帧率较低,即CPU负载较低。Both the first frame loss rate threshold and the second frame loss rate threshold can be set in advance. The first frame loss rate threshold and the second frame loss rate threshold are used to judge the high or low frame loss rate of the system. The first frame loss rate The threshold is greater than the second frame loss rate threshold. For example, the first frame loss rate threshold may be 1%, 2% and so on, and the second frame loss rate threshold may be 0%, 0.1% and so on. When the system frame loss rate is greater than or equal to the first frame loss rate threshold, it indicates that the system frame loss rate is high, that is, the CPU load is high. When the system frame loss rate is less than or equal to the second frame loss rate threshold, it indicates that the system frame loss rate is low, that is, the CPU load is low.

第一时间比率阈值和第二时间比率阈值均可以预先进行设置,第一时间比率阈值和第二时间比率阈值是用来判断IO时间比率的高低的阈值,第一时间比率阈值大于第二时间比率阈值。比如,第一时间比率阈值可以为60%、85%等,第二时间比率阈值可以为40%、35%等。当IO时间比率大于或等于第一时间比率阈值时,说明IO时间比率较高,即IO负载较高。当IO时间比率小于或等于第二时间比率阈值时,说明IO时间比率较低,即IO负载较低。Both the first time ratio threshold and the second time ratio threshold can be set in advance. The first time ratio threshold and the second time ratio threshold are thresholds used to judge the IO time ratio. The first time ratio threshold is greater than the second time ratio threshold. For example, the first time ratio threshold may be 60%, 85% and so on, and the second time ratio threshold may be 40%, 35% and so on. When the IO time ratio is greater than or equal to the first time ratio threshold, it indicates that the IO time ratio is high, that is, the IO load is high. When the IO time ratio is less than or equal to the second time ratio threshold, it indicates that the IO time ratio is low, that is, the IO load is low.

这种情况下,若系统丢帧率大于或等于第一丢帧率阈值,或者IO时间比率大于或等于第一时间比率阈值,说明CPU负载较高或者IO负载较高,即说明系统负载较高,因而可以确定负载等级为重。In this case, if the system frame loss rate is greater than or equal to the first frame loss rate threshold, or the IO time ratio is greater than or equal to the first time ratio threshold, it means that the CPU load or IO load is high, that is, the system load is high , so it can be determined that the load level is heavy.

若系统丢帧率大于第二丢帧率阈值且小于第一丢帧率阈值,以及IO时间比率大于第二时间比率阈值且小于第一时间比率阈值,说明CPU负载适中且IO负载适中,即说明系统负载适中,因而可以确定负载等级为中。If the system frame loss rate is greater than the second frame loss rate threshold and less than the first frame loss rate threshold, and the IO time ratio is greater than the second time ratio threshold and less than the first time ratio threshold, it means that the CPU load is moderate and the IO load is moderate, that is, The system load is moderate, so it can be determined that the load level is medium.

若系统丢帧率小于或等于第二丢帧率阈值,或者IO时间比率小于或等于第二时间比率阈值,说明CPU负载较低或者IO负载较低,即说明系统负载较低,因而可以确定负载等级为轻。If the system frame loss rate is less than or equal to the second frame loss rate threshold, or the IO time ratio is less than or equal to the second time ratio threshold, it means that the CPU load or IO load is low, which means that the system load is low, so the load can be determined The grade is light.

步骤604:电子设备根据该用户场景、该电源状态和该系统负载,确定调度策略。Step 604: The electronic device determines a scheduling policy according to the user scenario, the power state and the system load.

该调度策略用于对电子设备进行资源调度,具体用于对底层硬件资源进行调度。该调度策略包含对电子设备当前状态合理的调优参数。该调度策略可以被下发给调度引擎,以供调度引擎基于该调度策略实现对底层硬件资源的调度。The scheduling policy is used to schedule resources of electronic devices, and is specifically used to schedule underlying hardware resources. The scheduling strategy contains tuning parameters that are reasonable for the current state of the electronic equipment. The scheduling policy can be delivered to the scheduling engine, so that the scheduling engine can schedule the underlying hardware resources based on the scheduling policy.

本申请实施例中,可以在电子设备的运行过程中持续确定电子设备当前所处的用户场景、电子设备的电源状态和系统负载,也即,可以动态识别用户场景、电源状态和系统负载,并根据该用户场景、该电源状态和该系统负载的变化动态确定调度策略,据此进行资源的动态调优。如此,可以准确实现对电子设备的资源的合理分配,从而可以在满足用户需求,且兼顾电子设备本身的系统需求的情况下,降低电子设备的能耗,提升电子设备的续航能力,进而保证电子设备的稳定运行。In the embodiment of the present application, the current user scene, power state and system load of the electronic device can be continuously determined during the operation of the electronic device, that is, the user scene, power state and system load can be dynamically identified, and According to the change of the user scenario, the power state and the system load, the scheduling strategy is dynamically determined, and resources are dynamically optimized accordingly. In this way, the resource allocation of electronic equipment can be accurately realized, so that the energy consumption of electronic equipment can be reduced, the battery life of electronic equipment can be improved, and the electronic equipment can be guaranteed stable operation of the equipment.

具体地,步骤604的操作可以为:电子设备获取该用户场景对应的第一关键值,且获取该电源状态对应的第二关键值,以及获取该系统负载对应的第三关键值,然后根据第一关键值、第二关键值和第三关键值,确定目标关键值,之后获取目标关键值对应的策略作为调度策略。Specifically, the operation of step 604 may be as follows: the electronic device obtains the first key value corresponding to the user scenario, obtains the second key value corresponding to the power state, and obtains the third key value corresponding to the system load, and then according to the first key value The first key value, the second key value, and the third key value determine the target key value, and then obtain the policy corresponding to the target key value as a scheduling policy.

可选地,电子设备中可以预先设置有用户场景与关键值(也可称为key值)之间的对应关系,该对应关系可以是技术人员根据使用需求预先设置的,其中包括有各种用户场景对应的关键值。电子设备可以从该对应关系中获取该用户场景对应的关键值作为第一关键值。Optionally, the corresponding relationship between user scenarios and key values (also referred to as key values) may be preset in the electronic device, and the corresponding relationship may be preset by technicians according to usage requirements, including various user The key value corresponding to the scene. The electronic device may acquire the key value corresponding to the user scenario from the correspondence relationship as the first key value.

可选地,电子设备中可以预先设置有电源状态与关键值之间的对应关系,该对应关系可以是技术人员根据使用需求预先设置的,其中包括有各种电源状态对应的关键值。电子设备可以从该对应关系中获取该电源状态对应的关键值作为第二关键值。Optionally, the electronic device may be preset with a correspondence between power states and key values. The correspondence may be preset by technicians according to usage requirements, including key values corresponding to various power states. The electronic device may acquire the key value corresponding to the power state from the correspondence relationship as the second key value.

作为一种示例,在电源状态包括电源模式和电源计划的情况下,电源状态与关键值之间的对应关系可以包括两个对应关系,其中一个对应关系是电源模式与关键值之间的对应关系,另一个对应关系是电源计划与关键值之间的对应关系。这种情况下,电子设备可以从电源模式与关键值之间的对应关系中,获取该电源状态中的电源模式对应的关键值,然后从电源计划与关键值之间的对应关系中,获取该电源状态中的电源计划对应的关键值,然后将该电源模式对应的关键值与该电源计划对应的关键值进行拼接,得到第二关键值。As an example, in the case that the power state includes a power mode and a power plan, the correspondence between the power state and the key value may include two correspondences, one of which is the correspondence between the power mode and the key value , another correspondence is the correspondence between a power plan and a key figure. In this case, the electronic device can obtain the key value corresponding to the power mode in the power state from the correspondence between the power mode and the key value, and then obtain the key value from the correspondence between the power plan and the key value. The key value corresponding to the power plan in the power state, and then splicing the key value corresponding to the power mode and the key value corresponding to the power plan to obtain a second key value.

可选地,电子设备中可以预先设置有系统负载(如负载等级)与关键值之间的对应关系,该对应关系可以是技术人员根据使用需求预先设置的,其中包括有各种系统负载对应的关键值。电子设备可以从该对应关系中获取该系统负载对应的关键值作为第三关键值。Optionally, the corresponding relationship between system loads (such as load levels) and key values can be preset in the electronic equipment. The corresponding relationship can be preset by technicians according to usage requirements, including various system loads key value. The electronic device may acquire the key value corresponding to the system load from the correspondence relationship as the third key value.

可选地,电子设备根据第一关键值、第二关键值和第三关键值,确定目标关键值时,可以将第一关键值、第二关键值和第三关键值进行拼接,得到目标关键值。示例地,可以按照预设的拼接方式将第一关键值、第二关键值和第三关键值进行拼接,比如,可以将第二关键值拼接在第一关键值的末尾,再将第三关键值拼接在第二关键值的末尾,以得到目标关键值。Optionally, when the electronic device determines the target key value based on the first key value, the second key value, and the third key value, the first key value, the second key value, and the third key value can be spliced together to obtain the target key value value. For example, the first key value, the second key value and the third key value can be spliced according to the preset splicing method, for example, the second key value can be spliced at the end of the first key value, and then the third key value value is concatenated at the end of the second key value to obtain the target key value.

可选地,电子设备中可以预先设置有关键值与调度策略之间的对应关系,该对应关系可以是技术人员根据使用需求预先设置的,其中包括有各个关键值对应的调度策略。电子设备可以从该对应关系中获取目标关键值对应的调度策略。之后,电子设备就可以使用获取到的调度策略对电子设备进行资源调度。Optionally, the electronic device may be preset with a corresponding relationship between key values and scheduling policies. The corresponding relationship may be preset by technicians according to usage requirements, including scheduling policies corresponding to each key value. The electronic device can obtain the scheduling policy corresponding to the target key value from the corresponding relationship. Afterwards, the electronic device can use the obtained scheduling policy to perform resource scheduling on the electronic device.

值得注意的是,在用户场景、电源状态、系统负载中的任意一项或多项发生变化时,电子设备都需要重新根据这三者确定调度策略。具体来讲,需要重新执行步骤604,以根据最新的用户场景、电源状态和系统负载确定调度策略,也即,需要重新确定这三者对应的关键值,并将这三者对应的关键值拼接得到目标关键值,并据此重新确定调度策略。如此,可以保证确定出的调度策略能够适应电子设备的最新状态,从而根据该调度策略就可以准确实现对电子设备的资源的合理分配。It is worth noting that when any one or more of the user scenario, power state, and system load changes, the electronic device needs to re-determine the scheduling strategy based on these three. Specifically, step 604 needs to be re-executed to determine the scheduling strategy based on the latest user scenario, power supply status, and system load, that is, it is necessary to re-determine the key values corresponding to the three, and splicing the key values corresponding to the three Get the target key value, and re-determine the scheduling strategy accordingly. In this way, it can be ensured that the determined scheduling strategy can adapt to the latest state of the electronic device, so that the resource allocation of the electronic device can be accurately and reasonably allocated according to the scheduling strategy.

下面以图9为例来对上述步骤604中确定调度策略的过程进行示例性说明。The following takes FIG. 9 as an example to illustrate the process of determining the scheduling policy in step 604 above.

图9是本申请实施例提供的一种确定调度策略的示意图。FIG. 9 is a schematic diagram of determining a scheduling policy provided by an embodiment of the present application.

参见图9,在用户场景、电源状态、系统负载中的任意一项或多项发生变化时,电子设备可以根据这三者重新确定调度策略,即重新获取这三者对应的关键值,并将这三者对应的关键值拼接得到目标关键值,并据此重新确定调度策略。特别地,由于电源状态、系统负载的变化可能会影响后台程序运行状态的变更,因此若在用户场景未变化的情况下发生了电源状态或系统负载的变化,则可以重新确定子场景,如果子场景发生了变更,则可以重新确定用户场景,之后,再重新获取用户场景、电源状态和系统负载对应的关键值,将这三者对应的关键值拼接得到目标关键值,并据此重新确定调度策略。其中,在用户场景未变化时发生了电源状态或系统负载的变化的情况下,重新确定子场景时可以使用上述步骤601中确定用户场景的过程中用于确定子场景的代码来确定,如此,可以实现代码复用,降低处理压力。Referring to Figure 9, when any one or more of the user scenario, power state, and system load changes, the electronic device can re-determine the scheduling strategy based on these three, that is, reacquire the key values corresponding to the three, and The key values corresponding to the three are spliced to obtain the target key value, and the scheduling strategy is re-determined accordingly. In particular, since changes in the power state and system load may affect changes in the running state of the background program, if the power state or system load changes without changing the user scene, the sub-scene can be re-determined, if the sub-scene If the scene changes, the user scene can be re-determined, and then the key values corresponding to the user scene, power state, and system load can be obtained again, and the key values corresponding to the three can be spliced to obtain the target key value, and the scheduling can be re-determined based on this Strategy. Wherein, when the power state or system load changes when the user scene does not change, the sub-scene can be re-determined by using the code used to determine the sub-scene in the process of determining the user scene in step 601 above, so, Code reuse can be realized and processing pressure can be reduced.

在本申请实施例中,确定电子设备当前所处的用户场景,以及确定电子设备的电源状态和系统负载。之后,获取用户场景对应的第一关键值,获取电源状态对应的第二关键值,获取系统负载对应的第三关键值,根据第一关键值、第二关键值和第三关键值,确定目标关键值。在关键值与调度策略之间的对应关系中,获取目标关键值对应的调度策略。本申请实施例中确定调度策略时的参考因素比较全面,因而后续基于该调度策略对电子设备所进行的资源调度可以准确实现对电子设备的资源的合理分配,从而不仅能满足用户需求,还可以兼顾电子设备本身的系统需求,进而可以在降低电子设备的能耗,提升电子设备的续航能力的情况下,保证电子设备的稳定运行。并且,本申请实施例中将各种参考因素转换为对应的关键值,然后根据关键值直接获取对应的调度策略,操作过程简单,可以降低系统处理压力,进一步保证电子设备的稳定运行。In the embodiment of the present application, the current user scene of the electronic device is determined, and the power state and system load of the electronic device are determined. Afterwards, obtain the first key value corresponding to the user scenario, obtain the second key value corresponding to the power state, obtain the third key value corresponding to the system load, and determine the target according to the first key value, the second key value and the third key value key value. In the corresponding relationship between the key value and the scheduling policy, the scheduling policy corresponding to the target key value is obtained. In the embodiment of the present application, the reference factors when determining the scheduling strategy are relatively comprehensive, so the subsequent resource scheduling of electronic devices based on the scheduling strategy can accurately realize the reasonable allocation of resources for electronic devices, so as to not only meet user needs, but also Taking into account the system requirements of the electronic equipment itself, it is possible to ensure the stable operation of the electronic equipment while reducing the energy consumption of the electronic equipment and improving the battery life of the electronic equipment. Moreover, in the embodiment of the present application, various reference factors are converted into corresponding key values, and then the corresponding scheduling strategy is directly obtained according to the key values. The operation process is simple, which can reduce system processing pressure and further ensure the stable operation of electronic equipment.

图10是本申请实施例提供的一种调度策略确定装置的结构示意图,该装置可以由软件、硬件或者两者的结合实现成为计算机设备的部分或者全部,该计算机设备可以为上文图1实施例所述的电子设备100。参见图10,该装置包括:第一确定模块1001、第一获取模块1002、第二确定模块1003和第二获取模块1004。Fig. 10 is a schematic structural diagram of an apparatus for determining a scheduling strategy provided by an embodiment of the present application. This apparatus can be implemented by software, hardware, or a combination of the two to become part or all of a computer device. The computer device can be implemented as shown in Fig. 1 above. The electronic device 100 described as an example. Referring to FIG. 10 , the device includes: a first determination module 1001 , a first acquisition module 1002 , a second determination module 1003 and a second acquisition module 1004 .

第一确定模块1001,用于确定电子设备当前所处的用户场景,以及确定电子设备的电源状态和系统负载;The first determining module 1001 is configured to determine the current user scene of the electronic device, and determine the power state and system load of the electronic device;

第一获取模块1002,用于获取用户场景对应的第一关键值,获取电源状态对应的第二关键值,以及获取系统负载对应的第三关键值;The first acquiring module 1002 is configured to acquire a first key value corresponding to a user scenario, acquire a second key value corresponding to a power state, and acquire a third key value corresponding to a system load;

第二确定模块1003,用于根据第一关键值、第二关键值和第三关键值,确定目标关键值;The second determining module 1003 is configured to determine the target key value according to the first key value, the second key value and the third key value;

第二获取模块1004,用于在关键值与调度策略之间的对应关系中,获取目标关键值对应的调度策略,调度策略用于对电子设备进行资源调度。The second acquiring module 1004 is configured to acquire a scheduling policy corresponding to the target key value in the corresponding relationship between the key value and the scheduling policy, and the scheduling policy is used for resource scheduling of the electronic device.

可选地,第一确定模块1001用于:Optionally, the first determination module 1001 is used for:

获取电子设备的应用运行信息,应用运行信息包括焦点应用信息,焦点应用信息包括焦点应用的应用类型和应用运行状态;Obtain application running information of the electronic device, where the application running information includes focus application information, and the focus application information includes the application type and application running status of the focus application;

根据应用运行信息确定用户场景。Determine user scenarios based on application running information.

可选地,第一确定模块1001用于:Optionally, the first determination module 1001 is used for:

根据焦点应用信息中的应用类型确定主场景;Determine the main scene according to the application type in the focus application information;

根据主场景、焦点应用信息中的应用运行状态、非焦点应用信息和后台应用信息,确定至少一个子场景;Determine at least one sub-scene according to the main scene, the application running state in the focus application information, the non-focus application information and the background application information;

从至少一个子场景中选择优先级最高的一个子场景,主场景和一个子场景为用户场景。A sub-scene with the highest priority is selected from at least one sub-scene, and the main scene and one sub-scene are user scenes.

可选地,该装置还包括:Optionally, the device also includes:

检测模块,用于检测系统工作状态;The detection module is used to detect the working state of the system;

第一确定模块1001用于:The first determining module 1001 is used for:

若系统工作状态变更为空闲状态,则在应用运行信息指示应用均处于用户未使用的状态时,确定用户场景为空闲场景。If the system working state is changed to the idle state, when the application running information indicates that the applications are not in use by the user, it is determined that the user scene is an idle scene.

可选地,第一确定模块1001用于:Optionally, the first determining module 1001 is used for:

获取IO负载信息;Obtain IO load information;

根据应用运行信息和IO负载信息,确定用户场景。Determine the user scenario based on application running information and IO load information.

可选地,电源状态包括电源模式和电源计划,第一确定模块1001用于:Optionally, the power state includes a power mode and a power plan, and the first determining module 1001 is used for:

若检测到电源模式变化事件和电源计划变化事件,则根据电源模式变化事件和电源计划变化事件确定电源状态。If the power mode change event and the power plan change event are detected, the power state is determined according to the power mode change event and the power plan change event.

可选地,第二确定模块1003用于:Optionally, the second determination module 1003 is used for:

将第一关键值、第二关键值和第三关键值进行拼接,得到目标关键值。The first key value, the second key value and the third key value are spliced together to obtain the target key value.

可选地,该装置还包括:Optionally, the device also includes:

触发模块,用于若用户场景、电源状态、系统负载中的任意一项或多项发生变化,则触发第一获取模块1002获取用户场景对应的第一关键值,获取电源状态对应的第二关键值,以及获取系统负载对应的第三关键值。The trigger module is used to trigger the first acquisition module 1002 to acquire the first key value corresponding to the user scene and the second key value corresponding to the power state if any one or more of the user scene, power state, and system load changes. value, and obtain the third key value corresponding to the system load.

在本申请实施例中,确定电子设备当前所处的用户场景,以及确定电子设备的电源状态和系统负载。之后,获取用户场景对应的第一关键值,获取电源状态对应的第二关键值,获取系统负载对应的第三关键值,根据第一关键值、第二关键值和第三关键值,确定目标关键值。在关键值与调度策略之间的对应关系中,获取目标关键值对应的调度策略。本申请实施例中确定调度策略时的参考因素比较全面,因而后续基于该调度策略对电子设备所进行的资源调度可以准确实现对电子设备的资源的合理分配,从而不仅能满足用户需求,还可以兼顾电子设备本身的系统需求,进而可以在降低电子设备的能耗,提升电子设备的续航能力的情况下,保证电子设备的稳定运行。并且,本申请实施例中将各种参考因素转换为对应的关键值,然后根据关键值直接获取对应的调度策略,操作过程简单,可以降低系统处理压力,进一步保证电子设备的稳定运行。In the embodiment of the present application, the current user scene of the electronic device is determined, and the power state and system load of the electronic device are determined. Afterwards, obtain the first key value corresponding to the user scenario, obtain the second key value corresponding to the power state, obtain the third key value corresponding to the system load, and determine the target according to the first key value, the second key value and the third key value key value. In the corresponding relationship between the key value and the scheduling policy, the scheduling policy corresponding to the target key value is obtained. In the embodiment of the present application, the reference factors when determining the scheduling strategy are relatively comprehensive, so the subsequent resource scheduling of electronic devices based on the scheduling strategy can accurately realize the reasonable allocation of resources for electronic devices, so as to not only meet user needs, but also Taking into account the system requirements of the electronic equipment itself, it is possible to ensure the stable operation of the electronic equipment while reducing the energy consumption of the electronic equipment and improving the battery life of the electronic equipment. Moreover, in the embodiment of the present application, various reference factors are converted into corresponding key values, and then the corresponding scheduling strategy is directly obtained according to the key values. The operation process is simple, which can reduce system processing pressure and further ensure the stable operation of electronic equipment.

需要说明的是:上述实施例提供的调度策略确定装置在确定调度策略时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。It should be noted that: when the scheduling policy determination device provided in the above embodiment determines the scheduling policy, it only uses the division of the above-mentioned functional modules as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs. , that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

上述实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请实施例的保护范围。The functional units and modules in the above-mentioned embodiments can be integrated into one processing unit, or each unit can exist separately physically, or two or more units can be integrated into one unit, and the above-mentioned integrated units can use hardware It can also be implemented in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.

上述实施例提供的调度策略确定装置与调度策略确定方法实施例属于同一构思,上述实施例中单元、模块的具体工作过程及带来的技术效果,可参见方法实施例部分,此处不再赘述。The dispatching policy determination device provided by the above-mentioned embodiment and the embodiment of the dispatching policy determination method belong to the same concept. For the specific working process and technical effects of the units and modules in the above-mentioned embodiment, please refer to the method embodiment, and will not repeat them here. .

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,比如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(比如:同轴电缆、光纤、数据用户线(Digital Subscriber Line,DSL))或无线(比如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(比如:软盘、硬盘、磁带)、光介质(比如:数字通用光盘(Digital Versatile Disc,DVD))或半导体介质(比如:固态硬盘(Solid State Disk,SSD))等。In the above embodiments, all or part may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be accessed from a website, computer, server, or data center Transmission to another website site, computer, server or data center by wired (such as: coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as: infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or may be a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital versatile disc (Digital Versatile Disc, DVD)) or a semiconductor medium (such as a solid state disk (Solid State Disk, SSD)) wait.

以上所述为本申请提供的可选实施例,并不用以限制本申请,凡在本申请的揭露的技术范围之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above-mentioned optional embodiments provided by the application are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the technical scope of the disclosure of the application shall be included in the scope of the application. within the scope of protection.

Claims (11)

1.一种调度策略确定方法,其特征在于,所述方法包括:1. A scheduling strategy determination method, characterized in that the method comprises: 确定电子设备当前所处的用户场景,以及确定所述电子设备的电源状态和系统负载;Determine the current user scenario of the electronic device, and determine the power state and system load of the electronic device; 获取所述用户场景对应的第一关键值,获取所述电源状态对应的第二关键值,以及获取所述系统负载对应的第三关键值;Obtain a first key value corresponding to the user scenario, obtain a second key value corresponding to the power state, and obtain a third key value corresponding to the system load; 根据所述第一关键值、所述第二关键值和所述第三关键值,确定目标关键值;determining a target key value according to the first key value, the second key value, and the third key value; 在关键值与调度策略之间的对应关系中,获取所述目标关键值对应的调度策略,所述调度策略用于对所述电子设备进行资源调度。In the corresponding relationship between the key value and the scheduling policy, the scheduling policy corresponding to the target key value is acquired, and the scheduling policy is used to perform resource scheduling on the electronic device. 2.如权利要求1所述的方法,其特征在于,所述确定电子设备当前所处的用户场景,包括:2. The method according to claim 1, wherein the determining the current user scene of the electronic device comprises: 获取所述电子设备的应用运行信息,所述应用运行信息包括焦点应用信息,所述焦点应用信息包括焦点应用的应用类型和应用运行状态;Acquire application running information of the electronic device, where the application running information includes focus application information, and the focus application information includes an application type and an application running state of the focus application; 根据所述应用运行信息确定所述用户场景。The user scenario is determined according to the application running information. 3.如权利要求2所述的方法,其特征在于,所述应用运行信息还包括非焦点应用信息和后台应用信息,所述根据所述应用运行信息确定所述用户场景,包括:3. The method according to claim 2, wherein the application running information further includes non-focus application information and background application information, and determining the user scenario according to the application running information comprises: 根据所述焦点应用信息中的应用类型确定主场景;determining the main scene according to the application type in the focus application information; 根据所述主场景、所述焦点应用信息中的应用运行状态、所述非焦点应用信息和所述后台应用信息,确定至少一个子场景;Determine at least one sub-scene according to the main scene, the application running state in the focus application information, the non-focus application information, and the background application information; 从所述至少一个子场景中选择优先级最高的一个子场景,所述主场景和所述一个子场景为所述用户场景。Selecting a sub-scene with the highest priority from the at least one sub-scene, the main scene and the one sub-scene being the user scene. 4.如权利要求2所述的方法,其特征在于,所述方法还包括:4. The method of claim 2, further comprising: 检测系统工作状态;Check the working status of the system; 所述根据所述应用运行信息确定所述用户场景,包括:The determining the user scenario according to the application running information includes: 若所述系统工作状态变更为空闲状态,则在所述应用运行信息指示应用均处于用户未使用的状态时,确定所述用户场景为空闲场景。If the system working state is changed to an idle state, when the application running information indicates that the applications are not in use by the user, the user scene is determined to be an idle scene. 5.如权利要求2所述的方法,其特征在于,所述根据所述应用运行信息确定所述用户场景,包括:5. The method according to claim 2, wherein the determining the user scenario according to the application running information comprises: 获取输入输出IO负载信息;Obtain input and output IO load information; 根据所述应用运行信息和所述IO负载信息,确定所述用户场景。Determine the user scenario according to the application running information and the IO load information. 6.如权利要求1-5任一所述的方法,其特征在于,所述电源状态包括电源模式和电源计划,所述确定所述电子设备的电源状态,包括:6. The method according to any one of claims 1-5, wherein the power state includes a power mode and a power plan, and determining the power state of the electronic device includes: 若检测到电源模式变化事件和电源计划变化事件,则根据所述电源模式变化事件和所述电源计划变化事件确定所述电源状态。If a power mode change event and a power plan change event are detected, the power state is determined according to the power mode change event and the power plan change event. 7.如权利要求1-6任一所述的方法,其特征在于,所述根据所述第一关键值、所述第二关键值和所述第三关键值,确定目标关键值,包括:7. The method according to any one of claims 1-6, wherein the determining the target key value according to the first key value, the second key value and the third key value comprises: 将所述第一关键值、所述第二关键值和所述第三关键值进行拼接,得到所述目标关键值。Splicing the first key value, the second key value and the third key value to obtain the target key value. 8.如权利要求1-7任一所述的方法,其特征在于,所述方法还包括:8. The method according to any one of claims 1-7, further comprising: 若所述用户场景、所述电源状态、所述系统负载中的任意一项或多项发生变化,则重新执行所述获取所述用户场景对应的第一关键值,获取所述电源状态对应的第二关键值,以及获取所述系统负载对应的第三关键值的步骤及后续步骤。If any one or more of the user scenario, the power state, and the system load changes, re-execute the obtaining of the first key value corresponding to the user scenario, and obtain the key value corresponding to the power state. The second key value, and the step of obtaining the third key value corresponding to the system load and subsequent steps. 9.一种调度策略确定装置,其特征在于,所述装置包括:9. A scheduling policy determination device, characterized in that the device comprises: 第一确定模块,用于确定电子设备当前所处的用户场景,以及确定所述电子设备的电源状态和系统负载;A first determining module, configured to determine the current user scene of the electronic device, and determine the power state and system load of the electronic device; 第一获取模块,用于获取所述用户场景对应的第一关键值,获取所述电源状态对应的第二关键值,以及获取所述系统负载对应的第三关键值;A first acquiring module, configured to acquire a first key value corresponding to the user scenario, acquire a second key value corresponding to the power state, and acquire a third key value corresponding to the system load; 第二确定模块,用于根据所述第一关键值、所述第二关键值和所述第三关键值,确定目标关键值;A second determining module, configured to determine a target key value according to the first key value, the second key value, and the third key value; 第二获取模块,用于在关键值与调度策略之间的对应关系中,获取所述目标关键值对应的调度策略,所述调度策略用于对所述电子设备进行资源调度。The second obtaining module is configured to obtain a scheduling strategy corresponding to the target key value in the corresponding relationship between the key value and the scheduling strategy, and the scheduling strategy is used to perform resource scheduling on the electronic device. 10.一种计算机设备,其特征在于,所述计算机设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1-8任意一项所述的方法。10. A computer device, characterized in that the computer device comprises a memory, a processor, and a computer program stored in the memory and operable on the processor, the computer program being executed by the processor When realizing the method as described in any one of claims 1-8. 11.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行如权利要求1-8任意一项所述的方法。11. A computer-readable storage medium, characterized in that instructions are stored in the computer-readable storage medium, and when it is run on a computer, the computer executes the method according to any one of claims 1-8 .
CN202210735811.0A 2022-05-16 2022-06-27 Scheduling strategy determination method, device, equipment and storage medium Active CN116028207B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2022105293041 2022-05-16
CN202210529304 2022-05-16

Publications (2)

Publication Number Publication Date
CN116028207A true CN116028207A (en) 2023-04-28
CN116028207B CN116028207B (en) 2024-04-12

Family

ID=86071124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210735811.0A Active CN116028207B (en) 2022-05-16 2022-06-27 Scheduling strategy determination method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116028207B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117891617A (en) * 2024-03-15 2024-04-16 荣耀终端有限公司 Resource scheduling method, device, readable storage medium and chip system
CN118042263A (en) * 2024-01-10 2024-05-14 荣耀终端有限公司 Image acquisition method, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2845341A1 (en) * 2014-03-11 2015-09-11 Pierre Popovic A computer system, methods, apparatus for processing applications, dispensing workloads, monitor energy and sequence power to nonhierarchical multi-tier blade servers in data centers
CN105045367A (en) * 2015-01-16 2015-11-11 中国矿业大学 Android system equipment power consumption optimization method based on game load prediction
CN106412343A (en) * 2015-07-28 2017-02-15 中兴通讯股份有限公司 Power consumption control method and device and mobile terminal
CN109960395A (en) * 2018-10-15 2019-07-02 华为技术有限公司 Resource regulating method and computer equipment
CN113778663A (en) * 2021-07-28 2021-12-10 荣耀终端有限公司 Scheduling method of multi-core processor and electronic equipment
CN113906648A (en) * 2019-07-12 2022-01-07 华为技术有限公司 Power supply protection method and system with power supply protection function
CN114443256A (en) * 2022-04-07 2022-05-06 荣耀终端有限公司 Resource scheduling method and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101717365B1 (en) * 2015-08-07 2017-03-16 한국과학기술원 Portable electronic device for aging mitigating of power supply-connected batteries

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2845341A1 (en) * 2014-03-11 2015-09-11 Pierre Popovic A computer system, methods, apparatus for processing applications, dispensing workloads, monitor energy and sequence power to nonhierarchical multi-tier blade servers in data centers
CN105045367A (en) * 2015-01-16 2015-11-11 中国矿业大学 Android system equipment power consumption optimization method based on game load prediction
CN106412343A (en) * 2015-07-28 2017-02-15 中兴通讯股份有限公司 Power consumption control method and device and mobile terminal
CN109960395A (en) * 2018-10-15 2019-07-02 华为技术有限公司 Resource regulating method and computer equipment
CN113906648A (en) * 2019-07-12 2022-01-07 华为技术有限公司 Power supply protection method and system with power supply protection function
CN113778663A (en) * 2021-07-28 2021-12-10 荣耀终端有限公司 Scheduling method of multi-core processor and electronic equipment
CN114443256A (en) * 2022-04-07 2022-05-06 荣耀终端有限公司 Resource scheduling method and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118042263A (en) * 2024-01-10 2024-05-14 荣耀终端有限公司 Image acquisition method, electronic equipment and storage medium
CN117891617A (en) * 2024-03-15 2024-04-16 荣耀终端有限公司 Resource scheduling method, device, readable storage medium and chip system

Also Published As

Publication number Publication date
CN116028207B (en) 2024-04-12

Similar Documents

Publication Publication Date Title
CN114443256B (en) Resource scheduling method and electronic equipment
CN116028205B (en) Resource scheduling method and electronic equipment
JP2013542491A (en) Mobile device and method for publishing and managing a set of performance scaling algorithms
CN116028207A (en) Scheduling policy determination method, device, equipment and storage medium
CN116028210A (en) Resource scheduling method, electronic equipment and storage medium
CN117112191B (en) Information processing method and electronic device
CN116028211B (en) Display card scheduling method, electronic equipment and computer readable storage medium
CN117130454B (en) Power consumption adjustment method and electronic equipment
CN116027880B (en) Resource scheduling method and electronic device
CN116069209A (en) Focus window processing method, device, equipment and storage medium
CN116025580B (en) Method and electronic device for adjusting fan speed
CN116028208B (en) System load determining method, device, equipment and storage medium
CN117130772A (en) Resource scheduling method, electronic equipment and storage medium
CN116028005B (en) Audio session acquisition method, device, equipment and storage medium
CN116089055B (en) Resource scheduling method and device
CN116055443B (en) Method for identifying social scene, electronic equipment and computer readable storage medium
CN117130462B (en) Device control method and electronic device
CN116028209B (en) Resource scheduling method, electronic equipment and storage medium
CN117130460B (en) Method, device, server and storage medium for reducing power consumption
CN117112187B (en) Resource scheduling method and device
CN117270670B (en) Power consumption control method and electronic device
CN116028206A (en) Resource scheduling method, electronic device and storage medium
CN118828816A (en) Resource scheduling method and device
CN115878179A (en) Information processing method, information processing device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
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