Control Method and Electronic Device

By monitoring the process load data of the target application and running it on a processor that matches the processing performance, the high power consumption problems caused by high-performance processors running low-load processes and low-performance processors running high-load processes are solved, achieving lower processor power consumption and higher energy efficiency performance.

CN113656177BActive Publication Date: 2025-05-27LENOVO (BEIJING) LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110953835.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-19
Publication Date
2025-05-27
Estimated Expiration
2041-08-19

AI Technical Summary

Technical Problem

In the prior art, high-performance processors often run low-load processes, while low-performance processors run high-load processes, resulting in excessive processor power consumption of electronic devices.

Method used

By monitoring the process load data of the target application, the target process runs on a processor whose processing performance matches the load data, avoiding high-performance processors running low-load processes and low-performance processors running high-load processes.

Benefits of technology

It reduces the processor power consumption of electronic devices and improves the energy efficiency performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113656177B_ABST
    Figure CN113656177B_ABST
Patent Text Reader

Abstract

The present application discloses a control method and an electronic device, the method comprising: controlling a target process corresponding to a target application in an electronic device to run in a first processor; wherein the electronic device is configured with a target processor, the target processor comprising a plurality of sub-processors, and the first processor is a processor among the plurality of sub-processors that matches the load data of the target process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of operating systems, and particularly to a control method and an electronic device. Background Art

[0002] Currently, in a central processing unit (CPU), a method of configuring multiple core processors is usually adopted to improve the processing performance of the CPU. Summary of the Invention

[0003] In view of this, this application provides a control method and an electronic device as follows:

[0004] A control method includes:

[0005] Controlling a target process corresponding to a target application in an electronic device to run on a first processor;

[0006] Wherein, the electronic device is configured with a target processor, the target processor includes multiple sub-processors, and the first processor is a processor among the multiple sub-processors that matches the load data of the target process.

[0007] In the above method, preferably, the load data of the target process includes: the type of processor occupancy rate of the target process;

[0008] Wherein, the matching of the first processor with the load data of the target process includes:

[0009] The processor identifier of the first processor corresponds to the processor occupancy rate of the target process, and the processor identifier represents the processing performance of the first processor.

[0010] In the above method, preferably, after the target application is started and before controlling the target process corresponding to the target application in the electronic device to run on the first processor, the method further includes:

[0011] Controlling the target process corresponding to the target application to run on a second processor among the multiple sub-processors;

[0012] Judging whether the second processor matches the load data of the target process;

[0013] In the case where the second processor does not match the load data of the target process, performing the following: controlling the target process corresponding to the target application in the electronic device to run on the first processor; the device power consumption value corresponding to the target process running on the first processor is less than the device power consumption value corresponding to the target process running on the second processor;

[0014] Or,

[0015] After the target application is launched, execute the following: control the target process corresponding to the target application in the electronic device to run in the first processor.

[0016] In the above method, preferably, the step of controlling the target process corresponding to the target application in the electronic device to run in the first processor includes:

[0017] Obtain the load data of the target process and the target processor identifier corresponding to the load data;

[0018] Control the target process to run in the first processor corresponding to the target processor identifier.

[0019] In the above method, preferably, the step of controlling the target process corresponding to the target application in the electronic device to run in the first processor includes:

[0020] In the correspondence set, search for the correspondence corresponding to the target process; the correspondence set contains at least one correspondence, the correspondence is the correspondence between the process identifier and the processor identifier, and the correspondence is obtained based on the load data corresponding to the process identifier;

[0021] If the target correspondence corresponding to the target process is found in the correspondence set, control the target process to run in the first processor corresponding to the target processor identifier in the target correspondence;

[0022] If the correspondence corresponding to the target process is not found in the correspondence set, obtain the load data of the target process and the target processor identifier corresponding to the load data, and control the target process to run in the first processor corresponding to the target processor identifier.

[0023] In the above method, preferably, the method further includes:

[0024] After obtaining the target processor identifier corresponding to the load data, update the correspondence in the correspondence set at least according to the target process and the target processor identifier;

[0025] And / or,

[0026] Update the correspondence in the correspondence set at least according to the processes on other devices and the corresponding processor identifiers.

[0027] In the above method, preferably, after controlling the target process corresponding to the target application in the electronic device to run in the first processor, the method further includes:

[0028] Determine whether the load data of the target process meets the frequency limit condition, where the frequency limit condition is related to the processor identifier of the first processor;

[0029] When the load data meets the frequency limit condition, set the maximum operating frequency for the first processor, so that the operating frequency of the first processor is below the maximum operating frequency, and the maximum operating frequency corresponds to the frequency limit condition.

[0030] In the above method, preferably, the sub-processors in the target processor are divided into multiple processor groups. The sub-processors in the same processor group require matching supply voltages, and one processor group corresponds to one power supply, and the supply voltages of the power supplies corresponding to different processor groups are different;

[0031] Wherein, the method further includes:

[0032] Send a power supply instruction to the first power supply corresponding to the processor group where the first processor is located. The power supply instruction at least includes the first voltage required by the first processor, so that the first power supply supplies electrical energy to the processor group where the first processor is located according to the first voltage.

[0033] An electronic device includes:

[0034] A target processor, where the target processor includes multiple sub-processors;

[0035] A first controller, configured to: control the target process corresponding to the target application to run in the first processor; wherein, the first processor is the processor in the multiple sub-processors that matches the load data of the target process.

[0036] In the above electronic device, preferably, the sub-processors in the target processor are divided into multiple processor groups. The sub-processors in the same processor group require matching supply voltages, and one processor group corresponds to one power supply, and the supply voltages of the power supplies corresponding to different processor groups are different;

[0037] Wherein, the electronic device further includes:

[0038] A second controller, configured to: send a power supply instruction to the first power supply corresponding to the processor group where the first processor is located. The power supply instruction at least includes the first voltage required by the first processor, so that the first power supply supplies electrical energy to the processor group where the first processor is located according to the first voltage.

[0039] As can be seen from the above technical solution, in a control method and an electronic device disclosed in this application, after a target application is started, the target process corresponding to the target application is run on a processor that matches the load data of the target process, so that the target process is run on a processor that matches the load data in the electronic device, avoiding the high power consumption caused by a high-performance processor running a low-load process and a low-performance processor running a high-load process, thereby reducing the processor power consumption of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] To more clearly illustrate the technical solutions of the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0041] Figure 1 It is a flowchart of a control method provided in Embodiment 1 of this application;

[0042] Figure 2 It is a schematic diagram of a processor and a hardware accelerator in a computer;

[0043] Figure 3 It is another flowchart of a control method provided in Embodiment 1 of this application;

[0044] Figure 4 It is a partial flowchart of a control method provided in Embodiment 1 of this application.

[0045] Figure 5 It is an example diagram in the embodiments of this application;

[0046] Figure 6 It is another partial flowchart of a control method provided in Embodiment 1 of this application;

[0047] Figure 7 It is another example diagram in the embodiments of this application;

[0048] Figure 8 It is another partial flowchart of a control method provided in Embodiment 1 of this application;

[0049] Figure 9 It is another example diagram in the embodiments of this application;

[0050] Figure 10 It is another flowchart of a control method provided in Embodiment 1 of this application;

[0051] Figure 11 and Figure 12 They are respectively example diagrams of the target processor in the embodiments of this application;

[0052] Figure 13 It is a schematic structural diagram of an electronic device provided in the second embodiment of the present application;

[0053] Figure 14 It is another schematic structural diagram of an electronic device provided in the second embodiment of the present application;

[0054] Figures 15 - 20 They are respectively example diagrams applicable to a computer in the present application. Detailed implementation manners

[0055] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0056] Refer to Figure 1 As shown, it is a flowchart of the implementation of a control method provided in the first embodiment of the present application. This method can be applied to an electronic device configured with a target processor and capable of running an application process through a sub-processor in the target processor. The electronic device can be a mobile phone, a pad, a notebook, etc. The technical solution in this embodiment is mainly used to reduce the power consumption of the processor in the electronic device.

[0057] Specifically, the method in this embodiment may include the following steps:

[0058] Step 101: Monitor whether a target application is started in the electronic device. If a target application is started, execute Step 102.

[0059] Specifically, in this embodiment, it can be monitored whether a target process is created to determine whether a target application is started in the electronic device. If it is monitored that a target process is created and running, it can be determined that the target application corresponding to the target process is started and running.

[0060] Step 102: Control the target process corresponding to the target application to run in the first processor.

[0061] Among them, a target processor can be configured in the electronic device, such as a CPU, and there are multiple sub-processors in the target processor. For example, as Figure 2 shown, in the CPU of a computer, there are various types of cores, such as big core of the CPU, small core of the CPU, etc. Different cores have different attributes, such as different performance, different power consumption, different required voltages, and so on.

[0062] Based on this, in this embodiment, the target process corresponding to the target application is run in a sub-processor, i.e., the first processor, that matches the load data of the target process. Thus, the target process is run by the sub-processor that matches the load data, thereby avoiding the high power consumption caused by a high-performance processor running a low-load process and also avoiding the high power consumption caused by a low-performance processor running a high-load process.

[0063] In addition, in the electronic device, in addition to including a CPU, it may also include other processors or what can be understood as hardware accelerators, such as Figure 2 the graphics processing unit (GPU) core, the neural-network processing unit (NPU) core, and the video processing unit (VPU) core shown in

[0064] etc. In order to achieve better matching of processing performance and process load performance and lower power consumption, in this embodiment, after the target application is started, the process type of the target process can be first determined. If it is a CPU process type, then step 102 can be executed. If it is other types such as GPU, NPU, or VPU, etc., then the target process can be directly switched to the corresponding hardware accelerator. For example, the target process corresponding to the GPU type is run on the GPU, the target process corresponding to the NPU type is run on the NPU, and the target process corresponding to the VPU type is run on the VPU.

[0065] In one implementation, the load data of the target process may include: the processor occupancy rate of the target process, such as the CPU occupancy rate.

[0066] Specifically, in this embodiment, the CPU occupancy rate of each running process in the task manager can be obtained by scanning the task manager in the operating system of the electronic device, and thus the CPU occupancy rate of the target process can be read.

[0067] Based on this, the first processor matching the load data of the target process includes:

[0068] The processor identifier of the first processor corresponds to the processor occupancy rate of the target process, where the processor identifier characterizes the processing performance of the first processor.

[0069] Among them, the processor identifier can be the processor model or number of the sub-processor, etc., to characterize the processing performance of the sub-processor. For example, the core model characterizes the core performance.

[0070] That is to say, in this embodiment, according to the load data of the target process, a sub-processor with a processing performance corresponding to the processor occupancy rate is searched for the target process among the multiple sub-processors in the target processor, that is, the first processor matching the load data of the target process.

[0071] Thus, the processing performance of the first processor where the target process is located corresponds to the processor occupancy rate of the target process. For example, a target process with a high CPU occupancy rate runs in the large core within the CPU, and a target process with a low CPU occupancy rate runs in the small core within the CPU. The processing performance of the large core is higher than that of the small core. Thus, the high power consumption situation caused by the large core running a process with a low CPU occupancy rate is avoided, and the high power consumption situation caused by the small core running a process with a high CPU occupancy rate is also avoided.

[0072] In one implementation manner, in this embodiment, after the target application is started and before controlling the target process corresponding to the target application to run in the first processor, that is, before step 102, the method in this embodiment may further include the following steps, such as Figure 3 as shown in

[0073] Step 103: Control the target process corresponding to the target application to run in the second processor in the target processor.

[0074] Among them, the second processor is one of the multiple sub-processors included in the target processor. Specifically, the second processor can be the sub-processor determined for the target process according to the default control rule. Here, the default control rule can be: the rule of randomly selecting any idle sub-processor in the target processor, or the control rule can be: the rule of selecting the sub-processor that was first placed in the idle state in the target processor.

[0075] For example, after the target application is started, in this embodiment, an idle sub-processor is randomly selected from the multiple sub-processors in the target processor to run the target process; or, after the target application is started, in this embodiment, the sub-processor that was first placed in the idle state is selected from the multiple sub-processors in the target processor to run the target process.

[0076] Step 104: Determine whether the second processor matches the load data of the target process. If not, execute Step 102. If it matches, no processing is required and the current process ends.

[0077] Among them, the second processor matching the load data of the target process can be that the processor identifier of the second processor matches the processor occupancy rate of the target process. Based on this, in Step 104, it is determined whether the processor identifier of the second processor matches the occupancy rate of the target process. If it matches, at this time, there is no need to switch the sub-processor on which the target process runs. If it does not match, it indicates that there may be a high-power consumption situation when the second processor runs the target process. At this time, execute Step 102, that is, switch the target process to the first processor whose processing performance matches the processor occupancy rate of the target process, thereby achieving the purpose of reducing power consumption.

[0078] It can be seen that in this embodiment, for the started target application, first, according to the default control rule, the target process corresponding to the target application is run on a second processor, and then it is determined whether the processor occupancy rate of the target process matches the processing performance of the second processor. If not, the target process is switched to the first processor whose processing performance matches the processor occupancy rate of the target process. Thus, while shortening the waiting time before the target process is run on the sub-processor, the power consumption is reduced by switching the sub-processor.

[0079] In another implementation manner, in this embodiment, after the target application is started, Step 102 can be directly executed. That is to say, in this embodiment, for the started target application, the first processor whose processing performance matches the processor occupancy rate of the target process can be directly selected and the target process is run on this first processor. Thus, a sub-processor with matching processing performance is directly allocated to the target process, further reducing the power consumption.

[0080] Based on the above implementation, when controlling the target process corresponding to the target application to run on the first processor in Step 102, it can be specifically implemented in the following manner, as Figure 4 shown in

[0081] Step 401: Obtain the load data of the target process and the target processor identifier corresponding to the load data.

[0082] Among them, the load data of the target process can be the historical load data, test load data, or real-time load data of the target process. The historical load data refers to the load data of the target process recorded in history during the previous or multiple previous runs, such as the historical CPU occupancy rate, etc. The test load data refers to the load data of the target process recorded during the test of the target application before leaving the factory, such as the test CPU occupancy rate, etc. The real-time load data refers to the real-time data of the target process currently running on the second processor, such as the current CPU occupancy rate, etc.

[0083] The target processor identifier corresponding to the load data refers to the processor identifier of the sub-processor whose processing performance matches the load data, such as the core model or number, etc. Among them, in this embodiment, the target processor identifier corresponding to the load data can be obtained according to the preset correspondence between the load data and the processor identifier.

[0084] Specifically, in this embodiment, the correspondence between the load data of the target process can be found in the correspondence table between the load data and the processor identifier. The correspondence table contains at least one correspondence, and each correspondence is respectively the correspondence between the load data and the processor identifier, such as the correspondence between the range of CPU occupancy rate and the large core model or small core model; then, if the target correspondence corresponding to the load data of the target process is found in the correspondence table, the target processor identifier in the target correspondence can be obtained, that is, the processor identifier of the sub-processor whose processing performance matches the load data of the target process.

[0085] For example Figure 5 As shown in, there is a correspondence table between the range of CPU occupancy rate and the corresponding core model preset in the electronic device. The range of high CPU occupancy rate, such as the range above 50%, corresponds to the large core model with high processing performance, and the range of low CPU occupancy rate, such as the range below 50%, corresponds to the small core model with low processing performance. Based on this, in this embodiment, after obtaining the CPU occupancy rate of the target process, the core model corresponding to the CPU occupancy rate is found in this correspondence table.

[0086] Step 402: Control the target process to run in the first processor corresponding to the target processor identifier.

[0087] Among them, the first processor corresponding to the target processor identifier is the sub-processor whose processing performance matches the load data of the target process. Based on this, in this embodiment, after obtaining the target processor identifier corresponding to the load data of the target process, the target process can be run in the sub-processor corresponding to the target processor identifier, thereby enabling the target process to run in the sub-processor whose processing performance matches the processor occupancy rate of the target process.

[0088] For exampleFigure 5 As shown in Figure 5 , in the electronic device, a correspondence table between the range of CPU occupancy and the corresponding core model is preset. The range of high CPU occupancy corresponds to the large core model with high processing performance, and the range of low CPU occupancy corresponds to the small core model with low processing performance. Based on this, in this embodiment, after obtaining the CPU occupancy of the target process, the core model corresponding to the CPU occupancy is searched in the correspondence table to determine the corresponding core, and then the target process is run on this core.

[0089] In another implementation manner, when controlling the target process corresponding to the target application to run in the first processor in step 102, it can also be implemented in the following manner, as Figure 6 shown in Figure 6 :

[0090] Step 601: In the correspondence set, search for the correspondence corresponding to the target process. If the target correspondence corresponding to the target process is found in the correspondence set, execute step 602; if the correspondence corresponding to the target process is not found in the correspondence set, execute step 603.

[0091] Among them, the correspondence set contains at least one correspondence. Each correspondence is the correspondence between the process identifier and the processor identifier, and the correspondence is obtained based on the load data corresponding to the process identifier. Specifically, the correspondence can be determined according to the processor occupancy in the load data corresponding to the process identifier. For example, according to the processor occupancy of the process, the correspondence between the process identifier of the process and the processor identifier whose processing performance matches the processor occupancy of the process is set.

[0092] As Figure 7 shown in Figure 7 , in the electronic device, a correspondence set between the process identifier and the corresponding core model can be preset. The process identifier corresponding to the range of high CPU occupancy above 50% corresponds to the large core model with high processing performance, and the process identifier corresponding to the range of low CPU occupancy below 50% corresponds to the small core model with low processing performance. Based on this, in this embodiment, the correspondence corresponding to the target process is searched in this correspondence table, that is, the core model corresponding to the target process is searched.

[0093] Step 602: Control the target process to run in the first processor corresponding to the target processor identifier in the target correspondence.

[0094] Among them, the first processor corresponding to the target processor identifier in the target correspondence relationship is the sub-processor whose processing performance matches the load data of the target process. Based on this, in this embodiment, after finding the target correspondence relationship, the target process can be run on the sub-processor corresponding to the target processor identifier in the target correspondence relationship, so that the target process runs on the sub-processor whose processing performance matches the processor occupancy rate of the target process.

[0095] Step 603: Obtain the load data of the target process and the target processor identifier corresponding to the load data, and control the target process to run on the first processor corresponding to the target processor identifier.

[0096] Among them, the load data of the target process can be the historical load data, test load data, or real-time load data of the target process. The target processor identifier corresponding to the load data refers to the processor identifier of the sub-processor whose processing performance matches the load data, such as the kernel model or number, etc. Among them, in this embodiment, the target processor identifier corresponding to the load data can be obtained according to the preset correspondence relationship between the load data and the processor identifier.

[0097] Specifically, in this embodiment, the correspondence relationship corresponding to the load data of the target process can be found in the set or table of correspondence relationships between the load data and the processor identifier. The set of correspondence relationships contains at least one correspondence relationship, and each correspondence relationship is respectively the correspondence relationship between the load data and the processor identifier, such as the correspondence relationship between the range of CPU occupancy rate and the large core model or small core model; then, if the target correspondence relationship corresponding to the load data of the target process is found in the set of correspondence relationships, then the target processor identifier in the target correspondence relationship can be obtained, that is, the processor identifier of the sub-processor whose processing performance matches the load data of the target process, and then the target process can be controlled to run on the first processor corresponding to the target processor identifier.

[0098] That is to say, in this embodiment, a set of correspondence relationships between process identifiers and processor identifiers is pre-configured in the electronic device. When it is detected that a target application is started, first check whether there is a target correspondence relationship corresponding to the target process of the target application among the correspondence relationships between the process identifiers and the processor identifiers included in the set. If so, directly control the target process to run on the first processor corresponding to the target processor identifier in the target correspondence relationship. If not, the load data of the target process can be obtained, and then the target processor identifier corresponding to the load data of the target process can be found by using the set of correspondence relationships between the load data and the processor identifier, so as to control the target process to run on the first processor corresponding to the target processor identifier. Such as Figure 5 and Figure 7As shown in the figure, in the electronic device, a set of corresponding relationships between process identifiers and corresponding kernel models is preset. The process identifier with a high CPU occupancy rate corresponds to the large core model with high processing performance, and the process identifier with a low CPU occupancy rate corresponds to the small core model with low processing performance. Based on this, in this embodiment, the corresponding relationship corresponding to the target process is searched in this set of corresponding relationships, that is, the kernel model corresponding to the target process is searched. If the corresponding relationship corresponding to the target process is not found in this corresponding relationship table, then the target corresponding relationship corresponding to the CPU occupancy rate of the target process is searched in the corresponding relationship table between the preset CPU occupancy rate range and the corresponding kernel model in the electronic device. In the corresponding relationship table between the CPU occupancy rate range and the corresponding kernel model, the high CPU occupancy rate range corresponds to the large core model with high processing performance, and the low CPU occupancy rate range corresponds to the small core model with low processing performance. Based on this, in this embodiment, after obtaining the CPU occupancy rate of the target process, the kernel model corresponding to this CPU occupancy rate is searched in this corresponding relationship table, so as to determine the corresponding kernel. After that, the target process is run on this kernel.

[0099] In a specific implementation, when controlling the target process to run on the first processor, the target processor identifier corresponding to the first processor can be written into the target scheduling information corresponding to the target process, such as the process scheduling table in the operating system. Based on this, the process scheduling table contains the target processor identifier corresponding to the target process. Thus, the operating system in the electronic device can run the target process on the first processor corresponding to this target scheduling information according to the process scheduling table.

[0100] Based on the above implementation, after step 603, this embodiment may further include the following steps, such as Figure 8 as shown in the figure:

[0101] Step 604: Update the corresponding relationship in the set of corresponding relationships at least according to the target process and the target processor identifier.

[0102] That is to say, if the target corresponding relationship corresponding to the target process is not found in the set of corresponding relationships between the process identifier and the processor identifier, then after obtaining the target processor identifier corresponding to the load data of the target process through the corresponding relationship between the load data and the processor identifier, according to this target process and the corresponding target processor identifier, the corresponding relationship in the set of corresponding relationships between the process identifier and the processor identifier is updated, so that this set of corresponding relationships contains the corresponding relationship between the process identifier of the target process and the target processor identifier, which is convenient for the next processor allocation for the target process.

[0103] In another implementation manner, this embodiment may also update the corresponding relationship in the set of corresponding relationships between the process identifier and the processor identifier at least according to the processes on other devices and the corresponding processor identifiers.

[0104] Specifically, the electronic device uploads the local processes and the assigned processor identifiers to a server, such as a cloud server or the background server of a service provider. Other devices also upload their own processes and the assigned processor identifiers to the server. Thus, the electronic device in this embodiment can obtain the processes and the assigned processor identifiers uploaded by other devices from the server, and then update the corresponding relationships in the local corresponding relationship set based on these processes and the assigned processor identifiers.

[0105] For example, multiple users each use an electronic device, such as a mobile phone, a pad, a notebook, a computer, etc., to run different applications. As Figure 9 shown in [figure reference], each electronic device records the process identifier of the running process and the processor identifier of the correspondingly assigned sub-processor, and uploads these process identifiers and processor identifiers to the server. Thus, through the server, each electronic device can obtain the process identifiers and the corresponding processor identifiers recorded by other devices. Therefore, on each electronic device, these process identifiers and the corresponding processor identifiers can be used to update the local corresponding relationship set through methods such as data statistics and machine learning algorithms, that is, set a corresponding processor identifier for each process identifier, so that the corresponding relationship set contains more and more accurate corresponding relationships between process identifiers and processor identifiers, facilitating the electronic device to more quickly and accurately switch the running target process to the sub-processor that can handle the load data matching the target process.

[0106] In one implementation manner, after step 102, the method in this embodiment may further include the following steps, as Figure 10 shown in [figure reference]:

[0107] Step 105: Determine whether the load data of the target process meets the frequency limit condition. If it meets, execute step 106. If it does not meet, do not perform any processing and end the current process.

[0108] Among them, the frequency limit condition is related to the processor identifier of the first processor. The frequency limit condition includes a load range, such as the CPU occupancy rate in the range of 50%-80%, or the CPU occupancy rate below 20%, etc. Processor identifiers representing different processing performances correspond to different frequency limit conditions. The extreme values of the load range in the frequency limit condition corresponding to the processor identifier representing high processing performance are higher than the extreme values of the load range in the frequency limit condition corresponding to the processor identifier representing low processing performance. For example, the CPU occupancy rate range in the frequency limit condition corresponding to the large core identifier is in the range of 50%-80%, and the CPU occupancy rate range in the frequency limit condition corresponding to the small core identifier is less than 20%.

[0109] Step 106: Set the maximum operating frequency for the first processor so that the operating frequency of the first processor is below the maximum operating frequency.

[0110] The maximum operating frequency here corresponds to the frequency limit condition. For example, a high-extreme load range corresponds to a higher maximum operating frequency, and a low-extreme load range corresponds to a lower maximum operating frequency.

[0111] It can be seen that in this embodiment, after switching to the first processor with a processing performance matching the processor occupancy rate for the target process, in order to further reduce power consumption, the operating frequency of the first processor can also be restricted. For example, after running a process with a high load, i.e., a high CPU occupancy rate, on a large core with high processing performance, it is determined whether the current CPU occupancy rate of this process is within the load range where the operating frequency needs to be restricted, i.e., the range of 50%-80%. If the current CPU occupancy rate of this process is within the range of 50%-80%, then control the operating frequency of the first processor to be below the maximum operating frequency, such as below 2 GHz. If the current CPU occupancy rate of the process is not within the range of 50%-80%, then no processing is required. At this time, the first processor operates at the default operating frequency. Another example is that after running a process with a low load, i.e., a low CPU occupancy rate, on a small core with low processing performance, it is determined whether the current CPU occupancy rate of this process is within the load range where the operating frequency needs to be restricted, i.e., less than 20%. If the current CPU occupancy rate of this process is within the range of less than 20%, then control the operating frequency of the first processor to be below the maximum operating frequency, such as below 1.5 GHz. If the current CPU occupancy rate of the process is not within the range of less than 20%, then no processing is required. At this time, the first processor operates at the default operating frequency.

[0112] In addition, in this embodiment, the sub-processors in the target processor can be divided into multiple processor groups. The power supply voltages required by the sub-processors in the same processor group are matched. Here, being matched means that the power supply voltages required by the sub-processors in the same processor group are the same or within the same voltage range. Based on this, in this embodiment, a power supply is provided for each processor group respectively, and the power supply voltages of the power supplies corresponding to different processor groups are different, and the power supply voltage corresponds to the power supply voltage required by the sub-processors in this processor group, as Figure 11 shown.

[0113] Based on this, in order to further reduce power consumption, in this embodiment, when providing electrical energy for each sub-processor, a power supply instruction can be sent to the power supply corresponding to the processor group where the sub-processor is located. The power supply instruction at least includes the power supply voltage required by the sub-processor, so that each power supply provides electrical energy to the processor group where the corresponding sub-processor is located according to the power supply voltage respectively.

[0114] For example, as Figure 12 shown, in this embodiment, when supplying power to the first processor, a power supply instruction is sent to the first power supply corresponding to the processor group where the first processor is located. The power supply instruction at least includes the first voltage required by the first processor, so that the first power supply supplies power to the processor group where the first processor is located according to the first voltage; for the second processor whose processing performance is different from that of the first processor, in this embodiment, when supplying power to the second processor, a power supply instruction is sent to the second power supply corresponding to the processor group where the second processor is located. The power supply instruction at least includes the second voltage required by the second processor, so that the second power supply supplies power to the processor group where the second processor is located according to the second voltage, and the second voltage is different from the first voltage.

[0115] Based on the above implementation solution, in this embodiment, when a sub-processor such as the first processor stops running and enters the idle state, a stop instruction corresponding to the sub-processor can be sent to the power supply corresponding to the processor group, so that the power supply cuts off power to the sub-processor or the power supply supplies power to the sub-processor according to the target voltage. At this time, the sub-processor is in the sleep state under the target voltage. In addition, when all the sub-processors in the processor group stop running and enter the idle state, a stop instruction corresponding to the processor group can be sent to the power supply corresponding to the processor group, so that the power supply cuts off power or the power supply supplies power to the processor group according to the target voltage. At this time, each sub-processor in the processor group is in the sleep state under the target voltage.

[0116] Referring to Figure 13 , which is a schematic structural diagram of an electronic device provided in the second embodiment of the present application. The electronic device can be a mobile phone, a pad, a notebook, or other devices. The technical solution in this embodiment is mainly used to reduce the power consumption of the processor in the electronic device.

[0117] Specifically, the electronic device in this embodiment may include the following components:

[0118] A target processor 1301, which includes a plurality of sub-processors 1311;

[0119] A first controller 1302, configured to: control the target process corresponding to the target application to run in the first processor 1312; wherein, the first processor 1312 is the processor among the plurality of sub-processors 1311 that matches the load data of the target process.

[0120] As can be seen from the above solution, in a control method provided in the first embodiment of the present application, after the target application is started, the target process corresponding to the target application is run on a processor that matches the load data of the target process, so as to use a processor that matches the load data to run the target process in the electronic device, avoiding the high power consumption caused by a high-performance processor running a low-load process and a low-performance processor running a high-load process, thereby reducing the processor power consumption of the electronic device.

[0121] Further, as Figure 14 shown in, the sub-processors 1311 in the target processor 1301 are divided into multiple processor groups 1313. The sub-processors 1311 in the same processor group 1313 require matching supply voltages, and one of the processor groups 1313 corresponds to a power supply 1303. The supply voltages of the power supplies 1303 corresponding to different processor groups 1313 are different;

[0122] Wherein, the electronic device further includes:

[0123] A second controller 1304, configured to: send a power supply instruction to the first power supply 1303 corresponding to the processor group 1313 where the first processor 1312 is located, and the power supply instruction at least includes the first voltage required by the first processor 1312, so that the first power supply 1303 supplies electrical energy to the processor group 1313 where the first processor 1312 is located according to the first voltage.

[0124] Taking the electronic device as a computer as an example, based on the embodiments in the present application in the foregoing text, the following is a detailed description:

[0125] In this embodiment, based on the latest Intel ADL big and little cores, a customized driver is used to judge the load sizes of applications and background processes, and then through the interfaces in the operating system, the preferred cores corresponding to each process and different frequencies at which different cores run are set in the process scheduling table of the operating system, so that processes with different loads run on the cores with the most appropriate processing performance and the most appropriate frequencies.

[0126] First, the big and little cores of ADL have different execution efficiencies and power consumption performances for different load tasks, and can be divided into three types of processes according to Figure 15 the corresponding relationship between processing performance and power consumption shown in: A heavy-load processes, B mixed-load processes, and C light-load processes. A mixed-load process can be understood as a process where the CPU occupancy rate may be too high or too low.

[0127] Based on this, in this embodiment, the heavy-load processes need to run on the large cores, and the light-load processes need to run on the small cores. For the processes with mixed loads, they are dynamically allocated to the large cores or small cores according to the real-time CPU occupancy rate. In addition, the operating frequencies of the large cores and small cores are further restricted according to the load size.

[0128] For example, for applications commonly used by users such as video playback applications, the load values of each process can be pre-marked through the load data obtained from laboratory tests, and then the corresponding cores can be directly allocated accordingly; for other applications used by users, the CPU occupancy rate of the process can be detected in real time through the driver in this embodiment, the load value of the process can be dynamically marked, and the corresponding core can be dynamically allocated accordingly; for other applications commonly used by users, through the big data collected and machine learning algorithms, tags of the corresponding core models are assigned to the processes, and then the processes of these applications can be directly allocated the corresponding cores.

[0129] Accordingly, when the above scheme is adopted to switch the cores of processes on a computer, the power consumption can be effectively reduced. As Figure 16 shown, in the scenario of playing an online video of a certain video playback application on the ADL platform, among the four examples, compared with the first scenario of default core matching, the second scenario of dynamically allocating to the small core through the load has the most obvious power-saving effect, which can save 27.3% of the power, and the power-saving effects of the third and fourth scenarios are not obvious.

[0130] In addition, in addition to having large and small cores in the CPU of the computer, the computer may also include hardware accelerators such as GPUs, VPUs, and NPUs. At the same time, some processes can use hardware accelerators such as GPUs, VPUs, and NPUs to achieve higher performance metrics per watt. Therefore, for these processes, in this embodiment, after identifying the processes corresponding to these hardware accelerators, these processes can be switched to the corresponding hardware accelerators through the interfaces in the operating system.

[0131] Combined with Figure 17 the architecture diagram shown in Figure 18 and the flowchart shown in

[0132] First, in a computer, a process load identifier, namely a heavy-load process label A and a light-load process label C, is respectively set for Process 1 and Process 2. Thus, after APP Process 1 and APP Process 2 are created, the process allocation driver in this embodiment can modify the process scheduling table in the operating system according to label A and label C, so that the operating system switches APP Process 1 and APP Process 2 to the respective kernels corresponding to label A and label C, such as in a big core or a small core; for APP Process 3 and other APP processes, that is, for processes with a mixed process label B or without a process label, the load detection driver in this embodiment detects the load, i.e., the CPU occupancy rate, so as to match these processes to a kernel with appropriate processing performance.

[0133] Taking a certain APP process as an example, the driver program in this embodiment first determines the process type of the APP process, such as GPU, CPU, VPU or NPU, etc. If it is of the type of GPU, VPU or NPU, then the APP process can be directly run on the corresponding type of hardware accelerator. If it is of the type of CPU, then the corresponding kernel can be determined by judging the type of the load. For example, if it is a heavy-load process, then the APP process is switched to the big core. If it is a light-load process, then the APP process is switched to the small core. If it is a mixed-load process, then it is judged whether the current CPU occupancy rate of the APP process is greater than 50%. If the current CPU occupancy rate of the APP process is greater than 50%, then the APP process is switched to the big core. If the current CPU occupancy rate of the APP process is less than or equal to 50%, then the APP process is switched to the small core. Further, after the APP process is switched to the big core, it is judged whether the current CPU occupancy rate of the APP process is below 80%. If so, then the operating frequency of the big core is limited to below 2 GHz; after the APP process is switched to the small core, it is judged whether the current CPU occupancy rate of the APP process is above 20%. If so, then the operating frequency of the small core is limited to below 1.5 GHz. Thus, the power consumption is further reduced.

[0134] In addition, in this embodiment, the big and small cores in the CPU can be powered separately. One way is to specifically supply a higher voltage to the big core, and the other way is to specifically supply a lower voltage to the small core, such as Figure 19 and Figure 20As shown, the Power Management Unit (PMU) controls the power supplies Vcc big core power and Vcc small core power of the big core and small core respectively by sending SVID (System V Interface Description) instructions to the power controller (VR controller), thereby reducing power consumption by flexible power supply and achieving the purpose of power saving. Among them, when the small core is not working, the power supply of the small core can be turned off or given a very low standby voltage, and when the big core is not working, the power supply of the big core can be turned off or given a very low standby voltage.

[0135] In summary, in this embodiment, the big and small cores can be allocated according to the process load, and further, the operating frequencies of the big and small cores can be controlled according to the process load, thereby greatly reducing power consumption. In addition, the hardware accelerators outside the CPU core can be allocated according to the process type, so as to realize real-time load detection of the process and flexible allocation of the kernel through a customized driver program. In addition, during the process of matching the kernel for the process, machine learning algorithms and the like can be used to ensure that the APP actually used by the user can be correctly and timely allocated a kernel.

[0136] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0137] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0138] The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented directly in hardware, in a software module executed by a processor, or in a combination thereof. The software module may be placed in a random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0139] The foregoing description of the disclosed embodiments enables those skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A control method, comprising: Controlling a target process corresponding to a target application in an electronic device to run in a first processor; wherein, the electronic device is configured with a target processor, the target processor includes a plurality of sub-processors, the plurality of sub-processors have different operating frequencies, and the first processor is a processor among the plurality of sub-processors that matches the load data of the target process; wherein, after controlling the target process corresponding to the target application in the electronic device to run in the first processor, the method further includes: Determining whether the load data of the target process meets a frequency limit condition, the frequency limit condition is related to the processor identifier of the first processor, and different processor identifiers representing different processing performances correspond to different frequency limit conditions; When the load data meets the frequency limit condition, setting the maximum operating frequency for the first processor, so that the operating frequency of the first processor is below the maximum operating frequency, and the maximum operating frequency corresponds to the frequency limit condition.

2. The method according to claim 1, the load data of the target process comprising: The type of processor occupancy rate of the target process; wherein, the first processor matches the load data of the target process, including: The processor identifier of the first processor corresponds to the processor occupancy rate of the target process, and the processor identifier represents the processing performance of the first processor.

3. The method according to claim 1, after the target application is started and before controlling the target process corresponding to the target application in the electronic device to run in the first processor, the method further comprising: Controlling the target process corresponding to the target application to run in a second processor among the plurality of sub-processors; Determining whether the second processor matches the load data of the target process; When the second processor does not match the load data of the target process, performing the step of: controlling the target process corresponding to the target application in the electronic device to run in the first processor; The device power consumption value corresponding to the target process running on the first processor is less than the device power consumption value corresponding to the target process running on the second processor; or, After the target application is started, performing the step of: controlling the target process corresponding to the target application in the electronic device to run in the first processor.

4. The method according to claim 3, controlling the target process corresponding to the target application in the electronic device to run in the first processor, comprising: Obtaining the load data of the target process and the target processor identifier corresponding to the load data; Controlling the target process to run in the first processor corresponding to the target processor identifier.

5. The method according to claim 3, controlling the target process corresponding to the target application in the electronic device to run in the first processor, comprising: Searching for the corresponding relationship corresponding to the target process in the corresponding relationship set; The set of corresponding relationships includes at least one corresponding relationship, where the corresponding relationship is the corresponding relationship between a process identifier and a processor identifier, and the corresponding relationship is obtained based on the load data corresponding to the process identifier; If the target corresponding relationship corresponding to the target process is found in the set of corresponding relationships, control the target process to run in the first processor corresponding to the target processor identifier in the target corresponding relationship; If the corresponding relationship corresponding to the target process is not found in the set of corresponding relationships, obtain the load data of the target process and the target processor identifier corresponding to the load data, and control the target process to run in the first processor corresponding to the target processor identifier.

6. The method according to claim 5, further including: After obtaining the target processor identifier corresponding to the load data, update the corresponding relationship in the set of corresponding relationships at least according to the target process and the target processor identifier; and / or, Update the corresponding relationship in the set of corresponding relationships at least according to the processes on other devices and the corresponding processor identifiers.

7. The method according to claim 1, wherein the sub-processors in the target processor are divided into multiple processor groups, the supply voltages required by the sub-processors in the same processor group match each other, and one processor group corresponds to one power supply, and the supply voltages of the power supplies corresponding to different processor groups are different; wherein, The method further includes: Send a power supply instruction to the first power supply corresponding to the processor group where the first processor is located, and the power supply instruction includes at least the first voltage required by the first processor, so that the first power supply provides electrical energy to the processor group where the first processor is located according to the first voltage.

8. An electronic device, including: A target processor, which includes a plurality of sub-processors, and the plurality of sub-processors have different operating frequencies; A first controller, configured to: control the target process corresponding to the target application to run in the first processor; wherein, the first processor is the processor in the plurality of sub-processors that matches the load data of the target process; wherein, after controlling the target process corresponding to the target application in the electronic device to run in the first processor, the electronic device further includes: Judge whether the load data of the target process meets the frequency limit condition, where the frequency limit condition is related to the processor identifier of the first processor, and different processor identifiers representing different processing performances correspond to different frequency limit conditions; When the load data meets the frequency limit condition, set the maximum operating frequency for the first processor, so that the operating frequency of the first processor is below the maximum operating frequency, and the maximum operating frequency corresponds to the frequency limit condition.

9. The electronic device according to claim 8, wherein the sub-processors in the target processor are divided into multiple processor groups, the power supply voltages required by the sub-processors in the same processor group match each other, and one processor group corresponds to one power supply, and the power supply voltages of the power supplies corresponding to different processor groups are different; Wherein, the electronic device further includes: a second controller, configured to: send a power supply instruction to a first power supply corresponding to the processor group where the first processor is located, where the power supply instruction at least includes a first voltage required by the first processor, so that the first power supply provides electric energy to the processor group where the first processor is located according to the first voltage.

Citation Information

Patent Citations

  • Method and equipment for adjusting processor frequency

    CN103488532A

  • Task scheduling method and apparatus

    CN112328384A