CN116027880A - Resource scheduling method and electronic equipment - Google Patents

Resource scheduling method and electronic equipment Download PDF

Info

Publication number
CN116027880A
CN116027880A CN202210794204.1A CN202210794204A CN116027880A CN 116027880 A CN116027880 A CN 116027880A CN 202210794204 A CN202210794204 A CN 202210794204A CN 116027880 A CN116027880 A CN 116027880A
Authority
CN
China
Prior art keywords
scheduling
electronic device
electronic equipment
scene
strategy
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
CN202210794204.1A
Other languages
Chinese (zh)
Other versions
CN116027880B (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 CN116027880A publication Critical patent/CN116027880A/en
Application granted granted Critical
Publication of CN116027880B publication Critical patent/CN116027880B/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

Abstract

The embodiment of the application provides a resource scheduling method and electronic equipment, wherein the method is executed by the electronic equipment, and under the condition that a user scene corresponding to a service processed by the electronic equipment changes or state information of the electronic equipment changes, the method comprises the following steps: if the current state information of the electronic equipment does not meet the preset condition, determining a first scheduling strategy corresponding to the identification of the current user scene based on the first mapping; adjusting a first parameter according to a first scheduling strategy to adjust CPU power consumption; if the current state information of the electronic equipment meets the preset condition, determining a second scheduling strategy corresponding to the current state information based on the second mapping, and adjusting a second parameter according to the second scheduling strategy so as to reduce the CPU temperature or reduce the CPU power consumption. The method can enable the adjusted CPU running state to meet the actual requirements of the electronic equipment to a large extent, and the situation that scheduling strategies conflict does not exist.

Description

Resource scheduling method and electronic equipment
The present application claims priority from the national intellectual property agency, application number 202210529209.1, application name "resource scheduling method and electronic device" filed on day 16 of month 2022, the entire contents of which are incorporated herein by reference.
Technical Field
The application relates to the technical field of electronics, in particular to a resource scheduling method and electronic equipment.
Background
With the continuous development of electronic technology, the types of electronic devices are more and more, and the types of the central processing unit (central processing unit, CPU) chip platforms used by the electronic devices are different, so that the ways of adjusting the performance and the power consumption of the CPU are also various.
For example, the current more popular CPU chip platforms include
Figure BDA0003734948880000011
Is a CPU of (2); for->
Figure BDA0003734948880000012
More of which employ dynamic tuning techniques (dynamic turning technology, DTT) to adjust the performance and power consumption of the CPU, the adjustment process typically dynamically adjusts parameters associated with the CPU power consumption according to the CPU's load variation to achieve a balance of CPU performance and power consumption.
However, the above conventional techniques cannot meet the actual requirements of the electronic device to some extent in view of the complexity of the user's scenario when the user uses the electronic device.
Disclosure of Invention
The application provides a resource scheduling method and electronic equipment, which can enable the adjusted CPU running state to meet the actual requirements of the electronic equipment to a large extent.
In a first aspect, the present application provides a resource scheduling method, where the method is executed by an electronic device, and when a user scenario corresponding to a service processed by the electronic device changes or status information of the electronic device changes, the method includes:
If the current state information of the electronic equipment does not meet the preset condition, determining a first scheduling strategy corresponding to the identification of the current user scene based on the first mapping;
adjusting a first parameter according to a first scheduling strategy to adjust CPU power consumption;
if the current state information of the electronic equipment meets the preset condition, determining a second scheduling strategy corresponding to the current state information based on a second mapping;
and adjusting a second parameter according to a second scheduling strategy to reduce the CPU temperature or reduce the CPU power consumption.
The current state information of the electronic equipment meets the preset condition to represent that the working state of the electronic equipment reaches the early warning state. The first mapping may be a correspondence between identifications of a plurality of user scenarios and a plurality of first scheduling policies, and the second mapping may be a correspondence between a plurality of state information and a plurality of second scheduling policies. The first parameter may be a parameter related to CPU power consumption, such as PL1, PL2, or EPP. The second parameter may also be a parameter related to CPU power consumption, for example, a parameter for adjusting the current state of the electronic device, such as a parameter for adjusting the temperature of the CPU (fan rotation speed, etc.), a parameter for adjusting the battery power consumption speed (PL 1, PL2, etc.).
It will be appreciated that when a user scenario in which an electronic device is located changes, it is often necessary for the electronic device to change the scheduling policy, or when status information of the electronic device changes, it is also often necessary for the electronic device to change the scheduling policy. Therefore, under the condition that the scene of the user is changed or the state information is changed, the electronic equipment can judge whether the current state information meets the preset condition (also can be marked as the first condition) or not, and the preset condition characterizes the working state of the electronic equipment to reach the early warning state. If the current state information of the electronic equipment meets the preset conditions, the working state of the electronic equipment is indicated to reach the early warning state, and the early warning state needs to be eliminated preferentially at the moment, so that the user scene of the electronic equipment can be temporarily ignored; then the electronic device may adjust a parameter associated with CPU power consumption (i.e., a second parameter) according to a second scheduling policy corresponding to the current state information.
If the current state information of the electronic device does not meet the preset condition, it is indicated that the working state of the electronic device does not reach the early warning state yet, then the early warning state does not need to be eliminated, the user scene of the electronic device can be considered preferentially, and then the electronic device can adjust parameters (i.e. first parameters) related to the CPU power consumption according to a first scheduling policy corresponding to the user scene.
In the implementation manner, the electronic device can determine which scheduling strategy is adopted to adjust the parameters related to the CPU power consumption according to the current state information, so that the adjusted CPU running state meets the actual requirement of the electronic device to a greater extent, and the situation that the scheduling strategies are in conflict does not exist.
With reference to the first aspect, in some implementations of the first aspect, the current state information of the electronic device includes at least one of a power mode, a CPU temperature, and a battery level of the electronic device.
Alternatively, the power mode and battery state information may be obtained from information acquired by a power state probe in the electronic device, and the CPU temperature may be obtained from a thermistor placed around the CPU.
With reference to the first aspect, in some implementations of the first aspect, the preset condition includes at least one of a power mode of the electronic device being a first mode, a CPU temperature being higher than a temperature threshold, and a battery level being lower than a power threshold.
With reference to the first aspect, in some implementations of the first aspect, if the current state information of the electronic device meets a preset condition, determining, based on a second mapping, a second scheduling policy corresponding to the current state information includes: and if the current power mode of the electronic device is the first mode, or the current CPU temperature is higher than a temperature threshold, or the current battery level is lower than a battery level threshold, determining a second scheduling strategy based on the second mapping.
With reference to the first aspect, in some implementations of the first aspect, if the current state information of the electronic device does not meet the preset condition, determining, based on the first mapping, a first scheduling policy corresponding to the current user scenario includes: if the current power mode of the electronic device is not the first mode, the current CPU temperature is lower than or equal to the temperature threshold, and the current battery power is higher than or equal to the power threshold, a first scheduling policy is determined based on the first mapping.
That is, when any one of the above preset conditions is satisfied, that is, the current state information of the electronic device satisfies the preset condition, the second scheduling policy is determined. And when all the preset conditions are not met, namely the current state information of the electronic equipment does not meet the preset conditions, determining a first scheduling strategy.
With reference to the first aspect, in some implementations of the first aspect, adjusting the first parameter according to the first scheduling policy includes: determining a DTT strategy number of the dynamic tuning technology according to strategy parameters corresponding to the first scheduling strategy; and adjusting the first parameter according to the DTT strategy number.
Wherein, because the CPU chip platforms in the electronic device are not of the same type, the first scheduling policy determined by the electronic device may not be recognized by all CPU chip platforms. Therefore, for some CPU chip platforms, for example, intel platforms, the first scheduling policy needs to be translated to obtain a corresponding DTT policy number, and then parameters related to CPU power consumption are adjusted according to the policy corresponding to the DTT policy number; thereby, the applicability of the first scheduling policy can be improved.
It should be noted that, according to the policy parameters corresponding to the first scheduling policy, the process of determining the DTT policy number may also be performed after detecting that the user scene corresponding to the service processed by the electronic device changes. After detecting that the user scene corresponding to the service processed by the electronic equipment changes, the electronic equipment can determine a first scheduling strategy according to the identification of the current user scene, and determine a DTT strategy number according to the strategy parameters corresponding to the first scheduling strategy.
With reference to the first aspect, in some implementations of the first aspect, the DTT policy number is different from a DTT policy number used by a user scene before the change occurs.
The electronic device selects which scheduling policy to use to adjust the CPU power consumption parameter under the condition that the user scene changes, and when the user scene is different, the corresponding first scheduling policy is different, and then the DTT policy numbers translated according to the first scheduling policy are different.
In one implementation manner, the electronic device may acquire current state information of the electronic device when determining that the DTT policy number is different from the DTT policy number used in the user scene before the change occurs, so as to determine whether the current state information meets the preset condition.
With reference to the first aspect, in some implementations of the first aspect, determining, based on the first mapping, a first scheduling policy corresponding to an identifier of a current user scenario includes: determining a third scheduling strategy according to the identification of the current user scene and the first mapping, wherein the third scheduling strategy comprises at least one strategy parameter in first long-time Rui frequency power consumption PL1, first short-time Rui frequency power consumption PL2 and first energy efficiency ratio EPP of the CPU; determining a first scheduling policy according to a third scheduling policy, an identification of a current user scene and a current system load of the electronic equipment, wherein the first scheduling policy comprises at least one policy parameter of a second PL1, a second PL2 and a second EPP of the CPU, and the second PL1 is larger than the first PL1, the second PL2 is larger than the second PL2 and the second EPP is smaller than the first EPP under the condition that the system load is larger than a preset first value.
When determining the first scheduling policy, the electronic device may first find and determine a base scheduling policy (i.e., a third scheduling policy) in the first mapping according to the identifier of the current user scenario, and then fine-tune the base scheduling policy according to the current system load, for example, when the load increases, PL1 and PL2 are increased appropriately, and EPP is reduced, so that performance and power consumption of the electronic device may be balanced better.
With reference to the first aspect, in some implementations of the first aspect, the method further includes: acquiring process information and first information of a first process corresponding to a first window currently displayed by electronic equipment, wherein the first information comprises at least one of the following information: GPU occupation information, peripheral event information or power mode information of the first process; and determining the identification of the current user scene according to the process information of the first process and the first information.
In this implementation manner, the electronic device may determine, through the process information and the first information of the current display window, the identifier of the current user scene. For example, if the type of the first process is a video class, the GPU occupancy rate of the first process is greater than 0, and the GPU engine is a GPU video process engine, and it is determined that the user scene where the electronic device is located is a video playing scene. It will be appreciated that if the type of first process is a video class, it may be determined first that the user is currently using a video class application. If the GPU occupancy rate of the first process is greater than 0, the condition that resources occupying the GPU exist in the running process of the first process is indicated. If the GPU engine of the first process is a GPU video processing (video process) engine, then this indicates that the first process uses the GPU for decoding operations during execution. Therefore, the user can be determined to play the video by using the electronic equipment with high probability, namely, the user scene where the electronic equipment is located is a video playing scene.
If the type of the first process is a video type, the GPU occupancy rate of the first process is larger than 0, the GPU engine is a GPU3D engine, and the user scene where the electronic is located is determined to be a video browsing scene. Accordingly, if the GPU engine of the first process is a GPU3D engine, it indicates that the first process uses only the GPU to perform 2D or 3D rendering operation, and it can be inferred that the user is browsing video resources using the electronic device, but not playing video, that is, the user scene where the electronic device is located is a video browsing scene.
If the type of the first process is a game class, it may be determined that the user is currently using the game class application. If the GPU occupancy rate of the first process is greater than 0, the condition that resources occupying the GPU exist in the running process of the first process is indicated. If the GPU engine of the first process is a GPU3D engine, the first process is indicated to use the GPU to perform 2D or 3D rendering operation. Thus, the user can be determined to play the game by using the electronic equipment with high probability, namely, the user scene where the electronic equipment is located is a game scene.
With reference to the first aspect, in some implementations of the first aspect, the peripheral event information may include one or more of a keyboard input event, a mouse input event, a microphone input event, and a camera input event;
If the type of the first process is social, and a keyboard input event is detected, determining that the user scene where the electronic is located is a text chat scene. That is, if it is detected that the user is using the social application and typing at the same time, the user is chatting using the social application with a high probability, and it can be determined that the user scene where the electronic is located is a text chatting scene.
If the type of the first process is social, a microphone input event is detected, a camera input event is not detected, and the user scene where the electronic is located is determined to be a voice chat scene. That is, if it is detected that the user is using the social application and is inputting voice at the same time, the user is highly likely to use the social application to perform voice chat, and it can be determined that the user scene where the electronic device is located is a voice chat scene.
If the type of the first process is social, detecting a microphone input event and a camera input event, and determining that a user scene where the electronic device is located is a video chat scene. That is, if it is detected that the user is using the social application and is inputting video at the same time, the user is using the social application to conduct video chat with a high probability, and it can be determined that the user scene where the electronic is located is a video chat scene.
If the type of the first process is office type, and a keyboard input event is detected, determining that the user scene where the electronic device is located is a document editing scene. If the fact that the user is using the office application and typing is detected, the user is likely to edit the document by using the office application, and the user scene where the electronic device is located can be determined to be a document editing scene.
If the type of the first process is office type, detecting a mouse input event and not detecting a keyboard input event, and determining a user scene where the electronic device is located as a document browsing scene. That is, if it is detected that the user uses the mouse but does not use the keyboard in the process of using the office application, the user browses the document using the office application with a high probability, and it can be determined that the user scene where the electronic is located is a document browsing scene.
If the type of the first process is office type, detecting a microphone input event and a camera input event, and determining a user scene where the electronic device is located as a video conference scene. That is, if it is detected that the user uses the camera in the process of using the office application, the user performs the video conference using the office application with a high probability, and it can be determined that the user scene where the electronic device is located is a video conference scene. Thus, it is possible to determine which user scenario is currently in connection with the peripheral event information.
With reference to the first aspect, in some implementations of the first aspect, the electronic device includes a scene recognition engine, a dispatch engine, a BIOS, and an Intel DTT driver, where the method includes:
under the condition that a user scene corresponding to a service processed by the electronic equipment changes, the electronic equipment calls a scene recognition engine, and a policy parameter corresponding to a third scheduling policy is determined according to the identification of the current user scene and the first mapping;
the electronic equipment calls a scene recognition engine and sends the identification of the current user scene and the strategy parameters corresponding to the third dispatching strategy to the dispatching engine;
the electronic equipment calls a scheduling engine, and determines the strategy parameters corresponding to the first scheduling strategy according to the strategy parameters corresponding to the third scheduling strategy, the identification of the current user scene and the current system load of the electronic equipment;
the electronic equipment calls a scheduling engine to determine a DTT strategy number according to strategy parameters corresponding to the first scheduling strategy;
the electronic device calls a dispatch engine to send a DTT policy number to the BIOS;
the electronic equipment calls an Intel DTT driver, and acquires current state information of the electronic equipment under the condition that the DTT strategy number received by the BIOS is monitored to change;
the electronic equipment calls an Intel DTT driver and judges whether the current state information of the electronic equipment meets preset conditions or not;
If the preset condition is met, the electronic equipment calls an Intel DTT driver to determine a second scheduling strategy corresponding to the current state information according to the second mapping, and adjusts a second parameter according to the second scheduling strategy;
if the preset condition is not met, the electronic equipment calls an Intel DTT driver, and the first parameter is adjusted according to the DTT strategy number.
In the implementation manner, after the electronic device determines that the user scene where the electronic device is located changes, the electronic device can determine the corresponding scheduling policy by combining with the current user scene. And then the electronic equipment determines which scheduling strategy is adopted to adjust the performance and the power consumption of the CPU according to the current operation information, so that the adjusted CPU operation state meets the actual requirements of the electronic equipment to a greater extent.
In a second aspect, the present application provides an apparatus, which is included in an electronic device, and which has a function of implementing the electronic device behavior in the first aspect and possible implementations of the first aspect. The functions may be realized by hardware, or may be realized by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the functions described above. Such as a receiving module or unit, a processing module or unit, etc.
In a third aspect, the present application provides an electronic device, the electronic device comprising: a processor, a memory, and an interface; the processor, the memory and the interface cooperate with each other such that the electronic device performs any one of the methods of the technical solutions of the first aspect.
In a fourth aspect, the present application provides a chip comprising a processor. The processor is configured to read and execute a computer program stored in the memory to perform the method of the first aspect and any possible implementation thereof.
Optionally, the chip further comprises a memory, and the memory is connected with the processor through a circuit or a wire.
Further optionally, the chip further comprises a communication interface.
In a fifth aspect, the present application provides a computer readable storage medium, in which a computer program is stored, which when executed by a processor causes the processor to perform any one of the methods of the first aspect.
In a sixth aspect, the present application provides a computer program product comprising: computer program code which, when run on an electronic device, causes the electronic device to perform any one of the methods of the solutions of the first aspect.
Drawings
Fig. 1 is a schematic structural diagram of an example of an electronic device according to an embodiment of the present application;
FIG. 2 is a block diagram of a software architecture of an example electronic device according to an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating interactions between software modules in an electronic device according to an embodiment of the present application;
FIG. 4 is a schematic diagram of interactions between software modules in another electronic device according to an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating interactions between software modules in another electronic device according to an embodiment of the present disclosure;
FIG. 6 is a flowchart illustrating an example of a resource scheduling method according to an embodiment of the present disclosure;
fig. 7 is a signaling interaction schematic diagram of an example resource scheduling method provided in an embodiment of the present application;
fig. 8 is a signaling interaction schematic diagram of another example resource scheduling method provided in an embodiment of the present application;
FIG. 9 is an exemplary window change interface diagram provided in an embodiment of the present application;
fig. 10 is a schematic signaling interaction diagram of another example of a resource scheduling method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, "/" means or is meant unless otherwise indicated, for example, a/B may represent a or B; "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" means two or more than two.
The terms "first," "second," "third," and the like, are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first", "a second", or a third "may explicitly or implicitly include one or more such feature.
With the continuous development of electronic technology, the types of electronic devices, such as notebook computers, personal computers (personal computer, PC), ultra-mobile personal computers (UMPC), etc., are increasing, and the types of CPU chip platforms used by the electronic devices are also different. For example, the currently popular types of CPU chip platforms mainly include
Figure BDA0003734948880000061
CPU and +.>
Figure BDA0003734948880000062
The two types of CPUs also differ in the way they adjust performance and power consumption.
For the following
Figure BDA0003734948880000063
The CPU of the (2) is mainly used for adjusting the performance and the power consumption of the CPU by adopting a DTT technology, and generally, parameters related to the power consumption of the CPU are dynamically adjusted according to the load change of the CPU so as to optimize the system performance, the battery endurance time, the heat dissipation performance and the like of the electronic equipment and realize the balance of the performance and the power consumption of the CPU. However, in view of the complexity of the user scenario when the user uses the electronic device, for example, the user may have a video scenario, an office scenario, a conference scenario, a chat scenario, etc., the DTT technology described above may not meet the power consumption requirement of the electronic device in the actual user scenario to some extent.
In view of this problem, there are some conventional techniques that, when adjusting parameters related to CPU power consumption, integrate factors such as a current user scenario and a system load of an electronic device to adjust related parameters, so that an adjusted CPU running state meets an actual user scenario. However, in the case where the DTT technique and the conventional technique are present at the same time, there may be caused a problem that two different adjustment strategies overlap each other, or even collide with each other.
In view of this, the embodiment of the application provides a resource scheduling method, which can be applied to electronic devices such as notebook computers, PCs, UMPCs and the like, and the electronic devices can dynamically adjust the performance and power consumption of the CPU by comprehensively considering the user scene and the current state information of the electronic devices when the user uses the electronic devices, so that the adjusted running state of the CPU meets the actual demands of the electronic devices to a greater extent. It should be noted that, the embodiment of the present application does not limit the specific type of the electronic device.
For clarity and conciseness in the description of the embodiments below, a brief introduction to related concepts or technologies is first given:
a focus window (focus window) refers to a window having focus. The focus window is the only window that can receive keyboard input. The manner in which the focus window is determined is associated with the focus mode (focus mode) of the system. The top level window of the focus window is called an active window (active window). Only one window at a time may be an active window. The focus window is a window which is needed to be used by the user at present with high probability.
The focus mode may be used to determine how the mouse brings a window into focus. In general, the focus modes may include three types, respectively:
(1) Click-to-focus (click-to-focus) in this mode, the window that the mouse clicks on gets focus. I.e. when the mouse clicks on any position of a window where focus is available, the window is activated, placed in front of all windows and receives keyboard input. When the mouse clicks on other windows, the window loses focus.
(2) The focus follows the mouse (focus-mouse), in which mode a window under the mouse can acquire focus. I.e. when the mouse is moved to a range of windows where focus is available, the user does not need to click somewhere on the window to activate the window, receive keyboard input, but the window is not necessarily placed at the forefront of all windows. When the mouse moves out of the range of this window, this window will also lose focus.
(3) Grass-focus (slope focus), which is similar to focus-mouse comparison: when the mouse is moved to a window where focus is available, the user may activate the window without clicking somewhere on the window, receiving keyboard input, but the window is not necessarily positioned at the forefront of all windows. Unlike focus-focus, focus does not change when the mouse moves out of this window, but only when the mouse moves into another window that can receive focus.
A process includes multiple threads, which may create a window. The focus process is the process to which the thread that created the focus window belongs.
(4) The long-time power consumption (PL 1) refers to the power consumption of the CPU under normal load, which is equivalent to the thermal design power consumption, and the running power consumption of the CPU for most of the time does not exceed PL1.
(5) Short-time-with-frequency power consumption (PL 2), which refers to the highest power consumption that a CPU can reach in a short time, has a duration limit. Generally, PL2 is greater than PL1.
(6) The CPU energy efficiency ratio (energy performance preference, EPP) is used for reflecting the scheduling trend of the CPU, and the value range is 0-255. The smaller the CPU energy efficiency ratio, the higher the CPU tends to be; the higher the CPU energy efficiency ratio, the lower the CPU trend.
(7) Translation refers to converting a certain form of parameter or data to obtain another form of parameter or data, where the another form of parameter or data may be identified by a specified platform. For example, the electronic device may translate the obtained policy parameters to obtain parameters that the CPU chip platform can recognize.
On this basis, fig. 1 is an exemplary schematic structural diagram of an electronic device 100 according to an embodiment of the present application. As shown in fig. 1, the electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (universal serial bus, USB) interface 130, charge management module 140, power management module 141, battery 142, wireless communication module 150, display screen 160, etc.
It is to be understood that the structure illustrated in the present embodiment does not constitute a specific limitation on the electronic apparatus 100. In other embodiments, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, 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 reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an I2C interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulsecode modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a USB interface, among others.
It should be understood that the connection relationship between the modules illustrated in this embodiment is only illustrative, and does not limit the structure of the electronic device 100. In other embodiments, the electronic device 100 may also employ different interfaces in the above embodiments, or a combination of interfaces.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display screen 160, the wireless communication module 150, and the like. In some embodiments, the power management module 141 and the charge management module 140 may also be provided in the same device.
The wireless communication module 150 may provide solutions for wireless communication including WLAN (e.g., wi-Fi), bluetooth, global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., applied to the electronic device 100. For example, in the embodiment of the present application, the electronic device 100 may establish a bluetooth connection with a terminal device (such as the wireless headset 100) through the wireless communication module 150.
The wireless communication module 150 may be one or more devices that integrate at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via an antenna, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 150 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via an antenna.
The electronic device 100 implements display functions through a GPU, a display screen 160, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 160 and the application processor. The GPU is 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.
The display screen 160 is used to display images, videos, and the like. The display 160 includes a display panel.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may include a storage program area and a storage data area by executing instructions stored in the internal memory 121, and the internal memory 121 may include a storage program area and a storage data area.
The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention exemplifies a Windows system of a layered architecture, and illustrates a software structure of the electronic device 100.
Illustratively, fig. 2 is a software architecture block diagram of the electronic device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, windows systems are classified into a user mode and a kernel mode. The user mode comprises an application layer and a subsystem dynamic link library. The kernel mode is divided into a hardware layer, a firmware layer, a hardware abstraction layer (hardware abstraction layer, HAL), a kernel and a driving layer and an executing body from bottom to top.
As shown in FIG. 2, the application layer includes applications for music, video, games, office, social, etc. The application layer also includes an environment subsystem, a scene recognition engine, a scheduling engine, and the like. Wherein only a part of application programs are shown in the figure, the application layer can also comprise other application programs, such as shopping application, browser and the like, and the application is not limited. In one embodiment, the environment subsystem, scene recognition engine, and scheduling engine may be integrated in a PC manager application.
The environment subsystem may expose certain subsets of the basic executive services to the application in a particular modality, providing an execution environment for the application.
The scenario recognition engine may recognize a user scenario in which the electronic device 100 is located and determine a base scheduling policy (also referred to as a third scheduling policy) that matches the user scenario. The scheduling engine may obtain the load situation of the electronic device 100, and determine an actual scheduling policy (may also be referred to as a first scheduling policy) according to the actual operation situation of the electronic device 100 in combination with the load situation of the electronic device 100 and the basic scheduling policy. The specific contents of the scene recognition engine and the scheduling engine are described below, and are not described herein.
The subsystem dynamic link library comprises an API module comprising Windows API, windows native API, etc. The Windows APIs, which can provide system call entry and internal function support for the application program, are different in that they are Windows system native APIs. For example, windows APIs may include user. Dll, kernel. Dll, and Windows native APIs may include ntdll. The user. Dll is a Windows user interface, and can be used for performing operations such as creating a window, sending a message, and the like. kernel. Dll is used to provide an interface for applications to access the kernel. ntdll.dll is an important Windows NT kernel-level file that describes the interface of the Windows local NTAPI. When Windows is started, ntdll.dll resides in a particular write protect region of memory, which prevents other programs from occupying that memory region.
The executives include a process manager, a virtual memory manager, a secure reference monitor, an I/O manager, windows management specifications (Windows management instrumentation, WMI), a power manager, a system event driver (operating system event driver) node, a system and chip driver (operating system to system on chip, OS2 SOC) node, and the like.
The process manager is used to create and suspend 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 may execute a security policy on the local computer that protects operating system resources, performs protection and monitoring of runtime objects.
The I/O manager performs device independent input/output and further processes call the appropriate device drivers.
The power manager may manage power state changes for all devices that support power state changes.
The system event driven node may interact with the kernel and the driver layer, for example, with a graphics card driver, and after determining that a GPU video decoding event exists, report the GPU video decoding event to the scene recognition engine.
The system and chip driver nodes may be configured for the scheduler engine to send adjustment information to the hardware device, e.g., to send adjustment PL1 and PL2 information to the CPU.
The kernel and driver layer includes a kernel and a device driver.
The kernel is an abstraction of the processor architecture, separates the difference between the executable and the processor architecture, and ensures the portability of the system. The kernel may perform thread scheduling and scheduling, trap handling and exception scheduling, interrupt handling and scheduling, etc.
The device driver operates in kernel mode as an interface between the I/O system and the associated hardware. The device drivers may include graphics card drivers, intel DTT drivers, mouse drivers, audio video drivers, camera drivers, keyboard drivers, and the like. For example, the graphics driver may drive the GPU to run and the Intel DTT driver may drive the CPU to run.
The HAL is a core state module, which can hide various details related to hardware, such as an I/O interface, an interrupt controller, a multiprocessor communication mechanism and the like, provide uniform service interfaces for different hardware platforms running Windows, and realize portability on various hardware platforms. It should be noted that, in order to maintain portability of Windows, the Windows internal components and the device driver written by the user do not directly access the hardware, but rather by calling the routine in the HAL.
The firmware layer may include a basic input output system (basic input output system, BIOS), which is a set of programs that are cured into a Read Only Memory (ROM) chip on the motherboard of the computer, which holds the most important basic input output programs, post-boot self-test programs, and system self-start programs of the computer, which can read and write specific information of the system settings from the complementary metal oxide semiconductor (complementary metal oxide semiconductor, CMOS). Its main function is to provide the lowest, most direct hardware setup and control for the computer. For example, the Intel DTT driver may send instructions to the CPU via the BIOS. Optionally, the firmware layer may further include an embedded controller (embedded controller, EC) that may receive the parameters transferred by the hardware layer, perform corresponding processing, send the parameters to the BIOS, and transfer the parameters to the upper layer by the BIOS.
The hardware layer may include a GPU, CPU, mouse, microphone, camera, keyboard, etc. hardware structures.
It should be noted that, in the embodiments of the present application, only the Windows system is used as an example, and in other operating systems (such as an android system, an IOS system, etc.), the schemes of the present application can be implemented as long as the functions implemented by the respective functional modules are similar to those implemented by the embodiments of the present application.
Fig. 3 shows a schematic workflow diagram of the software and hardware of the electronic device 100 for scheduling resources.
As shown in fig. 3, the application layer scene recognition engine includes a system probe module, a scene recognition module, and a base 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 may send a request to the system probe module to obtain the probe status. The system probe module may acquire the operating state of the electronic device 100. For example, the system probe modules may include a power state probe, a peripheral state probe, a process load probe, an audio video state probe, a system load probe, a system event probe, and the like.
The power state probe may subscribe to a kernel state for a power state event, determine a power state according to a callback function fed back by the kernel state, where the power state includes a battery (remaining) power, a power mode, and the like, and the power mode may include an alternating current (alternating current, AC) power and a Direct Current (DC) power. For example, the power state probe may send a request to the oseeventdriver node of the executive layer to subscribe to a power state event, which is forwarded by the oseeventdriver node to the power manager of the executive layer. The power manager may feed back a callback function to the power state probe through the oseeventdriver node.
The peripheral state probe can subscribe a peripheral event to the kernel state, and the peripheral event is determined according to a callback function fed back by the kernel state. Peripheral events include mouse wheel slide events, mouse click events, keyboard input events, microphone input events, camera input events, and the like.
The process load probe may subscribe to the process load from kernel states and determine the load of the process (e.g., the first process) according to the callback function fed back from kernel states.
The system load probe can subscribe the system load to the kernel state, and the system load is determined according to a callback function fed back by the kernel state.
The audio and video status probe may subscribe to the kernel mode for audio and video events, and determine the audio and video events currently existing in the electronic device 100 according to the callback function fed back by the kernel mode. The audio video events may include GPU decoding events, and the like. For example, the audio/video status probe may send a request to the oseeventdriver node of the executive layer to subscribe to the GPU decoding event, and the oseeventdriver node forwards the request to the graphics card driver of the kernel and driver layer. The display card driver can monitor the state of the GPU, and after the GPU is monitored to perform decoding operation, callback functions are fed back to the audio and video state probes through the OsEventDriver node.
The system event probe can subscribe to the kernel state for system events, and the system events are determined according to a callback function fed back by the kernel state. The 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 to the oseeventdriver node of the executive layer to subscribe to a process creation event, which is forwarded by the oseeventdriver node to the process manager. The process manager can feed back a callback function to the system event probe through the OsEventDriver node after the process is created. For another example, the system event probe may also send a subscribe to focus window change event to the API module, which may monitor whether the focus window of the electronic device 100 has changed, and when it is monitored that the focus window has changed, feed back a callback function to the system event probe.
It can be seen that the system probe module subscribes to various events of the electronic device 100 from the kernel mode, and then determines the running state of the electronic device 100 according to the callback function fed back from the kernel mode, so as to obtain the probe state. After the system probe module obtains the probe state, the probe state can be fed back to the scene recognition module. After the scene recognition module receives the probe state, the scene recognition module 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 context may reflect the current use needs of the user. For example, the scene recognition engine, upon recognizing that the focus window is a window of a video application, determines that the electronic device 100 is in a video scene, which illustrates that the user needs to Video applications are used to view and browse video. As another example, the scene recognition engine recognizes that the focus window is recognized as WeChat TM When determining that electronic device 100 is in a social context. Typically, when the scene recognition module determines that the user scene of the electronic device changes through the probe state (for example, when the probe state changes, the user scene may be considered to change), the scene recognition module may also send the user scene to the base policy matching manager, so that the base policy matching manager determines a new scheduling policy according to the new user scene (may also be referred to as a third scheduling policy, and specifically, see descriptions in S301 and S302 below). The base policy matching manager may then feed back the base scheduling policy to the scene recognition module. The scene recognition module then sends the basic scheduling policy and the user scene to the scheduling engine of the application layer.
As shown in fig. 3, the scheduling engine includes a load manager, a chip policy aggregator, and a scheduling executor. The load management controller can receive the basic scheduling strategy and the user scene sent by the scene identification module. The load manager may 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 an actual scheduling policy (which may also be referred to as a first scheduling policy, see the description in S310 below for details). The actual scheduling policy includes an OS scheduling policy and a first CPU power consumption scheduling policy (which may also be referred to as a first sub-policy).
After the load management controller determines the first scheduling policy, the load management controller may send the OS scheduling policy in the first 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 focal process. For example, the schedule executor may send an instruction to the process manager to adjust the process priority of the focal process, in response to which the process manager adjusts the process priority of the focal process. For another example, the scheduling executor may send an instruction to the I/O manager to adjust the I/O priority of the focal process, in response to which the I/O manager adjusts the I/O priority of the focal process.
Meanwhile, the load controller can also send the first CPU power consumption scheduling strategy in the first scheduling strategy to the chip strategy fusion device. After receiving the first CPU power consumption scheduling policy, the chip policy aggregator generally needs to translate the first CPU power consumption scheduling policy according to the chip platform type of the CPU before issuing the first CPU power consumption scheduling policy, so that the translated first CPU power consumption scheduling policy is adapted to the chip platform type of the CPU.
In the embodiment of the present application, the translation process may be: the chip platform type of the CPU is that
Figure BDA0003734948880000111
The chip policy aggregator needs to obtain a second CPU power consumption scheduling policy (may also be referred to as a second sub-policy, for example, see the descriptions in S329-S333 below) based on the first CPU power consumption scheduling policy. The dispatch executor may then send the second CPU power consumption dispatch policy to the BIOS via the WMI plug-in, the second CPU power consumption dispatch policy may include a minimum value for PL1, a maximum value for PL1, a duration for PL2, and EPP.
At this time, if the Intel DTT driver monitors that the policy received in the BIOS changes, judging whether the current state information of the electronic device meets a first condition, and if so, adjusting the performance and power consumption of the CPU according to the DTT technology; and if not, adjusting the performance and the power consumption of the CPU according to the second CPU power consumption scheduling strategy.
As can be seen from the workflow of fig. 3, the resource scheduling method provided in the embodiment of the present application mainly includes three processes, which are respectively: (1) Determining that a user scene where the electronic equipment is located changes; (2) Determining a scheduling strategy corresponding to the user scene according to the new user scene; (3) And selecting a corresponding scheduling strategy according to the current state information of the electronic equipment. The three processes described above will be respectively described below with reference to the drawings. It will be appreciated that these three processes may be performed by the electronic device shown in fig. 1, or by the modules in the electronic device shown in fig. 3.
In order to better understand the resource scheduling method provided in the embodiments of the present application, a software architecture related to the embodiments of the present application is first described in simplified manner with reference to fig. 3, and as shown in fig. 4, the software architecture includes: the system comprises a scene recognition engine, a scheduling engine, a fusion scheduling module and a CPU.
After the scene recognition engine recognizes that the user scene where the electronic equipment is located changes, determining a scheduling strategy corresponding to the user scene according to the new user scene. And then the scene recognition engine sends the CPU power consumption scheduling strategy in the scheduling strategy to the scheduling engine, and the scheduling engine translates the CPU power consumption scheduling strategy and sends the translated CPU power consumption scheduling strategy to the fusion scheduling module.
The fusion scheduling module receives the CPU power consumption scheduling strategy, which scheduling strategy needs to be used can be determined according to the current state information of the electronic equipment, and if the current state information of the electronic equipment meets the first condition, the performance and the power consumption of the CPU are adjusted according to a second scheduling strategy (the second scheduling strategy is the scheduling strategy corresponding to the current state information of the electronic equipment); and if the current state information of the electronic equipment does not meet the first condition, adjusting the performance and the power consumption of the CPU according to the received CPU power consumption scheduling strategy.
In one embodiment, as shown in fig. 5, the fusion scheduling module may include a BISO and an Intel DTT driver, where the BIOS may receive the CPU power consumption scheduling policy, and if the Intel DTT driver monitors that the policy received in the BIOS changes, it determines whether the current state information of the electronic device meets a first condition, and then executes the corresponding CPU scheduling policy.
The following describes a specific process of the resource scheduling method provided in the embodiment of the present application, as shown in fig. 6, where the method may be executed by an electronic device, and includes:
s1, under the condition that the change of a user scene where the electronic equipment is located is detected, determining a corresponding CPU power consumption scheduling strategy according to a scene identification of the current user scene.
The process of detecting the change of the user scene of the electronic device and the process of determining the corresponding CPU power consumption scheduling policy of the current user scene are described in detail in the following embodiments. Alternatively, the electronic device may set an identifier when detecting that the user scene is changed, for example, identifier 1 indicates that the user scene is changed. Optionally, the scene identifier of the current user scene may be information that may uniquely identify a scene, such as a scene number, a scene name, etc.; the determined CPU power consumption scheduling policy may include policy parameters, such as parameters PL1, PL2, EPP, etc., and may also include policy numbers, such as policy 1, policy 2, etc., where the policy numbers and the policy parameters may have a correspondence therebetween.
S2, acquiring current state information of the electronic equipment.
The current state information of the electronic device may include state information such as a power mode, a CPU temperature, and a battery level. Alternatively, the power mode and the state information of the battery level may be obtained by the information acquired by the above-described power state probe, and the CPU temperature may be obtained by a thermistor placed around the CPU.
And S3, judging whether the current state information of the electronic equipment meets the first condition, if so, executing S4, and if not, executing S5.
The first condition is used for representing that the working state of the electronic equipment reaches an early warning state. For example, the first condition may include at least one of a CPU temperature above a temperature threshold, a battery level below a battery level threshold, and a power mode being the first mode.
Illustratively, the temperature threshold may be 40 ℃, the charge threshold may be 70%, and the first mode may be DC. Then, if the current CPU temperature of the electronic device is higher than 40 ℃, or the battery power is lower than 70%, or the power mode is DC, the current state information of the electronic device is considered to satisfy the first condition.
And S4, adjusting parameters related to the CPU power consumption according to the second scheduling strategy.
It can be understood that when the current state information of the electronic device meets the first condition, it is indicated that the working state of the electronic device has reached the early warning state, and then the early warning state needs to be preferentially eliminated at this time, so that the user scenario of the electronic device can be temporarily ignored. Therefore, in the embodiment of the present application, when the current state information of the electronic device meets the first condition, a parameter (which may be referred to as a second parameter) related to CPU power consumption is adjusted according to a second scheduling policy corresponding to the current state information.
In one implementation, the second scheduling policy may have a mapping relationship with state information of the electronic device. Two data tables of APCT1 and APAT1 are stored in the electronic equipment, different running states of the electronic equipment are stored in the data table of APCT1, and scheduling strategies corresponding to the different running states are stored in the data table of APAT1, and the scheduling strategies respectively adjust different parameters, for example, the strategy 1 is to increase the rotating speed of the fan, namely, adjust the rotating speed parameters of the fan. Illustratively, the storage forms of the APCT1 and APAT1 data tables may be as shown in Table 1.
TABLE 1
Figure BDA0003734948880000131
As shown in table 1, the second scheduling policy may be a scheduling policy formulated according to a power mode, a CPU temperature, and a battery level of the electronic device. For example, when the CPU temperature is above a temperature threshold, the battery level is not below a power level threshold, and the power mode is not the first mode, the second scheduling policy may be to increase the fan speed, thereby reducing the CPU temperature; when the CPU temperature is not higher than the temperature threshold, the battery power is lower than the power threshold, and the power mode is not the first mode, the second scheduling policy may be to reduce PL1, PL2, thereby reducing the power consumption of the CPU. Illustratively, the CPU temperature is 50 ℃, the battery power is 80%, and the second scheduling strategy is to increase the fan speed when the power mode is AC; the second scheduling policy is to decrease PL1, PL2 when the CPU temperature is 40 ℃, the battery power is 60%, and the power mode is AC.
S5, adjusting parameters related to the CPU power consumption according to the determined strategy parameters of the CPU power consumption scheduling strategy.
It can be understood that when the current state information of the electronic device does not meet the first condition, it is indicated that the working state of the electronic device does not reach the early warning state yet, and then the early warning state does not need to be eliminated, so that the user scene of the electronic device can be considered preferentially, and parameters related to the CPU power consumption can be adjusted according to the CPU power consumption scheduling policy corresponding to the user scene.
After determining the CPU power consumption scheduling policy, the electronic device further translates the CPU power consumption scheduling policy to obtain a corresponding DTT policy number, and then adjusts parameters related to CPU power consumption according to the policy corresponding to the DTT policy number, for adapting the policy to the Intel platform, and a specific translation process may be described in S316-S318 in the following embodiments. For example, the correspondence between the DTT policy number and the specific policy may be shown in table 5 below, and the electronic device may obtain the corresponding DTT policy according to the DTT policy number. Illustratively, when the DTT policy number is 0, its corresponding pl1_mini is 30, pl1_max is 40, pl2 is 95, pl2_time is 28, and epo Gear is 3. Then the electronic device can adjust the parameters of the CPU according to the policy: PL1, PL2, EPP (which may be referred to as a first parameter).
In one implementation manner, before the electronic device adjusts parameters related to the power consumption of the CPU according to the DTT policy number, the electronic device may further acquire a load condition of the CPU, fine-tune policy parameters corresponding to the DTT policy number according to the load condition of the CPU, and finally adjust performance and power consumption of the CPU according to the fine-tuned policy.
For example, the load condition of the CPU acquired by the electronic device may be a load condition predicted after machine learning the historical load condition, and the fine tuning process may be: and adjusting the value of EPP according to the Gear indicated by EPO Gear by adjusting the value of PL1 in the range of PL1_MINI and PL1_MAX, wherein the values of PL2 and PL2_TIME are unchanged.
In the embodiment of the application, after the electronic device determines that the user scene where the electronic device is located changes, the corresponding CPU power consumption scheduling policy can be determined by combining with the current user scene. And then the electronic equipment determines which scheduling strategy is adopted to adjust parameters related to CPU power consumption according to the current state information, so that the adjusted CPU running state meets the actual requirements of the electronic equipment to a large extent, and the situation that the scheduling strategies are in conflict does not exist.
In combination with the software architecture of fig. 5 and the flowchart shown in fig. 6, the resource scheduling method provided in the embodiment of the present application is further described in the following, as shown in fig. 7, which may specifically include:
S11, under the condition that the scene recognition engine detects that the scene of the user where the electronic equipment is located changes, the CPU power consumption scheduling strategy 1 corresponding to the scene identification determined according to the current user scene.
The process of determining that the scene of the user of the electronic device changes by the scene recognition engine can be referred to as the process of the embodiment shown in fig. 8 below. Optionally, the scene recognition engine may further obtain a scene identifier of the current user scene, such as a scene number or a scene name of the current user scene, after detecting that the user scene of the electronic device changes.
The process of determining the CPU power consumption scheduling policy 1 by the scene recognition engine may be referred to as S301-S303 in the embodiment shown in fig. 10 described below.
S12, the scene identification engine sends the scene identification of the current user scene and the CPU power consumption scheduling strategy 1 to the scheduling engine.
In one implementation, the scenario recognition engine may send the scenario number of the current user scenario and the policy parameters corresponding to the CPU power consumption scheduling policy 1 to the scheduling engine. In another implementation manner, the scenario recognition engine may send the scenario number of the current user scenario and the policy number corresponding to the CPU power consumption scheduling policy 1 to the scheduling engine, and because the policy number corresponding to the CPU power consumption scheduling policy 1 may have a corresponding relationship with the policy parameter, the corresponding policy parameter may be found through the policy number.
S13, the scheduling engine determines a CPU power consumption scheduling strategy 2 according to the CPU power consumption scheduling strategy 1, the scene identification of the current user scene and the system load.
The system load can be determined according to the current running process number of the electronic device, for example, the system load is heavier as the process number is larger, and the system load is lighter as the process number is smaller; the process of determining the CPU power consumption scheduling policy 2 by the scheduling engine may be referred to as the process of S304-S310 in the embodiment shown in fig. 10 described below.
S14, the scheduling engine determines a DTT strategy number according to the CPU power consumption scheduling strategy 2.
The process (i.e., translation process) of determining the DTT policy number by the scheduling engine according to the CPU power consumption scheduling policy 2 can be referred to as the process of S317 in the embodiment shown in fig. 10 described below.
S15, the dispatching engine sends the DTT strategy number to the BIOS.
It will be appreciated that the scheduler engine may send the DTT policy number to the BIOS via WMI.
In this embodiment of the present application, two data tables, respectively APCT2 and APAT2, may be stored in the BIOS, and the DTT policy number received by the BIOS may be a value of a customer ID field in the APCT2 table, and policy parameters corresponding to the DTT policy number may be found from the APAT table through the value. Illustratively, the storage forms of the APCT2 and APAT2 data tables may be as shown in Table 2.
TABLE 2
Figure BDA0003734948880000151
Illustratively, when the DTT policy number received by the BIOS is 1, i.e., the value in APCT2 is 1; and then, the strategy parameters corresponding to the DTT strategy number 1 are found in the APAT2, namely the PL1_MINI is 16, the PL1_MAX is 36, the PL2 is 32, the PL2_TIME is 4, and the EPO Gear is 4.
S16, under the condition that the Intel DTT driver monitors that the strategy number received by the BIOS changes, the current state information of the electronic equipment is obtained.
In one implementation, the Intel DTT driver may register the service of monitoring the policy number change event with the BIOS in advance, and then when the policy number received by the BIOS changes, the change event may be broadcast, and the Intel DTT driver may receive the broadcast signal, i.e. monitor that the policy number received by the BIOS changes. In another implementation, the Intel DTT driver may read the policy number in the BIOS at regular time (e.g., once every 1 second), and when the policy number in the BIOS is read to change, it is monitored that the policy number received by the BIOS changes. However, it should be noted that the embodiment of the present application does not limit the manner in which the Intel DTT driver listens for policy number changes in the BIOS.
The current state information of the electronic device may include state information such as a power mode, a CPU temperature, and a battery level. Alternatively, the power mode and battery level information may be obtained from the information obtained by the power status probe described above, and the CPU temperature may be obtained from a thermistor placed around the CPU.
S17, the Intel DTT driver judges whether the current state information of the electronic equipment meets the first condition, if so, the S18 is executed, and if not, the S19 is executed.
The first condition is used for representing that the working state of the electronic equipment reaches an early warning state.
S18, the Intel DTT driver adjusts parameters related to CPU power consumption according to the second scheduling strategy.
The process of adjusting the parameters according to the second scheduling policy may be described in S4 above, and two data tables, i.e., APCT1 and APAT1, may be stored in the BIOS.
S19, the Intel DTT driver adjusts parameters related to CPU power consumption according to the DTT strategy number.
The process of adjusting the parameters according to the DTT policy number may be described in S5 above.
In the embodiment of the application, after the electronic device determines that the user scene where the electronic device is located changes, the corresponding CPU power consumption scheduling policy can be determined by combining with the current user scene. And then the electronic equipment determines which scheduling strategy is adopted to adjust the performance and the power consumption of the CPU according to the current operation information, so that the adjusted CPU operation state meets the actual requirements of the electronic equipment to a greater extent.
For the above-mentioned process of S11, taking the electronic device changing from an office scene to a video scene as an example, as shown in fig. 8, the flow of determining that the user scene where the electronic device is located changes is as follows:
S101, a system probe module sends a request for subscribing a process creation event to an OsEventDriver node.
As shown in fig. 3, the scene recognition engine includes a system probe module that includes a system event probe. In the embodiment of the application, a request for subscribing to a process creation event can be sent by a system event probe to an oseeventdriver node located at an executable layer. Wherein the request to subscribe to a process creation event may also be referred to as a first request.
In an alternative embodiment, the request to subscribe to a process creation event may carry a process name. That is, the scene recognition engine may subscribe to only the creation events of the specified process, reducing interference of the creation events of irrelevant processes. For example, the specified process may be a process of a video application, a process of a game application, a process of an office application, a process of a social application, and so on. Of course, in other embodiments, the scenario recognition engine may not limit the subscribed process creation events.
S102, the OsEventDriver node sends a request for subscribing a process creation event to a process manager.
The request of the process creation event may refer to the description of S101, and will not be described herein.
That is, the system event probe of the scene recognition engine may send a request to subscribe to a process creation event to the process manager through the oseeventdriver node.
It will be appreciated that the oseeventdriver node registers a callback with the process manager, and the role of registering the callback is to return the process creation event to the oseeventdriver node after the process manager creates the process.
S103, the system probe module sends a request for subscribing the GPU decoding event to the OsEventDriver node.
As also shown in fig. 3, the system probe module further includes an audio-visual status probe. In the embodiment of the application, a request for subscribing the GPU decoding event can be sent to the oseeventdriver node by an audio/video status probe of the system probe module. Wherein, the request to subscribe to the GPU decode event may also be referred to as a third request.
S104, the OsEventdriver node sends a request for subscribing the GPU decoding event to the display card driver.
That is, the audio and video status probe of the scene recognition engine may send a request to subscribe to the GPU decoding event to the graphics card driver through the oseeventdriver node. Similarly, the oseeventdriver node may register a callback with the graphics card driver, where the role of registering the callback is to return the GPU decoding event to the oseeventdriver node after the graphics card driver monitors that the GPU performs the decoding operation.
S105, the system probe module sends a request for subscribing the focus window change event to the API module.
The API module may include a Windows user interface implemented by user32.dll, which may be used to create a window. In an alternative embodiment, a request to subscribe to a focus window change event may be sent by a system event probe of the system probe module to a Windows user interface of the API module. Wherein the request to subscribe to the focus window change event may also be referred to as a second request.
Likewise, the system event probe may register a callback with the API module, the role of which is to return the focus window change event to the system event probe when (the Windows user interface of) the API module monitors that the focus window has changed.
The focus window is a window with focus, and the high probability is a window which is needed to be used by a user currently. Thus, by monitoring the focus window, the user's need for use can be determined. For example, the focus window is a window of the video application, which indicates that the user needs to browse and play the video. As another example, the focus window is a window of a gaming application, indicating that the user desires to play a game. By monitoring whether the focus window changes, it can be determined whether the user's needs have changed. For example, the focus window changes from the window of the video application to the window of the game application, indicating that the user's current needs change from watching video to playing a game. It will be appreciated that if the focus window changes, i.e. the user's needs change, it may also be determined that the current user scene has changed.
The above-mentioned steps S101, S103 and S105 are not strictly sequential, and may be sequentially performed in the order shown in fig. 4, or may be simultaneously performed, or may be sequentially performed in the order of S103, S101 and S105, sequentially performed in the order of S103, S105 and S101, sequentially performed in the order of S105, S101 and S103, or sequentially performed in the order of S105, S103 and S101. Accordingly, there is no strict order among S102, S104, and S106, as long as it is satisfied that S102 is performed after S101, S104 is performed after S103, and S106 is performed after S105, and no specific limitation is made herein.
After the system probe module has subscribed to the requests of various events, the system probe module can monitor the change event when the user scene of the electronic equipment changes. The following describes an example of a user scene change of the electronic device from an office scene to a video scene.
S106, responding to the received operation of starting the video application by the user, and sending a process creation request to a process manager by the video application.
Wherein the creation process request includes a storage address of the video application.
Alternatively, the video application may send a request to create a process to the process manager through the kernel32.Dll interface and the ntdll interface of the API module (not shown).
S107, the process manager creates a video application process.
Specifically, the process manager may query the binary file of the video application through the storage address. By loading the binary file of the video application program, a process running environment can be created, and the video application process is started.
Wherein the Windows operating system defines a run of an application as a process. A process may own multiple threads. A window is an example of a window structure, a graphical user interface (graphical user interface, GUI) resource, a window is created by a thread, and a thread can own all of the windows it creates. In the embodiment of the application, when the electronic device runs the video application, the process manager needs to create a process of the video application, namely, a video application process (namely, a first process). The video application process comprises a plurality of threads, the plurality of threads comprise a thread 1, the thread 1 can be used for creating a main window of the video application, and the main window is a window integrated with all function keys of the video application.
S108, the process manager reports a process creation event to the OsEventDriver node.
Wherein the process creation event may include a name of the process created by the process manager. In the embodiment of the present application, the name of the process is the name of the video application process. Of course, if the process manager creates a process of another application, the name of the process corresponds to the name of the process of the other application.
As already described above, the OsEventDriver node sends a request to the process manager to subscribe to a process creation event, and registers a callback. Therefore, the process manager can report a process creation event to the oseeventdriver node after creating the video application process.
S109, the OsEventDriver node reports a process creation event to the system probe module.
The description of the process creation event is S108, and is not described herein.
In this embodiment of the present application, the oseeventdriver node may report the process creation event to a system event probe of the system probe module.
S110, the system probe module sends a process creation event to the scene recognition module.
S111, responding to a call request of the thread 1, and creating the window 1 by the API module.
After the process manager creates the video application process, the thread 1 of the video application process actively calls the Windows user interface creation window 1 of the API module. For example, as shown in fig. 9 (a), the electronic device may display a window 101, the window 101 being an office interface. The electronic device may receive an operation in which the user clicks on the icon 102 of the video application on the desktop, and in response to the operation, as shown in (b) of fig. 9, the electronic device displays a window 103 (i.e., window 1, which may also be referred to as a first window). In the above procedure, the focus window is changed from the original window 101 to the window 103.
S112, the API module reports the focus window event to the system probe module.
In this embodiment of the present application, after creating window 1, the Windows user interface of the API module may obtain the name of a first process (i.e. a focus process) and the name of a second process, where the first process is a process corresponding to a current focus window (i.e. window 1), and the second process is a process corresponding to a previous focus window (e.g. window 2). For example, the process corresponding to the window 1 is a video application process (first process), the name of which is, for example, hlive. Exe, and the process corresponding to the window 2 is an office application process (second process), the name of which is, for example, word. Exe. And because the name of the first process is inconsistent with the name of the second process, the API module determines that the focus window changes, and reports a focus window event to a system event probe of the system probe module. Wherein the focus window change event includes the name of the first process (i.e., the focus process). Illustratively, the first process is a video application process, and the focus window change event carries a name of the video application process.
Note that, in the case where the electronic device has already started the video application, the electronic device may not execute S106 to S111. After the system probe module sends a request for subscribing the focus window change event to the API module, if the user switches the focus window to the window of the video application, the API module can also detect that the focus window changes and report the focus window event to the system probe module.
S113, the system probe module sends a focus window event to the scene recognition module.
S114, the scene recognition module determines that the type to which the first process belongs is a video type.
The electronic device may be preconfigured with an application list, and the scene recognition module may query whether the application list includes the first process. If the application list includes the first process, the scene recognition module may determine a type to which the first process belongs. The application list comprises the process name of each application and the type of the application. By way of example, the application list may be as shown in Table 3:
TABLE 3 Table 3
Application of Process name Type(s)
Video frequency hlive.exe Video class
Word word.exe Office class
Shooting game shot.exe Game class
WeChat wechat.exe Social class
…… …… ……
For example, the name of the first process is hlive. Exe, the scene recognition module may determine that the type to which the first process belongs is a video class. For another example, the name of the first process is wechat. Exe, the scene recognition module may determine that the type to which the first process belongs is a social class. It should be noted that, table 2 is only used as an example, and actually table 2 may further include process names of more applications and types of the processes.
It should be noted that the purpose of this step is to primarily determine the user scenario in which the electronic device is located. The user scene in which the electronic device is located may include a video scene, a game scene, a social scene, an office scene, a browser scene, and so forth. The video scene further comprises a video playing scene and a video browsing scene. The social scenes may further include text chat scenes, voice chat scenes, video chat scenes, and so on. The office scenes further may include document editing scenes, document browsing scenes, video conferencing scenes, and the like. The browser scene may include a browse web scene, a play video scene, and the like.
In this step, the type of the user scene where the electronic device is located may be determined by the type to which the first process belongs. For example, if the type to which the first process belongs is determined to be a video class, it may be determined that the electronic device is in a video scene; for another example, if it is determined that the type to which the first process belongs is a game class, it may be determined that the electronic device is in a game scene. And, since the name of the first process and the name of the second process are not consistent, it can be determined that the user scene of the electronic device is changed.
In order to further analyze the user requirements, the scene recognition module may further analyze the specific scene where the electronic device is located by combining with other parameters (for example, a peripheral event, a GPU running state, etc.), so as to achieve an effect that the analysis result is more accurate, and taking the video scene as an example, the specific process may include:
and S115, responding to the received operation of playing the video by the user, and sending a video playing instruction to the API module by the video application.
Specifically, the video application may send the video play instruction to the DirectX API of the API module. The video play instruction may include a cache address of the video.
S116, the API module reads the video file.
The API module can read the corresponding video file according to the cache address carried in the video playing instruction.
S117, the API module sends a decoding instruction to the display card driver.
S118, the display card drives to send a starting instruction to the GPU.
S119, the GPU decodes.
Specifically, the GPU may perform decoding operations on the video file through the GPU video processing engine.
S120, the GPU reports the decoding event to the display card driver.
S121, the display card driver reports the decoding event to the OsEventDriver node.
S122, the OsEventDriver node reports the decoding event to the system probe module.
Specifically, the oseeventdriver node reports the decoding event to an audio/video status probe of the system probe module.
S123, the system probe module sends a decoding event to the scene recognition module.
S124, the scene recognition module sends an instruction 1 to the system probe module.
The instruction 1 indicates the system probe module to acquire the GPU occupancy rate of the first process. The instruction 1 may carry the name of the first process.
S125, the system probe module sends a request for acquiring the GPU occupancy rate of the first process to the process manager.
Wherein the request for obtaining the GPU occupancy of the focal process may include the name of the first process.
In an alternative embodiment, a request to obtain the GPU occupancy of the first process may be sent by an audio video status probe of the system probe module to the process manager.
S126, the process manager collects the GPU occupancy rate of the first process.
Specifically, the process manager may collect the GPU occupancy rate of the first process through a graphics kernel (graphics kernel) interface driven by a graphics card.
S127, the process manager sends the GPU occupancy rate of the first process to the system probe module.
The process manager may send the GPU occupancy of the first process to the audio-video status probe of the system probe module.
S128, the system probe module sends the GPU occupancy rate of the first process to the scene recognition engine.
S129, the scene recognition module judges whether the GPU occupancy rate of the first process is larger than 0.
If the GPU occupancy rate of the first process is greater than 0, S130 is executed.
Whether the first process uses the GPU in the running process can be determined through the GPU occupancy rate of the first process, and if the GPU occupancy rate of the first process is greater than 0, the first process can be considered to use the GPU in the running process; if the GPU occupancy rate of the first process is 0, the first process is indicated to not use the GPU in the running process.
S130, the scene recognition module sends an instruction 2 to the system probe module.
Wherein instruction 2 instructs the system probe module to acquire the GPU engine of the first process. The instruction 2 may carry the name of the first process.
S131, the system probe module sends a request for acquiring the GPU engine of the first process to the process manager.
The audio and video status probe of the system probe module can send a request for acquiring the GPU engine of the first process to the process manager. The request to acquire the GPU engine of the first process includes the name of the first process.
The GPU engines comprise a GPU 3D engine, a GPU copy engine, a GPU video encoding engine and a GPU video processing engine. Wherein the GPU 3D engine is mainly responsible for processing 2D or 3D graphics. The GPU copy engine is mainly used for transmitting data. The GPU video encoding engine is mainly used for encoding operation. The GPU video processing engine performs mainly decoding operations. In some embodiments, the GPU video processing engine may also be replaced by a GPU video decoder engine.
S132, the process manager acquires the GPU engine of the first process.
Specifically, the process manager may obtain the GPU engine of the first process through a graphics kernel interface driven by a graphics card.
S133, the process manager sends a message 1 to the system probe module, wherein the message 1 indicates that the GPU engine of the first process is a GPU video processing engine.
Specifically, the process manager may send the message to an audio/video status probe of the system probe module, and then forward the message to the scene recognition module by the audio/video status.
S134, the system probe module sends a message 1 to the scene recognition module.
S135, the scene recognition module judges whether the GPU engine of the first process is a GPU video processing engine.
If the GPU engine of the first process is GPU video processing engine, then execute S136; if the GPU engine of the first process is not GPU video processing engine, then S130 is executed.
In step S114, the scene recognition engine has determined that the type to which the first process belongs is a video class, i.e. that the electronic device is in a video scene. Through step S135, the scene recognition engine may determine a specific operation performed by the first process through the GPU, and further determine a specific operation of the user using the video application. For example, if the GPU engine of the first process is GPU video processing engine, indicating that the first process is using the GPU for decoding operations, the user may be considered to be playing video using the video application. For another example, if the GPU engine of the first process is not GPU video processing engine, it indicates that the first process is not using the GPU for decoding operations, then the user has a high probability of browsing video resources on the video application, and not yet playing video.
S136, the scene recognition module determines that the user scene is a video playing scene according to the process information of the first process.
The process information of the first process comprises information such as the name of the first process, the application type to which the first process belongs, the GPU occupancy rate of the first process, and a GPU engine used by the first process.
From the above, it can be seen that if the type of the first process (the focus process) is a video type, the GPU occupancy rate of the first process is greater than 0, and the GPU engine of the first process is a GPU video processing engine, it can be determined that the electronic device is in a video playing scene.
The above S101 to S136 are described only by taking a video playing scene in which the electronic device is in a video scene as an example. Indeed, the electronic device may also be in other user scenes (e.g., gaming scenes, office scenes, social scenes, video browsing scenes, etc.).
In an alternative embodiment, if the scene recognition engine determines that the type of the first process (focus process) belongs to the game class, the power mode of the CPU is changed to the game mode (game mode), the GPU occupancy rate of the first process is greater than 0, and the GPU engine of the first process is a GPU 3D engine, it may be determined that the electronic device is in the game scene.
Wherein the power state probes of the system probe module may send a request to the power manager to subscribe to a power mode change event. The power manager may report the power mode change event to a power state probe of the system probe module when the power module transitions to a game mode (game mode). As such, the scene recognition engine can determine whether the power mode of the CPU is a game mode through the power mode change event. In addition, the process of the scene recognition engine obtaining the type of the first process may refer to S101, S102, S105, S106 to S114 in fig. 8, and the process of the scene recognition engine determining whether the GPU occupancy rate of the first process is greater than 0 and whether the GPU engine of the first process is a GPU 3D engine refers to S124 to S135. The difference is that the video application is replaced with a game application, and the description thereof is omitted.
In summary, after performing the above-described process, the electronic device may determine that the user scene has changed from an office scene to a video scene, and then may perform a subsequent process of determining its corresponding scheduling policy according to the new user scene, which may be described below with reference to fig. 10.
For the above-mentioned processes of S11-S15 in fig. 7, as shown in fig. 10, the flow of determining the corresponding scheduling policy according to the user scenario is as follows:
S301, the scene recognition module sends scene information to the basic scheduling policy matching manager.
The scene information is used for indicating a user scene where the electronic equipment is located. For example, the electronic device may pre-assign unique identifiers to different user scenarios, and the scenario information may include the unique identifiers of the user scenarios. For example, the identification (e.g., scene number V01) may indicate that the electronic device is in a video playback scene. For another example, the identification (e.g., scene number V02) may indicate that the electronic device is in a video browsing scene.
Regarding the process of determining the user scene where the electronic device is located by the scene recognition module, refer to S101 to S136 specifically, and are not described herein again.
S302, the basic strategy matching manager obtains a scheduling strategy 1 according to the scene information.
The scheduling policy 1 includes an OS scheduling policy 1 and a CPU power consumption scheduling policy 1, and the scheduling policy 1 may also be referred to as a third scheduling policy.
Optionally, the OS schedule policy 1 includes a first process priority of the first process and a first I/O priority. The priority of the first process is used for measuring the capability of the first process to preempt the CPU, and the higher the priority is, the higher the first process can preferentially meet the occupation requirement of the first process on CPU resources, so that the higher the running smoothness of the first process is. In an alternative embodiment, the priority of the focal process includes, in order from high to low, the level: real-time, high, above normal, below normal, low. The priority of the first process can also be understood as the focal process priority (focus process priority, FPP).
The I/O priority of the first process is used for measuring the responsiveness of the system to the disk and the I/O request of the first process, and the higher the priority is, the higher the responsiveness of the disk and the I/O request of the first process is, namely the faster the response speed is. In an alternative embodiment, the focal process I/O priority includes, in order from high to low, the levels of: critical, high, normal, low, very low. The I/O priority of the first process can also be understood as the focal process I/O priority (focus process IO priority, FPP_IO). Optionally, the CPU power consumption scheduling policy 1 includes a first PL1, a first PL2, and a first EPP of the CPU.
It can be seen that the scheduling policy 1 may adjust the process priority, the I/O priority and the CPU power consumption of the first process.
In an alternative embodiment, the electronic device may be preconfigured with various user scenarios and their corresponding scheduling policies. For example, the correspondence between various user scenarios and their corresponding scheduling policies may be as shown in table 4.
For example, if it is determined that the user scenario in which the electronic device is located is a text chat scenario in a social scenario, the scheduling policy 1 includes: the first process priority of the first process is normal, the first I/O priority of the first process is normal, the first PL1 of the CPU is 12W, the first PL2 is 60W, and the first EPP is 220. It should be noted that the scheduling policy in table 4 is only an example, and in practical application, the values of the process priority, the I/O priority, PL1, PL2, and EPP may not coincide with the values in table 4. In addition, table 4 only shows the scheduling policies of a partial scenario, and the actual electronic device may also configure more scheduling policies than table 4.
TABLE 4 Table 4
Figure BDA0003734948880000221
It should be noted that, the above scheduling policy is a scheduling policy when the default electronic device is in a light load state, and may be configured according to the load characteristics and the CPU power consumption obtained by statistics, where the CPU power consumption of each application under the corresponding load characteristics is counted in advance for the electronic device. Therefore, the scheduling policy 1 obtained by the basic policy matching manager can be used as a reference scheme of a policy for scheduling by the electronic equipment, and the electronic equipment can also obtain an actual scheduling policy according to the scheduling policy 1 and combining with an actual system load.
S303, the basic policy matching manager sends the scheduling policy 1 to the scene recognition module.
S304, the scene recognition module sends the scheduling strategy 1 and scene information to the load controller.
That is, after the base policy matching manager determines the scheduling policy 1, the scheduling policy 1 is forwarded to the load manager through the scene recognition module. In an alternative embodiment, the scenario recognition module may send the scheduling policy 1 and the scenario information to the load manager in two steps, respectively.
S305, the load controller sends a request for acquiring the system load to the system probe module.
Wherein the system load is the average number of processes in an executable state and processes in an uninterruptible state. The process in the runnable state refers to a process that is using or waiting for using a CPU. The process of the uninterruptible state is a process waiting for I/O access (e.g., disk I/O).
S306, the system probe module sends a request for acquiring the system load to the process manager.
As shown in fig. 3, the system probe module includes a system load probe, and a request to acquire a system load may be sent by the system load probe to the process manager. In an alternative embodiment, the oseeventdriver node may also forward a request to the process manager to acquire the system load of the system load probe (not shown).
S307, the process manager acquires the system load.
S308, the process manager sends a system load to the system probe module.
In particular, the process manager may send the system load to a system load probe of the system probe module. In an alternative embodiment, the system load may also be forwarded by the oseeventdriver node to a system load probe (not shown).
S309, the system probe module sends the system load to the load controller.
And S310, the load controller obtains a scheduling strategy 2 according to the system load, the scene information and the scheduling strategy 1.
Scheduling policy 2 may include an OS scheduling policy 2 (may also be referred to as an OS scheduling policy) and a CPU power consumption scheduling policy 2 (may also be referred to as a first sub-policy). The CPU power consumption scheduling policy 2 includes PL1 ', PL 2', EPP ', and PL 1' is PL1 adjusted by the load manager, and may also be referred to as second PL1.PL 2' is the load regulator adjusted PL2 and may also be referred to as a second PL2. EPP' is the EPP adjusted by the load controller and may also be referred to as the second EPP. Wherein the scheduling policy 2 may also be referred to as a first scheduling policy.
In an alternative embodiment, the load manager may divide the system load into three levels, light load, medium load, heavy load, respectively. The electronic device may be preconfigured with various user scenarios and their corresponding adjustment policies. For example, the adjustment strategy may be as shown in table 5 below.
For example, if the electronic device is in a video playing scene, and according to the above table 4, the scheduling policy 1 is: the process priority of the video application process is normal, the I/O priority of the video application process is normal, PL1 (i.e., first PL 1) of the CPU is 18W, PL2 (i.e., first PL 2) is 60W, and EPP (i.e., first EPP) is 200. In this case, as shown in table 5, if the system load is a light load, it is not necessary to adjust the scheduling policy, that is, the scheduling policy 2 is the scheduling policy 1. If the system load is a medium load, the process priority of the video application process needs to be kept normal, the I/O priority of the video application process is normal, PL1 is increased by 22W on the basis of 18W, PL2 is increased by 30W on the basis of 60W, epp is decreased by 50 on the basis of 200, i.e. the scheduling policy 2 is: the video application process has normal process priority, the video application process has normal I/O priority (OS scheduling policy 2), PL1 ' 40W, PL2 ' 90W, and EPP ' 150 (CPU scheduling policy 2). If the system load is heavy, the process priority of the video application process needs to be kept normal, the I/O priority of the video application process is adjusted to be high, PL1 is increased by 37W on the basis of 18W, PL2 is increased by 45W on the basis of 60W, EPP is reduced by 100 on the basis of 200, namely the scheduling strategy 2 is: the process priority of the video application process is normal, the I/O priority of the video application process is high, PL1 ' is 55W, PL2 ' is 105W, and EPP ' is 100.
TABLE 5
Figure BDA0003734948880000231
It should be noted that, table 5 only shows a part of the user scenario and the corresponding adjustment policies, and the electronic device may further configure more adjustment policies than table 5, which is not limited herein.
In an alternative embodiment, the specific mapping relationship (for example, mapping is performed by a specific formula) is satisfied between the system load and the CPU power consumption, and the load controller may also calculate the CPU power consumption by using the specific formula and the system load, so as to obtain the scheduling policy 2.
S311, the load management controller sends the OS scheduling strategy 2 to the scheduling executor.
The OS scheduling policy 2 includes a second process priority of the first process and a second I/O priority.
S312, the scheduling executor sends an instruction 3 to the I/O manager.
Wherein instruction 3 carries the second I/O priority of the first process. In addition, as can be seen from FIG. 3, the schedule executor includes an I/O priority interface, from which instruction 3 may be sent to the I/O manager. Wherein this instruction 3 may also be referred to as a second instruction.
S313, in response to the instruction 3, the I/O manager adjusts the I/O priority of the first process.
That is, the I/O manager may adjust the I/O priority of the first process to the second I/O priority. Thus, the first process can be guaranteed to be capable of preferentially performing the I/O access, and the response time of the first process in the I/O access process is reduced.
S314, the scheduling executor sends an instruction 4 to the process manager.
Wherein instruction 4 carries the second process priority of the first process. In addition, as can be seen from fig. 3, the scheduling executor further comprises a process priority interface, by which the instruction 4 can be sent to the process manager. Wherein this instruction 5 may also be referred to as first instruction.
S315, in response to receiving the instruction 4, the process manager adjusts the process priority of the first process.
That is, the process manager may adjust the process priority of the first process to the second process priority. Therefore, the first process can occupy CPU resources preferentially, and smooth operation of the first process is guaranteed.
Therefore, by adjusting the I/O priority and the process priority of the first process, the I/O access of the first process and the consumption of CPU resources can be preferentially ensured, so that the first process can normally and smoothly run, and the user is ensured to have good experience.
It should be noted that, there is no strict sequence between S312 and S314, S312 may be executed first, S314 may be executed first, S312 may be executed second, S312 may be executed first, or S314 and S312 may be executed simultaneously.
S316, the load manager sends the CPU power consumption scheduling strategy 2 to the chip strategy fusion device.
S317, the chip strategy fusion device determines a dynamic tuning technology strategy number according to the CPU power consumption scheduling strategy 2.
DTT is
Figure BDA0003734948880000242
Company is->
Figure BDA0003734948880000243
Processor and->
Figure BDA0003734948880000244
The power consumption is automatically and dynamically distributed among the independent display cards, so that the performance is optimized, the battery endurance time is prolonged, the performance of the CPU and the GPU can be improved, and the intelligent mixed work load power is balanced.
It will be appreciated that there may be a mapping relationship between the DTT policy number and the CPU power consumption scheduling policy 2. A DTT policy table is constructed in BIOS, and any CPU power consumption scheduling policy 2 can be mapped to a DTT policy number in the DTT policy table through parameters (PL 1 ', PL2 ' and EPP ') in the DTT policy table, as shown in Table 6.
The DTT policy number may be used to identify a DTT policy (may also be referred to as a second sub-policy), where the DTT policy corresponding to the DTT policy number is used to adjust pl1_mini, pl1_max, pl2, pl2_time, EPO Gear of the CPU. pL1_MINI is the minimum value of PL1, pL1_MAX is the maximum value of PL1, and pL2_TIME is the duration of PL2. The energy efficiency-performance optimization Gear (energy performance optimize Gear, EPO Gear) is used for representing the strength of the DTT for adjusting the CPU energy efficiency ratio (EPP), the range of values is 1-5, and the larger the value is, the more energy efficiency tends to be when the EPP is adjusted; the smaller the value, the more performance is favored when adjusting EPP.
TABLE 6
Figure BDA0003734948880000241
Note that table 6 only shows the correspondence of the parts PL1', PL2', EPP ' and DTT policy numbers, and actually may include more information than table 6. For example, if the CPU power consumption scheduling policy 2 indicates that PL1' is-1, PL2' is-1 and EPP ' is-1, the DTT policy number may be determined to be 0, which corresponds to PL1 MINI of 30, PL1 max of 40, PL2 of 95, PL2 time of 28, epo Gear of 3.
S318, the chip strategy fusion device sends the DTT strategy number to the scheduling executor.
S319, the scheduling executor sends the DTT policy number to the BIOS.
In an alternative embodiment, the chip policy aggregator may also send the DTT policy (i.e. the second sub-policy) corresponding to the DTT policy number directly to the scheduling executor.
In summary, by executing the above process, the electronic device determines, according to the new user scenario, the CPU scheduling policy corresponding to the user scenario, that is, the second sub-policy. The dispatch executor may then send the DTT policy number to the BIOS and perform the process of S16-S19 described above.
In the embodiment of the application, the electronic device may acquire the focus window change event, determine that the user scene where the electronic device is located is changed according to the focus window change event, determine the first scheduling policy by combining with the current user scene, and translate the first scheduling policy to obtain the DTT policy number. And then the electronic equipment determines which scheduling strategy is adopted to adjust the performance and the power consumption of the CPU according to the current operation information, so that the adjusted CPU operation state meets the actual requirements of the electronic equipment to a greater extent.
Examples of the resource scheduling method provided by the embodiments of the present application are described above in detail. It will be appreciated that the electronic device, in order to achieve the above-described functions, includes corresponding hardware and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application in conjunction with the embodiments, but such implementation is not to be considered as outside the scope of this application.
The embodiment of the present application may divide the functional modules of the electronic device according to the above method examples, for example, may divide each function into each functional module corresponding to each function, for example, a detection unit, a processing unit, a display unit, or the like, or may integrate two or more functions into one module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
It should be noted that, all relevant contents of each step related to the above method embodiment may be cited to the functional description of the corresponding functional module, which is not described herein.
The electronic device provided in this embodiment is configured to execute the resource scheduling method, so that the same effect as that of the implementation method can be achieved.
In case an integrated unit is employed, the electronic device may further comprise a processing module, a storage module and a communication module. The processing module can be used for controlling and managing the actions of the electronic equipment. The memory module may be used to support the electronic device to execute stored program code, data, etc. And the communication module can be used for supporting the communication between the electronic device and other devices.
Wherein the processing module may be a processor or a controller. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. A processor may also be a combination that performs computing functions, e.g., including one or more microprocessors, digital signal processing (digital signal processing, DSP) and microprocessor combinations, and the like. The memory module may be a memory. The communication module can be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip and other equipment which interact with other electronic equipment.
In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device according to this embodiment may be a device having the structure shown in fig. 1.
The present application also provides a computer readable storage medium, in which a computer program is stored, which when executed by a processor, causes the processor to execute the resource scheduling method of any one of the above embodiments.
The present application also provides a computer program product, which when run on a computer, causes the computer to perform the above-mentioned related steps to implement the resource scheduling method in the above-mentioned embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component, or a module, and may include a processor and a memory connected to each other; the memory is used for storing computer-executable instructions, and when the device runs, the processor can execute the computer-executable instructions stored in the memory, so that the chip executes the resource scheduling method in each method embodiment.
The electronic device, the computer readable storage medium, the computer program product or the chip provided in this embodiment are used to execute the corresponding method provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding method provided above, and will not be described herein.
It will be appreciated by those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts shown as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A resource scheduling method, wherein the method is executed by an electronic device, and when a user scene corresponding to a service processed by the electronic device changes or state information of the electronic device changes, the method comprises:
if the current state information of the electronic equipment does not meet the preset condition, determining a first scheduling strategy corresponding to the identification of the current user scene based on a first mapping;
adjusting a first parameter according to the first scheduling strategy to adjust CPU power consumption;
if the current state information of the electronic equipment meets the preset condition, determining a second scheduling strategy corresponding to the current state information based on a second mapping;
and adjusting a second parameter according to the second scheduling strategy to reduce the CPU temperature or reduce the CPU power consumption.
2. The method of claim 1, wherein the current state information of the electronic device includes at least one of a power mode, a CPU temperature, and a battery level of the electronic device.
3. The method of claim 2, wherein the preset condition includes at least one of a power mode of the electronic device being a first mode, a CPU temperature being above a temperature threshold, and a battery level being below a battery level threshold.
4. The method of claim 3, wherein determining a second scheduling policy corresponding to the current state information based on a second mapping if the current state information of the electronic device meets a preset condition, comprises:
and if the current power mode of the electronic equipment is the first mode, or the current CPU temperature is higher than the temperature threshold, or the current battery power is lower than the power threshold, determining the second scheduling strategy based on the second mapping.
5. The method of claim 3, wherein determining a first scheduling policy corresponding to the current user scenario based on the first mapping if the current state information of the electronic device does not satisfy the preset condition comprises:
And if the current power mode of the electronic equipment is not the first mode, the current CPU temperature is lower than or equal to the temperature threshold value, the current battery power is higher than or equal to the power threshold value, and the first scheduling strategy is determined based on the first mapping.
6. The method according to any one of claims 1 to 5, wherein said adjusting a first parameter according to said first scheduling policy comprises:
determining a DTT strategy number of the dynamic tuning technology according to strategy parameters corresponding to the first scheduling strategy;
and adjusting the first parameter according to the DTT strategy number.
7. The method according to any one of claims 1 to 6, wherein the determining a first scheduling policy corresponding to an identification of a current user scenario based on the first mapping comprises:
determining a third scheduling strategy according to the identification of the current user scene and the first mapping, wherein the third scheduling strategy comprises at least one strategy parameter in a first long-time Rui frequency power consumption PL1, a first short-time Rui frequency power consumption PL2 and a first energy efficiency ratio EPP of a CPU;
determining the first scheduling policy according to the third scheduling policy, the identification of the current user scene and the current system load of the electronic equipment, wherein the first scheduling policy comprises at least one policy parameter of a second PL1, a second PL2 and a second EPP of the CPU, wherein the second PL1 is larger than the first PL1, the second PL2 is larger than the second PL2 and the second EPP is smaller than the first EPP when the system load is larger than a preset first value.
8. The method according to any one of claims 1 to 7, further comprising:
acquiring process information and first information of a first process corresponding to a first window currently displayed by the electronic device, wherein the first information comprises at least one of the following information: GPU occupation information, peripheral event information or power mode information of the first process;
and determining the identification of the current user scene according to the process information of the first process and the first information.
9. The method of claim 1, wherein the electronic device comprises a scene recognition engine, a dispatch engine, a BIOS, and an Intel DTT driver, the method comprising:
under the condition that a user scene corresponding to a service processed by the electronic equipment changes, the electronic equipment calls the scene recognition engine, and a policy parameter corresponding to a third scheduling policy is determined according to the identification of the current user scene and the first mapping;
the electronic equipment calls the scene recognition engine and sends the identification of the current user scene and the strategy parameters corresponding to the third dispatching strategy to the dispatching engine;
the electronic equipment invokes the scheduling engine, and determines the strategy parameters corresponding to the first scheduling strategy according to the strategy parameters corresponding to the third scheduling strategy, the identification of the current user scene and the current system load of the electronic equipment;
The electronic equipment calls the scheduling engine, and determines a DTT strategy number according to strategy parameters corresponding to the first scheduling strategy;
the electronic device calls the dispatching engine to send the DTT policy number to the BIOS;
the electronic equipment calls the Intel DTT driver, and acquires current state information of the electronic equipment under the condition that the DTT strategy number received by the BIOS changes;
the electronic equipment calls the Intel DTT driver and judges whether the current state information of the electronic equipment meets the preset condition;
if the preset condition is met, the electronic equipment calls the Intel DTT driver, a second scheduling strategy corresponding to the current state information is determined according to the second mapping, and the second parameter is adjusted according to the second scheduling strategy;
and if the preset condition is not met, the electronic equipment calls the Intel DTT driver and adjusts the first parameter according to the DTT strategy number.
10. An electronic device, comprising:
one or more processors;
one or more memories;
the memory stores one or more programs that, when executed by the processor, cause the electronic device to perform the method of any of claims 1-9.
11. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, causes the processor to perform the method of any of claims 1 to 9.
CN202210794204.1A 2022-05-16 2022-07-07 Resource scheduling method and electronic equipment Active CN116027880B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2022105292091 2022-05-16
CN202210529209 2022-05-16

Publications (2)

Publication Number Publication Date
CN116027880A true CN116027880A (en) 2023-04-28
CN116027880B CN116027880B (en) 2023-11-24

Family

ID=86080148

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210794204.1A Active CN116027880B (en) 2022-05-16 2022-07-07 Resource scheduling method and electronic equipment

Country Status (1)

Country Link
CN (1) CN116027880B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107861816A (en) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 Resource allocation method and device
WO2019047709A1 (en) * 2017-09-06 2019-03-14 Oppo广东移动通信有限公司 Resource configuration method and related product
CN109960395A (en) * 2018-10-15 2019-07-02 华为技术有限公司 Resource regulating method and computer equipment
WO2020108085A1 (en) * 2018-11-30 2020-06-04 Oppo广东移动通信有限公司 Resource allocation method and apparatus, terminal, and storage medium
CN113641488A (en) * 2021-07-07 2021-11-12 荣耀终端有限公司 Method and device for optimizing resources based on user use scene
CN113722058A (en) * 2021-06-16 2021-11-30 荣耀终端有限公司 Resource calling method and electronic equipment
CN114443256A (en) * 2022-04-07 2022-05-06 荣耀终端有限公司 Resource scheduling method and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019047709A1 (en) * 2017-09-06 2019-03-14 Oppo广东移动通信有限公司 Resource configuration method and related product
CN107861816A (en) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 Resource allocation method and device
CN109960395A (en) * 2018-10-15 2019-07-02 华为技术有限公司 Resource regulating method and computer equipment
WO2020108085A1 (en) * 2018-11-30 2020-06-04 Oppo广东移动通信有限公司 Resource allocation method and apparatus, terminal, and storage medium
CN113722058A (en) * 2021-06-16 2021-11-30 荣耀终端有限公司 Resource calling method and electronic equipment
CN113641488A (en) * 2021-07-07 2021-11-12 荣耀终端有限公司 Method and device for optimizing resources based on user use scene
CN114443256A (en) * 2022-04-07 2022-05-06 荣耀终端有限公司 Resource scheduling method and electronic equipment

Also Published As

Publication number Publication date
CN116027880B (en) 2023-11-24

Similar Documents

Publication Publication Date Title
CN115599513B (en) Resource scheduling method and electronic equipment
CN116028205B (en) Resource scheduling method and electronic equipment
US20210389973A1 (en) Electronic device and method for operating the same
JP2013542491A (en) Mobile device and method for publishing and managing a set of performance scaling algorithms
CN116025580B (en) Method for adjusting rotation speed of fan and electronic equipment
CN116027879B (en) Method for determining parameters, electronic device and computer readable storage medium
CN116028210B (en) Resource scheduling method, electronic equipment and storage medium
EP3665572A1 (en) Memory allocation type for media buffer
CN116028211A (en) Display card scheduling method, electronic equipment and computer readable storage medium
CN116027880B (en) Resource scheduling method and electronic equipment
CN116069209A (en) Focus window processing method, device, equipment and storage medium
CN116055443B (en) Method for identifying social scene, electronic equipment and computer readable storage medium
CN116028209B (en) Resource scheduling method, electronic equipment and storage medium
CN116028005B (en) Audio session acquisition method, device, equipment and storage medium
CN116028207B (en) Scheduling policy determination method, device, equipment and storage medium
CN116028208B (en) System load determining method, device, equipment and storage medium
CN116089055B (en) Resource scheduling method and device
WO2023221752A1 (en) Information processing method and electronic device
CN116028314B (en) Temperature parameter reading method, electronic device, and computer-readable storage medium
CN116028206A (en) Resource scheduling method, electronic equipment and storage medium
CN117130454A (en) Power consumption adjustment method and electronic equipment
CN116027878B (en) Power consumption adjustment method and electronic equipment
CN117270670B (en) Power consumption control method and electronic equipment
CN117130772A (en) Resource scheduling method, electronic equipment and storage medium
US11316343B2 (en) Interactive user control of power utilization

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