WO2023221720A1 - Resource scheduling method and apparatus - Google Patents

Resource scheduling method and apparatus Download PDF

Info

Publication number
WO2023221720A1
WO2023221720A1 PCT/CN2023/089131 CN2023089131W WO2023221720A1 WO 2023221720 A1 WO2023221720 A1 WO 2023221720A1 CN 2023089131 W CN2023089131 W CN 2023089131W WO 2023221720 A1 WO2023221720 A1 WO 2023221720A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
application
information
probe
scheduling
Prior art date
Application number
PCT/CN2023/089131
Other languages
French (fr)
Chinese (zh)
Other versions
WO2023221720A9 (en
Inventor
尚明
Original Assignee
荣耀终端有限公司
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 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2023221720A1 publication Critical patent/WO2023221720A1/en
Publication of WO2023221720A9 publication Critical patent/WO2023221720A9/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/28Supervision thereof, e.g. detecting power-supply failure by out of limits supervision
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3215Monitoring of peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3243Power saving in microcontroller unit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the present application relates to the technical field of resource scheduling, and in particular, to a resource scheduling method and device.
  • This application provides a resource scheduling method and device, aiming to solve the resource scheduling problem of electronic equipment.
  • this application provides the following technical solutions:
  • this application provides a resource scheduling method.
  • the method is applied to electronic equipment.
  • the operating system of the electronic equipment is a Windows system.
  • the method includes: a system probe module based on the electronic equipment obtains basic status information of the electronic equipment; The information is processed to obtain the operating status information of the electronic device.
  • the operating status information of the electronic device includes at least one of the application operating status of the electronic device, the system working status and the system power mode information; the electronic device is determined based on the operating status information of the electronic device.
  • the application scenario in which the electronic device is located; based on the application scenario in which the electronic device is located, a target resource scheduling strategy that matches the application scenario in which the electronic device is located is determined.
  • the target resource scheduling strategy includes a central processor power consumption scheduling strategy; according to the target resource scheduling strategy Resource scheduling for electronic equipment.
  • the target resource scheduling strategy can be called the target scheduling strategy.
  • the electronic device equipped with the Windows system can obtain the basic status information of the electronic device based on the system probe module; the basic status information is processed to obtain the operating status information of the electronic device.
  • the operating status information of the electronic device includes the electronic device. At least one of the application running status of the device, the system working status and the system power mode information; determining the application scenario of the electronic device based on the running status information of the electronic device; determining the application scenario related to the electronic device based on the application scenario of the electronic device.
  • the target resource scheduling strategy matches the application scenario.
  • the target resource scheduling strategy includes the central processor power consumption scheduling strategy. Resource scheduling is performed on electronic devices according to the target resource scheduling strategy to ensure that resources are reasonably allocated under the application scenario as much as possible.
  • Mobile application scenarios are an application scenario. Because the electronic device can reasonably allocate resources according to the application scenario in which the electronic device is currently located, so that the resources can meet the resource requirements of the application scenario, ensure the smooth operation of the application in the application scenario, and improve the user experience.
  • the running status information of the electronic device includes at least one of the application running status of the electronic device, the system working status and the system power mode information. Therefore, the electronic device can comprehensively determine the application scenario based on various information and improve the accuracy.
  • the basic status information can be called first-level events, first-level information or first-level data, etc.
  • the basic status information can be obtained through the first-level probe in the system probe module, and the running status information can be called second-level events. , second-level letter Information or secondary data, etc., can also be called a mixed state.
  • Running status information can be obtained through the secondary probe in the system probe module.
  • the primary probe and the secondary probe can be interfaces in the Windows system. After obtaining the basic status information, the basic status information is summarized and analyzed to obtain the running status. information.
  • the basic status information includes: at least one of basic operation information related to the application, audio and video usage information, power mode usage information, external device usage information, and display usage information.
  • the basic operation information related to the application is at least Including the application name and application type of the focus application, the electronic device can obtain running status information by integrating multiple basic information, so that the running status information can cover multiple aspects of information.
  • the basic running information related to the application includes: the application name and application type of the focused application, the application name and application type of the non-focused application, the application name and application type of the background application;
  • the audio and video usage information includes: whether to use graphics processing information about the device, whether to use the audio module, and whether to use the camera;
  • power mode usage information includes: the usage mode of the operating system and the power supply mode of the electronic device;
  • external device usage information includes: information about whether to use external devices;
  • display screen Usage information includes: screen bright information of the display screen, lock screen unlock information of the display screen, and information of whether the electronic device is in a closed state.
  • the basic operation information related to the application can be obtained through the process probe, focus change (full screen) probe, and minimization probe in the system probe module.
  • Audio and video usage information can be obtained through the GPU probe, audio probe, and Camera probe in the system probe module.
  • the GPU probe obtains information about whether the graphics processor is used
  • the audio probe obtains information about whether the audio module is used
  • Power mode usage information can be obtained through the AC/DC power probe and system mode probe in the system probe module.
  • the AC/DC power probe obtains the power supply mode of the electronic device, such as DC power supply or AC power supply.
  • AC power supply instructions Using the power adapter, the system mode probe can obtain the usage mode of the operating system, which includes optimal energy efficiency, balance, and optimal performance.
  • processing the basic status information to obtain the running status information of the electronic device includes: obtaining the application name and application type of the focus application, the application name and application type of the non-focus application, and the application name of the background application from the basic status information and application type; if the audio and video usage information in the basic status information indicates that the application uses the graphics processor and/or camera, determine that the running state of the application is the video state, and the application includes at least one of a focused application, a non-focused application, and a background application; If the audio and video usage information in the basic status information indicates that the application uses the audio module, determine the running status of the application to be the audio status; if the audio and video usage information in the basic status information indicates that the application uses the graphics processor, camera and audio module, determine the running status of the application For audio and video status.
  • focus applications When determining the running state of the application, focus applications, non-focus applications and background applications can be used. If one of these applications uses a graphics processor and/or camera, the running state of the application is determined to be the video state, so that once the focus application is switched For applications using a graphics processor, the resource scheduling of the electronic device is matched to the video status so that the focused application can run smoothly after switching.
  • processing the basic status information to obtain the operating status information of the electronic device includes: determining the current mode of the electronic device according to the power mode of the operating system; if the power supply mode of the electronic device is DC power supply, determining whether the electronic device has Use a power adapter; if the power supply method of the electronic device is regarded as AC power supply, determine whether the electronic device uses a power adapter to determine whether the electronic device uses a power adapter and is in a certain mode, so that application scenarios can be distinguished by whether a power adapter is used and the mode. .
  • the mode the electronic device is currently in can be one of optimal energy efficiency, balance, and optimal performance.
  • the AC/DC power probe detects that it is in the AC state, it means that the power adapter is used; if the AC/DC power probe detects that it is in the AC state, it means that the power adapter is not used; the AC/DC power probe And the system mode probe summarizes the system power mode information, such as using the power adapter and being in the best energy efficiency mode.
  • the basic status information includes external device usage information and display screen usage information.
  • the basic status information is processed to obtain the operating status information of the electronic device, including: if the external device inputs an event to the electronic device and the display screen is in a bright screen and unlocked state , the electronic device is not in a closed state, confirm that the electronic device is in a state of use by the user; if the external device inputs an event to the electronic device, the display is in a bright screen unlocked state, and the electronic device is not in a closed state, determine that the electronic device is in a state that is not in use by the user.
  • determining the application scenario in which the electronic device is located based on the operating status information of the electronic device includes: determining the first application scenario in which the electronic device is located based on the first part of the information in the operating status information; and determining the first application scenario in which the electronic device is located based on the second part of the operating status information.
  • the first application scenario is adjusted to determine the second application scenario where the electronic device is located.
  • the second application scenario where the electronic device is located is the application scenario where the electronic device is located.
  • the first application scenario can be called the original application scenario
  • the second application scenario can be called the target application scenario. After the first application scenario is initially determined, it is adjusted so that the target application scenario can correspond to the first part of the information and the second part of the information. .
  • determining the first application scenario in which the electronic device is located based on the first part of the information in the running status information includes: determining the first application scenario based on the application running status in the running status information and the system load of the electronic device; The second part of the information in the status information adjusts the first application scenario and determines the second application scenario in which the electronic device is located. If the system working status information in the running status information indicates that the electronic device is in a state used by the user, the second part of the information is adjusted. One application scenario is determined as the second application scenario; if the system working status information in the running status information indicates that the electronic device is in a state that is not used by the user, it is determined that the electronic device is in an idle scenario, and the idle scenario is the second application scenario.
  • the system power mode information can supplement and improve the second application scenario, such as adding system power mode information to the second application scenario, such as adding that the power adapter is currently in the best energy efficiency mode, etc.
  • System load is optional when determining the first application scenario.
  • determining a target resource scheduling policy that matches the application scenario of the electronic device based on the application scenario in which the electronic device is located includes: if the electronic device does not use a power adapter, based on the application scenario and system power supply of the electronic device mode information to determine a target resource scheduling strategy that matches the application scenario of the electronic device; the method also includes: if the electronic device uses a power adapter, it is prohibited to determine based on the application scenario of the electronic device that matches the application scenario of the electronic device. Matching target resource scheduling policy.
  • the electronic device can determine the target resource scheduling strategy based on the application scenario and system power mode information, so that the target resource scheduling strategy can match the application scenario and system power mode information. If there is no system power mode information, the target resource scheduling strategy can be determined based on the application scenario.
  • System power mode information is optional when determining target resource scheduling policies.
  • the CPU power consumption scheduling strategy includes a first sub-strategy and a second sub-strategy.
  • the second sub-strategy is a dynamic tuning technology strategy determined according to the first sub-strategy; the electronic device is adjusted for resource scheduling according to the target resource scheduling strategy.
  • the method includes: if the hardware platform type is the first type, resource scheduling is performed on the electronic device according to the first sub-policy; if the hardware platform type is the second type, resource scheduling is performed on the electronic device according to the second sub-policy.
  • the method also includes: if the target resource scheduling strategy fails, obtain a preset self-built strategy; perform resource scheduling on the electronic device according to the self-built strategy to improve the target resource scheduling strategy.
  • the self-built strategy can be in conjunction with the electronic device.
  • this application provides a resource scheduling device.
  • the device is applied to electronic equipment.
  • the operating system of the electronic device is a Windows system.
  • the device includes: an acquisition unit for acquiring the basic status of the electronic device based on the system probe module of the electronic device. Information; process the basic status information to obtain the operating status information of the electronic device.
  • the operating status information of the electronic device includes at least one of the application operating status of the electronic device, the system working status and the system power mode information; the determining unit is used to Determine the application scenario of the electronic device based on the operating status information of the electronic device; determine the target resource scheduling strategy that matches the application scenario of the electronic device based on the application scenario of the electronic device.
  • the target resource scheduling strategy includes the central processor Power consumption scheduling strategy; scheduling unit, used to schedule resources for electronic devices according to the target resource scheduling strategy, to ensure that resources are reasonably allocated in application scenarios as much as possible, thereby reducing the power consumption of electronic devices, improving the battery life of electronic devices, and reducing the impact on mobile devices.
  • the impact of application scenarios Because the electronic device can reasonably allocate resources according to the application scenario in which the electronic device is currently located, so that the resources can meet the resource requirements of the application scenario, ensure the smooth operation of the application in the application scenario, and improve the user experience.
  • the running status information of the electronic device includes at least one of the application running status of the electronic device, the system working status and the system power mode information. Therefore, the electronic device can comprehensively determine the application scenario based on various information and improve the accuracy.
  • the basic status information can be called first-level events, first-level information or first-level data, etc.
  • the basic status information can be obtained through the first-level probe in the system probe module, and the running status information can be called second-level events. , secondary information or secondary data, etc.
  • the running status information can be obtained through the secondary probe in the system probe module.
  • the primary probe and secondary probe can be the interface in the Windows system. After obtaining the basic status information Summarize and analyze basic status information to obtain running status information.
  • the basic status information includes: at least one of basic operation information related to the application, audio and video usage information, power mode usage information, external device usage information, and display usage information.
  • the basic operation information related to the application is at least Including the application name and application type of the focus application, the electronic device can obtain running status information by integrating multiple basic information, so that the running status information can cover multiple aspects of information.
  • the basic running information related to the application includes: the application name and application type of the focused application, the application name and application type of the non-focused application, the application name and application type of the background application;
  • the audio and video usage information includes: whether to use graphics processing information about the device, whether to use the audio module, and whether to use the camera;
  • power mode usage information includes: the power mode of the operating system and the power supply mode of the electronic device;
  • external device usage information includes: information about whether to use external devices;
  • display screen Usage information includes: screen bright information of the display screen, lock screen unlock information of the display screen, and information of whether the electronic device is in a closed state.
  • the basic operation information related to the application can be obtained through the process probe, focus change (full screen) probe, and minimization probe in the system probe module.
  • Audio and video usage information can be obtained through the GPU probe, audio probe, and Camera probe in the system probe module.
  • the GPU probe obtains information about whether the graphics processor is used
  • the audio probe obtains information about whether the audio module is used
  • Power mode usage information can be obtained through the AC/DC power probe and system mode probe in the system probe module.
  • the AC/DC power probe obtains the power supply mode of the electronic device, such as DC power supply or AC power supply.
  • AC power supply instructions Using the power adapter, the system mode probe can obtain the usage mode of the operating system, the usage mode of the operating system, and the operating system Usage modes include optimal energy efficiency, balance, and optimal performance.
  • the acquisition unit processes the basic status information to obtain the running status information of the electronic device, including: obtaining the application name and application type of the focus application, the application name and application type of the non-focus application, and the application type of the background application from the basic status information.
  • Application name and application type if the audio and video usage information in the basic status information indicates that the application uses a graphics processor and camera, determine that the running state of the application is the video state, and the application includes at least one of a focused application, a non-focused application, and a background application; If the audio and video usage information in the basic status information indicates that the application uses the audio module, determine the running status of the application to be the audio status; if the audio and video usage information in the basic status information indicates that the application uses the graphics processor, camera and audio module, determine the running status of the application For audio and video status.
  • focus applications When determining the running state of the application, focus applications, non-focus applications and background applications can be used. If one of these applications uses a graphics processor and/or camera, the running state of the application is determined to be the video state, so that once the focus application is switched For applications using a graphics processor, the resource scheduling of the electronic device is matched to the video status so that the focused application can run smoothly after switching.
  • the acquisition unit processes the basic status information to obtain the running status information of the electronic device, including: determining the current mode of the power module according to the power mode of the operating system; if the power supply mode of the electronic device is DC power supply, determining the mode of the electronic device.
  • the device does not use a power adapter; if the power supply method of the electronic device is regarded as AC power supply, make sure the electronic device uses a power adapter.
  • the basic status information includes external device usage information and display screen usage information.
  • the acquisition unit processes the basic status information to obtain the running status information of the electronic device including: if the external device inputs an event to the electronic device and the display screen is on In the unlocked state and the electronic device is not in a closed state, it is determined that the electronic device is in a state for use by the user; if the external device inputs an event to the electronic device, the display is in a bright-screen unlocked state, and the electronic device is not in a closed state, it is determined that the electronic device is in a user-friendly state. Not in use; if the electronic device is in a closed state and/or the display is in a bright-screen unlocked state, it is determined that the electronic device is in a state that is not in use by the user.
  • the determining unit determines the application scenario in which the electronic device is located based on the operating status information of the electronic device, including: determining the first application scenario in which the electronic device is located based on the first part of the information in the operating status information; The second part of the information adjusts the first application scenario and determines the second application scenario where the electronic device is located.
  • the second application scenario where the electronic device is located is the application scenario where the electronic device is located.
  • the present application provides an electronic device.
  • the electronic device includes: a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor , causing the electronic device to execute the above method.
  • the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program When the computer program is run on an electronic device, it causes the electronic device to execute the above method.
  • Figure 1 is a schematic structural diagram of an electronic device provided by this application.
  • FIG. 2 is a software structure block diagram of the electronic device provided by this application.
  • FIG. 3 is a schematic diagram of resource scheduling for electronic equipment provided by this application.
  • FIG. 4 is a schematic structural diagram of the system probe module provided by this application.
  • Figure 5 is a signaling diagram of the resource scheduling method provided by this application.
  • Figure 6 is another signaling diagram of the resource scheduling method provided by this application.
  • Figure 7 is a schematic diagram of resource scheduling in the browser scenario provided by this application.
  • Figure 8 is a schematic structural diagram of a resource scheduling device provided by this application.
  • one or more refers to one, two or more than two; "and/or” describes the association relationship of associated objects, indicating that three relationships can exist; for example, A and/or B can mean: A alone exists, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural.
  • the character "/" generally indicates that the related objects are in an "or” relationship.
  • Focus Window refers to the window that has focus.
  • the focused window is the only window that can receive keyboard input.
  • the way the focus window is determined is related to the system's Focus Mode.
  • the top-level window of the focused window is called the active window (Active Window). Only one window can be active at a time.
  • the focus window is most likely the window that the user currently needs to use.
  • the focus window may be the window of the focus application (Application, APP), and the focus APP is the APP currently running in the foreground that can receive operations such as keyboard input and mouse operations.
  • a non-focus APP is an APP that is running in the foreground but cannot currently receive keyboard input, mouse operations, etc. That is, it generally refers to an APP that is running in the foreground but has no operations by the user.
  • a background APP is an APP that has been minimized to run in the background.
  • a process includes multiple threads, and threads can create windows.
  • the focus process is the process to which the thread that created the focus window belongs.
  • Long-term turbo power consumption (Power Limit1, PL1) refers to the power consumption of the CPU under normal load, which is equivalent to the thermal design power consumption. The CPU's operating power consumption does not exceed PL1 most of the time.
  • Short-term turbo power consumption refers to the highest power consumption that the CPU can achieve in a short period of time, which has a duration limit.
  • PL2 is larger than PL1
  • PL1 and PL2 are The name of the platform, in platform, PL1 is called SPL (Sustained Power Limit)
  • the first stage of PL2 is called FPPT (FAST PPT Limit)
  • the second stage of PL2 is called SPPT (SLOW PPT Limit).
  • CPMinCores refers to the minimum proportion of the number of logical processors that can be running.
  • the value range can be 0 to 100. For example, if it is set to 20, if there are 10 logical processors, at least 2 logical processors are running. state.
  • CPMaxCores refers to the maximum proportion of the number of logical processors that can be running.
  • the value range can be 0 to 100. For example, if it is set to 80, if there are 10 logical processors, up to 8 logical processors are running. state.
  • MaxPerformance refers to the upper limit of CPU performance, which can range from 0 to 100. For example, if it is set to 80, the CPU performance can reach 80% of the maximum performance.
  • MinPerformance refers to the lower limit of CPU performance, which can range from 0 to 100. For example, if it is set to 20, the CPU performance can be reduced to 20% of the maximum performance.
  • CPU energy efficiency ratio (Energy Performance Preference, EPP) is used to reflect the scheduling tendency of the CPU, and its value range can be 0 to 255. The smaller the CPU energy efficiency ratio, the CPU tends to have high performance; the higher the CPU energy efficiency ratio, the CPU tends to have low power consumption.
  • Energy efficiency-performance optimization gear (Energy Performance Optimize Gear, EPO Gear) is used to represent the intensity of DTT in adjusting the CPU energy efficiency ratio (EPP).
  • EPP CPU energy efficiency ratio
  • the value range can be 1 to 5. The larger the value, the more energy-efficient it is when adjusting EPP; The smaller the value, the more performance-oriented the EPP adjustment is.
  • Electronic devices can use Windows as the operating system.
  • the resource scheduling of electronic devices can be the resource scheduling mechanism configured by the Windows system.
  • the resource scheduling mechanism of the Windows system is oriented to A common resource scheduling mechanism for all applications, that is, electronic devices can use the same resource scheduling mechanism for different applications.
  • the resources required by different applications may be different. For example, the resources required by office applications are smaller than those required by game applications. If the resource scheduling mechanism of the Window system is set based on the game application, then there will be a waste of resources when the electronic device uses the resource scheduling mechanism to configure resources for the office application. If the resource scheduling mechanism of the Windows system is set according to the office application, then there will be a problem of insufficient resources when the electronic device uses this resource scheduling mechanism to configure resources for the game application. Therefore, the electronic device using a universal resource scheduling mechanism cannot guarantee that the resources are used in all applications. Reasonable allocation in scenarios. In some application scenarios, there may be excessive performance problems, which reduces the battery life of electronic devices, thereby affecting the most important mobile application scenario experience of electronic devices.
  • the mobile application scenario refers to the electronic device not connected to an external power supply.
  • Battery powered scenarios in electronic devices If the battery life of the electronic device is reduced and the electronic device is powered by the battery, the use time of the electronic device is shortened, which affects the use of the electronic device. For example, when the user is outdoors and there is no external power supply to connect, the usable time of the electronic device is shortened and the electronic device may not be able to be used. Satisfy users' use of electronic devices.
  • the resource scheduling method can use two-level probes to identify application scenarios to determine the current application scenario of the electronic device.
  • the scheduling strategy is determined based on the current application scenario of the electronic device. According to the scheduling Strategies for resource scheduling.
  • the electronic device can reasonably allocate resources for the electronic device according to the current application scenario of the electronic device, and ensure that the resources are reasonably allocated under the application scenario as much as possible, thereby reducing the power consumption of the electronic device, improving the battery life of the electronic device, and reducing the Impact on mobile application scenarios.
  • electronic devices can Reasonably allocate resources according to the current application scenario of the electronic device, so that the resources can meet the resource requirements of the application scenario, ensure the smooth operation of the application in the application scenario, and improve the user experience.
  • the two-level probe can also be called one of two-level events, two-level information, two-level data, etc.
  • the electronic device can be a tablet computer, desktop, laptop, notebook computer, ultra-mobile personal computer (UMPC), handheld computer, netbook, personal digital assistant (Personal Digital Assistant, PDA) and other devices.
  • the structural diagram of the electronic device is shown in Figure 1.
  • the electronic device may include: processor, external memory interface, internal memory, Universal Serial Bus (USB) interface, charging management module, power management module, battery, antenna 1.
  • Antenna 2 mobile communication module, wireless communication module, sensor module, buttons, motors, indicators, audio modules, cameras, display screens, and Subscriber Identification Module (SIM) card interfaces, etc.
  • the audio module can include speakers, receivers, microphones, headphone jacks, etc.
  • the sensor module can include pressure sensors, gyroscope sensors, air pressure sensors, magnetic sensors, acceleration sensors, distance sensors, proximity light sensors, fingerprint sensors, temperature sensors, and touch sensors. , ambient light sensor, etc.
  • the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device.
  • the electronic device may include more or fewer components than illustrated, some components may be combined, some components may be separated, or components may be arranged differently.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • the interface connection relationships between the modules illustrated in this embodiment are only schematic illustrations and do not constitute structural limitations on the electronic equipment.
  • the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the processor may include one or more processing units.
  • the processor may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing Unit, GPU), and an image signal processor (Image processor).
  • Signal Processor (ISP) Signal Processor
  • controller video codec
  • digital signal processor Digital Signal Processor, DSP
  • baseband processor baseband processor
  • neural network processor Neural-network Processing Unit, NPU
  • different processing units can be independent devices or integrated in one or more processors.
  • the processor is the nerve center and command center of electronic equipment.
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the external memory interface can be used to connect external memory cards, such as Micro SD cards, to expand the storage capabilities of electronic devices.
  • the external memory card communicates with the processor through the external memory interface to implement data storage functions. For example, save network configuration information, scheduling policy and other files in an external memory card.
  • Internal memory may be used to store computer executable program code, which includes instructions.
  • the processor executes instructions stored in the internal memory to perform various functional applications and data processing of the electronic device. For example, in this application, the processor causes the electronic device to execute the resource scheduling method provided by this application by running instructions stored in the internal memory.
  • the charging management module is used to receive charging input from the charger.
  • the charger may be a wired charger. While the charging management module charges the battery, it can also provide power to electronic devices through the power management module.
  • the power management module is used to connect the battery, charging management module and processor.
  • the power management module receives input from the battery and/or charge management module to power the processor, internal memory, external memory, display, wireless communication module, etc.
  • the power management module and the charging management module can also be provided in the same device.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in an electronic device can be used to cover a single or multiple communication bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be reused as a diversity antenna for a wireless LAN.
  • antennas may be used in conjunction with tuning switches.
  • Mobile communication modules can provide wireless communication solutions including 2G/3G/4G/5G applied to electronic devices.
  • Wireless communication modules can provide applications in electronic devices including Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) network), Bluetooth (Bluetooth, BT), Global Navigation Satellite System ( Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR) and other wireless communication solutions.
  • WLAN Wireless Local Area Networks
  • Wi-Fi Wireless Fidelity
  • Bluetooth Bluetooth
  • BT Global Navigation Satellite System
  • GNSS Global Navigation Satellite System
  • FM Frequency Modulation
  • NFC Near Field Communication
  • IR Infrared
  • GPU is an image processing microprocessor that connects the display and application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • the processor may include one or more GPUs that execute program instructions to generate or alter display information. Electronic devices can achieve shooting functions through ISPs, cameras, video codecs, GPUs, displays, and application processors. Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors. Such as music playback, recording, etc.
  • Pressure sensors are used to sense pressure signals and convert pressure signals into electrical signals.
  • Gyroscope sensors can be used to determine the motion posture of electronic devices.
  • Air pressure sensors measure air pressure.
  • Magnetic sensors include Hall sensors.
  • Electronic devices can use magnetic sensors to detect the opening and closing of the flip holster.
  • Acceleration sensors can detect the acceleration of electronic devices in all directions (usually three axes).
  • Distance sensor for measuring distance.
  • Proximity light sensors may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diode may be an infrared light emitting diode.
  • Electronic devices emit infrared light through light-emitting diodes.
  • Electronic devices use photodiodes to detect infrared reflected light from nearby objects.
  • the ambient light sensor is used to sense ambient light brightness.
  • the fingerprint sensor is used to collect fingerprints.
  • Temperature sensor is used to detect temperature.
  • Touch sensor also known as "touch device”.
  • the touch sensor can be set on the display screen, and the touch sensor and the display screen form a touch screen, also called a "touch screen”.
  • Buttons include power button, volume button, etc.
  • the motor can produce vibration cues.
  • the motor can be used to vibrate for incoming calls or for touch vibration feedback.
  • the indicator can be an indicator light, which can be used to indicate charging status, power changes, or can be used to indicate messages, missed calls, notifications, etc.
  • the SIM card interface is used to connect the SIM card. The SIM card can be inserted into or removed from the SIM card interface to achieve contact and separation from the electronic device.
  • the software system of the above-mentioned electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present invention takes the Windows system with a layered architecture as an example to illustrate the software structure of the electronic device.
  • Figure 2 is a software structure block diagram of an electronic device according to an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
  • the layers communicate through software interfaces.
  • the Windows system includes an application layer, a subsystem dynamic link library, a driver layer and a firmware layer.
  • the application layer can include music, video, games, office, social networking and other APPs.
  • the application layer can also include a system probe module, a scene recognition engine, an execution scheduling engine, a policy configuration module and a housekeeper interface module. Only some applications are shown in the figure.
  • the application layer may also include other applications, such as shopping applications, browsers, etc., which are not limited in this application.
  • the system probe module is used to report status to the scene recognition engine; the scene recognition engine is used to complete the identification of application scenarios based on the status reported by the system probe module, and determine the scheduling policy based on the identified application scenarios. strategy;
  • the execution scheduling engine is used to schedule the firmware layer according to the scheduling policy.
  • the policy configuration module is used to send multiple preconfigured scheduling strategies to the scene recognition engine. After the scene recognition engine recognizes the application scenario, it searches for a scheduling policy that matches the recognized application scenario from the multiple scheduling policies.
  • the housekeeper interface module is used to provide the currently used system power mode to the scene recognition module. The scene recognition engine can select a scheduling strategy that matches the currently used system power mode and the current application scenario.
  • the system power mode may be referred to as system power mode information.
  • the subsystem dynamic link library includes application programming interface (API) modules, which include Windows API, Windows native API, etc.
  • Windows API can provide system call entry and internal function support for APPs.
  • Windows native API is an API native to the Windows system.
  • Windows API can include user.dll, kernel.dll, and Windows native API can include ntdll.dll.
  • user.dll is the Windows user interface interface, which can be used to perform operations such as creating windows and sending messages.
  • kernel.dll is used to provide an interface for applications to access the kernel.
  • ntdll.dll is an important Windows NT kernel-level file. When Windows starts, ntdll.dll resides in a specific write-protected area of memory so that other programs cannot occupy this memory area.
  • the driver layer can include process manager, virtual memory manager, security reference monitor, input output (Input Output, IO) manager, power manager (not shown in the figure), Windows Management Instrumentation (WMI) Plug-in, event driver (Event driver), system and chip (Operating System to System on Chip, OS2SOC) driver.
  • WMI Windows Management Instrumentation
  • Event driver Event driver
  • OS2SOC Operating System to System on Chip
  • the process manager is used to create and terminate processes and threads.
  • the virtual memory manager implements "virtual memory".
  • the virtual memory manager also provides basic support for the cache manager.
  • the Security Reference Monitor enforces security policies on the local computer, protects operating system resources, and performs runtime object protection and monitoring.
  • the I/O manager performs device-independent input/output and calls the appropriate device driver for further processing.
  • the power manager manages changes to a device's power state.
  • the WMI plug-in allows the execution scheduling engine to send scheduling policies to the firmware layer;
  • the Event driver can interact with the graphics card driver, audio and video driver, camera driver, keyboard driver, etc., so that the system detection module can detect various events (also known as data or information), for example, interacting with the graphics card driver so that the system detection module can detect GPU video decoding events.
  • the OS2SOC driver can be used by the execution scheduling engine to send scheduling policies to the firmware layer.
  • the firmware layer includes various hardware and hardware drivers configured for electronic devices.
  • the firmware layer includes CPU, mouse, etc.
  • the firmware layer also includes mouse drivers.
  • the hardware configured in electronic equipment may belong to different hardware platforms.
  • the hardware platforms include: (Advanced Micro Devices, AMD), and etc., the scheduling policies of these three hardware platforms can be different, so the execution scheduling engine can distinguish the hardware platform types when determining the scheduling policy.
  • Figure 3 shows a schematic diagram of resource scheduling of an electronic device.
  • the operating system package of the electronic device It includes a scene recognition engine, an execution scheduling engine and a chip scheduling engine.
  • the scene recognition engine and the execution scheduling engine are located in the application layer.
  • the scene recognition engine can run as a plug-in, and the execution scheduling engine can run as a service.
  • the chip scheduling engine is located in the driver layer, and the chip scheduling engine The engine can be run as a service.
  • the scene recognition engine can interact with the execution scheduling engine. After the scene recognition engine identifies the application scenario, it determines the scheduling strategy (such as a set of policy values) based on the application scenario, and sends the scheduling strategy to the execution scheduling engine.
  • the execution scheduling engine receives the scheduling strategy.
  • the reception result is returned to the scene recognition engine to indicate that the execution scheduling engine has received the scheduling policy.
  • the execution scheduling engine sends the scheduling policy to the chip scheduling engine, and the chip scheduling engine executes the scheduling policy.
  • the scheduling policy executed by the chip scheduling engine may be a target resource scheduling policy.
  • the scene recognition engine includes a scene recognition module, a scene library, a policy scheduling module and a policy library.
  • the execution scheduling engine includes a scene interaction module, a scheduling strategy fusion module and a scheduling executor.
  • the chip scheduling engine includes WMI plug-in and OS2SOC driver. The following describes each module in the scene recognition engine, execution scheduling engine, and chip scheduling engine in conjunction with Figure 3 to illustrate the process of resource scheduling using these three engines.
  • the scene recognition engine can interact with the system probe module, execution scheduling engine, policy configuration module and housekeeper interface module respectively.
  • the housekeeper interface module can send the system power mode currently used by the electronic device to the scene recognition engine.
  • the system power mode can assist the scene recognition engine in determining the scheduling strategy;
  • the policy configuration module is used to send a variety of preconfigured scheduling strategies to the scene recognition engine. Scheduling strategies can be called various resource scheduling strategies.
  • the scene library in the scene recognition engine is used to store multiple application scenarios.
  • the application scenario includes multiple main scenes such as social scenes, office scenes, and browser scenes. Each main scene can be divided into multiple sub-scenarios.
  • the browser scene includes Browser Internet access scenarios, browser audio playback scenarios, browser video playback scenarios, etc.
  • the policy library in the scene recognition engine is used to store multiple scheduling policies sent by the policy configuration module.
  • the scheduling policy and the application scenario can have a one-to-one relationship, such as assigning a scheduling policy to each sub-scenario.
  • scheduling policies include large and small core scheduling and office policy library.
  • the office policy library records scheduling policies related to office applications. Large and small core scheduling is the large and small core scheduling capability provided by the architecture of Intel's 12th generation platform, indicating that large cores are used first ( The strategic configuration is carried out by focusing on performance) or small core (biasing on energy efficiency).
  • the policy scheduling module can send a query and subscription scenario request to the scene recognition module.
  • the query and subscription scenario request is used to trigger the scene recognition module to perform scene recognition.
  • the query and subscription scenario request can be sent immediately after the electronic device is turned on, or it can be sent regularly. This embodiment does not limited.
  • the scene recognition module After receiving the query subscription scene request, the scene recognition module sends a query subscription status request to the system probe module.
  • the query subscription status request is used to instruct each probe in the system probe module to perform status detection/status determination, etc., and then the system probe module
  • the needle module can report the status of the electronic device to the scene recognition module.
  • the scene recognition module determines the current application scenario of the electronic device from the scenario library according to the status of the electronic device, and reports the application scenario to the policy scheduling module.
  • the policy scheduling module can determine the scheduling policy from the policy library according to the current application scenario of the electronic device.
  • the policy scheduling module can also receive the system power mode issued by the butler interface module.
  • the system power mode can be determined according to the user switch identification issued by the butler interface module.
  • the policy scheduling module may refer to the system power mode when determining the scheduling policy, for example, determining a scheduling policy that matches the currently used system power mode and the current application scenario. Or the system power mode is used as a condition for whether the policy scheduling module determines the scheduling policy.
  • the system power mode is the preset mode, the policy scheduling module determines the scheduling policy according to the application scenario.
  • the policy scheduling module sends the scheduling policy to the scene interaction module. After receiving the scheduling policy, the scene interaction module returns a reception result to the policy scheduling module. The reception result is used to indicate that the scene interaction module successfully received the scheduling policy. field
  • the scene interaction module sends the scheduling policy to the scheduling policy fusion module, and the scheduling policy fusion module parses and escapes the scheduling policy to parse and escape the policy parameters in the scheduling policy into parameters recognized by the hardware platform.
  • the scheduling policy fusion module sends the parsed and escaped scheduling policy to the scheduling executor.
  • the scheduling executor sends the parsed and escaped scheduling policy according to the hardware platform type.
  • the scheduling executor can send the parsed and escaped scheduling policy (can be regarded as the first sub-policy) to the OS2SOC driver and the AMD driver; if the hardware platform type is The scheduling executor can send the parsed and escaped scheduling policy (can be regarded as the second sub-policy) to the Intel driver through the WMI plug-in.
  • the scheduling strategy may be a chip scheduling strategy, which achieves the best balance of power consumption by adjusting the energy efficiency ratio of the chip.
  • the scheduling policy may be the power consumption scheduling policy of the CPU.
  • the scheduling executor can send the CPU energy efficiency ratio (EPP) instruction in the power consumption scheduling policy to the power manager to adjust the EPP of the CPU.
  • the EPP is used to reflect the scheduling tendency of the CPU, and its value range is 0 to 255. .
  • the scheduling executor can also send long-term turbo power consumption (power limit1, PL1) and short-term turbo power consumption (power limit2, PL2) instructions in the power consumption scheduling policy to the OS2SOC driver to adjust the PL1 of the CPU. and PL2.
  • PL1 refers to the power consumption of the CPU under normal load, which is equivalent to the thermal design power consumption. The CPU's operating power consumption does not exceed PL1 most of the time.
  • PL2 refers to the highest power consumption that the CPU can achieve in a short period of time, which has a duration limit. Generally, PL2 is larger than PL1.
  • the scheduling executor can send the power consumption scheduling policy to the Intel DTT driver (Intel DTT in Figure 3) through the WMI plug-in.
  • the scheduling policy can include the minimum value of PL1, the maximum value of PL1, PL2, the duration of PL2 and EPP, which are provided by Intel The DTT driver CPU runs based on this scheduling policy.
  • the WMI plug-in, Intel DTT driver and OS2SOC driver can return the reception result. The reception result is used to indicate that the scheduling policy has been successfully received.
  • the system probe module includes: a primary probe and a secondary probe.
  • the primary probe includes a power status probe, a peripheral status probe, an audio and video status probe, a system load probe, etc.
  • Second-level probes include APP status probes and APP behavior probes; first-level probes are used to determine/detect first-level events (can also be called first-level data or first-level information, etc.); second-level probes can use a
  • the primary event detected by the primary probe is a secondary event (the secondary event can also be called secondary data or secondary information, etc.).
  • the secondary event detected by multiple secondary probes represents the status of the electronic device.
  • the power status probe is used to obtain power status events, such as determining the remaining power of the power supply, etc.
  • Peripheral status probes are used to obtain status events of peripheral devices in electronic devices, such as the status of mouse and keyboard, and determine whether there are mouse click events and keyboard input events, etc.
  • the audio and video status probe is used to determine the events of the audio module and the events of the GPU, such as determining whether the audio module is turned on, determining the GPU video decoding event, and determining whether to play the video. For example, it can also determine whether to share the desktop, etc.
  • the system load probe is used to determine the system load. For example, the system load probe can determine the application load and network IO events.
  • the application load refers to the business volume requested by the electronic device from the server, business running time, etc.
  • the APP status probe is used to determine the running status of the APP. It is used to determine/detect the status of at least one APP itself.
  • the APP status probe is used to determine the running status of three types of APPs: focus APP, non-focus APP and background APP. detection.
  • a background APP is an APP that has been minimized to run in the background.
  • a focus APP is an APP that is visible in the foreground and has the focus. It generally refers to an APP that is running in the foreground and is being operated by the user. Although a non-focus APP is also visible in the foreground, the focus is not on the APP. Generally refers to an APP that runs in the foreground but is not operated by the user.
  • the APP behavior probe is used to determine the state switching behavior of the APP, such as switching from the focus APP to the non-focus APP, or switching to the background APP, etc.
  • the first-level probe can obtain the first-level event through the callback function.
  • the power status probe can subscribe to the power status event from the kernel state and determine the power status based on the callback function fed back by the kernel state.
  • the power status is a first-level event of the power supply.
  • the power status includes the battery (remaining) power, whether the power adapter is connected, etc.
  • the power status probe can send a request to subscribe to the power status event to the Event driver of the driver layer, and the Event driver forwards the request to the power manager.
  • the power manager can use this Event driver to feedback the callback function to the power status probe, and the power status probe can determine the power status through the callback function, such as determining the battery level through the callback function.
  • Peripheral status probes can subscribe to peripheral events from the kernel state and determine peripheral events (i.e. status events of peripheral devices) based on the callback functions fed back by the kernel state to reflect the status of peripheral devices through peripheral events.
  • Peripheral events It can be regarded as external device usage information. Peripheral events include mouse wheel sliding events, mouse click events, keyboard input events, microphone input events, camera input events, etc.
  • the peripheral status probe sends a request to subscribe to the mouse status event to the Event driver, and the Event driver will subscribe to the mouse status event. The request is forwarded to the mouse driver.
  • the mouse driver can monitor the status/event of the mouse. After monitoring the click event of the mouse, it feeds back the callback function to the Event driver.
  • the callback function can indicate that the click event of the mouse has occurred, that is, the peripheral device sends a message to the electronic device. The device entered an event.
  • the system load probe can subscribe to the system load in the kernel state and determine the system load based on the callback function fed back by the kernel state.
  • the audio and video status probe can subscribe to audio and video events in the kernel state, and determine the current audio and video events of the electronic device based on the callback function fed back by the kernel state. Audio and video events may include GPU decoding events, etc.
  • the audio and video status probe can send a request to subscribe to the GPU decoding event to the Event driver, and the Event driver forwards the request to the graphics card driver.
  • the graphics card driver can monitor the status of the GPU. After monitoring that the GPU is performing a decoding operation, the Event driver feeds back the callback function to the audio and video status probe to determine that the GPU is used.
  • Figure 4 shows the architecture diagram of the system probe module.
  • the first-level probes include: process probe, focus change (full screen) probe, minimize probe, GPU probe, audio probe, Camera probe, PC Lid closing probe, PC bright screen probe, Windows lock probe, mouse and keyboard peripheral probe, AC/DC power probe, system mode probe and system load probe, etc.
  • the first-level probe can be the basic probe of the operating system of the electronic device (such as Windows system).
  • the development interface of the operating system can be used as the first-level probe.
  • the first-level probe can send a subscription event request to the Event driver. to get system events.
  • Process probes are used to obtain system events related to process changes such as process creation and process exit in the operating system; focus change (full screen) probes and minimization probes are used to obtain system events related to APP behavior changes such as window switching.
  • the GPU probe and audio probe can correspond to the audio and video status probe in Figure 3 above.
  • the GPU probe is used to obtain system events related to whether the GPU is used to determine whether to play the video and Display images, etc.
  • the audio probe is used to obtain system events related to whether the audio module is used.
  • the PC cover closing probe is used to determine whether the electronic device is in a closed state.
  • the closed state means that the first body and the second body of the electronic device overlap together.
  • the first body is equipped with a CPU and the second body is provided with a display. screen (for example, a PC cover probe can be used to determine whether a laptop is closed).
  • PC bright screen probe is used to determine whether the display screen of an electronic device is in a bright screen state.
  • the Windows Lock Probe is used to determine whether the operating system is locked or unlocked.
  • the mouse and keyboard peripheral probes can correspond to the design probes in Figure 3 above.
  • the mouse and keyboard peripheral probes are used to determine system events of external devices such as the mouse and keyboard, such as determining
  • the AC/DC power probe can correspond to the power status probe in Figure 3 above.
  • the AC/DC power probe is used to obtain the battery System events related to power distribution such as power and whether the power adapter is used.
  • the system mode probe is used to determine the power mode of the operating system, such as determining whether the operating system is in power saving mode (Power Saving).
  • the system load probe is used to obtain the system load of an electronic device.
  • the system load is the average number of processes in the runnable state and processes in the uninterruptible state.
  • a process in a runnable state refers to a process that is using the CPU or waiting to use the CPU.
  • a process in an uninterruptible state is a process waiting for I/O access (for example, disk I/O).
  • the system events (i.e., first-level events) obtained by the first-level probe are reported to the second-level probe, and the second-level probe calculates and processes the first-level event to obtain the second-level event (the second-level probe here is equivalent to the The events reported by the first-level probes are summarized and analyzed to obtain the second-level events).
  • Secondary probes include application switching probes, application running status probes, system working status probes, and power mode probes.
  • the application switching probe corresponds to the APP behavior probe in Figure 3 above
  • the application running status probe corresponds to the APP status probe in Figure 3 above.
  • the application switching probe can obtain the APP switching action event based on the system events obtained by the process probe, focus change (full screen) probe and minimization probe.
  • the APP switching action event includes switching events between APPs and the running stage of the APP. Switching events, such as the focus APP switching from one APP to another APP, such as switching from a game APP to a browser APP, or the focus APP switching from one running stage to another running stage, such as the game APP switching from game login to in-game .
  • the application switching probe can output the application name and application type of the focus APP, the application name and application type of the non-focus APP, and the application name and application type of the background APP.
  • the application switching probe uses the focus change (full screen) probe and
  • the system events obtained by the minimization probe can determine whether the APP switches (that is, the switching event between APPs is obtained), and which APP is switched to which APP after the switching occurs.
  • the same application switching probe probes the process at different times.
  • the obtained system events can be used to determine whether the running phase of the focus APP has changed, that is, the APP running phase switching event is obtained.
  • the application name and application type can be configured according to the default APP name type.
  • the application switching probe combines the GPU probe, audio probe, and Camera probe to obtain the application running status probe; the application running status probe is based on the system events obtained by the application switching probe, GPU probe, audio probe, and Camera probe. , obtain the application name and application type of the focus APP, non-focus APP and background APP, as well as the running status of each APP.
  • the application running status probe outputs the application name, application type and running status of the focus APP, and outputs the application name, application type and running status of the non-focus APP.
  • the application name, application type and running status are output.
  • the application name, application type and running status of the background APP are output.
  • the running status can be determined based on the system events obtained by the GPU probe, audio probe and Camera probe.
  • One way can be: after calculating the application switching probe based on the process probe, focus change (full screen) probe and minimize probe, obtain whether the application uses the GPU through the GPU probe, audio probe and Camera probe , audio, and camera status. If the GPU and Camera are used, the APP running status is the video status. If the GPU and Camera are not used, and only audio is used, the APP running status is the audio status.
  • the application that uses GPU, audio, and camera can be at least one of the focus APP, non-focus APP, and background APP.
  • the application switching probe determines that the current focus APP is a video type.
  • the electronic device may be in video browsing or video playback.
  • the application running status probe can be further determined through the system events of the GPU probe. If the GPU probe obtains a system event indicating the use of the GPU 3D engine, it indicates that the GPU is used for 2D or 3D rendering operations. It can be inferred that the user is using an electronic device to browse video resources instead of playing videos, that is, the video APP is in the state of browsing videos. .
  • the system working status probe is obtained through the PC cover closing probe, PC bright screen probe, Windows lock probe, and mouse and keyboard peripheral probe.
  • the system working status probe can be determined based on the system events obtained by these four first-level probes.
  • the operating system is Whether it is in the state of user use; for example, the mouse and keyboard peripheral probe determines that there are mouse click events and keyboard input events, and the PC cover closing probe determines that the electronic device is not closed, and the PC bright screen probe determines that the display screen is on. Then the system working status probe can determine that the operating system is in a state used by the user.
  • the power mode probe uses the AC/DC power probe and the system mode probe to determine the system power mode based on the system events obtained by the AC/DC power probe and the system mode probe.
  • the system power mode is used to indicate whether to use the power adapter. Use, whether in balance mode or performance mode, etc.
  • the AC/DC power probe can be used to determine whether the power supply is in the AC state or the DC state.
  • the AC state can be used to determine that the power adapter is not used, and the DC state can be used to determine that the power adapter is used.
  • the system mode probe can be used to determine the power mode of the operating system.
  • the power mode probe can superpose the system events obtained by the AC/DC power probe and the system mode probe to obtain the system power mode, such as through The AC/DC circuit probe determines that it is in the DC state and the system mode probe determines that it is in balanced mode. Then the power mode probe can determine that the electronic device uses a power adapter and the power mode is in balanced mode.
  • the system probe module can obtain the mixed state.
  • the mixed state includes application state information and operating system state information.
  • the application state information includes at least one of the focus APP, non-focus APP and background APP.
  • Information about an APP such as the APP’s application name, application type and running status, etc.
  • the operating system status information is used to indicate whether the operating system (which can also be an electronic device) is in the state used by the user, the system power mode, etc.
  • Application status information may be called application running status information, and operating system status information includes system working status and system power mode information.
  • the secondary probe reports the mixed status (also called status reporting) to the scene recognition engine.
  • the scene recognition engine identifies the current application scenario of the electronic device based on the information reported by the secondary probe.
  • One way can be: the scene recognition engine can determine the original application scenario based on part of the information in the mixed state, and then correct/adjust the original application scenario based on the remaining information in the mixed state to determine the target application scenario.
  • the scene recognition engine can determine the original application scenario based on the application status information in the mixed state (which may be application running status information), and then identify the original application scenario based on the operating system status information in the mixed state (such as system working status). Make corrections/adjustments to determine target application scenarios.
  • the scene recognition engine can determine the original application scenario based on the secondary events related to the application status reported by the application running status probe; then the scenario recognition engine can determine the original application scenario based on the secondary events related to the device usage reported by the system working status probe.
  • the scene is corrected once, and the scene is supplemented based on the power-related secondary events reported by the power mode probe. For example, after the scene recognition engine determines the original application scenario, if the operating system reported by the system working status probe is in a state used by the user, the scenario recognition engine determines the original application scenario as the target application scenario; if the operating system reported by the system working status probe is The system is not in the state of user use.
  • the scene recognition engine corrects the original application scene, determines that the electronic device is in an idle scene, and uses the idle scene as the target application scene.
  • the scene recognition engine can also use power mode probes to supplement target application scenarios. For example, the system power mode can be added to the target application scenario so that the scheduling policy can match the system power mode.
  • the scene recognition engine monitors the current application scenario of the electronic device through scene registration and makes scene decision-making.
  • the scene decision-making is to determine the scheduling strategy that matches the application scenario.
  • the scene recognition engine can search for matching scheduling policies from the configuration file based on the application scenario and the power mode of the operating system (issued to the scene recognition engine by the housekeeper interface module).
  • the configuration file can be stored in the policy library, and the configuration file includes patterns.
  • Configuration and scenario policy configuration, mode configuration The corresponding relationship between the power mode and the scene policy configuration is recorded in the center, and the corresponding relationship between the application scenario and the scheduling policy is recorded in the scene policy configuration.
  • the scene recognition mode can configure different scene policy configurations for different power modes through mode configuration, so that the scheduling policy matches the needs of the power mode.
  • the scene recognition engine determines the scene policy configuration from the mode configuration according to the power mode of the operating system; then it searches for a matching scheduling policy from the scene policy configuration according to the application scenario. Specifically, it can predetermine multiple scenarios and corresponding scheduling policies. The corresponding relationship is then determined based on the corresponding relationship to determine the scheduling strategy that matches the current scenario. If the scene recognition engine finds the scheduling policy, the scene recognition engine can send the scheduling policy to the execution scheduling engine; if the scene recognition engine does not find the scheduling policy, the scene recognition engine sends the default scheduling policy to the execution scheduling engine. If the scenario recognition engine does not find the scheduling policy according to any application scenario, the scenario recognition engine can send the default scheduling policy to the execution scheduling engine. Therefore, for the application scenario where the scheduling policy is not found, the default scheduling policy is not found. A scheduling strategy common to the application scenarios of the scheduling strategy.
  • the default scheduling policy is also a preset scheduling policy.
  • the default scheduling policy can be different from the scheduling policy in the scene policy configuration. It can also be a scheduling policy selected from the scene policy configuration as the default scheduling policy, such as selecting the number of uses.
  • the scheduling policy with the most is the default scheduling policy.
  • the scheduling policy may be targeted at the power consumption scheduling policy of the CPU.
  • the corresponding scheduling policy includes PL1 of the CPU, PL2 of the CPU, and EPP of the CPU.
  • the scheduling policy is executed through drivers of different hardware platforms.
  • the mode configuration can also be used as a preset condition for determining whether to determine the scheduling policy. For example, when the mode configuration indicates that it is in AC mode (that is, the power adapter is used), the scene recognition engine may not execute the process of determining the scheduling policy, or the scene recognition engine may not perform the process of determining the scheduling policy. It is prohibited to deliver the scheduling policy to the execution scheduling engine after scheduling the policy.
  • first-level probes can be determined based on the currently running APP. If the currently running APP is not the default APP, it is prohibited to use at least one first-level probe.
  • the default APP can be used for resource scheduling of electronic devices. Adjusted APPs, such as video APPs, game APPs, browser APPs, etc. At least one of the process probe, the focus change (full screen) probe, and the minimize probe can obtain the application name and application type of the APP. Therefore, this embodiment can obtain the current running status through at least one of these three probes.
  • the application name and application type of the APP are used to determine whether the currently running APP is a default APP. If not, the use of GPU probes, audio probes, Camera probes, PC cover closing probes, PC bright screen probes, and Windows probes is prohibited. Lock probe, mouse and keyboard peripheral probe, AC/DC power probe, system mode probe and system load probe, etc.
  • the resource scheduling method may include the following steps:
  • the policy configuration module delivers multiple scheduling policies to the scene recognition engine, and the multiple scheduling policies are stored in the policy library; the policy configuration module can also deliver multiple application scenarios to the scene recognition engine, and the multiple application scenarios are stored in the scene library. middle.
  • the policy configuration module can issue scene policy configuration to the scene recognition engine.
  • the scene policy configuration includes scheduling policies and application scenarios. Scheduling policies and application scenarios can have a one-to-one relationship.
  • the housekeeper interface module delivers the system power mode to the scene recognition engine.
  • the system power mode is used to indicate whether to use the power adapter, whether it is in the system power saving mode or performance mode, etc.
  • the policy scheduling module in the scene recognition engine sends a query and subscription scene request to the scene recognition module in the scene recognition engine.
  • the query and subscription scene request is used to trigger the scene recognition module to perform scene recognition.
  • the query and subscription scene request can be made immediately after the electronic device is turned on. It can be sent or sent regularly, which is not limited in this embodiment.
  • the scene recognition module sends a query subscription status request to the system probe module.
  • the query subscription status request is used to instruct each probe in the system probe module to perform status detection/status determination, etc.
  • the system probe module uses a two-level probe to obtain a mixed state.
  • the mixed state includes application state information and operating system state information.
  • the application state information includes information about at least one APP among the focus APP, the non-focus APP, and the background APP.
  • the operating system status information is used to indicate whether the operating system is in a state used by the user, the power mode of the operating system, etc.
  • the system probe module reports the mixed status to the scene recognition module.
  • the scene identification module selects the application scene currently in which the electronic device is located from the scene library according to the mixed state, and reports the application scene to the policy scheduling module.
  • the policy scheduling module selects a scheduling policy from the policy library according to the system power mode and application scenario.
  • step S502 may be executed before step S508.
  • step S502 may be executed after step S503.
  • the policy scheduling module delivers the scheduling policy to the scene interaction module in the execution scheduling engine, and the scene interaction module feeds back the reception result to the policy scheduling module.
  • the scene interaction module sends the scheduling policy to the scheduling policy fusion module in the execution scheduling engine.
  • the scheduling policy fusion module parses and escapes the scheduling policy, so as to parse and escape the policy in the scheduling policy into parameters recognized by the hardware platform.
  • the scheduling policy fusion module sends the parsed and escaped scheduling policy to the scheduling executor.
  • the scheduling executor sends the parsed and escaped scheduling policy according to the hardware platform type.
  • the above-mentioned Figures 4 and 5 show a feasible way for the scene recognition engine to determine the application scenario based on the secondary events obtained by the secondary probe, and the execution scheduling engine to determine the scheduling strategy based on the application scenario.
  • the scenario recognition engine and the execution scheduling engine can also Use secondary events in other ways. For example, in one example, the scene recognition engine determines the original application scenario based on the secondary events obtained by a part of the secondary probes, and determines the original scheduling strategy based on the original application scenarios; then the scenario recognition engine determines the original application scenario based on the secondary events obtained by the remaining secondary probes. The original application scenario and the original scheduling strategy are adjusted.
  • the original application scenario and the original scheduling strategy are determined through a part of the secondary probes, and then the original application scenario and the original scheduling strategy are adjusted through the secondary events obtained by the remaining secondary probes to obtain the target application scenario and the target scheduling strategy.
  • the signaling diagram is shown in Figure 6, which can include the following steps:
  • the policy configuration module delivers multiple scheduling policies to the scene recognition engine, and the multiple scheduling policies are stored in the policy library; the policy configuration module can also deliver multiple application scenarios to the scene recognition engine, and the multiple application scenarios are stored in the scene library. middle.
  • the policy configuration module can issue scene policy configuration to the scene recognition engine.
  • Scene policy configuration includes scheduling policies and application scenarios. Scheduling policies and application scenarios have a one-to-one relationship.
  • the housekeeper interface module delivers the system power mode to the scene recognition engine.
  • the system power mode is used to indicate whether to use the power adapter, whether it is in the system power saving mode or performance mode, etc.
  • the policy scheduling module in the scene recognition engine sends a query and subscription scene request to the scene recognition module in the scene recognition engine.
  • the query and subscription scene request is used to trigger the scene recognition module to perform scene recognition.
  • the query and subscription scene request can be made immediately after the electronic device is turned on. It can be sent or sent regularly, which is not limited in this embodiment.
  • the scene recognition engine sends a query subscription status request to the system probe module.
  • the query subscription status request is used to instruct each probe in the system probe module to perform status detection/status determination, etc.
  • the system probe module uses the first-level probe to obtain the first-level event, and uses the second-level probe to combine the first-level event to obtain the second-level event.
  • the first-level probes include: process probe, focus change (full screen) probe, minimize probe, GPU probe, audio probe, Camera probe, PC lid closing probe, PC bright screen probe, and Windows lock Probes, mouse and keyboard peripheral probes, AC/DC power probes, system mode probes and system load probes, etc.
  • the system probe module uses these first-level probes to obtain first-level events.
  • the secondary probes include the first part of the secondary probe and the second part of the secondary probe.
  • the first part of the secondary probe is used to determine the application scenario, and the second part of the secondary probe is used to adjust the original scheduling policy.
  • the first part of the second-level probes includes application switching probes and application running status probes, and the second part of the second-level probes includes system working status probes and power mode probes.
  • the secondary events of the first part of the secondary probes are reported to the scene recognition module, and the secondary events of the second part of the secondary probes can be reported to the scheduling policy fusion module in the execution scheduling engine.
  • the scene recognition module selects the original application scenario where the electronic device is currently located from the scene library based on the secondary events obtained by the first part of the secondary probe, and reports the original application scenario to the policy scheduling module.
  • step S602 selects the original scheduling policy from the policy library according to the system power mode and the original application scenario.
  • step S602 may be executed before step S607.
  • step S602 may be executed after step S603.
  • the policy scheduling module adjusts the original application scenario according to the secondary events obtained by the second part of the secondary probe to obtain the target application scenario; it adjusts the original scheduling policy based on the target application scenario to obtain the target scheduling policy.
  • the policy scheduling module sends the target scheduling policy to the scene interaction module in the execution scheduling engine, and the scene interaction module feeds back the reception result to the policy scheduling module.
  • the scene interaction module sends the target scheduling policy to the scheduling policy fusion module in the execution scheduling engine.
  • the scheduling policy fusion module parses and escapes the target scheduling policy, so as to parse and escape the policy in the target scheduling policy into parameters recognized by the hardware platform.
  • the scheduling policy fusion module sends the parsed and escaped target scheduling policy to the scheduling executor.
  • the scheduling executor parses the escaped target scheduling policy according to the hardware platform type.
  • the process probe can detect that the user has opened the chrome browser and confirm that the chrome process has been created.
  • the focus change (full screen) probe and minimize probe can also detect the user. Open the chrome browser to determine the chrome browser as the focus APP.
  • the application name and application type of the chrome browser can be obtained from the APP classification configuration.
  • the process probe, focus change (full screen) probe and minimize probe will send the obtained first-level events to the application switching probe. For example, if a chrome process is created and the chrome browser is the focus APP, it will be sent to the application switching probe.
  • the application switching probe determines that the currently focused APP is the Chrome browser.
  • the GPU probe, audio probe, and Camera probe can feed back first-level events related to the GPU, audio, and camera while the user is using the Chrome browser.
  • the application running status probe can be combined with the application
  • the current focus APP determined by the switching probe is the chrome browser, first-level events related to GPU, audio and camera, and determines the running status of the chrome browser, such as surfing the Internet, playing videos, etc.
  • the scene recognition module can determine the application scenario based on the running status of the Chrome browser reported by the application running status probe.
  • the application running status probe can combine application switching probes, GPU probes, audio probes and Camera probes.
  • the events obtained by the needle are sent to the scene identification module.
  • the scene identification module determines the main scene as the browser scene based on the events obtained by the application switching probe, and determines the sub-scene based on the events obtained by the GPU probe, audio probe and Camera probe.
  • the scenario is the original application scenario in which the electronic device is currently located.
  • application switching probes, GPU probes, audio probes and Camera probes can send events to the scene recognition module.
  • the first-level events obtained by the process probe, focus change (full screen) probe and minimization probe can be used as main scene feature factors
  • the events obtained by GPU probe, audio probe and Camera probe can be used as sub-scene feature factors. .
  • the scene identification module sends the original application scenario to the policy scheduling module, and the policy scheduling module determines the scheduling strategy.
  • the scheduling strategy includes multiple policy parameters, and the policy parameters are obtained based on actual measurement and tuning.
  • browser scenarios include browser online scenarios, browser video playback scenarios, and browser voice scenarios.
  • the browser online scenarios, browser video playback scenarios, and browser voice scenarios each correspond to a scheduling policy.
  • the browser Internet access scenario corresponds to browser policy 1
  • the browser video playback scenario corresponds to browser policy 2
  • the browser voice scenario corresponds to browser policy 3.
  • the scene recognition module recognizes that the original application scenario is a browser Internet scenario, then the policy scheduling module can determine the scheduling policy as browser policy 1.
  • Browser policy 1 can include: PL1, PL2, EPP, CPMinCores, CPMaxCores, MaxPerformance and MinPerformance, PL1 and PL2 is the name of the Intel platform.
  • PL1 is called SPL (Sustained Power Limit)
  • FPPT FAST PPT Limit
  • SPPT SLOW PPT Limit
  • CPMinCores refers to the minimum proportion of the number of logical processors that can be in the running state, ranging from 0 to 100.
  • CPMaxCores is Refers to the maximum proportion of the number of logical processors that can be in the running state, ranging from 0 to 100. For example, if it is set to 80, if there are 10 logical processors, up to 8 logical processors are in the running state; MaxPerformance refers to the CPU The upper limit of performance, ranging from 0 to 100. For example, if it is set to 80, the performance of the CPU can reach 80% of the maximum performance; MinPerformance refers to the lower limit of performance of the CPU, ranging from 0 to 100. For example, if it is set to 20, the performance of the CPU can reach the lowest performance. down to 20% of maximum performance.
  • the policy scheduling module can adjust the original application scenario based on decision-making characteristic factors.
  • the decision-making characteristic factors can be detected by PC lid closing probe, PC bright screen probe, Windows lock probe, mouse and keyboard peripheral probe, AC/DC power probe, system mode probe and system load probe. Level 1 event.
  • the policy scheduling module adjusts the original application scenario. For example, the decision characteristic factor determines that the electronic device is in an idle state, and the policy scheduling module determines that the electronic device is in an idle state. From the browser The Internet access scene is adjusted to the idle scene, and the idle scene is the target application scene. Then, the policy parameters in the browser policy 1 are adjusted based on the idle scene to adapt to the idle electronic device. If the decision-making characteristic factors have no impact on the browser Internet scenario, the policy scheduling module will not adjust the original application scenario and the original scheduling policy (such as browser policy 1).
  • the policy scheduling module sends the final browser policy 1 to the scene interaction module.
  • the scene interaction module writes the final browser policy 1 into the fusion scheduling queue.
  • the scheduling policy fusion module obtains the final browser policy 1 from the fusion scheduling queue. And complete the escape according to the hardware platform type, and send it to the hardware platform through the scheduling executor.
  • the hardware platform is and For example, if the hardware platform is The policy scheduling fusion module determines the dynamic tuning technology policy number based on the obtained target scheduling policy (such as the final browser policy 1).
  • DTT Dynamic tuning technology
  • the company is in processor and Technology that automatically and dynamically allocates power consumption between independent graphics cards to optimize performance and extend battery life. It can improve CPU and GPU performance and intelligently balance workloads for mixed workloads. Understandably, DTT policy There can be a mapping relationship between the number and the target scheduling policy. For example, if a DTT policy table is built in advance, any target scheduling policy can be mapped to a certain DTT policy number in the DTT policy table through the policy parameters in it, as shown in Figure 7. Browser policy 1 corresponds to policy number 2.
  • the DTT policy number can be used to identify a DTT policy, and the DTT policy corresponding to the DTT policy number is used to adjust the PL1_MINI, PL1_MAX, PL2, PL2_TIME, and EPO Gear of the CPU.
  • PL1_MINI is the minimum value of PL1
  • PL1_MAX is the maximum value of PL1
  • PL2_TIME is the duration of PL2.
  • Energy efficiency-performance optimization gear (Energy Performance Optimize Gear, EPO Gear) is used to represent the intensity of DTT in adjusting the CPU energy efficiency ratio (EPP). The value ranges from 1 to 5. The larger the value, the more energy efficiency is inclined when adjusting EPP; the smaller the value , the more performance-oriented when adjusting EPP.
  • the policy scheduling fusion module can send the DTT policy number to the scheduling executor.
  • the policy scheduling fusion module can also directly send the functional DTT policy corresponding to the DTT policy number to the scheduling executor.
  • the scheduling executor sends the DTT policy number to the Intel DTT driver, and the Intel DTT driver executes the DTT policy.
  • the scheduling policy corresponding to the number is called the DTT performance control table as shown in Figure 7.
  • the DTT performance control table is the scheduling policy corresponding to the DTT policy number and the scheduling policy sent by the upper-layer scheduling executor.
  • the scheduling policy fusion module can send instructions to adjust the EPP to the power manager through the scheduling executor, and the power manager can adjust the EPP of the CPU.
  • the scheduling executor can also send instructions to adjust PL1 and PL2 to the OS2SOC driver node, and the OS2SOC driver node drives PL1 and PL2 of the CPU.
  • the values of the AMD performance parameters and the values of the Windows parameters are set to the values of the corresponding policy parameters in the scheduling policy.
  • the scheduling strategy can use over-temperature protection as a basic strategy to prevent the temperature of electronic equipment from being too high and causing danger.
  • the scheduling policy module does not match the scheduling policy based on the application scenario, the default scheduling policy will be delivered.
  • the Intel DTT driver can execute a self-built strategy.
  • the self-built strategy includes multiple parameters. Resource scheduling is completed through the self-built strategy.
  • the self-built strategy can be related to the current scene of the electronic device.
  • a strategy, such as in the browser scenario, the self-built strategy is a browser scenario performance control strategy. Resource scheduling is completed through the self-built strategy, and the scheduling strategy is supplemented and improved by the self-built strategy.
  • this application also provides a resource scheduling device.
  • the device is applied to electronic equipment.
  • the operating system of the electronic device is a Windows system.
  • the structural diagram of the resource scheduling device is shown in Figure 8. It may include: an acquisition unit 100, a determination unit 200 and Scheduling unit 300.
  • the acquisition unit 100 is used to obtain the basic status information of the electronic device based on the system probe module of the electronic device; process the basic status information to obtain the running status information of the electronic device, and the running status information of the electronic device includes the application running status of the electronic device. , at least one of system working status and system power mode information; the determining unit 200 is used to determine the application scenario in which the electronic device is located based on the operating status information of the electronic device; determine the application scenario related to the electronic device based on the application scenario in which the electronic device is located A target resource scheduling strategy that matches the application scenario.
  • the target resource scheduling strategy includes a CPU power consumption scheduling strategy; the scheduling unit 300 is used to schedule resources for the electronic device according to the target resource scheduling strategy.
  • the running status information corresponds to the second-level event
  • the basic status information corresponds to the first-level event.
  • the basic status information includes: basic running information related to the application, audio and video usage information, power mode usage information, external device usage information and display usage information. At least one of the above, the basic running information related to the application at least includes the application name of the focus application and application type.
  • the basic running information related to the application includes: the application name and application type of the focus application, the application name and application type of the non-focus application, the application name and application type of the background application; audio and video usage information includes: whether to use the graphics processor information, whether to use the audio module and whether to use the camera; power mode usage information includes: the power mode of the operating system and the power supply mode of the electronic device; external device usage information includes: information about whether to use external devices; display screen usage information Including: the screen bright information of the display screen, the lock screen unlock information of the display screen, and the information of whether the electronic device is in a closed state.
  • the acquisition unit 100 processes the basic status information to obtain the running status information of the electronic device including: obtaining the application name and application type of the focus application, the application name and application type of the non-focus application, and the background information from the basic status information.
  • the application name and application type of the application if the audio and video usage information in the basic status information indicates that the application uses the graphics processor and camera, determine that the running state of the application is the video state, and the application includes at least one of the focus application, non-focus application and background application.
  • the audio and video usage information in the basic status information indicates that the application uses the audio module, determine that the running state of the application is the audio state; if the audio and video usage information in the basic status information indicates that the application uses the graphics processor, camera and audio module, determine the application's running status.
  • the running state is audio and video state.
  • the acquisition unit 100 processes the basic status information to obtain the operating status information of the electronic device including: determining the current mode of the electronic device according to the power mode of the operating system; if the power supply mode of the electronic device is DC power supply, Make sure the electronic device does not use a power adapter; if the electronic device is powered by AC power, make sure the electronic device uses a power adapter.
  • the basic status information includes external device usage information and display screen usage information.
  • the acquisition unit 100 processes the basic status information, and obtains the running status information of the electronic device including: if the external device inputs an event to the electronic device, the display screen is in If the screen is in the unlocked state and the electronic device is not in the cover-closed state, it is determined that the electronic device is in the state of use by the user; if the external device inputs an event to the electronic device, the display is in the screen-on-unlocked state, and the electronic device is not in the cover-closed state, it is determined that the electronic device is in the state of being used by the user. It is in a state that is not in use by the user; if the electronic device is in a closed state and/or the display is in a bright-screen unlocked state, it is determined that the electronic device is in a state that is not in use by the user.
  • the determining unit 200 determines the application scenario in which the electronic device is located based on the operating status information of the electronic device, including: determining the first application scenario in which the electronic device is located based on the first part of the information in the operating status information; The second part of the information is used to adjust the first application scenario and determine the second application scenario where the electronic device is located.
  • the second application scenario where the electronic device is located is the application scenario where the electronic device is located.
  • the first application scenario is determined based on the application running status in the running status information and the system load of the electronic device; the first application scenario is adjusted based on the second part of the information in the running status information, and the second application scenario where the electronic device is located is determined.
  • the application scenarios include: if the system working status information in the running status information indicates that the electronic device is in a state used by the user, the first application scenario is determined as the second application scenario; if the system working status information in the running status information indicates that the electronic device is in a state used by the user When not in use, it is determined that the electronic device is in an idle scene, and the idle scene is the second application scene.
  • the determining unit 200 determines the target resource scheduling policy, if the electronic device does not use a power adapter, based on the application scenario and system power mode information of the electronic device, a target resource scheduling policy that matches the application scenario of the electronic device is determined; if The electronic device uses a power adapter, and the determining unit 200 prohibits determining a target resource scheduling policy that matches the application scenario in which the electronic device is located based on the application scenario in which the electronic device is located.
  • the CPU power consumption scheduling strategy includes a first sub-strategy and a second sub-strategy, and the second sub-strategy is based on The dynamic tuning technology strategy determined by the first sub-strategy; the scheduling unit 300 adjusts the electronic device for resource scheduling according to the target resource scheduling policy, including: if the hardware platform type is the first type, resource scheduling for the electronic device according to the first sub-strategy; if the hardware platform The platform type is the second type, and resource scheduling is performed on the electronic device according to the second sub-policy.
  • the first type may be AMD and the second type may be Intel.
  • the method also includes: if the target resource scheduling strategy fails, obtain a preset self-built strategy; and perform resource scheduling for the electronic device according to the self-built strategy.
  • the electronic device includes: a memory and one or more processors; wherein the memory is used to store computer program codes, and the computer program codes include computer instructions; when the computer instructions are executed by the processor, the electronic device Execute the above method.
  • the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program When the computer program is run on an electronic device, it causes the electronic device to execute the above method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Power Sources (AREA)

Abstract

Embodiments of the present application provide a resource scheduling method and apparatus, which are applied to an electronic device. An operating system of the electronic device is a Windows system. The method comprises: on the basis of a system probe module of the electronic device, acquiring basic state information of the electronic device; processing the basic state information, and obtaining running state information of the electronic device, the running state information of the electronic device comprising at least one of an application running state, a system operating state, and system power supply mode information of the electronic device; on the basis of the running state information of the electronic device, determining an application scenario in which the electronic device is located; on the basis of the application scenario in which the electronic device is located, determining a target resource scheduling policy matching the application scenario in which the electronic device is located, the target resource scheduling policy comprising a central processing unit power consumption scheduling policy; and according to the target resource scheduling policy, performing resource scheduling on the electronic device.

Description

资源调度方法及装置Resource scheduling method and device
本申请要求于2022年05月16日提交中国国家知识产权局、申请号为202210530837.1、发明名称为“资源调度方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on May 16, 2022, with the application number 202210530837.1 and the invention title "Resource Scheduling Method and Device", the entire content of which is incorporated into this application by reference. .
技术领域Technical field
本申请涉及资源调度技术领域,尤其涉及一种资源调度方法及装置。The present application relates to the technical field of resource scheduling, and in particular, to a resource scheduling method and device.
背景技术Background technique
目前,电子设备可以以Windows系统作为操作系统,在硬件配置相同的情况下,搭载Windows10系统的电子设备和搭载Windows11系统的电子设备在性能和续航方面差异不大。导致搭载不同操作系统的电子设备在性能和续航方面差异不大的原因在于电子设备的资源调度,由此可知,电子设备的资源调度是一个亟需解决的问题。Currently, electronic devices can use Windows as the operating system. When the hardware configuration is the same, there is not much difference in performance and battery life between electronic devices equipped with Windows 10 system and electronic devices equipped with Windows 11 system. The reason why electronic devices equipped with different operating systems have little difference in performance and battery life is the resource scheduling of electronic devices. From this, it can be seen that the resource scheduling of electronic devices is an urgent problem that needs to be solved.
发明内容Contents of the invention
本申请提供了一种资源调度方法及装置,目的在于解决电子设备的资源调度问题。为了实现上述目的,本申请提供了以下技术方案:This application provides a resource scheduling method and device, aiming to solve the resource scheduling problem of electronic equipment. In order to achieve the above objectives, this application provides the following technical solutions:
第一方面,本申请提供一种资源调度方法,方法应用于电子设备,电子设备的操作系统为Windows系统,方法包括:基于电子设备的系统探针模块获取电子设备的基础状态信息;对基础状态信息进行处理,得到电子设备的运行状态信息,电子设备的运行状态信息包括电子设备的应用运行状态,系统工作状态以及系统电源模式信息中的至少一种;基于电子设备的运行状态信息确定电子设备所处的应用场景;基于电子设备所处的应用场景确定出与电子设备所处的应用场景相匹配的目标资源调度策略,目标资源调度策略包括中央处理器功耗调度策略;根据目标资源调度策略对电子设备进行资源调度。目标资源调度策略可以称为目标调度策略。In the first aspect, this application provides a resource scheduling method. The method is applied to electronic equipment. The operating system of the electronic equipment is a Windows system. The method includes: a system probe module based on the electronic equipment obtains basic status information of the electronic equipment; The information is processed to obtain the operating status information of the electronic device. The operating status information of the electronic device includes at least one of the application operating status of the electronic device, the system working status and the system power mode information; the electronic device is determined based on the operating status information of the electronic device. The application scenario in which the electronic device is located; based on the application scenario in which the electronic device is located, a target resource scheduling strategy that matches the application scenario in which the electronic device is located is determined. The target resource scheduling strategy includes a central processor power consumption scheduling strategy; according to the target resource scheduling strategy Resource scheduling for electronic equipment. The target resource scheduling strategy can be called the target scheduling strategy.
在本实施例中,搭载有Windows系统的电子设备可以基于系统探针模块获取电子设备的基础状态信息;对基础状态信息进行处理,得到电子设备的运行状态信息,电子设备的运行状态信息包括电子设备的应用运行状态,系统工作状态以及系统电源模式信息中的至少一种;基于电子设备的运行状态信息确定电子设备所处的应用场景;基于电子设备所处的应用场景确定出与电子设备所处的应用场景相匹配的目标资源调度策略,目标资源调度策略包括中央处理器功耗调度策略;根据目标资源调度策略对电子设备进行资源调度,尽可能保证资源在应用场景下得到合理分配,从而降低电子设备功耗,提高电子设备的续航,降低对移动应用场景的影响,移动应用场景是一种应用场景。因为电子设备可以根据电子设备当前所处的应用场景合理分配资源,使得资源可以满足该应用场景的资源需求,保证该应用场景下应用程序的流畅运行,提高用户体验。其中,电子设备的运行状态信息包括电子设备的应用运行状态,系统工作状态以及系统电源模式信息中的至少一种,由此电子设备可以综合多方面信息确定应用场景,提高准确度。In this embodiment, the electronic device equipped with the Windows system can obtain the basic status information of the electronic device based on the system probe module; the basic status information is processed to obtain the operating status information of the electronic device. The operating status information of the electronic device includes the electronic device. At least one of the application running status of the device, the system working status and the system power mode information; determining the application scenario of the electronic device based on the running status information of the electronic device; determining the application scenario related to the electronic device based on the application scenario of the electronic device. The target resource scheduling strategy matches the application scenario. The target resource scheduling strategy includes the central processor power consumption scheduling strategy. Resource scheduling is performed on electronic devices according to the target resource scheduling strategy to ensure that resources are reasonably allocated under the application scenario as much as possible. Reduce the power consumption of electronic devices, improve the battery life of electronic devices, and reduce the impact on mobile application scenarios. Mobile application scenarios are an application scenario. Because the electronic device can reasonably allocate resources according to the application scenario in which the electronic device is currently located, so that the resources can meet the resource requirements of the application scenario, ensure the smooth operation of the application in the application scenario, and improve the user experience. Among them, the running status information of the electronic device includes at least one of the application running status of the electronic device, the system working status and the system power mode information. Therefore, the electronic device can comprehensively determine the application scenario based on various information and improve the accuracy.
在本示例中,基础状态信息可以称为一级事件、一级信息或者一级数据等,基础状态信息可以通过系统探针模块中的一级探针获得,运行状态信息可以称为二级事件、二级信 息或者二级数据等,也可以称为混合状态。运行状态信息可以通过系统探针模块中的二级探针获得,一级探针和二级探针可以是Windows系统中的接口,在获得基础状态信息后对基础状态信息进行汇总分析得到运行状态信息。In this example, the basic status information can be called first-level events, first-level information or first-level data, etc. The basic status information can be obtained through the first-level probe in the system probe module, and the running status information can be called second-level events. , second-level letter Information or secondary data, etc., can also be called a mixed state. Running status information can be obtained through the secondary probe in the system probe module. The primary probe and the secondary probe can be interfaces in the Windows system. After obtaining the basic status information, the basic status information is summarized and analyzed to obtain the running status. information.
可选的,基础状态信息包括:与应用相关的基础运行信息、音视频使用信息、电源模式使用信息、外接设备使用信息和显示屏使用信息中的至少一种,与应用相关的基础运行信息至少包括焦点应用的应用名称和应用类型,使得电子设备可综合多种基础信息得到运行状态信息,使得运行状态信息可以涵盖多方面信息。Optionally, the basic status information includes: at least one of basic operation information related to the application, audio and video usage information, power mode usage information, external device usage information, and display usage information. The basic operation information related to the application is at least Including the application name and application type of the focus application, the electronic device can obtain running status information by integrating multiple basic information, so that the running status information can cover multiple aspects of information.
可选的,应用相关的基础运行信息包括:焦点应用的应用名称和应用类型、非焦点应用的应用名称和应用类型、后台应用的应用名称和应用类型;音视频使用信息包括:是否使用图形处理器的信息、是否使用音频模块的信息和是否使用摄像头的信息;电源模式使用信息包括:操作系统的使用模式和电子设备的供电方式;外接设备使用信息包括:是否使用外接设备的信息;显示屏使用信息包括:显示屏的亮屏信息、显示屏的锁屏解锁信息、电子设备是否处于合盖状态的信息。Optionally, the basic running information related to the application includes: the application name and application type of the focused application, the application name and application type of the non-focused application, the application name and application type of the background application; the audio and video usage information includes: whether to use graphics processing information about the device, whether to use the audio module, and whether to use the camera; power mode usage information includes: the usage mode of the operating system and the power supply mode of the electronic device; external device usage information includes: information about whether to use external devices; display screen Usage information includes: screen bright information of the display screen, lock screen unlock information of the display screen, and information of whether the electronic device is in a closed state.
其中应用相关的基础运行信息可通过系统探针模块中的进程探针、焦点变化(全屏)探针、最小化探针获得。音视频使用信息可通过系统探针模块中的GPU探针、音频探针、Camera探针,如GPU探针获得是否使用图形处理器的信息、音频探针获得是否使用音频模块的信息、Camera探针获得是否使用摄像头的信息。电源模式使用信息可通过系统探针模块中的AC/DC电量探针和系统模式探针得到,如AC/DC电量探针获得电子设备的供电方式,如是采用直流供电还是交流供电,交流供电说明使用了电源适配器,系统模式探针可以获得操作系统的使用模式,操作系统的使用模式包括最佳能效、平衡和最佳性能等。The basic operation information related to the application can be obtained through the process probe, focus change (full screen) probe, and minimization probe in the system probe module. Audio and video usage information can be obtained through the GPU probe, audio probe, and Camera probe in the system probe module. For example, the GPU probe obtains information about whether the graphics processor is used, the audio probe obtains information about whether the audio module is used, and the Camera probe Need to get information about whether the camera is used. Power mode usage information can be obtained through the AC/DC power probe and system mode probe in the system probe module. For example, the AC/DC power probe obtains the power supply mode of the electronic device, such as DC power supply or AC power supply. AC power supply instructions Using the power adapter, the system mode probe can obtain the usage mode of the operating system, which includes optimal energy efficiency, balance, and optimal performance.
可选的,对基础状态信息进行处理,得到电子设备的运行状态信息包括:从基础状态信息中获取焦点应用的应用名称和应用类型、非焦点应用的应用名称和应用类型、后台应用的应用名称和应用类型;如果基础状态信息中音视频使用信息指示应用使用图形处理器和/或摄像头,确定应用的运行状态为视频状态,应用包括焦点应用、非焦点应用和后台应用中的至少一种;如果基础状态信息中音视频使用信息指示应用使用音频模块,确定应用的运行状态为音频状态;如果基础状态信息中音视频使用信息指示应用使用图形处理器、摄像头和音频模块,确定应用的运行状态为音视频状态。Optionally, processing the basic status information to obtain the running status information of the electronic device includes: obtaining the application name and application type of the focus application, the application name and application type of the non-focus application, and the application name of the background application from the basic status information and application type; if the audio and video usage information in the basic status information indicates that the application uses the graphics processor and/or camera, determine that the running state of the application is the video state, and the application includes at least one of a focused application, a non-focused application, and a background application; If the audio and video usage information in the basic status information indicates that the application uses the audio module, determine the running status of the application to be the audio status; if the audio and video usage information in the basic status information indicates that the application uses the graphics processor, camera and audio module, determine the running status of the application For audio and video status.
其中确定应用的运行状态时可以采用焦点应用、非焦点应用和后台应用,如果这些应用中的一个应用使用了图形处理器和/或摄像头,确定应用的运行状态为视频状态,这样一旦焦点应用切换为使用了图形处理器的应用,电子设备的资源调度是与视频状态相匹配的,使得切换后的焦点应用可以顺畅运行。When determining the running state of the application, focus applications, non-focus applications and background applications can be used. If one of these applications uses a graphics processor and/or camera, the running state of the application is determined to be the video state, so that once the focus application is switched For applications using a graphics processor, the resource scheduling of the electronic device is matched to the video status so that the focused application can run smoothly after switching.
可选的,对基础状态信息进行处理,得到电子设备的运行状态信息包括:根据操作系统的电源模式,确定电子设备当前所处的模式;如果电子设备的供电方式为直流供电,确定电子设备没有使用电源适配器;如果电子设备的供电方式视为交流供电,确定电子设备使用电源适配器,以确定电子设备是否使用电源适配器和处于某个模式下,使得应用场景可以通过是否使用电源适配器和模式进行区分。电子设备当前所处的模式可以是最佳能效、平衡和最佳性能中的一个。如果AC/DC电量探针探测到处于AC状态,说明使用了电源适配器,如果AC/DC电量探针探测到处于AC状态,说明没有使用电源适配器;AC/DC电量探针 和系统模式探针汇总得到系统电源模式信息,如使用电源适配器和处于最佳能效模式。Optionally, processing the basic status information to obtain the operating status information of the electronic device includes: determining the current mode of the electronic device according to the power mode of the operating system; if the power supply mode of the electronic device is DC power supply, determining whether the electronic device has Use a power adapter; if the power supply method of the electronic device is regarded as AC power supply, determine whether the electronic device uses a power adapter to determine whether the electronic device uses a power adapter and is in a certain mode, so that application scenarios can be distinguished by whether a power adapter is used and the mode. . The mode the electronic device is currently in can be one of optimal energy efficiency, balance, and optimal performance. If the AC/DC power probe detects that it is in the AC state, it means that the power adapter is used; if the AC/DC power probe detects that it is in the AC state, it means that the power adapter is not used; the AC/DC power probe And the system mode probe summarizes the system power mode information, such as using the power adapter and being in the best energy efficiency mode.
可选的,基础状态信息包括外接设备使用信息和显示屏使用信息,对基础状态信息进行处理,得到电子设备的运行状态信息包括:如果外接设备向电子设备输入事件、显示屏处于亮屏解锁状态、电子设备没有处于合盖状态,确定电子设备处于用户使用的状态;如果外接设备向电子设备输入事件、显示屏处于亮屏解锁状态、电子设备没有处于合盖状态,确定电子设备处于用户没有使用的状态;如果电子设备处于合盖状态和/或显示屏处于亮屏解锁状态,确定电子设备处于用户没有使用的状态,以通过外接设备是否有输入事件、显示屏是否正在被使用来确定电子设备是否处于用户使用的状态,以在用户使用或没有使用时分配不同的目标资源调度策略。外接设备向电子设备输入事件可以通过鼠标键盘外设探针探测,显示屏是否处于亮屏可通过PC亮屏探针探测,是否处于锁屏状态可通过Windows锁定探针探测,合盖状态可以通过PC合盖探针探测。Optionally, the basic status information includes external device usage information and display screen usage information. The basic status information is processed to obtain the operating status information of the electronic device, including: if the external device inputs an event to the electronic device and the display screen is in a bright screen and unlocked state , the electronic device is not in a closed state, confirm that the electronic device is in a state of use by the user; if the external device inputs an event to the electronic device, the display is in a bright screen unlocked state, and the electronic device is not in a closed state, determine that the electronic device is in a state that is not in use by the user. status; if the electronic device is in a closed state and/or the display screen is in a bright-screen unlocked state, determine that the electronic device is in a state that is not in use by the user, and determine whether the electronic device has input events from the external device and whether the display screen is being used. Whether it is in a user-used state to allocate different target resource scheduling policies when the user is using or not using it. Events input by external devices to electronic devices can be detected through the mouse and keyboard peripheral probes. Whether the display is on can be detected through the PC bright screen probe. Whether the screen is in a locked state can be detected through the Windows lock probe. When the cover is closed, the PC lid closing probe detection.
可选的,基于电子设备的运行状态信息确定电子设备所处的应用场景包括:根据运行状态信息中的第一部分信息,确定电子设备所处的第一应用场景;根据运行状态信息中的第二部分信息,对第一应用场景进行调整,确定电子设备所处的第二应用场景,电子设备所处的第二应用场景为电子设备所处的应用场景。第一应用场景可以称为原始应用场景,第二应用场景可以称为目标应用场景,在初步确定第一应用场景后对其进行调整,使得目标应用场景可以与第一部分信息和第二部分信息对应。Optionally, determining the application scenario in which the electronic device is located based on the operating status information of the electronic device includes: determining the first application scenario in which the electronic device is located based on the first part of the information in the operating status information; and determining the first application scenario in which the electronic device is located based on the second part of the operating status information. For part of the information, the first application scenario is adjusted to determine the second application scenario where the electronic device is located. The second application scenario where the electronic device is located is the application scenario where the electronic device is located. The first application scenario can be called the original application scenario, and the second application scenario can be called the target application scenario. After the first application scenario is initially determined, it is adjusted so that the target application scenario can correspond to the first part of the information and the second part of the information. .
可选的,根据运行状态信息中的第一部分信息,确定电子设备所处的第一应用场景包括:根据运行状态信息中的应用运行状态和电子设备的系统负载,确定第一应用场景;根据运行状态信息中的第二部分信息,对第一应用场景进行调整,确定电子设备所处的第二应用场景包括:如果运行状态信息中的系统工作状态信息指示电子设备处于用户使用的状态,将第一应用场景确定为第二应用场景;如果运行状态信息中的系统工作状态信息指示电子设备处于用户没有使用的状态,确定电子设备处于空闲场景,空闲场景为第二应用场景。此外系统电源模式信息可以对第二应用场景进行补充完善,如在第二应用场景中加入系统电源模式信息,如加入使用了电源适配器当前处于最佳能效模式等。在确定第一应用场景时,系统负载是可选的。Optionally, determining the first application scenario in which the electronic device is located based on the first part of the information in the running status information includes: determining the first application scenario based on the application running status in the running status information and the system load of the electronic device; The second part of the information in the status information adjusts the first application scenario and determines the second application scenario in which the electronic device is located. If the system working status information in the running status information indicates that the electronic device is in a state used by the user, the second part of the information is adjusted. One application scenario is determined as the second application scenario; if the system working status information in the running status information indicates that the electronic device is in a state that is not used by the user, it is determined that the electronic device is in an idle scenario, and the idle scenario is the second application scenario. In addition, the system power mode information can supplement and improve the second application scenario, such as adding system power mode information to the second application scenario, such as adding that the power adapter is currently in the best energy efficiency mode, etc. System load is optional when determining the first application scenario.
可选的,基于电子设备所处的应用场景确定出与电子设备所处的应用场景相匹配的目标资源调度策略包括:如果电子设备没有使用电源适配器,基于电子设备所处的应用场景和系统电源模式信息,确定出与电子设备的应用场景相匹配的目标资源调度策略;方法还包括:如果电子设备使用电源适配器,禁止基于电子设备所处的应用场景确定出与电子设备所处的应用场景相匹配的目标资源调度策略。电子设备可以基于应用场景和系统电源模式信息确定目标资源调度策略,使得目标资源调度策略能够与应用场景和系统电源模式信息匹配,若没有系统电源模式信息,可以基于应用场景确定目标资源调度策略。确定目标资源调度策略时,系统电源模式信息是可选的。Optionally, determining a target resource scheduling policy that matches the application scenario of the electronic device based on the application scenario in which the electronic device is located includes: if the electronic device does not use a power adapter, based on the application scenario and system power supply of the electronic device mode information to determine a target resource scheduling strategy that matches the application scenario of the electronic device; the method also includes: if the electronic device uses a power adapter, it is prohibited to determine based on the application scenario of the electronic device that matches the application scenario of the electronic device. Matching target resource scheduling policy. The electronic device can determine the target resource scheduling strategy based on the application scenario and system power mode information, so that the target resource scheduling strategy can match the application scenario and system power mode information. If there is no system power mode information, the target resource scheduling strategy can be determined based on the application scenario. System power mode information is optional when determining target resource scheduling policies.
可选的,中央处理器功耗调度策略包括第一子策略和第二子策略,第二子策略为根据第一子策略确定的动态调谐技术策略;根据目标资源调度策略调整电子设备进行资源调度包括:若硬件平台类型为第一类型,根据第一子策略对电子设备进行资源调度;若硬件平台类型为第二类型,根据第二子策略对电子设备进行资源调度。 Optionally, the CPU power consumption scheduling strategy includes a first sub-strategy and a second sub-strategy. The second sub-strategy is a dynamic tuning technology strategy determined according to the first sub-strategy; the electronic device is adjusted for resource scheduling according to the target resource scheduling strategy. The method includes: if the hardware platform type is the first type, resource scheduling is performed on the electronic device according to the first sub-policy; if the hardware platform type is the second type, resource scheduling is performed on the electronic device according to the second sub-policy.
可选的,方法还包括:如果目标资源调度策略失效,获得预先设置的自建策略;根据自建策略对电子设备进行资源调度,从而对目标资源调度策略进行完善,自建策略可以是与电子设备当前所处场景相关的一个策略,如在浏览器场景下,自建策略是一个浏览器场景性能控制的策略,通过该自建策略完成资源调度,通过自建策略来补充完善调度策略。Optionally, the method also includes: if the target resource scheduling strategy fails, obtain a preset self-built strategy; perform resource scheduling on the electronic device according to the self-built strategy to improve the target resource scheduling strategy. The self-built strategy can be in conjunction with the electronic device. A policy related to the scenario the device is currently in. For example, in the browser scenario, the self-built policy is a browser scenario performance control strategy. Resource scheduling is completed through the self-built policy, and the scheduling policy is supplemented and improved by the self-built policy.
第二方面,本申请提供一种资源调度装置,装置应用于电子设备,电子设备的操作系统为Windows系统,装置包括:获取单元,用于基于电子设备的系统探针模块获取电子设备的基础状态信息;对基础状态信息进行处理,得到电子设备的运行状态信息,电子设备的运行状态信息包括电子设备的应用运行状态,系统工作状态以及系统电源模式信息中的至少一种;确定单元,用于基于电子设备的运行状态信息确定电子设备所处的应用场景;基于电子设备所处的应用场景确定出与电子设备所处的应用场景相匹配的目标资源调度策略,目标资源调度策略包括中央处理器功耗调度策略;调度单元,用于根据目标资源调度策略对电子设备进行资源调度,尽可能保证资源在应用场景下得到合理分配,从而降低电子设备功耗,提高电子设备的续航,降低对移动应用场景的影响。因为电子设备可以根据电子设备当前所处的应用场景合理分配资源,使得资源可以满足该应用场景的资源需求,保证该应用场景下应用程序的流畅运行,提高用户体验。其中,电子设备的运行状态信息包括电子设备的应用运行状态,系统工作状态以及系统电源模式信息中的至少一种,由此电子设备可以综合多方面信息确定应用场景,提高准确度。In a second aspect, this application provides a resource scheduling device. The device is applied to electronic equipment. The operating system of the electronic device is a Windows system. The device includes: an acquisition unit for acquiring the basic status of the electronic device based on the system probe module of the electronic device. Information; process the basic status information to obtain the operating status information of the electronic device. The operating status information of the electronic device includes at least one of the application operating status of the electronic device, the system working status and the system power mode information; the determining unit is used to Determine the application scenario of the electronic device based on the operating status information of the electronic device; determine the target resource scheduling strategy that matches the application scenario of the electronic device based on the application scenario of the electronic device. The target resource scheduling strategy includes the central processor Power consumption scheduling strategy; scheduling unit, used to schedule resources for electronic devices according to the target resource scheduling strategy, to ensure that resources are reasonably allocated in application scenarios as much as possible, thereby reducing the power consumption of electronic devices, improving the battery life of electronic devices, and reducing the impact on mobile devices. The impact of application scenarios. Because the electronic device can reasonably allocate resources according to the application scenario in which the electronic device is currently located, so that the resources can meet the resource requirements of the application scenario, ensure the smooth operation of the application in the application scenario, and improve the user experience. Among them, the running status information of the electronic device includes at least one of the application running status of the electronic device, the system working status and the system power mode information. Therefore, the electronic device can comprehensively determine the application scenario based on various information and improve the accuracy.
在本示例中,基础状态信息可以称为一级事件、一级信息或者一级数据等,基础状态信息可以通过系统探针模块中的一级探针获得,运行状态信息可以称为二级事件、二级信息或者二级数据等,运行状态信息可以通过系统探针模块中的二级探针获得,一级探针和二级探针可以是Windows系统中的接口,在获得基础状态信息后对基础状态信息进行汇总分析得到运行状态信息。In this example, the basic status information can be called first-level events, first-level information or first-level data, etc. The basic status information can be obtained through the first-level probe in the system probe module, and the running status information can be called second-level events. , secondary information or secondary data, etc. The running status information can be obtained through the secondary probe in the system probe module. The primary probe and secondary probe can be the interface in the Windows system. After obtaining the basic status information Summarize and analyze basic status information to obtain running status information.
可选的,基础状态信息包括:与应用相关的基础运行信息、音视频使用信息、电源模式使用信息、外接设备使用信息和显示屏使用信息中的至少一种,与应用相关的基础运行信息至少包括焦点应用的应用名称和应用类型,使得电子设备可综合多种基础信息得到运行状态信息,使得运行状态信息可以涵盖多方面信息。Optionally, the basic status information includes: at least one of basic operation information related to the application, audio and video usage information, power mode usage information, external device usage information, and display usage information. The basic operation information related to the application is at least Including the application name and application type of the focus application, the electronic device can obtain running status information by integrating multiple basic information, so that the running status information can cover multiple aspects of information.
可选的,应用相关的基础运行信息包括:焦点应用的应用名称和应用类型、非焦点应用的应用名称和应用类型、后台应用的应用名称和应用类型;音视频使用信息包括:是否使用图形处理器的信息、是否使用音频模块的信息和是否使用摄像头的信息;电源模式使用信息包括:操作系统的电源模式和电子设备的供电方式;外接设备使用信息包括:是否使用外接设备的信息;显示屏使用信息包括:显示屏的亮屏信息、显示屏的锁屏解锁信息、电子设备是否处于合盖状态的信息。其中应用相关的基础运行信息可通过系统探针模块中的进程探针、焦点变化(全屏)探针、最小化探针获得。音视频使用信息可通过系统探针模块中的GPU探针、音频探针、Camera探针,如GPU探针获得是否使用图形处理器的信息、音频探针获得是否使用音频模块的信息、Camera探针获得是否使用摄像头的信息。电源模式使用信息可通过系统探针模块中的AC/DC电量探针和系统模式探针得到,如AC/DC电量探针获得电子设备的供电方式,如是采用直流供电还是交流供电,交流供电说明使用了电源适配器,系统模式探针可以获得操作系统的使用模式,操作系统的使用模式,操作系统 的使用模式包括最佳能效、平衡和最佳性能等。Optionally, the basic running information related to the application includes: the application name and application type of the focused application, the application name and application type of the non-focused application, the application name and application type of the background application; the audio and video usage information includes: whether to use graphics processing information about the device, whether to use the audio module, and whether to use the camera; power mode usage information includes: the power mode of the operating system and the power supply mode of the electronic device; external device usage information includes: information about whether to use external devices; display screen Usage information includes: screen bright information of the display screen, lock screen unlock information of the display screen, and information of whether the electronic device is in a closed state. The basic operation information related to the application can be obtained through the process probe, focus change (full screen) probe, and minimization probe in the system probe module. Audio and video usage information can be obtained through the GPU probe, audio probe, and Camera probe in the system probe module. For example, the GPU probe obtains information about whether the graphics processor is used, the audio probe obtains information about whether the audio module is used, and the Camera probe Need to get information about whether the camera is used. Power mode usage information can be obtained through the AC/DC power probe and system mode probe in the system probe module. For example, the AC/DC power probe obtains the power supply mode of the electronic device, such as DC power supply or AC power supply. AC power supply instructions Using the power adapter, the system mode probe can obtain the usage mode of the operating system, the usage mode of the operating system, and the operating system Usage modes include optimal energy efficiency, balance, and optimal performance.
可选的,获取单元对基础状态信息进行处理,得到电子设备的运行状态信息包括:从基础状态信息中获取焦点应用的应用名称和应用类型、非焦点应用的应用名称和应用类型、后台应用的应用名称和应用类型;如果基础状态信息中音视频使用信息指示应用使用图形处理器和摄像头,确定应用的运行状态为视频状态,应用包括焦点应用、非焦点应用和后台应用中的至少一种;如果基础状态信息中音视频使用信息指示应用使用音频模块,确定应用的运行状态为音频状态;如果基础状态信息中音视频使用信息指示应用使用图形处理器、摄像头和音频模块,确定应用的运行状态为音视频状态。Optionally, the acquisition unit processes the basic status information to obtain the running status information of the electronic device, including: obtaining the application name and application type of the focus application, the application name and application type of the non-focus application, and the application type of the background application from the basic status information. Application name and application type; if the audio and video usage information in the basic status information indicates that the application uses a graphics processor and camera, determine that the running state of the application is the video state, and the application includes at least one of a focused application, a non-focused application, and a background application; If the audio and video usage information in the basic status information indicates that the application uses the audio module, determine the running status of the application to be the audio status; if the audio and video usage information in the basic status information indicates that the application uses the graphics processor, camera and audio module, determine the running status of the application For audio and video status.
其中确定应用的运行状态时可以采用焦点应用、非焦点应用和后台应用,如果这些应用中的一个应用使用了图形处理器和/或摄像头,确定应用的运行状态为视频状态,这样一旦焦点应用切换为使用了图形处理器的应用,电子设备的资源调度是与视频状态相匹配的,使得切换后的焦点应用可以顺畅运行。When determining the running state of the application, focus applications, non-focus applications and background applications can be used. If one of these applications uses a graphics processor and/or camera, the running state of the application is determined to be the video state, so that once the focus application is switched For applications using a graphics processor, the resource scheduling of the electronic device is matched to the video status so that the focused application can run smoothly after switching.
可选的,获取单元对基础状态信息进行处理,得到电子设备的运行状态信息包括:根据操作系统的电源模式,确定电源模块当前所处的模式;如果电子设备的供电方式为直流供电,确定电子设备没有使用电源适配器;如果电子设备的供电方式视为交流供电,确定电子设备使用电源适配器。Optionally, the acquisition unit processes the basic status information to obtain the running status information of the electronic device, including: determining the current mode of the power module according to the power mode of the operating system; if the power supply mode of the electronic device is DC power supply, determining the mode of the electronic device. The device does not use a power adapter; if the power supply method of the electronic device is regarded as AC power supply, make sure the electronic device uses a power adapter.
可选的,基础状态信息包括外接设备使用信息和显示屏使用信息,获取单元对基础状态信息进行处理,得到电子设备的运行状态信息包括:如果外接设备向电子设备输入事件、显示屏处于亮屏解锁状态、电子设备没有处于合盖状态,确定电子设备处于用户使用的状态;如果外接设备向电子设备输入事件、显示屏处于亮屏解锁状态、电子设备没有处于合盖状态,确定电子设备处于用户没有使用的状态;如果电子设备处于合盖状态和/或显示屏处于亮屏解锁状态,确定电子设备处于用户没有使用的状态。Optionally, the basic status information includes external device usage information and display screen usage information. The acquisition unit processes the basic status information to obtain the running status information of the electronic device including: if the external device inputs an event to the electronic device and the display screen is on In the unlocked state and the electronic device is not in a closed state, it is determined that the electronic device is in a state for use by the user; if the external device inputs an event to the electronic device, the display is in a bright-screen unlocked state, and the electronic device is not in a closed state, it is determined that the electronic device is in a user-friendly state. Not in use; if the electronic device is in a closed state and/or the display is in a bright-screen unlocked state, it is determined that the electronic device is in a state that is not in use by the user.
可选的,确定单元基于电子设备的运行状态信息确定电子设备所处的应用场景包括:根据运行状态信息中的第一部分信息,确定电子设备所处的第一应用场景;根据运行状态信息中的第二部分信息,对第一应用场景进行调整,确定电子设备所处的第二应用场景,电子设备所处的第二应用场景为电子设备所处的应用场景。Optionally, the determining unit determines the application scenario in which the electronic device is located based on the operating status information of the electronic device, including: determining the first application scenario in which the electronic device is located based on the first part of the information in the operating status information; The second part of the information adjusts the first application scenario and determines the second application scenario where the electronic device is located. The second application scenario where the electronic device is located is the application scenario where the electronic device is located.
第三方面,本申请提供一种电子设备,电子设备包括:存储器和一个或多个处理器;其中,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令;当计算机指令被处理器执行时,使得电子设备执行上述方法。In a third aspect, the present application provides an electronic device. The electronic device includes: a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor , causing the electronic device to execute the above method.
第四方面,本申请提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,当计算机程序在电子设备上运行时,使得电子设备执行上述方法。In a fourth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is run on an electronic device, it causes the electronic device to execute the above method.
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods.
附图说明Description of the drawings
为了更清楚地说明本申请实施例的技术方法,下面将对实施例中所需使用的附图作以简单地介绍。In order to explain the technical methods of the embodiments of the present application more clearly, the drawings required to be used in the embodiments will be briefly introduced below.
图1为本申请提供的电子设备的结构示意图;Figure 1 is a schematic structural diagram of an electronic device provided by this application;
图2为本申请提供的电子设备的软件结构框图; Figure 2 is a software structure block diagram of the electronic device provided by this application;
图3为本申请提供的电子设备进行资源调度的示意图;Figure 3 is a schematic diagram of resource scheduling for electronic equipment provided by this application;
图4为本申请提供的系统探针模块的结构示意图;Figure 4 is a schematic structural diagram of the system probe module provided by this application;
图5为本申请提供的资源调度方法的一种信令图;Figure 5 is a signaling diagram of the resource scheduling method provided by this application;
图6为本申请提供的资源调度方法的另一种信令图;Figure 6 is another signaling diagram of the resource scheduling method provided by this application;
图7为本申请提供的浏览器场景下进行资源调度的示意图;Figure 7 is a schematic diagram of resource scheduling in the browser scenario provided by this application;
图8为本申请提供的资源调度装置的结构示意图。Figure 8 is a schematic structural diagram of a resource scheduling device provided by this application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请实施例中,“一个或多个”是指一个、两个或两个以上;“和/或”,描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. The terminology used in the following examples is for the purpose of describing specific embodiments only and is not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a", "an", "said", "above", "the" and "the" are intended to also Expressions such as "one or more" are included unless the context clearly indicates otherwise. It should also be understood that in the embodiments of this application, "one or more" refers to one, two or more than two; "and/or" describes the association relationship of associated objects, indicating that three relationships can exist; for example, A and/or B can mean: A alone exists, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship.
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference in this specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Therefore, the phrases "in one embodiment", "in some embodiments", "in other embodiments", "in other embodiments", etc. appearing in different places in this specification are not necessarily References are made to the same embodiment, but rather to "one or more but not all embodiments" unless specifically stated otherwise. The terms “including,” “includes,” “having,” and variations thereof all mean “including but not limited to,” unless otherwise specifically emphasized.
本申请实施例涉及的多个,是指大于或等于两个。需要说明的是,在本申请实施例的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。The plurality involved in the embodiments of this application refers to more than or equal to two. It should be noted that in the description of the embodiments of this application, words such as "first" and "second" are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating. Or suggestive order.
为了下述各实施例的描述清楚简洁,首先给出相关概念或技术的简要介绍:In order to describe the following embodiments clearly and concisely, a brief introduction to related concepts or technologies is first given:
焦点窗口(Focus Window),指拥有焦点的窗口。焦点窗口是唯一可以接收键盘输入的窗口。焦点窗口的确定方式与系统的焦点模式(Focus Mode)关联。焦点窗口的顶层窗口被称为活动窗口(Active Window)。同一时间只有一个窗口可以是活动窗口。焦点窗口大概率为用户当前需要使用的窗口。焦点窗口可以是焦点应用程序(Application,APP)的窗口,焦点APP是当前前台运行可接收键盘输入和鼠标操作等操作的APP。Focus Window refers to the window that has focus. The focused window is the only window that can receive keyboard input. The way the focus window is determined is related to the system's Focus Mode. The top-level window of the focused window is called the active window (Active Window). Only one window can be active at a time. The focus window is most likely the window that the user currently needs to use. The focus window may be the window of the focus application (Application, APP), and the focus APP is the APP currently running in the foreground that can receive operations such as keyboard input and mouse operations.
非焦点APP是前台运行但是当前不能接收键盘输入和鼠标操作等操作的APP,即一般是指运行在前台但是用户没有操作的APP。A non-focus APP is an APP that is running in the foreground but cannot currently receive keyboard input, mouse operations, etc. That is, it generally refers to an APP that is running in the foreground but has no operations by the user.
后台APP是已经最小化至后台运行的APP。A background APP is an APP that has been minimized to run in the background.
进程包括多个线程,线程可以创建窗口。焦点进程为创建焦点窗口的线程所属的进程。A process includes multiple threads, and threads can create windows. The focus process is the process to which the thread that created the focus window belongs.
长时睿频功耗(Power Limit1,PL1),指CPU在正常负载下的功耗,相当于热设计功耗,CPU绝大部分时间的运行功耗不超过PL1。Long-term turbo power consumption (Power Limit1, PL1) refers to the power consumption of the CPU under normal load, which is equivalent to the thermal design power consumption. The CPU's operating power consumption does not exceed PL1 most of the time.
短时睿频功耗(Power Limit2,PL2),指CPU在短时间内可达到的最高功耗,其具有持续时间限制。一般地,PL2大于PL1,PL1和PL2是平台的名称,在平台, PL1称为SPL(Sustained Power Limit),PL2的一阶段称为FPPT(FAST PPT Limit),PL2的二阶段称为SPPT(SLOW PPT Limit)。Short-term turbo power consumption (Power Limit2, PL2) refers to the highest power consumption that the CPU can achieve in a short period of time, which has a duration limit. Generally, PL2 is larger than PL1, and PL1 and PL2 are The name of the platform, in platform, PL1 is called SPL (Sustained Power Limit), the first stage of PL2 is called FPPT (FAST PPT Limit), and the second stage of PL2 is called SPPT (SLOW PPT Limit).
CPMinCores,是指可处于运行状态的逻辑处理器数的最小占比,取值范围可以是0~100,比如设成20,如果有10个逻辑处理器,则至少有2个逻辑处理器处于运行状态。CPMinCores refers to the minimum proportion of the number of logical processors that can be running. The value range can be 0 to 100. For example, if it is set to 20, if there are 10 logical processors, at least 2 logical processors are running. state.
CPMaxCores,是指可处于运行状态的逻辑处理器数的最大占比,取值范围可以是0~100,比如设成80,如果有10个逻辑处理器,则最多有8个逻辑处理器处于运行状态。CPMaxCores refers to the maximum proportion of the number of logical processors that can be running. The value range can be 0 to 100. For example, if it is set to 80, if there are 10 logical processors, up to 8 logical processors are running. state.
MaxPerformance,是指CPU的性能上限,取值范围可以是0~100,比如设成80,CPU的性能能达到最大性能的80%。MaxPerformance refers to the upper limit of CPU performance, which can range from 0 to 100. For example, if it is set to 80, the CPU performance can reach 80% of the maximum performance.
MinPerformance,是指CPU的性能下限,取值范围可以是0~100,比如设成20,CPU的性能最低能降到最大性能的20%。MinPerformance refers to the lower limit of CPU performance, which can range from 0 to 100. For example, if it is set to 20, the CPU performance can be reduced to 20% of the maximum performance.
CPU能效比(Energy Performance Preference,EPP),用于反映CPU的调度倾向,其取值范围可以是0~255。CPU能效比越小,则表明CPU趋向于高性能;CPU能效比越高,则表明CPU趋向于低功耗。CPU energy efficiency ratio (Energy Performance Preference, EPP) is used to reflect the scheduling tendency of the CPU, and its value range can be 0 to 255. The smaller the CPU energy efficiency ratio, the CPU tends to have high performance; the higher the CPU energy efficiency ratio, the CPU tends to have low power consumption.
能效-性能优化挡位(Energy Performance Optimize Gear,EPO Gear),用来表征DTT调节CPU能效比(EPP)的力度,取值范围可以是1~5,值越大,调节EPP时越倾向能效;值越小,调节EPP时越倾向性能。Energy efficiency-performance optimization gear (Energy Performance Optimize Gear, EPO Gear) is used to represent the intensity of DTT in adjusting the CPU energy efficiency ratio (EPP). The value range can be 1 to 5. The larger the value, the more energy-efficient it is when adjusting EPP; The smaller the value, the more performance-oriented the EPP adjustment is.
电子设备可以将Windows系统作为操作系统,在硬件配置相同的情况下,搭载Windows10系统的电子设备和搭载Windows11系统的电子设备在性能和续航方面差异不大。导致搭载不同操作系统的电子设备在性能和续航方面差异不大的原因在于电子设备的资源调度,其中电子设备的资源调度可以是由Windows系统配置的资源调度机制,Windows系统的资源调度机制是面向所有应用程序的通用的资源调度机制,即针对不同应用程序,电子设备可以采用相同的资源调度机制。Electronic devices can use Windows as the operating system. When the hardware configuration is the same, there is not much difference in performance and battery life between electronic devices equipped with Windows 10 system and electronic devices equipped with Windows 11 system. The reason why electronic devices equipped with different operating systems have little difference in performance and battery life is the resource scheduling of electronic devices. The resource scheduling of electronic devices can be the resource scheduling mechanism configured by the Windows system. The resource scheduling mechanism of the Windows system is oriented to A common resource scheduling mechanism for all applications, that is, electronic devices can use the same resource scheduling mechanism for different applications.
不同应用程序所需的资源可能不同,如office应用程序所需的资源小于游戏应用程序所需的资源。如果Window系统的资源调度机制是根据游戏应用程序设置,那么电子设备以该资源调度机制为office应用程序配置资源时存在资源浪费问题。如果Windows系统的资源调度机制是根据office应用程序设置,那么电子设备以该资源调度机制为游戏应用程序配置资源时存在资源不够的问题,因此电子设备采用通用的资源调度机制不能保证资源在所有应用场景下得到合理分配,在一些应用场景下可能存在性能过剩问题,降低电子设备的续航,从而影响了电子设备最为重要的移动应用场景体验,其中移动应用场景是指电子设备没有连接外部电源,通过电子设备中的电池供电的场景。如果电子设备的续航降低,电子设备通过电池供电时,电子设备的使用时长缩短,影响了电子设备的使用,如用户在室外没有外部电源可连接的环境下,电子设备可使用时长缩短,可能无法满足用户对电子设备的使用。The resources required by different applications may be different. For example, the resources required by office applications are smaller than those required by game applications. If the resource scheduling mechanism of the Window system is set based on the game application, then there will be a waste of resources when the electronic device uses the resource scheduling mechanism to configure resources for the office application. If the resource scheduling mechanism of the Windows system is set according to the office application, then there will be a problem of insufficient resources when the electronic device uses this resource scheduling mechanism to configure resources for the game application. Therefore, the electronic device using a universal resource scheduling mechanism cannot guarantee that the resources are used in all applications. Reasonable allocation in scenarios. In some application scenarios, there may be excessive performance problems, which reduces the battery life of electronic devices, thereby affecting the most important mobile application scenario experience of electronic devices. The mobile application scenario refers to the electronic device not connected to an external power supply. Battery powered scenarios in electronic devices. If the battery life of the electronic device is reduced and the electronic device is powered by the battery, the use time of the electronic device is shortened, which affects the use of the electronic device. For example, when the user is outdoors and there is no external power supply to connect, the usable time of the electronic device is shortened and the electronic device may not be able to be used. Satisfy users' use of electronic devices.
本申请提供一种资源调度方法,该资源调度方法可以利用两级探针进行应用场景识别,以确定电子设备当前所处的应用场景,根据电子设备当前所处的应用场景确定调度策略,根据调度策略进行资源调度。电子设备通过该资源调度方法可以根据电子设备当前所处的应用场景为电子设备合理配置资源,尽可能保证资源在应用场景下得到合理分配,从而降低电子设备功耗,提高电子设备的续航,降低对移动应用场景的影响。因为电子设备可以 根据电子设备当前所处的应用场景合理分配资源,使得资源可以满足该应用场景的资源需求,保证该应用场景下应用程序的流畅运行,提高用户体验。其中两级探针也可以称为两级事件、两级信息、两级数据等中的一种。This application provides a resource scheduling method. The resource scheduling method can use two-level probes to identify application scenarios to determine the current application scenario of the electronic device. The scheduling strategy is determined based on the current application scenario of the electronic device. According to the scheduling Strategies for resource scheduling. Through this resource scheduling method, the electronic device can reasonably allocate resources for the electronic device according to the current application scenario of the electronic device, and ensure that the resources are reasonably allocated under the application scenario as much as possible, thereby reducing the power consumption of the electronic device, improving the battery life of the electronic device, and reducing the Impact on mobile application scenarios. Because electronic devices can Reasonably allocate resources according to the current application scenario of the electronic device, so that the resources can meet the resource requirements of the application scenario, ensure the smooth operation of the application in the application scenario, and improve the user experience. The two-level probe can also be called one of two-level events, two-level information, two-level data, etc.
电子设备可以是平板电脑、桌面型、膝上型、笔记本电脑、超级移动个人计算机(Ultra-mobile Personal Computer,UMPC)、手持计算机、上网本、个人数字助理(Personal Digital Assistant,PDA)等设备。电子设备的结构示意图如图1所示,电子设备可以包括:处理器,外部存储器接口,内部存储器,通用串行总线(Universal Serial Bus,USB)接口,充电管理模块,电源管理模块,电池,天线1,天线2,移动通信模块,无线通信模块,传感器模块,按键,马达,指示器,音频模块,摄像头,显示屏,以及用户标识模块(Subscriber Identification Module,SIM)卡接口等。其中音频模块可以包括扬声器,受话器,麦克风,耳机接口等,传感器模块可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器等。The electronic device can be a tablet computer, desktop, laptop, notebook computer, ultra-mobile personal computer (UMPC), handheld computer, netbook, personal digital assistant (Personal Digital Assistant, PDA) and other devices. The structural diagram of the electronic device is shown in Figure 1. The electronic device may include: processor, external memory interface, internal memory, Universal Serial Bus (USB) interface, charging management module, power management module, battery, antenna 1. Antenna 2, mobile communication module, wireless communication module, sensor module, buttons, motors, indicators, audio modules, cameras, display screens, and Subscriber Identification Module (SIM) card interfaces, etc. The audio module can include speakers, receivers, microphones, headphone jacks, etc. The sensor module can include pressure sensors, gyroscope sensors, air pressure sensors, magnetic sensors, acceleration sensors, distance sensors, proximity light sensors, fingerprint sensors, temperature sensors, and touch sensors. , ambient light sensor, etc.
可以理解的是,本实施例示意的结构并不构成对电子设备的具体限定。在另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。本实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备的结构限定。在另一些实施例中,电子设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, some components may be combined, some components may be separated, or components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware. The interface connection relationships between the modules illustrated in this embodiment are only schematic illustrations and do not constitute structural limitations on the electronic equipment. In other embodiments, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
处理器可以包括一个或多个处理单元,例如:处理器可以包括应用处理器(Application Processor,AP),调制解调处理器,图形处理器(Graphics Processing Unit,GPU),图像信号处理器(Image Signal Processor,ISP),控制器,视频编解码器,数字信号处理器(Digital Signal Processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。处理器是电子设备的神经中枢和指挥中心,控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor may include one or more processing units. For example, the processor may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing Unit, GPU), and an image signal processor (Image processor). Signal Processor (ISP), controller, video codec, digital signal processor (Digital Signal Processor, DSP), baseband processor, and/or neural network processor (Neural-network Processing Unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. The processor is the nerve center and command center of electronic equipment. The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
外部存储器接口可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备的存储能力。外部存储卡通过外部存储器接口与处理器通信,实现数据存储功能。例如将网络的配置信息、调度策略等文件保存在外部存储卡中。内部存储器可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器通过运行存储在内部存储器的指令,从而执行电子设备的各种功能应用以及数据处理。例如,在本申请中,处理器通过运行内部存储器中存储的指令,使得电子设备执行本申请提供的资源调度方法。The external memory interface can be used to connect external memory cards, such as Micro SD cards, to expand the storage capabilities of electronic devices. The external memory card communicates with the processor through the external memory interface to implement data storage functions. For example, save network configuration information, scheduling policy and other files in an external memory card. Internal memory may be used to store computer executable program code, which includes instructions. The processor executes instructions stored in the internal memory to perform various functional applications and data processing of the electronic device. For example, in this application, the processor causes the electronic device to execute the resource scheduling method provided by this application by running instructions stored in the internal memory.
充电管理模块用于从充电器接收充电输入。其中,充电器可以是有线充电器。充电管理模块为电池充电的同时,还可以通过电源管理模块为电子设备供电。The charging management module is used to receive charging input from the charger. Wherein, the charger may be a wired charger. While the charging management module charges the battery, it can also provide power to electronic devices through the power management module.
电源管理模块用于连接电池,充电管理模块与处理器。电源管理模块接收电池和/或充电管理模块的输入,为处理器,内部存储器,外部存储器,显示屏和无线通信模块等供电。在一些实施例中,电源管理模块和充电管理模块也可以设置于同一个器件中。The power management module is used to connect the battery, charging management module and processor. The power management module receives input from the battery and/or charge management module to power the processor, internal memory, external memory, display, wireless communication module, etc. In some embodiments, the power management module and the charging management module can also be provided in the same device.
天线1和天线2用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个 或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover a single or multiple communication bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
移动通信模块可以提供应用在电子设备上的包括2G/3G/4G/5G等无线通信的解决方案。无线通信模块可以提供应用在电子设备上的包括无线局域网(Wireless Local Area Networks,WLAN)(如无线保真(Wireless Fidelity,Wi-Fi)网络),蓝牙(Bluetooth,BT),全球导航卫星系统(Global Navigation Satellite System,GNSS),调频(Frequency Modulation,FM),近距离无线通信技术(Near Field Communication,NFC),红外技术(Infrared,IR)等无线通信的解决方案。Mobile communication modules can provide wireless communication solutions including 2G/3G/4G/5G applied to electronic devices. Wireless communication modules can provide applications in electronic devices including Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) network), Bluetooth (Bluetooth, BT), Global Navigation Satellite System ( Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR) and other wireless communication solutions.
电子设备通过GPU,显示屏,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。电子设备可以通过ISP,摄像头,视频编解码器,GPU,显示屏以及应用处理器等实现拍摄功能。电子设备可以通过音频模块,扬声器,受话器,麦克风,耳机接口,以及应用处理器等实现音频功能。例如音乐播放,录音等。Electronic devices implement display functions through GPUs, displays, and application processors. GPU is an image processing microprocessor that connects the display and application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. The processor may include one or more GPUs that execute program instructions to generate or alter display information. Electronic devices can achieve shooting functions through ISPs, cameras, video codecs, GPUs, displays, and application processors. Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors. Such as music playback, recording, etc.
压力传感器用于感受压力信号,可以将压力信号转换成电信号。陀螺仪传感器可以用于确定电子设备的运动姿态。气压传感器用于测量气压。磁传感器包括霍尔传感器。电子设备可以利用磁传感器检测翻盖皮套的开合。加速度传感器可检测电子设备在各个方向上(一般为三轴)加速度的大小。距离传感器,用于测量距离。Pressure sensors are used to sense pressure signals and convert pressure signals into electrical signals. Gyroscope sensors can be used to determine the motion posture of electronic devices. Air pressure sensors measure air pressure. Magnetic sensors include Hall sensors. Electronic devices can use magnetic sensors to detect the opening and closing of the flip holster. Acceleration sensors can detect the acceleration of electronic devices in all directions (usually three axes). Distance sensor for measuring distance.
接近光传感器可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备通过发光二极管向外发射红外光。电子设备使用光电二极管检测来自附近物体的红外反射光。环境光传感器用于感知环境光亮度。指纹传感器用于采集指纹。温度传感器用于检测温度。触摸传感器,也称“触控器件”。触摸传感器可以设置于显示屏,由触摸传感器与显示屏组成触摸屏,也称“触控屏”。Proximity light sensors may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diode may be an infrared light emitting diode. Electronic devices emit infrared light through light-emitting diodes. Electronic devices use photodiodes to detect infrared reflected light from nearby objects. The ambient light sensor is used to sense ambient light brightness. The fingerprint sensor is used to collect fingerprints. Temperature sensor is used to detect temperature. Touch sensor, also known as "touch device". The touch sensor can be set on the display screen, and the touch sensor and the display screen form a touch screen, also called a "touch screen".
按键包括开机键,音量键等。马达可以产生振动提示。马达可以用于来电振动提示,也可以用于触摸振动反馈。指示器可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口用于连接SIM卡。SIM卡可以通过插入SIM卡接口,或从SIM卡接口拔出,实现和电子设备的接触和分离。Buttons include power button, volume button, etc. The motor can produce vibration cues. The motor can be used to vibrate for incoming calls or for touch vibration feedback. The indicator can be an indicator light, which can be used to indicate charging status, power changes, or can be used to indicate messages, missed calls, notifications, etc. The SIM card interface is used to connect the SIM card. The SIM card can be inserted into or removed from the SIM card interface to achieve contact and separation from the electronic device.
上述电子设备的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Windows系统为例,示例性说明电子设备的软件结构。图2为本申请实施例的电子设备的软件结构框图。The software system of the above-mentioned electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present invention takes the Windows system with a layered architecture as an example to illustrate the software structure of the electronic device. Figure 2 is a software structure block diagram of an electronic device according to an embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,Windows系统包括应用层、子系统动态链接库、驱动层和固件层。The layered architecture divides the software into several layers, and each layer has clear roles and division of labor. The layers communicate through software interfaces. In some embodiments, the Windows system includes an application layer, a subsystem dynamic link library, a driver layer and a firmware layer.
如图2所示,应用层可以包括音乐、视频、游戏、办公、社交等APP。应用层还可以包括系统探针模块、场景识别引擎、执行调度引擎、策略配置模块和管家界面模块。图中仅示出部分应用程序,应用层还可以包括其他应用程序,例如购物应用、浏览器等,本申请不做限定。其中,系统探针模块用于向场景识别引擎进行状态上报;场景识别引擎用于根据系统探针模块上报的状态完成应用场景的识别,根据识别到的应用场景,确定调度策 略;执行调度引擎用于根据调度策略对固件层进行调度。As shown in Figure 2, the application layer can include music, video, games, office, social networking and other APPs. The application layer can also include a system probe module, a scene recognition engine, an execution scheduling engine, a policy configuration module and a housekeeper interface module. Only some applications are shown in the figure. The application layer may also include other applications, such as shopping applications, browsers, etc., which are not limited in this application. Among them, the system probe module is used to report status to the scene recognition engine; the scene recognition engine is used to complete the identification of application scenarios based on the status reported by the system probe module, and determine the scheduling policy based on the identified application scenarios. strategy; the execution scheduling engine is used to schedule the firmware layer according to the scheduling policy.
策略配置模块用于向场景识别引擎发送预先配置的多种调度策略,场景识别引擎在识别到应用场景后,从多种调度策略中查找与识别到的应用场景匹配的调度策略。管家界面模块用于向场景识别模块提供当前使用的系统电源模式,场景识别引擎可以选择与当前使用的系统电源模式和当前所处的应用场景相匹配的调度策略。系统电源模式可以称为系统电源模式信息。The policy configuration module is used to send multiple preconfigured scheduling strategies to the scene recognition engine. After the scene recognition engine recognizes the application scenario, it searches for a scheduling policy that matches the recognized application scenario from the multiple scheduling policies. The housekeeper interface module is used to provide the currently used system power mode to the scene recognition module. The scene recognition engine can select a scheduling strategy that matches the currently used system power mode and the current application scenario. The system power mode may be referred to as system power mode information.
子系统动态链接库包括应用程序接口(application programming interface,API)模块,该API模块包括Windows API,Windows原生API等。其中,Windows API和Windows原生API均可以为APP提供系统调用入口及内部函数支持,区别在于Windows原生API为Windows系统原生的API。例如,Windows API可包括user.dll、kernel.dll,Windows原生API可包括ntdll.dll。其中,user.dll是Windows用户界面接口,可用于执行创建窗口、发送消息等操作。kernel.dll用于为应用程序提供访问内核的接口。ntdll.dll是重要的Windows NT内核级文件。当Windows启动时,ntdll.dll就驻留在内存中特定的写保护区域,使其他程序无法占用这个内存区域。The subsystem dynamic link library includes application programming interface (API) modules, which include Windows API, Windows native API, etc. Among them, both Windows API and Windows native API can provide system call entry and internal function support for APPs. The difference is that Windows native API is an API native to the Windows system. For example, Windows API can include user.dll, kernel.dll, and Windows native API can include ntdll.dll. Among them, user.dll is the Windows user interface interface, which can be used to perform operations such as creating windows and sending messages. kernel.dll is used to provide an interface for applications to access the kernel. ntdll.dll is an important Windows NT kernel-level file. When Windows starts, ntdll.dll resides in a specific write-protected area of memory so that other programs cannot occupy this memory area.
驱动层可以包括进程管理器、虚拟内存管理器、安全引用监视器、输入输出(Input Output,IO)管理器、电源管理器(图中未画出)、Windows管理规范(Windows Management Instrumentation,WMI)插件、事件驱动(Event driver,Event驱动)、系统与芯片(Operating System to System on Chip,OS2SOC)驱动。The driver layer can include process manager, virtual memory manager, security reference monitor, input output (Input Output, IO) manager, power manager (not shown in the figure), Windows Management Instrumentation (WMI) Plug-in, event driver (Event driver), system and chip (Operating System to System on Chip, OS2SOC) driver.
进程管理器用于创建及中止进程和线程。The process manager is used to create and terminate processes and threads.
虚拟内存管理器实现“虚拟内存”。虚拟内存管理器也为高速缓存管理器提供基本的支持。The virtual memory manager implements "virtual memory". The virtual memory manager also provides basic support for the cache manager.
安全引用监视器可在本地计算机上执行安全策略,它保护了操作系统资源,执行运行时对象的保护和监视。The Security Reference Monitor enforces security policies on the local computer, protects operating system resources, and performs runtime object protection and monitoring.
I/O管理器执行独立于设备的输入/输出,并进一步处理调用适当的设备驱动程序。The I/O manager performs device-independent input/output and calls the appropriate device driver for further processing.
电源管理器可管理设备的电源状态更改。The power manager manages changes to a device's power state.
WMI插件可供执行调度引擎向固件层发送调度策略;Event驱动可以与显卡驱动,音视频驱动,摄像头驱动和键盘驱动等进行交互,以使得系统探测模块可以探测到各种事件(也可以称为数据或信息),例如与显卡驱动进行交互,使得系统探测模块可以监测到GPU视频解码事件。OS2SOC驱动可供执行调度引擎向固件层发送调度策略。The WMI plug-in allows the execution scheduling engine to send scheduling policies to the firmware layer; the Event driver can interact with the graphics card driver, audio and video driver, camera driver, keyboard driver, etc., so that the system detection module can detect various events (also known as data or information), for example, interacting with the graphics card driver so that the system detection module can detect GPU video decoding events. The OS2SOC driver can be used by the execution scheduling engine to send scheduling policies to the firmware layer.
固件层包括为电子设备配置的各种硬件和硬件驱动,如固件层包括CPU、鼠标等,固件层还包括鼠标驱动。电子设备配置的硬件所属硬件平台可能不同,如硬件平台包括: (Advanced Micro Devices,AMD),等,这三个硬件平台的调度策略可以不同,因此执行调度引擎在确定调度策略时可以区分硬件平台类型。The firmware layer includes various hardware and hardware drivers configured for electronic devices. For example, the firmware layer includes CPU, mouse, etc. The firmware layer also includes mouse drivers. The hardware configured in electronic equipment may belong to different hardware platforms. For example, the hardware platforms include: (Advanced Micro Devices, AMD), and etc., the scheduling policies of these three hardware platforms can be different, so the execution scheduling engine can distinguish the hardware platform types when determining the scheduling policy.
需要说明的是,本申请以Windows系统举例来说明,在其他操作系统中(例如安卓系统,IOS系统等),只要各个功能模块实现的功能和本申请的实施例类似,也能实现本申请的方案。It should be noted that this application takes the Windows system as an example. In other operating systems (such as Android systems, IOS systems, etc.), as long as the functions implemented by each functional module are similar to the embodiments of the present application, the implementation of the present application can also be implemented. plan.
结合上述图2,图3示出了电子设备进行资源调度的示意图,电子设备的操作系统包 括场景识别引擎、执行调度引擎和芯片调度引擎,场景识别引擎和执行调度引擎位于应用层,场景识别引擎可以作为插件运行,执行调度引擎可以作为服务运行;芯片调度引擎位于驱动层,且芯片调度引擎可以作为服务运行。场景识别引擎可以与执行调度引擎进行交互,场景识别引擎识别出应用场景后,根据应用场景确定调度策略(如一组策略值),将调度策略下发给执行调度引擎,执行调度引擎接收到调度策略后,向场景识别引擎返回接收结果,以指示执行调度引擎接收到调度策略。然后,执行调度引擎向芯片调度引擎发送调度策略,由芯片调度引擎执行调度策略。芯片调度引擎执行的调度策略可以是目标资源调度策略。Combined with the above-mentioned Figure 2, Figure 3 shows a schematic diagram of resource scheduling of an electronic device. The operating system package of the electronic device It includes a scene recognition engine, an execution scheduling engine and a chip scheduling engine. The scene recognition engine and the execution scheduling engine are located in the application layer. The scene recognition engine can run as a plug-in, and the execution scheduling engine can run as a service. The chip scheduling engine is located in the driver layer, and the chip scheduling engine The engine can be run as a service. The scene recognition engine can interact with the execution scheduling engine. After the scene recognition engine identifies the application scenario, it determines the scheduling strategy (such as a set of policy values) based on the application scenario, and sends the scheduling strategy to the execution scheduling engine. The execution scheduling engine receives the scheduling strategy. Finally, the reception result is returned to the scene recognition engine to indicate that the execution scheduling engine has received the scheduling policy. Then, the execution scheduling engine sends the scheduling policy to the chip scheduling engine, and the chip scheduling engine executes the scheduling policy. The scheduling policy executed by the chip scheduling engine may be a target resource scheduling policy.
场景识别引擎包括场景识别模块、场景库、策略调度模块和策略库。执行调度引擎包括场景交互模块、调度策略融合模块和调度执行器。芯片调度引擎包括WMI插件和OS2SOC驱动。下面结合图3,对场景识别引擎、执行调度引擎和芯片调度引擎中各模块进行说明,以阐述利用这三个引擎进行资源调度的过程。The scene recognition engine includes a scene recognition module, a scene library, a policy scheduling module and a policy library. The execution scheduling engine includes a scene interaction module, a scheduling strategy fusion module and a scheduling executor. The chip scheduling engine includes WMI plug-in and OS2SOC driver. The following describes each module in the scene recognition engine, execution scheduling engine, and chip scheduling engine in conjunction with Figure 3 to illustrate the process of resource scheduling using these three engines.
在图3中,场景识别引擎可以分别与系统探针模块、执行调度引擎、策略配置模块和管家界面模块进行交互。管家界面模块可以向场景识别引擎发送电子设备当前使用的系统电源模式,系统电源模式可以辅助场景识别引擎确定调度策略;策略配置模块用于向场景识别引擎发送预先配置的多种调度策略,多种调度策略可以称为多种资源调度策略。In Figure 3, the scene recognition engine can interact with the system probe module, execution scheduling engine, policy configuration module and housekeeper interface module respectively. The housekeeper interface module can send the system power mode currently used by the electronic device to the scene recognition engine. The system power mode can assist the scene recognition engine in determining the scheduling strategy; the policy configuration module is used to send a variety of preconfigured scheduling strategies to the scene recognition engine. Scheduling strategies can be called various resource scheduling strategies.
场景识别引擎中的场景库用于存储多个应用场景,如应用场景包括社交场景、办公场景和浏览器场景等多个主场景,每个主场景下可以划分多个子场景,如浏览器场景包括浏览器上网场景、浏览器音频播放场景和浏览器视频播放场景等。场景识别引擎中的策略库用于存储策略配置模块发送的多种调度策略,调度策略和应用场景可以是一对一关系,如为每个子场景分配一个调度策略。例如调度策略包括大小核调度和办公策略库等,办公策略库中记录与办公应用相关的调度策略,大小核调度是Intel第12代平台的架构提供的大小核调度能力,指示优先使用大核(偏性能)还是小核(偏能效)进行的策略配置。The scene library in the scene recognition engine is used to store multiple application scenarios. For example, the application scenario includes multiple main scenes such as social scenes, office scenes, and browser scenes. Each main scene can be divided into multiple sub-scenarios. For example, the browser scene includes Browser Internet access scenarios, browser audio playback scenarios, browser video playback scenarios, etc. The policy library in the scene recognition engine is used to store multiple scheduling policies sent by the policy configuration module. The scheduling policy and the application scenario can have a one-to-one relationship, such as assigning a scheduling policy to each sub-scenario. For example, scheduling policies include large and small core scheduling and office policy library. The office policy library records scheduling policies related to office applications. Large and small core scheduling is the large and small core scheduling capability provided by the architecture of Intel's 12th generation platform, indicating that large cores are used first ( The strategic configuration is carried out by focusing on performance) or small core (biasing on energy efficiency).
策略调度模块可以向场景识别模块发送查询订阅场景请求,查询订阅场景请求用于触发场景识别模块进行场景识别,查询订阅场景请求可以在电子设备开机后立即发送,也可以定期发送,本实施例不限定。The policy scheduling module can send a query and subscription scenario request to the scene recognition module. The query and subscription scenario request is used to trigger the scene recognition module to perform scene recognition. The query and subscription scenario request can be sent immediately after the electronic device is turned on, or it can be sent regularly. This embodiment does not limited.
场景识别模块在接收到查询订阅场景请求后,向系统探针模块发送查询订阅状态请求,查询订阅状态请求用于指示系统探针模块中的各探针进行状态探测/状态确定等,然后系统探针模块可以向场景识别模块上报电子设备的状态。场景识别模块根据电子设备的状态,从场景库中确定出电子设备当前所处的应用场景,向策略调度模块上报应用场景。策略调度模块可以根据电子设备当前所处的应用场景,从策略库中确定调度策略。After receiving the query subscription scene request, the scene recognition module sends a query subscription status request to the system probe module. The query subscription status request is used to instruct each probe in the system probe module to perform status detection/status determination, etc., and then the system probe module The needle module can report the status of the electronic device to the scene recognition module. The scene recognition module determines the current application scenario of the electronic device from the scenario library according to the status of the electronic device, and reports the application scenario to the policy scheduling module. The policy scheduling module can determine the scheduling policy from the policy library according to the current application scenario of the electronic device.
此外,策略调度模块还可以接收管家界面模块下发的系统电源模式,系统电源模式可根据管家界面模块下发的用户开关标识确定。策略调度模块在确定调度策略时可以参照系统电源模式,例如确定与当前使用的系统电源模式和当前所处的应用场景相匹配的调度策略。又或者系统电源模式作为策略调度模块是否确定调度策略的条件,在系统电源模式为预设模式时,策略调度模块根据应用场景确定调度策略。In addition, the policy scheduling module can also receive the system power mode issued by the butler interface module. The system power mode can be determined according to the user switch identification issued by the butler interface module. The policy scheduling module may refer to the system power mode when determining the scheduling policy, for example, determining a scheduling policy that matches the currently used system power mode and the current application scenario. Or the system power mode is used as a condition for whether the policy scheduling module determines the scheduling policy. When the system power mode is the preset mode, the policy scheduling module determines the scheduling policy according to the application scenario.
策略调度模块将调度策略发送给场景交互模块,场景交互模块在接收到调度策略后,向策略调度模块返回接收结果,接收结果用于指示场景交互模块成功接收到调度策略。场 景交互模块将调度策略发送给调度策略融合模块,由调度策略融合模块对调度策略进行解析转义,以将调度策略中的策略参数解析转义成硬件平台识别的参数。调度策略融合模块将解析转义后的调度策略发送给调度执行器。调度执行器根据硬件平台类型发送解析转义后的调度策略。The policy scheduling module sends the scheduling policy to the scene interaction module. After receiving the scheduling policy, the scene interaction module returns a reception result to the policy scheduling module. The reception result is used to indicate that the scene interaction module successfully received the scheduling policy. field The scene interaction module sends the scheduling policy to the scheduling policy fusion module, and the scheduling policy fusion module parses and escapes the scheduling policy to parse and escape the policy parameters in the scheduling policy into parameters recognized by the hardware platform. The scheduling policy fusion module sends the parsed and escaped scheduling policy to the scheduling executor. The scheduling executor sends the parsed and escaped scheduling policy according to the hardware platform type.
例如如果硬件平台类型为调度执行器可以向OS2SOC驱动向AMD驱动发送解析转义后的调度策略(可以视为第一子策略);如果硬件平台类型为调度执行器可以通过WMI插件向Intel驱动发送解析转义后的调度策略(可以视为第二子策略)。在本实施例中,调度策略可以是芯片调度策略,通过调整芯片的能效比,实现功耗的最佳平衡。例如调度策略可以是CPU的功耗调度策略。For example if the hardware platform type is The scheduling executor can send the parsed and escaped scheduling policy (can be regarded as the first sub-policy) to the OS2SOC driver and the AMD driver; if the hardware platform type is The scheduling executor can send the parsed and escaped scheduling policy (can be regarded as the second sub-policy) to the Intel driver through the WMI plug-in. In this embodiment, the scheduling strategy may be a chip scheduling strategy, which achieves the best balance of power consumption by adjusting the energy efficiency ratio of the chip. For example, the scheduling policy may be the power consumption scheduling policy of the CPU.
如果硬件平台类型为调度执行器可以向电源管理器发送功耗调度策略中的CPU能效比(energy performance preference,EPP)指令,以调整CPU的EPP,EPP用于反映CPU的调度倾向,其取值范围为0~255。CPU能效比越小,则表明CPU趋向于高性能;CPU能效比越高,则表明CPU趋向于低功耗。另外,调度执行器还可以向OS2SOC驱动发送功耗调度策略中的长时睿频功耗(power limit1,PL1)、短时睿频功耗(power limit2,PL2)的指令,以调整CPU的PL1和PL2。PL1指CPU在正常负载下的功耗,相当于热设计功耗,CPU绝大部分时间的运行功耗不超过PL1。PL2指CPU在短时间内可达到的最高功耗,其具有持续时间限制。一般地,PL2大于PL1。若硬件平台类型为调度执行器可以通过WMI插件向Intel DTT驱动(图3中的Intel DTT)发送功耗调度策略,调度策略可包括PL1的最小值、PL1的最大值、PL2、PL2的持续时间及EPP,由Intel DTT驱动CPU基于该调度策略运行。WMI插件、Intel DTT驱动和OS2SOC驱动在接收到调度策略后,可以返回接收结果,接收结果用于指示成功接收到调度策略。If the hardware platform type is The scheduling executor can send the CPU energy efficiency ratio (EPP) instruction in the power consumption scheduling policy to the power manager to adjust the EPP of the CPU. The EPP is used to reflect the scheduling tendency of the CPU, and its value range is 0 to 255. . The smaller the CPU energy efficiency ratio, the CPU tends to have high performance; the higher the CPU energy efficiency ratio, the CPU tends to have low power consumption. In addition, the scheduling executor can also send long-term turbo power consumption (power limit1, PL1) and short-term turbo power consumption (power limit2, PL2) instructions in the power consumption scheduling policy to the OS2SOC driver to adjust the PL1 of the CPU. and PL2. PL1 refers to the power consumption of the CPU under normal load, which is equivalent to the thermal design power consumption. The CPU's operating power consumption does not exceed PL1 most of the time. PL2 refers to the highest power consumption that the CPU can achieve in a short period of time, which has a duration limit. Generally, PL2 is larger than PL1. If the hardware platform type is The scheduling executor can send the power consumption scheduling policy to the Intel DTT driver (Intel DTT in Figure 3) through the WMI plug-in. The scheduling policy can include the minimum value of PL1, the maximum value of PL1, PL2, the duration of PL2 and EPP, which are provided by Intel The DTT driver CPU runs based on this scheduling policy. After receiving the scheduling policy, the WMI plug-in, Intel DTT driver and OS2SOC driver can return the reception result. The reception result is used to indicate that the scheduling policy has been successfully received.
在本实施例中,系统探针模块包括:一级探针和二级探针,一级探针包括电源状态探针、外设状态探针、音视频状态探针和系统负载探针等。二级探针包括APP状态探针和APP行为探针等;一级探针用于确定/探测一级事件(也可以称为一级数据或一级信息等);二级探针可以利用一级探针探测到的一级事件得到二级事件(二级事件也可以称为二级数据或二级信息等),由多个二级探针探测到的二级事件表示电子设备的状态。In this embodiment, the system probe module includes: a primary probe and a secondary probe. The primary probe includes a power status probe, a peripheral status probe, an audio and video status probe, a system load probe, etc. Second-level probes include APP status probes and APP behavior probes; first-level probes are used to determine/detect first-level events (can also be called first-level data or first-level information, etc.); second-level probes can use a The primary event detected by the primary probe is a secondary event (the secondary event can also be called secondary data or secondary information, etc.). The secondary event detected by multiple secondary probes represents the status of the electronic device.
其中,电源状态探针用于获取电源状态事件,例如确定电源的剩余电量等。外设状态探针用于获取电子设备中外设设备的状态事件,如鼠标键盘等的状态,确定是否有鼠标点击事件和键盘输入事件等等。音视频状态探针用于确定音频模块的事件和GPU的事件,例如确定音频模块是否开启,确定GPU视频解码事件,以确定是否播放视频,例如还可以确定是否共享桌面等。系统负载探针用于确定系统负载,例如通过系统负载探针可以确定应用负载和网络IO事件,应用负载是指电子设备向服务器请求的业务量,业务运行时间等等。Among them, the power status probe is used to obtain power status events, such as determining the remaining power of the power supply, etc. Peripheral status probes are used to obtain status events of peripheral devices in electronic devices, such as the status of mouse and keyboard, and determine whether there are mouse click events and keyboard input events, etc. The audio and video status probe is used to determine the events of the audio module and the events of the GPU, such as determining whether the audio module is turned on, determining the GPU video decoding event, and determining whether to play the video. For example, it can also determine whether to share the desktop, etc. The system load probe is used to determine the system load. For example, the system load probe can determine the application load and network IO events. The application load refers to the business volume requested by the electronic device from the server, business running time, etc.
APP状态探针用于确定APP的运行状态,是针对至少一个APP自身状态的确定/探测,例如APP状态探针用于对焦点APP、非焦点APP和后台APP这三种类型APP的运行状态进行探测。后台APP是已经最小化至后台运行的APP,焦点APP是前台可见且焦点所在APP,一般是指运行在前台且用户正在操作的APP,非焦点APP虽然也在前台可见但是焦点不在该APP上,一般是指运行在前台但是用户没有操作的APP。APP行为探针用于确定APP的状态切换行为,如从焦点APP切换为非焦点APP,又例如切换为后台APP等等。 The APP status probe is used to determine the running status of the APP. It is used to determine/detect the status of at least one APP itself. For example, the APP status probe is used to determine the running status of three types of APPs: focus APP, non-focus APP and background APP. detection. A background APP is an APP that has been minimized to run in the background. A focus APP is an APP that is visible in the foreground and has the focus. It generally refers to an APP that is running in the foreground and is being operated by the user. Although a non-focus APP is also visible in the foreground, the focus is not on the APP. Generally refers to an APP that runs in the foreground but is not operated by the user. The APP behavior probe is used to determine the state switching behavior of the APP, such as switching from the focus APP to the non-focus APP, or switching to the background APP, etc.
在本实施例中,一级探针可以借助回调函数获取一级事件。例如电源状态探针可以向内核态订阅电源状态事件,根据内核态反馈的回调函数确定电源状态,电源状态为电源的一级事件,电源状态包括电池(剩余)电量,是否连接电源适配器等。例如,电源状态探针可向驱动层的Event驱动发送订阅电源状态事件的请求,由Event驱动向电源管理器转发该请求。电源管理器可通过该Event驱动向电源状态探针反馈回调函数,电源状态探针可通过回调函数确定电源状态,如通过回调函数确定电池电量。In this embodiment, the first-level probe can obtain the first-level event through the callback function. For example, the power status probe can subscribe to the power status event from the kernel state and determine the power status based on the callback function fed back by the kernel state. The power status is a first-level event of the power supply. The power status includes the battery (remaining) power, whether the power adapter is connected, etc. For example, the power status probe can send a request to subscribe to the power status event to the Event driver of the driver layer, and the Event driver forwards the request to the power manager. The power manager can use this Event driver to feedback the callback function to the power status probe, and the power status probe can determine the power status through the callback function, such as determining the battery level through the callback function.
外设状态探针可以向内核态订阅外设事件,根据内核态反馈的回调函数确定外设事件(即外设设备的状态事件),以通过外设事件反映外设设备的状态,外设事件可以视为是外接设备使用信息。外设事件包括鼠标滚轮滑动事件、鼠标点击事件、键盘输入事件、麦克风输入事件、摄像头输入事件等,如外设状态探针向Event驱动发送订阅鼠标状态事件的请求,Event驱动将订阅鼠标状态事件的请求转发给鼠标驱动,鼠标驱动可以监控鼠标的状态/事件,在监控到鼠标发生点击事件后,向Event驱动反馈回调函数,回调函数可以指示出鼠标发生了点击事件,即外设设备向电子设备输入了事件。Peripheral status probes can subscribe to peripheral events from the kernel state and determine peripheral events (i.e. status events of peripheral devices) based on the callback functions fed back by the kernel state to reflect the status of peripheral devices through peripheral events. Peripheral events It can be regarded as external device usage information. Peripheral events include mouse wheel sliding events, mouse click events, keyboard input events, microphone input events, camera input events, etc. For example, the peripheral status probe sends a request to subscribe to the mouse status event to the Event driver, and the Event driver will subscribe to the mouse status event. The request is forwarded to the mouse driver. The mouse driver can monitor the status/event of the mouse. After monitoring the click event of the mouse, it feeds back the callback function to the Event driver. The callback function can indicate that the click event of the mouse has occurred, that is, the peripheral device sends a message to the electronic device. The device entered an event.
系统负载探针可以向内核态订阅系统负载,根据内核态反馈的回调函数确定系统负载。音视频状态探针可向内核态订阅音视频事件,根据内核态反馈的回调函数确定电子设备当前存在的音视频事件。音视频事件可包括GPU解码事件等。例如,音视频状态探针可向Event驱动发送订阅GPU解码事件的请求,由Event驱动向显卡驱动转发该请求。显卡驱动可以监控GPU的状态,在监控到GPU在进行解码操作后,通过该Event驱动向音视频状态探针反馈回调函数,可以确定使用了GPU。The system load probe can subscribe to the system load in the kernel state and determine the system load based on the callback function fed back by the kernel state. The audio and video status probe can subscribe to audio and video events in the kernel state, and determine the current audio and video events of the electronic device based on the callback function fed back by the kernel state. Audio and video events may include GPU decoding events, etc. For example, the audio and video status probe can send a request to subscribe to the GPU decoding event to the Event driver, and the Event driver forwards the request to the graphics card driver. The graphics card driver can monitor the status of the GPU. After monitoring that the GPU is performing a decoding operation, the Event driver feeds back the callback function to the audio and video status probe to determine that the GPU is used.
图4示出了系统探针模块的架构图,其中一级探针包括:进程探针、焦点变化(全屏)探针、最小化探针、GPU探针、音频探针、Camera探针、PC合盖探针、PC亮屏探针、Windows锁定探针、鼠标键盘外设探针、AC/DC电量探针、系统模式探针和系统负载探针等。Figure 4 shows the architecture diagram of the system probe module. The first-level probes include: process probe, focus change (full screen) probe, minimize probe, GPU probe, audio probe, Camera probe, PC Lid closing probe, PC bright screen probe, Windows lock probe, mouse and keyboard peripheral probe, AC/DC power probe, system mode probe and system load probe, etc.
一级探针可以是电子设备的操作系统(如Windows系统)的基础探针,可将操作系统的开发接口作为一级探针使用,一级探针可通过向Event驱动发送订阅事件请求的方式来获得系统事件。进程探针用于获得操作系统中进程创建和进程退出等与进程变化相关的系统事件;焦点变化(全屏)探针和最小化探针用于获得窗口切换等与APP行为变化相关的系统事件。The first-level probe can be the basic probe of the operating system of the electronic device (such as Windows system). The development interface of the operating system can be used as the first-level probe. The first-level probe can send a subscription event request to the Event driver. to get system events. Process probes are used to obtain system events related to process changes such as process creation and process exit in the operating system; focus change (full screen) probes and minimization probes are used to obtain system events related to APP behavior changes such as window switching.
GPU探针和音频探针可以对应上述图3中的音视频状态探针,GPU探针用于获得与GPU是否使用相关的系统事件,以通过与GPU是否使用相关的系统事件确定是否播放视频和显示图像等等,音频探针用于获得与音频模块是否使用相关的系统事件。PC合盖探针用于确定电子设备是否处于合盖状态,合盖状态是指电子设备的第一本体和第二本体重叠在一起,第一本体上设置有CPU,第二本体上设置有显示屏(例如,PC合盖探针能够用于确定笔记本电脑是否处于合盖状态)。PC亮屏探针用于确定电子设备的显示屏是否处于亮屏状态。Windows锁定探针用于确定操作系统是处于锁屏状态还是解锁状态。鼠标键盘外设探针可以对应上述图3中的外观设计探针,鼠标键盘外设探针用于确定鼠标和键盘等外接设备的系统事件,如确定鼠标是否有点击事件、键盘是否有输入事件等等。The GPU probe and audio probe can correspond to the audio and video status probe in Figure 3 above. The GPU probe is used to obtain system events related to whether the GPU is used to determine whether to play the video and Display images, etc., and the audio probe is used to obtain system events related to whether the audio module is used. The PC cover closing probe is used to determine whether the electronic device is in a closed state. The closed state means that the first body and the second body of the electronic device overlap together. The first body is equipped with a CPU and the second body is provided with a display. screen (for example, a PC cover probe can be used to determine whether a laptop is closed). PC bright screen probe is used to determine whether the display screen of an electronic device is in a bright screen state. The Windows Lock Probe is used to determine whether the operating system is locked or unlocked. The mouse and keyboard peripheral probes can correspond to the design probes in Figure 3 above. The mouse and keyboard peripheral probes are used to determine system events of external devices such as the mouse and keyboard, such as determining whether there are click events on the mouse and input events on the keyboard. etc.
AC/DC电量探针可以对应上述图3中的电源状态探针,AC/DC电量探针用于获得电池 电量以及是否使用电源适配器等与配电相关的系统事件,系统模式探针用于确定操作系统的电源模式,如确定操作系统是否处于节能模式(Power Saving)中。系统负载探针用于获得电子设备的系统负载,系统负载是处于可运行状态的进程和不可中断状态的进程的平均数。可运行状态的进程指正在使用CPU或者等待使用CPU的进程。不可中断状态的进程为等待I/O访问(例如,磁盘I/O)的进程。The AC/DC power probe can correspond to the power status probe in Figure 3 above. The AC/DC power probe is used to obtain the battery System events related to power distribution such as power and whether the power adapter is used. The system mode probe is used to determine the power mode of the operating system, such as determining whether the operating system is in power saving mode (Power Saving). The system load probe is used to obtain the system load of an electronic device. The system load is the average number of processes in the runnable state and processes in the uninterruptible state. A process in a runnable state refers to a process that is using the CPU or waiting to use the CPU. A process in an uninterruptible state is a process waiting for I/O access (for example, disk I/O).
一级探针获得的系统事件(即一级事件)上报给二级探针,由二级探针对一级事件进行计算和处理,以得到二级事件(这里的二级探针相当于是对一级探针上报的事件进行了汇总和分析,从而得到二级事件)。二级探针包括应用切换探针、应用运行状态探针、系统工作状态探针、电源模式探针。应用切换探针对应上述图3中的APP行为探针,应用运行状态探针对应上述图3中的APP状态探针。The system events (i.e., first-level events) obtained by the first-level probe are reported to the second-level probe, and the second-level probe calculates and processes the first-level event to obtain the second-level event (the second-level probe here is equivalent to the The events reported by the first-level probes are summarized and analyzed to obtain the second-level events). Secondary probes include application switching probes, application running status probes, system working status probes, and power mode probes. The application switching probe corresponds to the APP behavior probe in Figure 3 above, and the application running status probe corresponds to the APP status probe in Figure 3 above.
其中应用切换探针可以根据进程探针、焦点变化(全屏)探针和最小化探针获得的系统事件,得到APP切换动作事件,APP切换动作事件包括APP之间的切换事件和APP的运行阶段切换事件,如焦点APP从一个APP切换至另一个APP,如从游戏APP切换至浏览器APP,又例如焦点APP从一个运行阶段切换至另一个运行阶段,如游戏APP从游戏登陆切换至游戏中。应用切换探针可以输出焦点APP的应用名称和应用类型、非焦点APP的应用名称和应用类型、后台APP的应用名称和应用类型,应用切换探针通过不同时刻下焦点变化(全屏)探针和最小化探针获得的系统事件可以确定APP是否发生切换(即得到APP之间的切换事件),以及在发生切换后从哪个APP切换至哪个APP,同样的应用切换探针通过不同时刻下进程探针获得的系统事件可确定焦点APP的运行阶段是否发生变化,即得到APP运行阶段切换事件。应用名称和应用类型可根据预设的APP名字类型配置得到。The application switching probe can obtain the APP switching action event based on the system events obtained by the process probe, focus change (full screen) probe and minimization probe. The APP switching action event includes switching events between APPs and the running stage of the APP. Switching events, such as the focus APP switching from one APP to another APP, such as switching from a game APP to a browser APP, or the focus APP switching from one running stage to another running stage, such as the game APP switching from game login to in-game . The application switching probe can output the application name and application type of the focus APP, the application name and application type of the non-focus APP, and the application name and application type of the background APP. The application switching probe uses the focus change (full screen) probe and The system events obtained by the minimization probe can determine whether the APP switches (that is, the switching event between APPs is obtained), and which APP is switched to which APP after the switching occurs. The same application switching probe probes the process at different times. The obtained system events can be used to determine whether the running phase of the focus APP has changed, that is, the APP running phase switching event is obtained. The application name and application type can be configured according to the default APP name type.
应用切换探针结合GPU探针、音频探针、Camera探针,得到应用运行状态探针;应用运行状态探针根据应用切换探针、GPU探针、音频探针和Camera探针获得的系统事件,获得焦点APP、非焦点APP和后台APP的应用名称和应用类型,以及每个APP的运行状态,例如应用运行状态探针输出焦点APP的应用名称、应用类型和运行状态,输出非焦点APP的应用名称、应用类型和运行状态,输出后台APP的应用名称、应用类型和运行状态,其中运行状态可根据GPU探针、音频探针和Camera探针获得的系统事件确定。一种方式可以是:在根据进程探针、焦点变化(全屏)探针和最小化探针计算出应用切换探针后,通过GPU探针、音频探针和Camera探针,获得应用是否使用GPU、音频、Camera的状态,如使用GPU和Camera,则得出APP运行状态为视频状态,如未使用GPU和Camera,仅使用音频,则得出APP运行状态为音频状态。是否使用GPU、音频、Camera的应用可以是焦点APP、非焦点APP和后台APP中的至少一种APP。The application switching probe combines the GPU probe, audio probe, and Camera probe to obtain the application running status probe; the application running status probe is based on the system events obtained by the application switching probe, GPU probe, audio probe, and Camera probe. , obtain the application name and application type of the focus APP, non-focus APP and background APP, as well as the running status of each APP. For example, the application running status probe outputs the application name, application type and running status of the focus APP, and outputs the application name, application type and running status of the non-focus APP. The application name, application type and running status are output. The application name, application type and running status of the background APP are output. The running status can be determined based on the system events obtained by the GPU probe, audio probe and Camera probe. One way can be: after calculating the application switching probe based on the process probe, focus change (full screen) probe and minimize probe, obtain whether the application uses the GPU through the GPU probe, audio probe and Camera probe , audio, and camera status. If the GPU and Camera are used, the APP running status is the video status. If the GPU and Camera are not used, and only audio is used, the APP running status is the audio status. The application that uses GPU, audio, and camera can be at least one of the focus APP, non-focus APP, and background APP.
例如应用切换探针确定当前焦点APP为视频类,在运行视频类APP时电子设备可能处于视频浏览中也可能处于视频播放中,那么应用运行状态探针可通过GPU探针的系统事件进一步确定,如GPU探针获取到系统事件指示使用GPU 3D引擎,则表明使用GPU进行2D或者3D渲染操作,可以推断用户在使用电子设备浏览视频资源,而非播放视频,即视频类APP处于浏览视频状态中。For example, the application switching probe determines that the current focus APP is a video type. When running a video type APP, the electronic device may be in video browsing or video playback. Then the application running status probe can be further determined through the system events of the GPU probe. If the GPU probe obtains a system event indicating the use of the GPU 3D engine, it indicates that the GPU is used for 2D or 3D rendering operations. It can be inferred that the user is using an electronic device to browse video resources instead of playing videos, that is, the video APP is in the state of browsing videos. .
系统工作状态探针通过PC合盖探针、PC亮屏探针、Windows锁定探针、鼠标键盘外设探针得到,系统工作状态探针可以根据这四个一级探针获得的系统事件确定操作系统是 否处于用户使用的状态;例如鼠标键盘外设探针确定有鼠标点击事件和键盘输入事件,且PC合盖探针确定电子设备没有合盖,PC亮屏探针确定显示屏处于亮屏中,那么系统工作状态探针可确定操作系统处于用户使用的状态。The system working status probe is obtained through the PC cover closing probe, PC bright screen probe, Windows lock probe, and mouse and keyboard peripheral probe. The system working status probe can be determined based on the system events obtained by these four first-level probes. The operating system is Whether it is in the state of user use; for example, the mouse and keyboard peripheral probe determines that there are mouse click events and keyboard input events, and the PC cover closing probe determines that the electronic device is not closed, and the PC bright screen probe determines that the display screen is on. Then the system working status probe can determine that the operating system is in a state used by the user.
电源模式探针通过AC/DC电量探针和系统模式探针,根据AC/DC电量探针和系统模式探针获得的系统事件,得出系统电源模式,系统电源模式用于指示是否使用电源适配器使用,是否处于平衡模式或者性能模式等。例如通过AC/DC电量探针可以获得电源是处于AC状态还是DC状态,以通过AC状态确定没有使用电源适配器,通过DC状态确定使用了电源适配器;通过系统模式探针可以确定操作系统的电源模式,如处于最佳能效模式,还是处于平衡模式,还是处于最佳性能等模式;电源模式探针可以将AC/DC电量探针和系统模式探针获得的系统事件叠加得到系统电源模式,如通过AC/DC电路探针确定处于DC状态,通过系统模式探针确定处于平衡模式,那么电源模式探针可确定电子设备使用了电源适配器,且电源模式处于平衡模式。The power mode probe uses the AC/DC power probe and the system mode probe to determine the system power mode based on the system events obtained by the AC/DC power probe and the system mode probe. The system power mode is used to indicate whether to use the power adapter. Use, whether in balance mode or performance mode, etc. For example, the AC/DC power probe can be used to determine whether the power supply is in the AC state or the DC state. The AC state can be used to determine that the power adapter is not used, and the DC state can be used to determine that the power adapter is used. The system mode probe can be used to determine the power mode of the operating system. , such as in the best energy efficiency mode, balanced mode, or best performance mode; the power mode probe can superpose the system events obtained by the AC/DC power probe and the system mode probe to obtain the system power mode, such as through The AC/DC circuit probe determines that it is in the DC state and the system mode probe determines that it is in balanced mode. Then the power mode probe can determine that the electronic device uses a power adapter and the power mode is in balanced mode.
通过以上二级探针获得的二级事件,系统探针模块可以得到混合状态,混合状态包含了应用状态信息和操作系统状态信息,如应用状态信息包括焦点APP、非焦点APP和后台APP中至少一个APP的信息,如APP的应用名称、应用类型和运行状态等。操作系统状态信息用于指示操作系统(也可以是电子设备)是否处于用户使用的状态、系统电源模式等。应用状态信息可以称为应用运行状态信息,操作系统状态信息包括系统工作状态和系统电源模式信息。Through the secondary events obtained by the above secondary probes, the system probe module can obtain the mixed state. The mixed state includes application state information and operating system state information. For example, the application state information includes at least one of the focus APP, non-focus APP and background APP. Information about an APP, such as the APP’s application name, application type and running status, etc. The operating system status information is used to indicate whether the operating system (which can also be an electronic device) is in the state used by the user, the system power mode, etc. Application status information may be called application running status information, and operating system status information includes system working status and system power mode information.
二级探针将混合状态上报(也可以称为状态上报)给场景识别引擎,场景识别引擎根据二级探针上报的信息,识别出电子设备当前所处的应用场景。一种方式可以是:场景识别引擎可以根据混合状态中部分信息确定原始应用场景,再根据混合状态中剩余信息对原始应用场景进行纠正/调整,确定目标应用场景。一种示例中,场景识别引擎可以根据混合状态中的应用状态信息(可以是应用运行状态信息)确定原始应用场景,然后根据混合状态中的操作系统状态信息(如系统工作状态)对原始应用场景进行纠正/调整,确定目标应用场景。The secondary probe reports the mixed status (also called status reporting) to the scene recognition engine. The scene recognition engine identifies the current application scenario of the electronic device based on the information reported by the secondary probe. One way can be: the scene recognition engine can determine the original application scenario based on part of the information in the mixed state, and then correct/adjust the original application scenario based on the remaining information in the mixed state to determine the target application scenario. In one example, the scene recognition engine can determine the original application scenario based on the application status information in the mixed state (which may be application running status information), and then identify the original application scenario based on the operating system status information in the mixed state (such as system working status). Make corrections/adjustments to determine target application scenarios.
例如场景识别引擎可以根据应用运行状态探针上报的与应用状态相关的二级事件,确定原始应用场景;然后场景识别引擎根据系统工作状态探针上报的与设备使用相关的二级事件对原始应用场景进行一次纠正,根据电源模式探针上报的与电源相关的二级事件进行场景补充。如场景识别引擎确定原始应用场景后,如果根据系统工作状态探针上报的操作系统处于用户使用的状态,场景识别引擎将原始应用场景确定为目标应用场景;如果根据系统工作状态探针上报的操作系统没有处于用户使用的状态,场景识别引擎对原始应用场景进行纠正,确定电子设备处于空闲场景,将空闲场景作为目标应用场景。此外场景识别引擎还可以利用电源模式探针对目标应用场景进行补充,例如将系统电源模式补充到目标应用场景中,使得调度策略可以与系统电源模式匹配。For example, the scene recognition engine can determine the original application scenario based on the secondary events related to the application status reported by the application running status probe; then the scenario recognition engine can determine the original application scenario based on the secondary events related to the device usage reported by the system working status probe. The scene is corrected once, and the scene is supplemented based on the power-related secondary events reported by the power mode probe. For example, after the scene recognition engine determines the original application scenario, if the operating system reported by the system working status probe is in a state used by the user, the scenario recognition engine determines the original application scenario as the target application scenario; if the operating system reported by the system working status probe is The system is not in the state of user use. The scene recognition engine corrects the original application scene, determines that the electronic device is in an idle scene, and uses the idle scene as the target application scene. In addition, the scene recognition engine can also use power mode probes to supplement target application scenarios. For example, the system power mode can be added to the target application scenario so that the scheduling policy can match the system power mode.
场景识别引擎通过场景注册方式监听到电子设备当前所处的应用场景后进行场景决策,场景决策是为了确定与应用场景匹配的调度策略。其中场景识别引擎可以根据应用场景和操作系统的电源模式(由管家界面模块下发给场景识别引擎),从配置文件中查找匹配的调度策略,配置文件可以存储在策略库中,配置文件包括模式配置和场景策略配置,模式配 置中记录电源模式和场景策略配置的对应关系,场景策略配置中记录应用场景和调度策略的对应关系。场景识别模式通过模式配置可以为不同电源模式配置不同的场景策略配置,以使得调度策略与电源模式的需求相匹配。The scene recognition engine monitors the current application scenario of the electronic device through scene registration and makes scene decision-making. The scene decision-making is to determine the scheduling strategy that matches the application scenario. The scene recognition engine can search for matching scheduling policies from the configuration file based on the application scenario and the power mode of the operating system (issued to the scene recognition engine by the housekeeper interface module). The configuration file can be stored in the policy library, and the configuration file includes patterns. Configuration and scenario policy configuration, mode configuration The corresponding relationship between the power mode and the scene policy configuration is recorded in the center, and the corresponding relationship between the application scenario and the scheduling policy is recorded in the scene policy configuration. The scene recognition mode can configure different scene policy configurations for different power modes through mode configuration, so that the scheduling policy matches the needs of the power mode.
场景识别引擎根据操作系统的电源模式,从模式配置中确定场景策略配置;然后根据应用场景从场景策略配置中查找匹配的调度策略,具体来说,可以预先确定多种场景与相应的调度策略的对应关系,然后再基于该对应关系确定出与当前场景匹配的调度策略。如果场景识别引擎查找到调度策略,场景识别引擎可以向执行调度引擎发送调度策略;如果场景识别引擎没有查找到调度策略,场景识别引擎向执行调度引擎发送默认的调度策略。如果场景识别引擎根据任一应用场景没有查找到调度策略,场景识别引擎可以向执行调度引擎发送默认的调度策略,因此对于没有查找到调度策略的应用场景来说,默认的调度策略是没有查找到调度策略的应用场景共用的一个调度策略。The scene recognition engine determines the scene policy configuration from the mode configuration according to the power mode of the operating system; then it searches for a matching scheduling policy from the scene policy configuration according to the application scenario. Specifically, it can predetermine multiple scenarios and corresponding scheduling policies. The corresponding relationship is then determined based on the corresponding relationship to determine the scheduling strategy that matches the current scenario. If the scene recognition engine finds the scheduling policy, the scene recognition engine can send the scheduling policy to the execution scheduling engine; if the scene recognition engine does not find the scheduling policy, the scene recognition engine sends the default scheduling policy to the execution scheduling engine. If the scenario recognition engine does not find the scheduling policy according to any application scenario, the scenario recognition engine can send the default scheduling policy to the execution scheduling engine. Therefore, for the application scenario where the scheduling policy is not found, the default scheduling policy is not found. A scheduling strategy common to the application scenarios of the scheduling strategy.
默认的调度策略也是预先设置的一个调度策略,该默认的调度策略可以与场景策略配置中的调度策略不同,也可以是从场景策略配置中选择一个调度策略作为默认的调度策略,如选择使用次数最多的调度策略为默认的调度策略。在本实施例中,调度策略可以针对的是CPU的功耗调度策略,相对应的调度策略包括CPU的PL1、CPU的PL2及CPU的EPP,通过不同硬件平台的驱动执行该调度策略。The default scheduling policy is also a preset scheduling policy. The default scheduling policy can be different from the scheduling policy in the scene policy configuration. It can also be a scheduling policy selected from the scene policy configuration as the default scheduling policy, such as selecting the number of uses. The scheduling policy with the most is the default scheduling policy. In this embodiment, the scheduling policy may be targeted at the power consumption scheduling policy of the CPU. The corresponding scheduling policy includes PL1 of the CPU, PL2 of the CPU, and EPP of the CPU. The scheduling policy is executed through drivers of different hardware platforms.
此外模式配置还可以作为是否确定调度策略的预设条件,如在模式配置指示处于AC模式下(即使用了电源适配器),场景识别引擎可以不执行确定调度策略的流程,或者场景识别引擎在确定调度策略后禁止向执行调度引擎下发调度策略。In addition, the mode configuration can also be used as a preset condition for determining whether to determine the scheduling policy. For example, when the mode configuration indicates that it is in AC mode (that is, the power adapter is used), the scene recognition engine may not execute the process of determining the scheduling policy, or the scene recognition engine may not perform the process of determining the scheduling policy. It is prohibited to deliver the scheduling policy to the execution scheduling engine after scheduling the policy.
在这里说明一点:一级探针的使用可以根据当前运行的APP确定,如果当前运行的APP不是预设APP,禁止使用至少一个一级探针,预设APP可以是对电子设备的资源调度进行调整的APP,如视频APP、游戏APP、浏览器APP等。进程探针、焦点变化(全屏)探针和最小化探针中的至少一个可以获取到APP的应用名称和应用类型,因此本实施例可通过这三个探针中的至少一个获取到当前运行的APP的应用名称和应用类型,判断当前运行的APP是否是预设APP,如果不是,禁止使用GPU探针、音频探针、Camera探针、PC合盖探针、PC亮屏探针、Windows锁定探针、鼠标键盘外设探针、AC/DC电量探针、系统模式探针和系统负载探针等。One point to note here: the use of first-level probes can be determined based on the currently running APP. If the currently running APP is not the default APP, it is prohibited to use at least one first-level probe. The default APP can be used for resource scheduling of electronic devices. Adjusted APPs, such as video APPs, game APPs, browser APPs, etc. At least one of the process probe, the focus change (full screen) probe, and the minimize probe can obtain the application name and application type of the APP. Therefore, this embodiment can obtain the current running status through at least one of these three probes. The application name and application type of the APP are used to determine whether the currently running APP is a default APP. If not, the use of GPU probes, audio probes, Camera probes, PC cover closing probes, PC bright screen probes, and Windows probes is prohibited. Lock probe, mouse and keyboard peripheral probe, AC/DC power probe, system mode probe and system load probe, etc.
结合图3和图4给出本申请提供的资源调度方法的信令图,如图5所示,资源调度方法可以包括以下步骤:The signaling diagram of the resource scheduling method provided by this application is given in conjunction with Figure 3 and Figure 4. As shown in Figure 5, the resource scheduling method may include the following steps:
S501、策略配置模块向场景识别引擎下发多种调度策略,多种调度策略存储在策略库中;策略配置模块还可以向场景识别引擎下发多种应用场景,多种应用场景存储在场景库中。当然策略配置模块可以向场景识别引擎下发场景策略配置,场景策略配置包括调度策略和应用场景,调度策略和应用场景可以是一对一关系。S501. The policy configuration module delivers multiple scheduling policies to the scene recognition engine, and the multiple scheduling policies are stored in the policy library; the policy configuration module can also deliver multiple application scenarios to the scene recognition engine, and the multiple application scenarios are stored in the scene library. middle. Of course, the policy configuration module can issue scene policy configuration to the scene recognition engine. The scene policy configuration includes scheduling policies and application scenarios. Scheduling policies and application scenarios can have a one-to-one relationship.
S502、管家界面模块向场景识别引擎下发系统电源模式,系统电源模式用于指示是否使用电源适配器使用,是否处于系统节电模式或者性能模式等。S502. The housekeeper interface module delivers the system power mode to the scene recognition engine. The system power mode is used to indicate whether to use the power adapter, whether it is in the system power saving mode or performance mode, etc.
S503、场景识别引擎中的策略调度模块向场景识别引擎中的场景识别模块发送查询订阅场景请求,查询订阅场景请求用于触发场景识别模块进行场景识别,查询订阅场景请求可以在电子设备开机后立即发送,也可以定期发送,本实施例不限定。 S503. The policy scheduling module in the scene recognition engine sends a query and subscription scene request to the scene recognition module in the scene recognition engine. The query and subscription scene request is used to trigger the scene recognition module to perform scene recognition. The query and subscription scene request can be made immediately after the electronic device is turned on. It can be sent or sent regularly, which is not limited in this embodiment.
S504、场景识别模块向系统探针模块发送查询订阅状态请求,查询订阅状态请求用于指示系统探针模块中的各探针进行状态探测/状态确定等。S504. The scene recognition module sends a query subscription status request to the system probe module. The query subscription status request is used to instruct each probe in the system probe module to perform status detection/status determination, etc.
S505、系统探针模块利用两级探针得到混合状态,混合状态包括应用状态信息和操作系统状态信息,如应用状态信息包括焦点APP、非焦点APP和后台APP中至少一个APP的信息,如APP的应用名称、应用类型和运行状态等。操作系统状态信息用于指示是否操作系统处于用户使用的状态、操作系统的电源模式等。S505. The system probe module uses a two-level probe to obtain a mixed state. The mixed state includes application state information and operating system state information. For example, the application state information includes information about at least one APP among the focus APP, the non-focus APP, and the background APP. For example, APP application name, application type and running status, etc. The operating system status information is used to indicate whether the operating system is in a state used by the user, the power mode of the operating system, etc.
S506、系统探针模块向场景识别模块上报混合状态。S506. The system probe module reports the mixed status to the scene recognition module.
S507、场景识别模块根据混合状态,从场景库中选择电子设备当前所处的应用场景,并向策略调度模块上报应用场景。S507. The scene identification module selects the application scene currently in which the electronic device is located from the scene library according to the mixed state, and reports the application scene to the policy scheduling module.
S508、策略调度模块根据系统电源模式和应用场景,从策略库中选择调度策略。在本实施例中,步骤S502在步骤S508之前执行即可,例如可以在执行步骤S503之后执行步骤S502。S508. The policy scheduling module selects a scheduling policy from the policy library according to the system power mode and application scenario. In this embodiment, step S502 may be executed before step S508. For example, step S502 may be executed after step S503.
S509、策略调度模块向执行调度引擎中的场景交互模块下发调度策略,场景交互模块向策略调度模块反馈接收结果。S509. The policy scheduling module delivers the scheduling policy to the scene interaction module in the execution scheduling engine, and the scene interaction module feeds back the reception result to the policy scheduling module.
S510、场景交互模块向执行调度引擎中的调度策略融合模块发送调度策略。S510. The scene interaction module sends the scheduling policy to the scheduling policy fusion module in the execution scheduling engine.
S511、调度策略融合模块对调度策略进行解析转义,以将调度策略中的策略解析转义成硬件平台识别的参数。S511. The scheduling policy fusion module parses and escapes the scheduling policy, so as to parse and escape the policy in the scheduling policy into parameters recognized by the hardware platform.
S512、调度策略融合模块将解析转义后的调度策略发送给调度执行器。S512. The scheduling policy fusion module sends the parsed and escaped scheduling policy to the scheduling executor.
S513、调度执行器根据硬件平台类型发送解析转义后的调度策略。S513. The scheduling executor sends the parsed and escaped scheduling policy according to the hardware platform type.
上述图4和图5示出了场景识别引擎根据二级探针获得的二级事件确定应用场景、执行调度引擎根据应用场景确定调度策略的一种可行方式,场景识别引擎和执行调度引擎还可以采用其他方式来使用二级事件。例如一种示例中,场景识别引擎根据一部分二级探针获得的二级事件确定原始应用场景,根据原始应用场景确定原始调度策略;然后场景识别引擎根据剩余二级探针获得的二级事件对原始应用场景和原始调度策略进行调整。也就是说通过一部分二级探针确定原始应用场景和原始调度策略,再通过剩余的二级探针获得的二级事件对原始应用场景和原始调度策略进行调整,得到目标应用场景和目标调度策略。其信令图如图6所示,可以包括以下步骤:The above-mentioned Figures 4 and 5 show a feasible way for the scene recognition engine to determine the application scenario based on the secondary events obtained by the secondary probe, and the execution scheduling engine to determine the scheduling strategy based on the application scenario. The scenario recognition engine and the execution scheduling engine can also Use secondary events in other ways. For example, in one example, the scene recognition engine determines the original application scenario based on the secondary events obtained by a part of the secondary probes, and determines the original scheduling strategy based on the original application scenarios; then the scenario recognition engine determines the original application scenario based on the secondary events obtained by the remaining secondary probes. The original application scenario and the original scheduling strategy are adjusted. That is to say, the original application scenario and the original scheduling strategy are determined through a part of the secondary probes, and then the original application scenario and the original scheduling strategy are adjusted through the secondary events obtained by the remaining secondary probes to obtain the target application scenario and the target scheduling strategy. . The signaling diagram is shown in Figure 6, which can include the following steps:
S601、策略配置模块向场景识别引擎下发多种调度策略,多种调度策略存储在策略库中;策略配置模块还可以向场景识别引擎下发多种应用场景,多种应用场景存储在场景库中。当然策略配置模块可以向场景识别引擎下发场景策略配置,场景策略配置包括调度策略和应用场景,调度策略和应用场景是一对一关系。S601. The policy configuration module delivers multiple scheduling policies to the scene recognition engine, and the multiple scheduling policies are stored in the policy library; the policy configuration module can also deliver multiple application scenarios to the scene recognition engine, and the multiple application scenarios are stored in the scene library. middle. Of course, the policy configuration module can issue scene policy configuration to the scene recognition engine. Scene policy configuration includes scheduling policies and application scenarios. Scheduling policies and application scenarios have a one-to-one relationship.
S602、管家界面模块向场景识别引擎下发系统电源模式,系统电源模式用于指示是否使用电源适配器使用,是否处于系统节电模式或者性能模式等。S602. The housekeeper interface module delivers the system power mode to the scene recognition engine. The system power mode is used to indicate whether to use the power adapter, whether it is in the system power saving mode or performance mode, etc.
S603、场景识别引擎中的策略调度模块向场景识别引擎中的场景识别模块发送查询订阅场景请求,查询订阅场景请求用于触发场景识别模块进行场景识别,查询订阅场景请求可以在电子设备开机后立即发送,也可以定期发送,本实施例不限定。S603. The policy scheduling module in the scene recognition engine sends a query and subscription scene request to the scene recognition module in the scene recognition engine. The query and subscription scene request is used to trigger the scene recognition module to perform scene recognition. The query and subscription scene request can be made immediately after the electronic device is turned on. It can be sent or sent regularly, which is not limited in this embodiment.
S604、场景识别引擎向系统探针模块发送查询订阅状态请求,查询订阅状态请求用于指示系统探针模块中的各探针进行状态探测/状态确定等。 S604. The scene recognition engine sends a query subscription status request to the system probe module. The query subscription status request is used to instruct each probe in the system probe module to perform status detection/status determination, etc.
S605、系统探针模块利用一级探针获得一级事件,利用二级探针结合一级事件获得二级事件。例如一级探针包括:进程探针、焦点变化(全屏)探针、最小化探针、GPU探针、音频探针、Camera探针、PC合盖探针、PC亮屏探针、Windows锁定探针、鼠标键盘外设探针、AC/DC电量探针、系统模式探针和系统负载探针等,系统探针模块利用这些一级探针获得一级事件。S605. The system probe module uses the first-level probe to obtain the first-level event, and uses the second-level probe to combine the first-level event to obtain the second-level event. For example, the first-level probes include: process probe, focus change (full screen) probe, minimize probe, GPU probe, audio probe, Camera probe, PC lid closing probe, PC bright screen probe, and Windows lock Probes, mouse and keyboard peripheral probes, AC/DC power probes, system mode probes and system load probes, etc. The system probe module uses these first-level probes to obtain first-level events.
二级探针包括第一部分二级探针和第二部分二级探针,第一部分二级探针用于确定应用场景,第二部分二级探针用于调整原始调度策略。例如第一部分二级探针包括应用切换探针和应用运行状态探针,第二部分二级探针包括系统工作状态探针和电源模式探针。第一部分二级探针的二级事件上报给场景识别模块,第二部分二级探针的二级事件可以上报给执行调度引擎中的调度策略融合模块。The secondary probes include the first part of the secondary probe and the second part of the secondary probe. The first part of the secondary probe is used to determine the application scenario, and the second part of the secondary probe is used to adjust the original scheduling policy. For example, the first part of the second-level probes includes application switching probes and application running status probes, and the second part of the second-level probes includes system working status probes and power mode probes. The secondary events of the first part of the secondary probes are reported to the scene recognition module, and the secondary events of the second part of the secondary probes can be reported to the scheduling policy fusion module in the execution scheduling engine.
S606、场景识别模块根据第一部分二级探针获得的二级事件,从场景库中选择电子设备当前所处的原始应用场景,并向策略调度模块上报原始应用场景。S606. The scene recognition module selects the original application scenario where the electronic device is currently located from the scene library based on the secondary events obtained by the first part of the secondary probe, and reports the original application scenario to the policy scheduling module.
S607、策略调度模块根据系统电源模式和原始应用场景,从策略库中选择原始调度策略。在本实施例中,步骤S602在步骤S607之前执行即可,例如可以在执行步骤S603之后执行步骤S602。S607. The policy scheduling module selects the original scheduling policy from the policy library according to the system power mode and the original application scenario. In this embodiment, step S602 may be executed before step S607. For example, step S602 may be executed after step S603.
S608、策略调度模块根据第二部分二级探针获得的二级事件,对原始应用场景进行调整,得到目标应用场景;结合目标应用场景对原始调度策略进行调整,得到目标调度策略。S608. The policy scheduling module adjusts the original application scenario according to the secondary events obtained by the second part of the secondary probe to obtain the target application scenario; it adjusts the original scheduling policy based on the target application scenario to obtain the target scheduling policy.
S609、策略调度模块向执行调度引擎中的场景交互模块下目标调度策略,场景交互模块向策略调度模块反馈接收结果。S609. The policy scheduling module sends the target scheduling policy to the scene interaction module in the execution scheduling engine, and the scene interaction module feeds back the reception result to the policy scheduling module.
S610、场景交互模块向执行调度引擎中的调度策略融合模块发送目标调度策略。S610. The scene interaction module sends the target scheduling policy to the scheduling policy fusion module in the execution scheduling engine.
S611、调度策略融合模块对目标调度策略进行解析转义,以将目标调度策略中的策略解析转义成硬件平台识别的参数。S611. The scheduling policy fusion module parses and escapes the target scheduling policy, so as to parse and escape the policy in the target scheduling policy into parameters recognized by the hardware platform.
S612、调度策略融合模块将解析转义后的目标调度策略发送给调度执行器。S612. The scheduling policy fusion module sends the parsed and escaped target scheduling policy to the scheduling executor.
S613、调度执行器根据硬件平台类型解析转义后的目标调度策略。S613. The scheduling executor parses the escaped target scheduling policy according to the hardware platform type.
下面结合示例进行说明,如图7所示,阐述了电子设备识别出浏览器场景,并对浏览器场景进行资源调度的过程。用户在操作系统的系统界面打开chrome浏览器时,进程探针可以检测到用户打开了chrome浏览器,确定创建了chrome进程,焦点变化(全屏)换探针和最小化探针也可以检测到用户打开了chrome浏览器,以确定出chrome浏览器为焦点APP,其中chrome浏览器的应用名称和应用类型可从APP分类配置中获得。进程探针、焦点变化(全屏)换探针和最小化探针将获得的一级事件发送给应用切换探针,如将创建了chrome进程和chrome浏览器为焦点APP发送给应用切换探针,应用切换探针确定当前焦点APP为chrome浏览器。The following is explained with an example. As shown in Figure 7, the process of the electronic device identifying the browser scene and scheduling resources for the browser scene is explained. When the user opens the chrome browser in the system interface of the operating system, the process probe can detect that the user has opened the chrome browser and confirm that the chrome process has been created. The focus change (full screen) probe and minimize probe can also detect the user. Open the chrome browser to determine the chrome browser as the focus APP. The application name and application type of the chrome browser can be obtained from the APP classification configuration. The process probe, focus change (full screen) probe and minimize probe will send the obtained first-level events to the application switching probe. For example, if a chrome process is created and the chrome browser is the focus APP, it will be sent to the application switching probe. The application switching probe determines that the currently focused APP is the Chrome browser.
在用户打开了chrome浏览器后,GPU探针、音频探针和Camera探针可以在用户使用chrome浏览器过程中反馈与GPU、音频和摄像头相关的一级事件,应用运行状态探针可以结合应用切换探针确定的当前焦点APP为chrome浏览器、与GPU、音频和摄像头相关的一级事件,确定chrome浏览器的运行状态,如是上网中,还是播放视频等等。After the user opens the Chrome browser, the GPU probe, audio probe, and Camera probe can feed back first-level events related to the GPU, audio, and camera while the user is using the Chrome browser. The application running status probe can be combined with the application The current focus APP determined by the switching probe is the chrome browser, first-level events related to GPU, audio and camera, and determines the running status of the chrome browser, such as surfing the Internet, playing videos, etc.
场景识别模块可以根据应用运行状态探针上报的chrome浏览器的运行状态确定出应用场景,当然应用运行状态探针可以将应用切换探针、GPU探针、音频探针和Camera探 针获得的事件发送给场景识别模块,场景识别模块根据应用切换探针获得的事件确定主场景为浏览器场景,根据GPU探针、音频探针和Camera探针获得的事件确定出子场景,子场景即为电子设备当前所处的原始应用场景。在实际应用中,应用切换探针、GPU探针、音频探针和Camera探针可以向场景识别模块发送事件。其中进程探针、焦点变化(全屏)换探针和最小化探针获得的一级事件可以作为主场景特征因子,GPU探针、音频探针和Camera探针获得的事件可以作为子场景特征因子。The scene recognition module can determine the application scenario based on the running status of the Chrome browser reported by the application running status probe. Of course, the application running status probe can combine application switching probes, GPU probes, audio probes and Camera probes. The events obtained by the needle are sent to the scene identification module. The scene identification module determines the main scene as the browser scene based on the events obtained by the application switching probe, and determines the sub-scene based on the events obtained by the GPU probe, audio probe and Camera probe. The scenario is the original application scenario in which the electronic device is currently located. In practical applications, application switching probes, GPU probes, audio probes and Camera probes can send events to the scene recognition module. Among them, the first-level events obtained by the process probe, focus change (full screen) probe and minimization probe can be used as main scene feature factors, and the events obtained by GPU probe, audio probe and Camera probe can be used as sub-scene feature factors. .
场景识别模块向策略调度模块发送原始应用场景,由策略调度模块确定调度策略,调度策略包括多个策略参数,策略参数是根据实测和调优得到的。例如浏览器场景包括浏览器上网场景、浏览器播放视频场景和浏览器语音场景等,浏览器上网场景、浏览器播放视频场景和浏览器语音场景分别对应一个调度策略。例如浏览器上网场景对应浏览器策略1,浏览器播放视频场景对应浏览器策略2,浏览器语音场景对应浏览器策略3。场景识别模块识别原始应用场景为浏览器上网场景,那么策略调度模块可以确定调度策略为浏览器策略1,浏览器策略1可以包括:PL1、PL2、EPP、CPMinCores、CPMaxCores、MaxPerformance和MinPerformance,PL1和PL2是Intel平台的名称,在AMD平台,PL1称为SPL(Sustained Power Limit),PL2的一阶段称为FPPT(FAST PPT Limit),PL2的二阶段称为SPPT(SLOW PPT Limit)。CPMinCores是指可处于运行状态的逻辑处理器数的最小占比,取值0~100,比如设成20,如果有10个逻辑处理器,则至少有2个逻辑处理器处于运行状态;CPMaxCores是指可处于运行状态的逻辑处理器数的最大占比,取值0~100,比如设成80,如果有10个逻辑处理器,则最多有8个逻辑处理器处于运行状态;MaxPerformance是指CPU的性能上限,取值0~100,比如设成80,CPU的性能能达到最大性能的80%;MinPerformance是指CPU的性能下限,取值0~100,比如设成20,CPU的性能最低能降到最大性能的20%。The scene identification module sends the original application scenario to the policy scheduling module, and the policy scheduling module determines the scheduling strategy. The scheduling strategy includes multiple policy parameters, and the policy parameters are obtained based on actual measurement and tuning. For example, browser scenarios include browser online scenarios, browser video playback scenarios, and browser voice scenarios. The browser online scenarios, browser video playback scenarios, and browser voice scenarios each correspond to a scheduling policy. For example, the browser Internet access scenario corresponds to browser policy 1, the browser video playback scenario corresponds to browser policy 2, and the browser voice scenario corresponds to browser policy 3. The scene recognition module recognizes that the original application scenario is a browser Internet scenario, then the policy scheduling module can determine the scheduling policy as browser policy 1. Browser policy 1 can include: PL1, PL2, EPP, CPMinCores, CPMaxCores, MaxPerformance and MinPerformance, PL1 and PL2 is the name of the Intel platform. On the AMD platform, PL1 is called SPL (Sustained Power Limit), the first stage of PL2 is called FPPT (FAST PPT Limit), and the second stage of PL2 is called SPPT (SLOW PPT Limit). CPMinCores refers to the minimum proportion of the number of logical processors that can be in the running state, ranging from 0 to 100. For example, if it is set to 20, if there are 10 logical processors, at least 2 logical processors are in the running state; CPMaxCores is Refers to the maximum proportion of the number of logical processors that can be in the running state, ranging from 0 to 100. For example, if it is set to 80, if there are 10 logical processors, up to 8 logical processors are in the running state; MaxPerformance refers to the CPU The upper limit of performance, ranging from 0 to 100. For example, if it is set to 80, the performance of the CPU can reach 80% of the maximum performance; MinPerformance refers to the lower limit of performance of the CPU, ranging from 0 to 100. For example, if it is set to 20, the performance of the CPU can reach the lowest performance. down to 20% of maximum performance.
策略调度模块可以结合决策特征因子对原始应用场景进行调整。例如决策特征因子可以是PC合盖探针、PC亮屏探针、Windows锁定探针、鼠标键盘外设探针、AC/DC电量探针、系统模式探针和系统负载探针等探测到的一级事件。如果决策特征因子对浏览器上网场景有影响,则策略调度模块对原始应用场景进行调整,例如决策特征因子确定出电子设备处于空闲态中,则策略调度模块确定电子设备处于空闲状态,从浏览器上网场景调整为空闲场景,空闲场景为目标应用场景,再结合空闲场景对浏览器策略1中的策略参数进行调整,以适配空闲态的电子设备。如果决策特征因子对浏览器上网场景没有影响,策略调度模块不对原始应用场景和原始调度策略(如浏览器策略1)进行调整。The policy scheduling module can adjust the original application scenario based on decision-making characteristic factors. For example, the decision-making characteristic factors can be detected by PC lid closing probe, PC bright screen probe, Windows lock probe, mouse and keyboard peripheral probe, AC/DC power probe, system mode probe and system load probe. Level 1 event. If the decision characteristic factor has an impact on the browser Internet scenario, the policy scheduling module adjusts the original application scenario. For example, the decision characteristic factor determines that the electronic device is in an idle state, and the policy scheduling module determines that the electronic device is in an idle state. From the browser The Internet access scene is adjusted to the idle scene, and the idle scene is the target application scene. Then, the policy parameters in the browser policy 1 are adjusted based on the idle scene to adapt to the idle electronic device. If the decision-making characteristic factors have no impact on the browser Internet scenario, the policy scheduling module will not adjust the original application scenario and the original scheduling policy (such as browser policy 1).
策略调度模块向场景交互模块发送最终的浏览器策略1,场景交互模块将最终的浏览器策略1写入到融合调度队列中,调度策略融合模块从融合调度队列中获取最终的浏览器策略1,并根据硬件平台类型完成转义,通过调度执行器向硬件平台发送。The policy scheduling module sends the final browser policy 1 to the scene interaction module. The scene interaction module writes the final browser policy 1 into the fusion scheduling queue. The scheduling policy fusion module obtains the final browser policy 1 from the fusion scheduling queue. And complete the escape according to the hardware platform type, and send it to the hardware platform through the scheduling executor.
以硬件平台是为例,如果硬件平台为策略调度融合模块根据获取到的目标调度策略(如最终的浏览器策略1)确定动态调谐技术策略号。The hardware platform is and For example, if the hardware platform is The policy scheduling fusion module determines the dynamic tuning technology policy number based on the obtained target scheduling policy (such as the final browser policy 1).
动态调谐技术(dynamic tuning technology,DTT)是公司在处理器和独立显卡之间自动并动态分配功耗,以优化性能并延长电池续航时间的技术,其可以使CPU和GPU的性能得到提升,智能混合工作负载功率平衡。可以理解地,DTT策 略号与目标调度策略可以存在映射关系,如预先构建一张DTT策略表,任何一条目标调度策略能通过其内的策略参数映射到DTT策略表中某个DTT策略号,如图7中所示,浏览器策略1对应策略号2。Dynamic tuning technology (DTT) is The company is in processor and Technology that automatically and dynamically allocates power consumption between independent graphics cards to optimize performance and extend battery life. It can improve CPU and GPU performance and intelligently balance workloads for mixed workloads. Understandably, DTT policy There can be a mapping relationship between the number and the target scheduling policy. For example, if a DTT policy table is built in advance, any target scheduling policy can be mapped to a certain DTT policy number in the DTT policy table through the policy parameters in it, as shown in Figure 7. Browser policy 1 corresponds to policy number 2.
其中,DTT策略号可用于标识一种DTT策略,DTT策略号对应的DTT策略用于调整CPU的PL1_MINI、PL1_MAX、PL2、PL2_TIME、EPO Gear。PL1_MINI为PL1的最小值,PL1_MAX为PL1的最大值,PL2_TIME为PL2的持续时间。能效-性能优化挡位(Energy Performance Optimize Gear,EPO Gear)用来表征DTT调节CPU能效比(EPP)的力度,取值范围1~5,值越大,调节EPP时越倾向能效;值越小,调节EPP时越倾向性能。Among them, the DTT policy number can be used to identify a DTT policy, and the DTT policy corresponding to the DTT policy number is used to adjust the PL1_MINI, PL1_MAX, PL2, PL2_TIME, and 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. Energy efficiency-performance optimization gear (Energy Performance Optimize Gear, EPO Gear) is used to represent the intensity of DTT in adjusting the CPU energy efficiency ratio (EPP). The value ranges from 1 to 5. The larger the value, the more energy efficiency is inclined when adjusting EPP; the smaller the value , the more performance-oriented when adjusting EPP.
策略调度融合模块可以向调度执行器发送DTT策略号。在一种可选的实施方式中,策略调度融合模块也可直接向调度执行器发送该DTT策略号对应的功DTT策略,调度执行器向Intel DTT驱动发送DTT策略号,Intel DTT驱动执行DTT策略号对应的调度策略,如图7中调用DTT性能控制表,DTT性能控制表即是DTT策略号对应的调度策略,上层调度执行器发送的调度策略。The policy scheduling fusion module can send the DTT policy number to the scheduling executor. In an optional implementation, the policy scheduling fusion module can also directly send the functional DTT policy corresponding to the DTT policy number to the scheduling executor. The scheduling executor sends the DTT policy number to the Intel DTT driver, and the Intel DTT driver executes the DTT policy. The scheduling policy corresponding to the number is called the DTT performance control table as shown in Figure 7. The DTT performance control table is the scheduling policy corresponding to the DTT policy number and the scheduling policy sent by the upper-layer scheduling executor.
如果硬件平台为调度策略融合模块可以通过调度执行器向电源管理器发送调整EPP的指令,电源管理器可调整CPU的EPP。另外,调度执行器还可以向OS2SOC驱动节点发送调整PL1、PL2的指令,OS2SOC驱动节点驱动CPU的PL1和PL2。如图7中所示将AMD性能参数的取值和Windows参数的取值设置为调度策略中相应策略参数的取值。If the hardware platform is The scheduling policy fusion module can send instructions to adjust the EPP to the power manager through the scheduling executor, and the power manager can adjust the EPP of the CPU. In addition, the scheduling executor can also send instructions to adjust PL1 and PL2 to the OS2SOC driver node, and the OS2SOC driver node drives PL1 and PL2 of the CPU. As shown in Figure 7, the values of the AMD performance parameters and the values of the Windows parameters are set to the values of the corresponding policy parameters in the scheduling policy.
对于这两个硬件平台,调度策略可以将过温保护作为基础策略,以防止电子设备的温度过高,发生危险。此外如果调度策略模块根据应用场景没有匹配到调度策略,则下发默认的调度策略。如果场景识别模块至调度执行器的工作失效,Intel DTT驱动可以执行自建策略,自建策略包括多个参数,通过自建策略完成资源调度,自建策略可以是与电子设备当前所处场景相关的一个策略,如在浏览器场景下,自建策略是一个浏览器场景性能控制的策略,通过该自建策略完成资源调度,通过自建策略来补充完善调度策略。for and For these two hardware platforms, the scheduling strategy can use over-temperature protection as a basic strategy to prevent the temperature of electronic equipment from being too high and causing danger. In addition, if the scheduling policy module does not match the scheduling policy based on the application scenario, the default scheduling policy will be delivered. If the work of the scene recognition module to the scheduling executor fails, the Intel DTT driver can execute a self-built strategy. The self-built strategy includes multiple parameters. Resource scheduling is completed through the self-built strategy. The self-built strategy can be related to the current scene of the electronic device. A strategy, such as in the browser scenario, the self-built strategy is a browser scenario performance control strategy. Resource scheduling is completed through the self-built strategy, and the scheduling strategy is supplemented and improved by the self-built strategy.
此外,本申请还提供一种资源调度装置,装置应用于电子设备,电子设备的操作系统为Windows系统,资源调度装置的结构示意图如图8所示,可以包括:获取单元100、确定单元200和调度单元300。In addition, this application also provides a resource scheduling device. The device is applied to electronic equipment. The operating system of the electronic device is a Windows system. The structural diagram of the resource scheduling device is shown in Figure 8. It may include: an acquisition unit 100, a determination unit 200 and Scheduling unit 300.
获取单元100,用于基于电子设备的系统探针模块获取电子设备的基础状态信息;对基础状态信息进行处理,得到电子设备的运行状态信息,电子设备的运行状态信息包括电子设备的应用运行状态,系统工作状态以及系统电源模式信息中的至少一种;确定单元200,用于基于电子设备的运行状态信息确定电子设备所处的应用场景;基于电子设备所处的应用场景确定出与电子设备所处的应用场景相匹配的目标资源调度策略,目标资源调度策略包括中央处理器功耗调度策略;调度单元300,用于根据目标资源调度策略对电子设备进行资源调度。The acquisition unit 100 is used to obtain the basic status information of the electronic device based on the system probe module of the electronic device; process the basic status information to obtain the running status information of the electronic device, and the running status information of the electronic device includes the application running status of the electronic device. , at least one of system working status and system power mode information; the determining unit 200 is used to determine the application scenario in which the electronic device is located based on the operating status information of the electronic device; determine the application scenario related to the electronic device based on the application scenario in which the electronic device is located A target resource scheduling strategy that matches the application scenario. The target resource scheduling strategy includes a CPU power consumption scheduling strategy; the scheduling unit 300 is used to schedule resources for the electronic device according to the target resource scheduling strategy.
其中,运行状态信息对应二级事件,基础状态信息对应一级事件,基础状态信息包括:与应用相关的基础运行信息、音视频使用信息、电源模式使用信息、外接设备使用信息和显示屏使用信息中的至少一种,与应用相关的基础运行信息至少包括焦点应用的应用名称 和应用类型。Among them, the running status information corresponds to the second-level event, and the basic status information corresponds to the first-level event. The basic status information includes: basic running information related to the application, audio and video usage information, power mode usage information, external device usage information and display usage information. At least one of the above, the basic running information related to the application at least includes the application name of the focus application and application type.
例如,应用相关的基础运行信息包括:焦点应用的应用名称和应用类型、非焦点应用的应用名称和应用类型、后台应用的应用名称和应用类型;音视频使用信息包括:是否使用图形处理器的信息、是否使用音频模块的信息和是否使用摄像头的信息;电源模式使用信息包括:操作系统的电源模式和电子设备的供电方式;外接设备使用信息包括:是否使用外接设备的信息;显示屏使用信息包括:显示屏的亮屏信息、显示屏的锁屏解锁信息、电子设备是否处于合盖状态的信息。For example, the basic running information related to the application includes: the application name and application type of the focus application, the application name and application type of the non-focus application, the application name and application type of the background application; audio and video usage information includes: whether to use the graphics processor information, whether to use the audio module and whether to use the camera; power mode usage information includes: the power mode of the operating system and the power supply mode of the electronic device; external device usage information includes: information about whether to use external devices; display screen usage information Including: the screen bright information of the display screen, the lock screen unlock information of the display screen, and the information of whether the electronic device is in a closed state.
在一些示例中,获取单元100对基础状态信息进行处理,得到电子设备的运行状态信息包括:从基础状态信息中获取焦点应用的应用名称和应用类型、非焦点应用的应用名称和应用类型、后台应用的应用名称和应用类型;如果基础状态信息中音视频使用信息指示应用使用图形处理器和摄像头,确定应用的运行状态为视频状态,应用包括焦点应用、非焦点应用和后台应用中的至少一种;如果基础状态信息中音视频使用信息指示应用使用音频模块,确定应用的运行状态为音频状态;如果基础状态信息中音视频使用信息指示应用使用图形处理器、摄像头和音频模块,确定应用的运行状态为音视频状态。In some examples, the acquisition unit 100 processes the basic status information to obtain the running status information of the electronic device including: obtaining the application name and application type of the focus application, the application name and application type of the non-focus application, and the background information from the basic status information. The application name and application type of the application; if the audio and video usage information in the basic status information indicates that the application uses the graphics processor and camera, determine that the running state of the application is the video state, and the application includes at least one of the focus application, non-focus application and background application. kind; if the audio and video usage information in the basic status information indicates that the application uses the audio module, determine that the running state of the application is the audio state; if the audio and video usage information in the basic status information indicates that the application uses the graphics processor, camera and audio module, determine the application's running status. The running state is audio and video state.
在一些示例中,获取单元100对基础状态信息进行处理,得到电子设备的运行状态信息包括:根据操作系统的电源模式,确定电子设备当前所处的模式;如果电子设备的供电方式为直流供电,确定电子设备没有使用电源适配器;如果电子设备的供电方式视为交流供电,确定电子设备使用电源适配器。In some examples, the acquisition unit 100 processes the basic status information to obtain the operating status information of the electronic device including: determining the current mode of the electronic device according to the power mode of the operating system; if the power supply mode of the electronic device is DC power supply, Make sure the electronic device does not use a power adapter; if the electronic device is powered by AC power, make sure the electronic device uses a power adapter.
在一些示例中,基础状态信息包括外接设备使用信息和显示屏使用信息,获取单元100对基础状态信息进行处理,得到电子设备的运行状态信息包括:如果外接设备向电子设备输入事件、显示屏处于亮屏解锁状态、电子设备没有处于合盖状态,确定电子设备处于用户使用的状态;如果外接设备向电子设备输入事件、显示屏处于亮屏解锁状态、电子设备没有处于合盖状态,确定电子设备处于用户没有使用的状态;如果电子设备处于合盖状态和/或显示屏处于亮屏解锁状态,确定电子设备处于用户没有使用的状态。In some examples, the basic status information includes external device usage information and display screen usage information. The acquisition unit 100 processes the basic status information, and obtains the running status information of the electronic device including: if the external device inputs an event to the electronic device, the display screen is in If the screen is in the unlocked state and the electronic device is not in the cover-closed state, it is determined that the electronic device is in the state of use by the user; if the external device inputs an event to the electronic device, the display is in the screen-on-unlocked state, and the electronic device is not in the cover-closed state, it is determined that the electronic device is in the state of being used by the user. It is in a state that is not in use by the user; if the electronic device is in a closed state and/or the display is in a bright-screen unlocked state, it is determined that the electronic device is in a state that is not in use by the user.
可选的,确定单元200基于电子设备的运行状态信息确定电子设备所处的应用场景包括:根据运行状态信息中的第一部分信息,确定电子设备所处的第一应用场景;根据运行状态信息中的第二部分信息,对第一应用场景进行调整,确定电子设备所处的第二应用场景,电子设备所处的第二应用场景为电子设备所处的应用场景。例如根据运行状态信息中的应用运行状态和电子设备的系统负载,确定第一应用场景;根据运行状态信息中的第二部分信息,对第一应用场景进行调整,确定电子设备所处的第二应用场景包括:如果运行状态信息中的系统工作状态信息指示电子设备处于用户使用的状态,将第一应用场景确定为第二应用场景;如果运行状态信息中的系统工作状态信息指示电子设备处于用户没有使用的状态,确定电子设备处于空闲场景,空闲场景为第二应用场景。Optionally, the determining unit 200 determines the application scenario in which the electronic device is located based on the operating status information of the electronic device, including: determining the first application scenario in which the electronic device is located based on the first part of the information in the operating status information; The second part of the information is used to adjust the first application scenario and determine the second application scenario where the electronic device is located. The second application scenario where the electronic device is located is the application scenario where the electronic device is located. For example, the first application scenario is determined based on the application running status in the running status information and the system load of the electronic device; the first application scenario is adjusted based on the second part of the information in the running status information, and the second application scenario where the electronic device is located is determined. The application scenarios include: if the system working status information in the running status information indicates that the electronic device is in a state used by the user, the first application scenario is determined as the second application scenario; if the system working status information in the running status information indicates that the electronic device is in a state used by the user When not in use, it is determined that the electronic device is in an idle scene, and the idle scene is the second application scene.
在确定单元200确定目标资源调度策略时,如果电子设备没有使用电源适配器,基于电子设备所处的应用场景和系统电源模式信息,确定出与电子设备的应用场景相匹配的目标资源调度策略;如果电子设备使用电源适配器,确定单元200禁止基于电子设备所处的应用场景确定出与电子设备所处的应用场景相匹配的目标资源调度策略。When the determining unit 200 determines the target resource scheduling policy, if the electronic device does not use a power adapter, based on the application scenario and system power mode information of the electronic device, a target resource scheduling policy that matches the application scenario of the electronic device is determined; if The electronic device uses a power adapter, and the determining unit 200 prohibits determining a target resource scheduling policy that matches the application scenario in which the electronic device is located based on the application scenario in which the electronic device is located.
可选的,中央处理器功耗调度策略包括第一子策略和第二子策略,第二子策略为根据 第一子策略确定的动态调谐技术策略;调度单元300根据目标资源调度策略调整电子设备进行资源调度包括:若硬件平台类型为第一类型,根据第一子策略对电子设备进行资源调度;若硬件平台类型为第二类型,根据第二子策略对电子设备进行资源调度。第一类型可以是AMD,第二类型可以是Intel。Optionally, the CPU power consumption scheduling strategy includes a first sub-strategy and a second sub-strategy, and the second sub-strategy is based on The dynamic tuning technology strategy determined by the first sub-strategy; the scheduling unit 300 adjusts the electronic device for resource scheduling according to the target resource scheduling policy, including: if the hardware platform type is the first type, resource scheduling for the electronic device according to the first sub-strategy; if the hardware platform The platform type is the second type, and resource scheduling is performed on the electronic device according to the second sub-policy. The first type may be AMD and the second type may be Intel.
可选的,方法还包括:如果目标资源调度策略失效,获得预先设置的自建策略;根据自建策略对电子设备进行资源调度。Optionally, the method also includes: if the target resource scheduling strategy fails, obtain a preset self-built strategy; and perform resource scheduling for the electronic device according to the self-built strategy.
本申请提供一种电子设备,电子设备包括:存储器和一个或多个处理器;其中,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令;当计算机指令被处理器执行时,使得电子设备执行上述方法。This application provides an electronic device. The electronic device includes: a memory and one or more processors; wherein the memory is used to store computer program codes, and the computer program codes include computer instructions; when the computer instructions are executed by the processor, the electronic device Execute the above method.
本申请提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,当计算机程序在电子设备上运行时,使得电子设备执行上述方法。The present application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is run on an electronic device, it causes the electronic device to execute the above method.
上述各个附图对应的流程或结构的描述各有侧重,某个流程或结构中没有详述的部分,可以参见其他流程或结构的相关描述。 The descriptions of the processes or structures corresponding to each of the above drawings have different emphasis. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

Claims (13)

  1. 一种资源调度方法,其特征在于,所述方法应用于电子设备,所述电子设备的操作系统为Windows系统,所述方法包括:A resource scheduling method, characterized in that the method is applied to electronic equipment, and the operating system of the electronic equipment is a Windows system. The method includes:
    基于所述电子设备的系统探针模块获取所述电子设备的基础状态信息;Obtain basic status information of the electronic device based on the system probe module of the electronic device;
    对所述基础状态信息进行处理,得到所述电子设备的运行状态信息,所述电子设备的运行状态信息包括所述电子设备的应用运行状态,系统工作状态以及系统电源模式信息中的至少一种;The basic status information is processed to obtain the running status information of the electronic device. The running status information of the electronic device includes at least one of the application running status, system working status and system power mode information of the electronic device. ;
    基于所述电子设备的运行状态信息确定所述电子设备所处的应用场景;Determine the application scenario in which the electronic device is located based on the operating status information of the electronic device;
    基于所述电子设备所处的应用场景确定出与所述电子设备所处的应用场景相匹配的目标资源调度策略,所述目标资源调度策略包括中央处理器功耗调度策略;Determine a target resource scheduling policy that matches the application scenario where the electronic device is located based on the application scenario where the electronic device is located, where the target resource scheduling policy includes a central processor power consumption scheduling policy;
    根据所述目标资源调度策略对所述电子设备进行资源调度。Resource scheduling is performed on the electronic device according to the target resource scheduling policy.
  2. 根据权利要求1所述的方法,其特征在于,所述基础状态信息包括:与应用相关的基础运行信息、音视频使用信息、电源模式使用信息、外接设备使用信息和显示屏使用信息中的至少一种,所述与应用相关的基础运行信息至少包括所述焦点应用的应用名称和应用类型。The method according to claim 1, characterized in that the basic status information includes: at least one of basic operation information related to the application, audio and video usage information, power mode usage information, external device usage information and display screen usage information. In one method, the basic operation information related to the application at least includes the application name and application type of the focus application.
  3. 根据权利要求2所述的方法,其特征在于,所述应用相关的基础运行信息包括:所述焦点应用的应用名称和应用类型、非焦点应用的应用名称和应用类型、后台应用的应用名称和应用类型;The method according to claim 2, characterized in that the basic operation information related to the application includes: the application name and application type of the focus application, the application name and application type of the non-focus application, the application name of the background application and App types;
    所述音视频使用信息包括:是否使用图形处理器的信息、是否使用音频模块的信息和是否使用摄像头的信息;The audio and video usage information includes: information on whether to use a graphics processor, information on whether to use an audio module, and information on whether to use a camera;
    所述电源模式使用信息包括:操作系统的电源模式和所述电子设备的供电方式;The power mode usage information includes: the power mode of the operating system and the power supply mode of the electronic device;
    所述外接设备使用信息包括:是否使用外接设备的信息;The external device usage information includes: information on whether the external device is used;
    所述显示屏使用信息包括:显示屏的亮屏信息、所述显示屏的锁屏解锁信息、所述电子设备是否处于合盖状态的信息。The display screen usage information includes: screen on information of the display screen, screen lock and unlock information of the display screen, and information on whether the electronic device is in a closed state.
  4. 根据权利要求1至3中任意一项所述的方法,其特征在于,所述对所述基础状态信息进行处理,得到所述电子设备的运行状态信息包括:The method according to any one of claims 1 to 3, characterized in that, processing the basic status information to obtain the operating status information of the electronic device includes:
    从所述基础状态信息中获取所述焦点应用的应用名称和应用类型、非焦点应用的应用名称和应用类型、后台应用的应用名称和应用类型;Obtain the application name and application type of the focus application, the application name and application type of the non-focus application, and the application name and application type of the background application from the basic status information;
    如果所述基础状态信息中音视频使用信息指示应用使用图形处理器和/或摄像头,确定应用的运行状态为视频状态,所述应用包括所述焦点应用、所述非焦点应用和所述后台应用中的至少一种;If the audio and video usage information in the basic status information indicates that the application uses a graphics processor and/or camera, it is determined that the running status of the application is the video status, and the application includes the focus application, the non-focus application and the background application. at least one of;
    如果所述基础状态信息中音视频使用信息指示应用使用音频模块,确定应用的运行状态为音频状态;If the audio and video usage information in the basic status information indicates that the application uses the audio module, determine that the running status of the application is the audio status;
    如果所述基础状态信息中音视频使用信息指示应用使用图形处理器、摄像头和音频模块,确定应用的运行状态为音视频状态。If the audio and video usage information in the basic status information indicates that the application uses a graphics processor, camera and audio module, it is determined that the running status of the application is the audio and video status.
  5. 根据权利要求3或4所述的方法,其特征在于,所述对所述基础状态信息进行处理,得到所述电子设备的运行状态信息包括:The method according to claim 3 or 4, characterized in that said processing the basic status information to obtain the operating status information of the electronic device includes:
    根据所述操作系统的电源模式,确定所述电子设备当前所处的模式; Determine the current mode of the electronic device according to the power mode of the operating system;
    如果所述电子设备的供电方式为直流供电,确定所述电子设备没有使用所述电源适配器;如果所述电子设备的供电方式视为交流供电,确定所述电子设备使用所述电源适配器。If the power supply mode of the electronic device is DC power supply, it is determined that the electronic device does not use the power adapter; if the power supply mode of the electronic device is regarded as AC power supply, it is determined that the electronic device uses the power adapter.
  6. 根据权利要求3至5中任意一项所述的方法,其特征在于,所述基础状态信息包括外接设备使用信息和显示屏使用信息,所述对所述基础状态信息进行处理,得到所述电子设备的运行状态信息包括:The method according to any one of claims 3 to 5, characterized in that the basic status information includes external device usage information and display screen usage information, and the basic status information is processed to obtain the electronic device usage information. The operating status information of the device includes:
    如果所述外接设备向所述电子设备输入事件、所述显示屏处于亮屏解锁状态、所述电子设备没有处于合盖状态,确定所述电子设备处于用户使用的状态;If the external device inputs an event to the electronic device, the display screen is in a bright-screen unlocked state, and the electronic device is not in a closed state, it is determined that the electronic device is in a state for use by the user;
    如果所述外接设备向所述电子设备输入事件、所述显示屏处于亮屏解锁状态、所述电子设备没有处于合盖状态,确定所述电子设备处于用户没有使用的状态;If the external device inputs an event to the electronic device, the display screen is in a bright-screen unlocked state, and the electronic device is not in a closed state, it is determined that the electronic device is in a state that is not in use by the user;
    如果所述电子设备处于合盖状态和/或所述显示屏处于亮屏解锁状态,确定所述电子设备处于用户没有使用的状态。If the electronic device is in a closed state and/or the display screen is in a bright-screen unlocked state, it is determined that the electronic device is in a state that is not in use by the user.
  7. 根据权利要求1至6中任意一项所述的方法,其特征在于,所述基于所述电子设备的运行状态信息确定所述电子设备所处的应用场景包括:The method according to any one of claims 1 to 6, wherein determining the application scenario in which the electronic device is located based on the operating status information of the electronic device includes:
    根据所述运行状态信息中的第一部分信息,确定所述电子设备所处的第一应用场景;Determine the first application scenario in which the electronic device is located based on the first part of the information in the operating status information;
    根据所述运行状态信息中的第二部分信息,对所述第一应用场景进行调整,确定所述电子设备所处的第二应用场景,所述电子设备所处的第二应用场景为所述电子设备所处的应用场景。According to the second part of the information in the running status information, the first application scenario is adjusted to determine the second application scenario where the electronic device is located, and the second application scenario where the electronic device is located is the Application scenarios for electronic devices.
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述运行状态信息中的第一部分信息,确定所述电子设备所处的第一应用场景包括:根据所述运行状态信息中的应用运行状态和所述电子设备的系统负载,确定所述第一应用场景;The method according to claim 7, wherein determining the first application scenario in which the electronic device is located based on the first part of the information in the running status information includes: based on the application in the running status information. The operating status and the system load of the electronic device determine the first application scenario;
    根据所述运行状态信息中的第二部分信息,对所述第一应用场景进行调整,确定所述电子设备所处的第二应用场景包括:如果所述运行状态信息中的系统工作状态信息指示所述电子设备处于用户使用的状态,将所述第一应用场景确定为所述第二应用场景;如果所述运行状态信息中的系统工作状态信息指示所述电子设备处于用户没有使用的状态,确定所述电子设备处于空闲场景,所述空闲场景为所述第二应用场景。According to the second part of the information in the running status information, adjusting the first application scenario and determining the second application scenario in which the electronic device is located includes: if the system working status information in the running status information indicates The electronic device is in a state of being used by the user, and the first application scenario is determined as the second application scenario; if the system working status information in the running status information indicates that the electronic device is in a state of not being used by the user, It is determined that the electronic device is in an idle scene, and the idle scene is the second application scene.
  9. 根据权利要求1至8中任意一项所述的方法,其特征在于,所述基于所述电子设备所处的应用场景确定出与所述电子设备所处的应用场景相匹配的目标资源调度策略包括:如果电子设备没有使用电源适配器,基于所述电子设备所处的应用场景和所述系统电源模式信息,确定出与所述电子设备所述的应用场景相匹配的目标资源调度策略;The method according to any one of claims 1 to 8, characterized in that, based on the application scenario in which the electronic device is located, a target resource scheduling policy that matches the application scenario in which the electronic device is located is determined. The method includes: if the electronic device does not use a power adapter, based on the application scenario in which the electronic device is located and the system power mode information, determine a target resource scheduling strategy that matches the application scenario of the electronic device;
    所述方法还包括:如果所述电子设备使用电源适配器,禁止基于所述电子设备所处的应用场景确定出与所述电子设备所处的应用场景相匹配的目标资源调度策略。The method further includes: if the electronic device uses a power adapter, prohibiting determining a target resource scheduling policy that matches the application scenario in which the electronic device is located based on the application scenario in which the electronic device is located.
  10. 根据权利要求1至9中任意一项所述的方法,其特征在于,所述中央处理器功耗调度策略包括第一子策略和第二子策略,所述第二子策略为根据所述第一子策略确定的动态调谐技术策略;The method according to any one of claims 1 to 9, characterized in that the CPU power consumption scheduling strategy includes a first sub-strategy and a second sub-strategy, and the second sub-strategy is based on the first A dynamic tuning technology strategy determined by a sub-strategy;
    所述根据所述目标资源调度策略调整所述电子设备进行资源调度包括:The adjusting the electronic device for resource scheduling according to the target resource scheduling policy includes:
    若所述硬件平台类型为所述第一类型,根据所述第一子策略对所述电子设备进行资源调度;If the hardware platform type is the first type, perform resource scheduling on the electronic device according to the first sub-policy;
    若所述硬件平台类型为所述第二类型,根据所述第二子策略对所述电子设备进行资源 调度。If the hardware platform type is the second type, perform resource allocation on the electronic device according to the second sub-policy Scheduling.
  11. 根据权利要求1至10中任意一项所述的方法,其特征在于,所述方法还包括:如果所述目标资源调度策略失效,获得预先设置的自建策略;根据所述自建策略对所述电子设备进行资源调度。The method according to any one of claims 1 to 10, characterized in that the method further includes: if the target resource scheduling strategy fails, obtaining a preset self-built strategy; The electronic equipment performs resource scheduling.
  12. 一种电子设备,其特征在于,所述电子设备包括:存储器和一个或多个处理器;An electronic device, characterized in that the electronic device includes: a memory and one or more processors;
    其中,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;当所述计算机指令被所述处理器执行时,使得所述电子设备执行如权利要求1至11中任意一项所述的方法。Wherein, the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device is caused to perform any one of claims 1 to 11 the method described.
  13. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行如权利要求1至11中任意一项所述的方法。 A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program. When the computer program is run on an electronic device, the electronic device causes the electronic device to execute any of claims 1 to 11. method described in one item.
PCT/CN2023/089131 2022-05-16 2023-04-19 Resource scheduling method and apparatus WO2023221720A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210530837.1 2022-05-16
CN202210530837.1A CN117112187A (en) 2022-05-16 2022-05-16 Resource scheduling method and device

Publications (2)

Publication Number Publication Date
WO2023221720A1 true WO2023221720A1 (en) 2023-11-23
WO2023221720A9 WO2023221720A9 (en) 2024-05-10

Family

ID=88809779

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/089131 WO2023221720A1 (en) 2022-05-16 2023-04-19 Resource scheduling method and apparatus

Country Status (2)

Country Link
CN (1) CN117112187A (en)
WO (1) WO2023221720A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107797868A (en) * 2017-10-31 2018-03-13 广东欧珀移动通信有限公司 resource adjusting method and device
CN107861816A (en) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 Resource allocation method and device
CN107995357A (en) * 2017-11-15 2018-05-04 广东欧珀移动通信有限公司 Resource allocation method and device
US20190020196A1 (en) * 2017-07-14 2019-01-17 Engie Storage Services Na Llc Clustered power generator architecture
CN109542614A (en) * 2018-05-30 2019-03-29 Oppo广东移动通信有限公司 Resource allocation method, device, terminal and storage medium
CN113778663A (en) * 2021-07-28 2021-12-10 荣耀终端有限公司 Scheduling method of multi-core processor and electronic equipment
CN114443256A (en) * 2022-04-07 2022-05-06 荣耀终端有限公司 Resource scheduling method and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391259B (en) * 2017-07-25 2020-12-01 Oppo广东移动通信有限公司 Resource processing method and device, computer readable storage medium and mobile terminal
CN109343902B (en) * 2018-09-26 2021-08-03 Oppo广东移动通信有限公司 Audio processing assembly operation method and device, terminal and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190020196A1 (en) * 2017-07-14 2019-01-17 Engie Storage Services Na Llc Clustered power generator architecture
CN107797868A (en) * 2017-10-31 2018-03-13 广东欧珀移动通信有限公司 resource adjusting method and device
CN107861816A (en) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 Resource allocation method and device
CN107995357A (en) * 2017-11-15 2018-05-04 广东欧珀移动通信有限公司 Resource allocation method and device
CN109542614A (en) * 2018-05-30 2019-03-29 Oppo广东移动通信有限公司 Resource allocation method, device, terminal and storage medium
CN113778663A (en) * 2021-07-28 2021-12-10 荣耀终端有限公司 Scheduling method of multi-core processor and electronic equipment
CN114443256A (en) * 2022-04-07 2022-05-06 荣耀终端有限公司 Resource scheduling method and electronic equipment

Also Published As

Publication number Publication date
WO2023221720A9 (en) 2024-05-10
CN117112187A (en) 2023-11-24

Similar Documents

Publication Publication Date Title
CN114443256B (en) Resource scheduling method and electronic equipment
EP3525417A1 (en) Data processing method, device, storage medium, electronic device and server
JP2016507815A (en) Image processing method, image processing device, terminal device, program, and recording medium
WO2021258795A1 (en) Atomic ability invoking method and terminal device
CN116028205B (en) Resource scheduling method and electronic equipment
CN113115439A (en) Positioning method and related equipment
WO2022048453A1 (en) Unlocking method and electronic device
WO2023221752A1 (en) Information processing method and electronic device
WO2023221720A1 (en) Resource scheduling method and apparatus
CA3194323A1 (en) Cross-device authentication method and related apparatus
CN116027879B (en) Method for determining parameters, electronic device and computer readable storage medium
CN117130454A (en) Power consumption adjustment method and electronic equipment
CN116069209A (en) Focus window processing method, device, equipment and storage medium
CN117873693A (en) Resource scheduling method, electronic equipment and storage medium
CN112905328B (en) Task processing method, device and computer readable storage medium
US20230362782A1 (en) Data Sharing Method, Electronic Device, and System
CN116028211A (en) Display card scheduling method, electronic equipment and computer readable storage medium
CN116028005B (en) Audio session acquisition method, device, equipment and storage medium
CN116028208B (en) System load determining method, device, equipment and storage medium
CN116028207B (en) Scheduling policy determination method, device, equipment and storage medium
CN116027880B (en) Resource scheduling method and electronic equipment
CN116089055B (en) Resource scheduling method and device
WO2022148201A1 (en) Wireless charging method, device, and system
CN116055443B (en) Method for identifying social scene, electronic equipment and computer readable storage medium
WO2022068156A1 (en) Cross-device authentication method and related apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23806673

Country of ref document: EP

Kind code of ref document: A1