Control method and electronic equipment

By determining the actual computing power of the CPU core in different application scenarios in electronic devices and updating the default value, selecting the kernel with the lowest energy efficiency ratio to perform tasks, the problem of being unable to accurately select a core with lower energy consumption in the existing technology, and improving users Experience and device performance.

CN119248466AActive Publication Date: 2025-01-03HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410373944.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2025-01-03
Estimated Expiration
2044-03-27

AI Technical Summary

Technical Problem

When existing electronic devices select CPU cores to perform tasks, they cannot accurately determine cores with lower energy consumption, resulting in low user experience, high power consumption or slow response.

Method used

By determining the actual computing power of the CPU core in different application scenarios, updating the default computing power, and selecting the kernel with the lowest energy efficiency ratio to perform tasks, ensuring that the appropriate kernel is accurately selected in different application scenarios.

Benefits of technology

Improves user experience, avoids the problems of high power consumption or slow response speed, and ensures the performance and energy efficiency of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248466A_ABST
    Figure CN119248466A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a control method and electronic equipment, relates to the field of electronic equipment, and can accurately determine a core of a CPU (Central Processing Unit) corresponding to a task for executing the electronic equipment so as to improve the use experience of a user. According to the specific scheme, the electronic equipment runs a first application program; the electronic equipment determines a first application scene according to the first application program; the electronic equipment determines a first actual computing power corresponding to each kernel in the CPU under the first application scene according to the first application scene; and the electronic equipment updates the default computing power corresponding to each kernel in the CPU according to the first actual computing power, so that the electronic equipment determines the kernel capable of executing the task corresponding to the first application scene based on the first actual computing power.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic equipment, and in particular to a control method and electronic equipment. Background Art

[0002] With the development of electronic device technology, the central processing unit (CPU) of more and more electronic devices can be a processor with a multi-core heterogeneous topology structure, that is, the CPU of the electronic device can include multiple cores, and different cores have different corresponding computing powers and corresponding power consumption.

[0003] Electronic devices can select different cores in the CPU to perform tasks corresponding to the electronic device through the energy aware scheduler (EAS) mechanism. When electronic devices select different cores in the CPU to perform tasks corresponding to the electronic device through the EAS mechanism, the electronic device determines the core in the CPU that can perform the task and has lower energy consumption based on the computing power of different cores in the CPU and the computing power corresponding to the task to be performed.

[0004] For any core in the CPU, its computing power is provided by the manufacturer and is a default value. However, when electronic devices are in different application scenarios, the computing power of the cores in the CPU is different and is not the default value provided by the manufacturer. Therefore, when electronic devices determine the core in the CPU that can perform the corresponding task and has lower energy consumption, based on the default computing power of different cores in the CPU, they cannot accurately determine the core that performs the task, resulting in a lower user experience. Summary of the invention

[0005] The embodiments of the present application provide a control method and an electronic device, which can accurately determine the core of the CPU corresponding to the task of executing the electronic device, thereby improving the user experience.

[0006] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0007] In a first aspect, an embodiment of the present application provides a control method applied to an electronic device, which may include: the electronic device runs a first application; the electronic device determines a first application scenario based on the first application; the electronic device determines a first actual computing power corresponding to each core in the CPU under the first application scenario based on the first application scenario; the electronic device updates the default computing power corresponding to each core in the CPU based on the first actual computing power, so that the electronic device determines the core that can execute the task corresponding to the first application scenario based on the first actual computing power.

[0008] Based on the control method described in the first aspect, when the electronic device determines the kernel that can execute the task corresponding to the current application scenario (i.e., the first application scenario), it determines the kernel that executes the task based on the actual computing power corresponding to each core in the CPU in the current application scenario, rather than determining the kernel that executes the task based on the default computing power of different cores in the CPU. Because the actual computing power corresponding to each core in the CPU is different from its corresponding default computing power in different application scenarios. Therefore, according to the actual computing power corresponding to each core in the CPU in the current application scenario, the kernel that executes the task can be accurately determined. Thereby improving the user experience.

[0009] In combination with the first aspect, in another possible implementation, before the above-mentioned electronic device determines the first actual computing power corresponding to each core in the CPU under the first application scenario according to the first application scenario, the above-mentioned control method may also include: the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios according to different application scenarios; the different application scenarios include the first application scenario; the electronic device stores the actual computing power corresponding to each core in the CPU under different application scenarios.

[0010] Based on this possible implementation method, since the electronic device can determine and store the actual computing power corresponding to each core in the CPU under different application scenarios according to different application scenarios, when the electronic device determines the first application scenario, the electronic device can determine the actual computing power corresponding to each core in the CPU under the first application scenario from the actual computing power corresponding to each core in the CPU under different application scenarios stored according to the first application scenario.

[0011] In combination with the first aspect, in another possible implementation, the actual computing power corresponding to each core in the CPU under the above-mentioned different application scenarios includes the actual computing power corresponding to each core in the CPU corresponding to different application scenarios at different frequencies.

[0012] Based on this possible implementation method, since the actual computing power corresponding to each core in the CPU under different application scenarios can include the actual computing power corresponding to each core in the CPU under different application scenarios at different frequencies, when the electronic device determines the first application scenario, the electronic device can accurately determine the actual computing power corresponding to each core in the CPU under the first application scenario from the actual computing power corresponding to each core in the CPU under different application scenarios stored according to the first application scenario.

[0013] In combination with the first aspect, in another possible implementation method, the above-mentioned electronic device determines the first actual computing power corresponding to each core in the CPU in the first application scenario according to the first application scenario, which may include: the electronic device determines the first frequency corresponding to the CPU in the first application scenario according to the first application scenario; the electronic device determines the actual computing power corresponding to each core in the CPU in different application scenarios, and the first actual computing power corresponding to each core in the CPU corresponding to the first application scenario at the first frequency.

[0014] Based on this possible implementation, since the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios according to the first frequency corresponding to the CPU under the first application scenario, the first actual computing power corresponding to each core in the CPU under the first application scenario under the first frequency. Therefore, the electronic device can more accurately determine the actual computing power corresponding to each core in the CPU under the first application scenario from the actual computing power corresponding to each core in the CPU under different application scenarios stored according to the first application scenario.

[0015] In combination with the first aspect, in another possible implementation, the above-mentioned control method may also include: the electronic device determines the first computing power corresponding to the existing task in the CPU under the first application scenario; the electronic device determines the first remaining computing power corresponding to each core in the CPU under the first application scenario based on the first computing power corresponding to the existing task in the CPU and the first actual computing power; the electronic device determines the first core that can execute the task corresponding to the first application scenario based on the first remaining computing power and the computing power of the task corresponding to the first application scenario.

[0016] Based on this possible implementation, the electronic device determines the first remaining computing power corresponding to each core in the CPU in the first application scenario based on the first computing power corresponding to the existing tasks in the CPU and the first actual computing power. And based on the first remaining computing power corresponding to each core in the CPU in the first application scenario, the first core that can execute the task corresponding to the first application scenario is determined. The core that can execute the task corresponding to the first application scenario can be accurately determined.

[0017] In combination with the first aspect, in another possible implementation, when the first kernel capable of executing tasks corresponding to the first application scenario includes multiple kernels, the control method may further include: the electronic device determines the kernel with the lowest energy efficiency ratio among the multiple kernels as the first target kernel; and the electronic device executes the tasks corresponding to the first application scenario through the first target kernel.

[0018] Based on this possible implementation, since the electronic device determines the core with the lowest energy efficiency ratio among the first cores capable of executing the task corresponding to the first application scenario as the target core for executing the task corresponding to the first application scenario, when the electronic device executes the task corresponding to the first application scenario according to the target core, the performance of the electronic device can be ensured and the high power consumption of the electronic device can be avoided.

[0019] In combination with the first aspect, in another possible implementation, the above-mentioned control method may also include: the electronic device receives a switching operation of the user; in response to the switching operation, the electronic device runs a second application; the second application is different from the first application; the electronic device determines a second application scenario based on the second application; the electronic device determines the second actual computing power corresponding to each core in the CPU under the second application scenario based on the second application scenario; the electronic device updates the first actual computing power corresponding to each core in the CPU based on the second actual computing power, so that the electronic device determines the core that can execute the task corresponding to the second application scenario based on the second actual computing power.

[0020] Based on this possible implementation, when the current application scenario of the electronic device is switched (i.e., switched to the second application scenario), when the electronic device determines the kernel that can execute the task corresponding to the current application scenario (i.e., the second application scenario), it can determine the kernel corresponding to the task of executing the switched application scenario based on the actual computing power corresponding to each core in the CPU in the second application scenario, rather than determining the kernel corresponding to the task based on the default computing power of different cores in the CPU. Because the actual computing power corresponding to each core in the CPU is different from its corresponding default computing power in different application scenarios. Therefore, according to the actual computing power corresponding to each core in the CPU in the switched application scenario, the kernel corresponding to the task of executing the switched application scenario can be accurately determined. Thereby improving the user experience.

[0021] In combination with the first aspect, in another possible implementation method, the above-mentioned electronic device determines the second actual computing power corresponding to each core in the CPU in the second application scenario according to the second application scenario, which may include: the electronic device determines the second frequency corresponding to the CPU in the second application scenario according to the second application scenario; the electronic device determines the actual computing power corresponding to each core in the CPU in different application scenarios, and the second actual computing power corresponding to each core in the CPU corresponding to the second application scenario at the second frequency.

[0022] Based on this possible implementation, after the application scenario is switched, the electronic device determines the second actual computing power corresponding to each core in the CPU under different application scenarios according to the second frequency corresponding to the CPU under the second application scenario after the switch, and the second actual computing power corresponding to each core in the CPU under the second application scenario under the second frequency. Therefore, the electronic device can more accurately determine the actual computing power corresponding to each core in the CPU under the second application scenario from the actual computing power corresponding to each core in the CPU under different application scenarios stored according to the second application scenario.

[0023] In combination with the first aspect, in another possible implementation, the above-mentioned control method may also include: the electronic device determines the second computing power corresponding to the existing task in the CPU under the second application scenario; the electronic device determines the second remaining computing power corresponding to each core in the CPU under the second application scenario based on the second computing power corresponding to the existing task in the CPU and the second actual computing power; the electronic device determines the second core that can execute the task corresponding to the first application scenario based on the second remaining computing power and the computing power of the task corresponding to the second application scenario.

[0024] Based on this possible implementation, after the application scenario is switched, the electronic device determines the second remaining computing power corresponding to each core in the CPU in the second application scenario based on the second computing power corresponding to the existing tasks in the CPU after the application scenario is switched, and the second actual computing power. And based on the second remaining computing power corresponding to each core in the CPU in the second application scenario, the second core that can execute the task corresponding to the second application scenario is determined. The core that can execute the task corresponding to the second application scenario can be accurately determined.

[0025] In combination with the first aspect, in another possible implementation, when the second core capable of executing tasks corresponding to the second application scenario includes multiple cores, the above control method may also include: the electronic device determines the core with the lowest energy efficiency ratio among the second cores as the second target core; and the electronic device executes the tasks corresponding to the second application scenario through the second target core.

[0026] Based on this possible implementation, after the application scenario is switched, the electronic device determines the core with the lowest energy efficiency ratio among the second cores capable of executing the task corresponding to the second application scenario as the target core for executing the task corresponding to the second application scenario. Therefore, when the electronic device executes the task corresponding to the second application scenario according to the target core, the performance of the electronic device can be ensured and the high power consumption of the electronic device can be avoided.

[0027] In a second aspect, an embodiment of the present application provides a control device, which can be applied to an electronic device to implement the method in the first aspect above. The functions of the control device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, for example, an operation module, a determination module, and an update module.

[0028] The running module can be used to run the first application.

[0029] The determination module can be used to determine a first application scenario according to a first application program.

[0030] The determination module can also be used to determine, according to the first application scenario, a first actual computing power corresponding to each core in the CPU in the first application scenario.

[0031] The update module can be used to update the default computing power corresponding to each core in the CPU according to the first actual computing power, so that the electronic device can determine the core that can execute the task corresponding to the first application scenario based on the first actual computing power.

[0032] In a third aspect, a control device is provided, which has the function of implementing the method described in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0033] In a fourth aspect, a control device is provided, comprising: a processor and a memory; the memory is used to store computer execution instructions, and when the control device is running, the processor executes the computer execution instructions stored in the memory so that the control device performs a control method as described in any one of the above-mentioned first aspects.

[0034] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by an electronic device, the electronic device implements the control method as described in any one of the first aspect or possible implementations of the first aspect.

[0035] In a sixth aspect, an embodiment of the present application provides a computer program product, comprising a computer-readable code, which, when executed in an electronic device, enables the electronic device to implement a control method as described in any one of the first aspect or possible implementations of the first aspect.

[0036] In a seventh aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting an electronic device to implement the functions involved in the first aspect above. In one possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.

[0037] It should be understood that the beneficial effects of the second to seventh aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A schematic diagram of the default energy efficiency ratio curve of different cores in the CPU of an electronic device;

[0039] Figure 2 A schematic diagram of a system structure of an electronic device provided in an embodiment of the present application Figure 1 ;

[0040] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0041] Figure 4 A schematic diagram of a system structure of an electronic device provided in an embodiment of the present application Figure 2 ;

[0042] Figure 5 A schematic diagram of a control method provided in an embodiment of the present application Figure 1 ;

[0043] Figure 6 This is a schematic diagram of the instruction distribution corresponding to the CPU in different application scenarios;

[0044] Figure 7 A schematic diagram of the default energy efficiency ratio curve and the actual energy efficiency ratio curve of different cores in the CPU of an electronic device;

[0045] Figure 8 A schematic diagram of a control method provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0047] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.

[0048] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. It should also be understood that " / " means or, for example, A / B can mean A or B; "and / or" in the text is merely a description of the association relationship of associated characters, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0049] With the development of electronic device technology, the central processing unit (CPU) of more and more electronic devices can be a processor with a multi-core heterogeneous topology (Arm, big.LITTLE), that is, the CPU of the electronic device can include multiple cores, and different cores have different corresponding computing powers and corresponding power consumption.

[0050] For example, the CPU of an electronic device may include a large core, a medium core, and a small core. The large core, medium core, and small core of the CPU are different types of cores in the processor design, with different main frequencies, architectures, and functional positioning, which can optimize the performance and energy efficiency of the CPU.

[0051] Large cores are usually high-performance cores with higher frequencies and powerful computing capabilities (i.e., computing power), and are suitable for processing tasks with high performance requirements, such as running large applications, games with high graphics requirements, and other computing-intensive tasks. Large cores usually operate at higher voltages and frequencies, so they consume more energy, but can provide faster response times and higher computing power.

[0052] Small cores are usually low-performance cores used to handle simpler tasks, such as lightweight applications such as browsers, emails, and music playback. Small cores have lower frequencies and weaker computing power (i.e., computing power), and lower power consumption, which can extend battery life and reduce power consumption. When processing these simple tasks, small cores can complete them with lower power consumption, thereby better meeting energy efficiency requirements.

[0053] The mid-core is usually between the big core and the small core, achieving a certain balance between performance and power consumption. The mid-core can play a role in some medium-load tasks, providing higher performance than the small core, while having lower power consumption than the big core.

[0054] That is to say, when the CPU of an electronic device includes a large core, a medium core, and a small core, the electronic device can perform tasks with high performance requirements through the large core of the CPU. At this time, the computing power of the electronic device is large, and the power consumption of the electronic device is large. The electronic device can also perform simple tasks (or tasks with low performance requirements) through the small core of the CPU. At this time, the computing power of the electronic device is small, and the power consumption of the electronic device is small. The electronic device can also perform corresponding tasks through the medium core of the CPU. At this time, the computing power of the electronic device is greater than the computing power of the electronic device when the small core is used, and is less than the computing power of the electronic device when the large core is used, and the power consumption of the electronic device is greater than the power consumption of the electronic device when the small core is used, and is less than the power consumption of the electronic device when the large core is used.

[0055] It should be noted that the computing power (i.e. capacity) corresponding to different cores of the CPU of an electronic device represents the number of instructions that different cores of the CPU can process when running at the highest frequency, and this value is relative to the core of the CPU with the largest computing power in the system of the electronic device and is normalized to within 1024.

[0056] When the CPU of an electronic device includes a large core, a medium core, and a small core, the electronic device can select different cores in the CPU to perform tasks corresponding to the electronic device through an energy aware scheduler (EAS) mechanism. When the electronic device selects different cores in the CPU to perform tasks corresponding to the electronic device through the EAS mechanism, the electronic device determines the core in the CPU that can perform the task and has lower energy consumption based on the computing power of different cores in the CPU and the computing power corresponding to the task to be performed.

[0057] That is, when the task that the electronic device needs to perform is a task with high performance requirements, the electronic device can determine to perform the task with high performance requirements through the large core of the CPU, so that the computing power of the electronic device is greater and can provide faster response time and higher computing power. Alternatively, when the task that the electronic device needs to perform is a task with low performance requirements, the electronic device can determine to perform the task with low performance requirements through the small core of the CPU, so that the power consumption of the electronic device can be lower.

[0058] For any core in the CPU, the corresponding computing power is a basic concept in kernel scheduling. It reflects the computing power of a CPU and is used to distinguish CPUs of different architectures. For any core in the CPU, the calculation formula for its corresponding maximum computing power is as described in the following formula 1.

[0059] Formula 1: capacity=capacity_dmips_mhz*cpuinfo_max_freq;

[0060] Among them, capacity_dmips_mhz can represent the Dhrystone Million Instructions PerSecond (DMIPS) value that can be executed by any core of the CPU when running at a frequency of each megahertz (MHz), cpuinfo_max_freq can represent the maximum frequency supported by the core of the CPU, and capacity can represent the maximum computing power of the core of the CPU.

[0061] It should be noted that the computing power of different frequencies in the core of the same CPU is linearly related to the frequency. In other words, the computing power of the CPU core at a certain frequency = (CPU frequency / CPU maximum frequency) * the maximum computing power of the CPU. That is, the computing power of the CPU core at a certain frequency is equal to the frequency of the CPU core divided by the maximum frequency of the CPU core, multiplied by the maximum computing power of the CPU core.

[0062] When an electronic device uses the EAS mechanism to select different cores in the CPU to perform tasks corresponding to the electronic device, not only the computing power of each core in the CPU is required, but also the power consumption of each core in the CPU at each frequency point. The electronic device can obtain the power of each core of the CPU at each frequency point through the energy consumption module (i.e., Energy Model module) included therein. When the electronic device obtains the power of each core of the CPU at each frequency point (i.e., frequency) through the energy consumption module included therein, it can be determined by the following formula 2.

[0063] Formula 2: Power = C*V 2 *freq;

[0064] Among them, C can represent the capacitance of the CPU, V can represent the voltage of the CPU at a certain frequency, freq can represent the frequency of the CPU, and Power can represent the power of any core of the CPU at a certain frequency.

[0065] For any core in the CPU, its corresponding energy efficiency ratio is the ratio of its power to its maximum computing power at a certain frequency, that is, power / capacity. Generally, for any core in the CPU, at a certain frequency, the lower the energy efficiency ratio, the better the energy efficiency ratio. Therefore, when the electronic device selects different cores in the CPU through the EAS mechanism to perform tasks corresponding to the electronic device, the electronic device can select the core corresponding to the frequency point with a low energy efficiency ratio to perform the corresponding task. Generally, the energy efficiency ratio of the small core in the CPU is better than that of the medium-core CPU, and the energy efficiency ratio of the medium-core CPU is better than that of the large-core CPU. That is, at the same frequency, the energy efficiency ratio of the small core in the CPU is lower than that of the medium-core CPU, and the energy efficiency ratio of the medium-core CPU is lower than that of the large-core CPU.

[0066] For example, combined with Figure 1 As shown, taking the CPU of an electronic device including a large core, a medium core and a small core as an example, the energy efficiency ratio of different cores in the electronic device is schematically explained.

[0067] like Figure 1 As shown, Figure 1 The horizontal axis in the figure can be expressed as frequency, and the vertical axis can be the power corresponding to any core in the CPU at a certain frequency. For any core in the CPU, by calculating the ratio of its corresponding power at each frequency to its corresponding maximum computing power, the energy efficiency ratio curve corresponding to the core can be obtained. The energy efficiency ratio curve of the large core in the CPU is as follows: Figure 1 As shown in curve 01, the energy efficiency ratio curve of the middle core in the CPU is as follows Figure 1 As shown in curve 02, the energy efficiency ratio curve of the small core in the CPU is as follows Figure 1 As shown by curve 03 in Figure 1 As shown, it can be seen that, overall, the energy efficiency ratio of the small core in the CPU is better than the energy efficiency ratio of the medium core CPU, which is 03 (that is, overall, the energy efficiency ratio of the small core in the CPU is lower than that of the medium core CPU), and the energy efficiency ratio of the medium core CPU is better than the energy efficiency ratio of the large core CPU, which is 01 (that is, overall, the energy efficiency ratio of the medium core in the CPU is lower than that of the large core CPU). That is, at the same frequency, the energy efficiency ratio of the small core in the CPU is lower than that of the medium core CPU, and the energy efficiency ratio of the medium core CPU is lower than that of the large core CPU.

[0068] Therefore, when an electronic device selects different cores in the CPU through the EAS mechanism to perform tasks corresponding to the electronic device, if both the large core and the medium core in the CPU can perform the tasks that the electronic device needs to perform, the electronic device can select the medium core to perform the tasks that need to be performed, thereby achieving lower power consumption without affecting performance. If both the medium core and the small core in the CPU can perform the tasks that the electronic device needs to perform, the electronic device can select the small core to perform the tasks that need to be performed, thereby achieving lower power consumption without affecting performance.

[0069] For any core in the CPU, its corresponding computing power is provided by the manufacturer. It is obtained by comprehensively evaluating any core in the CPU in many application scenarios, and does not take into account the differences in application scenarios. Therefore, for any core in the CPU, its corresponding computing power is a default value, and is usually a fixed value. However, when electronic devices are in different application scenarios, the computing power of the core in the CPU is different, and it is not the default value provided by the manufacturer. That is, when electronic devices are in different application scenarios, the execution performed by the core in the CPU is different, so the computing power corresponding to the core in the CPU is different, and it is not the default value provided by the manufacturer.

[0070] Therefore, when the electronic device determines the core in the CPU that can perform the corresponding task and has lower energy consumption, it cannot accurately determine the core that performs the task based on the default computing power of different cores in the CPU. When the core that performs the task is determined to be inaccurate, it is easy to cause the electronic device to have higher power consumption or a slower response speed. For example, when it is determined that the core that performs the task is a large core, and the small core can also perform the task at this time, it will cause the electronic device to have higher power consumption. For another example, when it is determined that the core that performs the task is a small core, and if the task is a high-performance task at this time, the electronic device performs the task through the small core, which will cause the electronic device to have a slower response speed.

[0071] In response to the above problems, an embodiment of the present application provides a control method, which is applied to an electronic device. The control method may include that the electronic device first determines the current application scenario. Afterwards, the electronic device may determine the actual computing power corresponding to each core in the CPU in the current application scenario. Afterwards, the electronic device may determine the remaining computing power corresponding to each core in the CPU in the current application scenario based on the actual computing power corresponding to each core in the CPU in the current application scenario, and the computing power corresponding to the existing tasks in the current application scenario. Afterwards, the electronic device may determine one or more cores that can perform the tasks that need to be performed in the current application scenario based on the remaining computing power corresponding to each core in the CPU in the current application scenario, and the computing power of the tasks that need to be performed in the current application scenario. Thus, the electronic device can determine the core that can perform the tasks that need to be performed in the current application scenario and has the lowest power consumption among the one or more cores to perform the tasks that need to be performed in the current application scenario.

[0072] In the solution of the present application, when the electronic device determines the core in the CPU that can perform the corresponding task and has low energy consumption, it does not determine the core corresponding to the task based on the default computing power of different cores in the CPU, but determines the core corresponding to the task based on the actual computing power corresponding to each core in the CPU in the current application scenario. Because the actual computing power corresponding to each core in the CPU is different from the default computing power corresponding to it in different application scenarios. Therefore, according to the actual computing power corresponding to each core in the CPU in the current application scenario, the core corresponding to the task can be accurately determined. That is, when it is determined that the core corresponding to the task is accurate, it can avoid high power consumption of the electronic device or slow response speed of the electronic device, thereby improving the user experience.

[0073] The control method provided in the embodiment of the present application is described below.

[0074] Combine the following Figure 2 The principle of the control method provided in the embodiment of the present application is schematically explained. Figure 2 As shown, the application scenarios of the electronic device may include video application scenarios, navigation application scenarios, shopping application scenarios, news application scenarios, music application scenarios, and e-book application scenarios, etc.

[0075] The electronic device may first determine the actual computing power corresponding to each core in the CPU in different application scenarios. For example, when the electronic device is in different scenarios, the electronic device may obtain the actual computing power corresponding to different cores in the CPU in the application scenario through a benchmark test (such as a benchmark test).

[0076] After the electronic device determines the actual computing power corresponding to each core in the CPU in different application scenarios, the electronic device can store the actual computing power corresponding to each core in the CPU in each application scenario in the corresponding configuration file (ie, config). For example, the electronic device can store the actual computing power corresponding to each core in the CPU in the video application scenario in configuration file 2. The electronic device can store the actual computing power corresponding to each core in the CPU in the navigation application scenario in configuration file 1. The electronic device can store the actual computing power corresponding to each core in the CPU in the music application scenario in configuration file 3. The electronic device can store the actual computing power corresponding to each core in the CPU in the e-book application scenario in configuration file 4.

[0077] It should be noted that, in different application scenarios, the actual computing power corresponding to each core in the corresponding CPU in the application scenario can also be stored in the same configuration file. For example, the electronic device can store the actual computing power corresponding to each core in the CPU in the video application scenario, and the actual computing power corresponding to each core in the CPU in the shopping application scenario in configuration file 2. The electronic device can store the actual computing power corresponding to each core in the CPU in the news application scenario, and the actual computing power corresponding to each core in the CPU in the e-book application scenario in configuration file 2.

[0078] After the electronic device stores the actual computing power corresponding to each core in the CPU in each application scenario in the corresponding configuration file, the electronic device first determines the current application scenario.

[0079] After the electronic device determines the current application scenario, the electronic device can obtain the actual computing power corresponding to each core in the CPU in the shopping application scenario under the current application scenario from the configuration file corresponding to the current application scenario.

[0080] Afterwards, the computing power algorithm module in the kernel of the electronic device can obtain a set of CPU kernels with computing power adaptation. That is, the computing power algorithm module in the kernel of the electronic device can determine the remaining computing power corresponding to each kernel in the CPU in the current application scenario based on the actual computing power corresponding to each kernel in the CPU in the current application scenario and the computing power corresponding to the existing tasks in the current application scenario. Afterwards, the computing power algorithm module in the kernel of the electronic device can determine one or more kernels that can execute the tasks that need to be executed in the current application scenario, that is, a set of CPU kernels with computing power adaptation, based on the remaining computing power corresponding to each kernel in the CPU in the current application scenario and the computing power of the tasks that need to be executed in the current application scenario.

[0081] Afterwards, the energy efficiency ratio core selection module in the core of the electronic device can determine the core that can execute the tasks that need to be executed in the current application scenario and has the lowest power consumption (that is, the core with lower energy efficiency, such as the large core, medium core or small core in the CPU) among the one or more cores (that is, the set of cores of the CPU with matched computing power) to execute the tasks that need to be executed in the current application scenario.

[0082] It should be noted that the kernel of the electronic device may also include other core selection modules, such as a vip core selection module, a core selection order module based on boost parameters, and a fast path core selection module. The specific types of other core selection modules included in the kernel of the electronic device in the embodiment of the present application are not limited. In the embodiment of the present application, after the computing power algorithm module in the kernel of the electronic device obtains the set of cores of the CPU adapted to the computing power, it is the energy efficiency ratio core selection module in the kernel of the electronic device. In the set of cores of the CPU adapted to the computing power, a core with relatively low energy efficiency is selected to perform the tasks that need to be performed in the current application scenario.

[0083] After the energy efficiency ratio core selection module in the core of the electronic device selects a core with relatively low energy efficiency, the energy efficiency ratio core selection module in the core of the electronic device can notify the CPU of the electronic device so that the core with relatively low energy efficiency in the CPU of the electronic device performs the tasks that need to be performed in the current application scenario.

[0084] The control method provided in the embodiment of the present application can be applied to the above-mentioned electronic devices. In some embodiments, the above-mentioned electronic devices can be mobile phones, tablet computers, handheld computers, personal computers (personal computers, PCs), cellular phones, personal digital assistants (personal digital assistants, PDAs) and other electronic devices including multi-core heterogeneous topology processors. That is, the processor of the electronic device in the embodiment of the present application can include multiple cores, such as large cores, medium cores and small cores. It should be noted that the embodiment of the present application does not limit the specific form of the electronic device.

[0085] For example, taking the electronic device as a mobile phone, Figure 3 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.

[0086] like Figure 3 As shown, the electronic device may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, an earphone interface 370D, a sensor module 380, a button 390, a motor 391, an indicator 392, a camera 393, a display screen 394, and a subscriber identification module (SIM) card interface 395, etc. Among them, the sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, an air pressure sensor 380C, a magnetic sensor 380D, an acceleration sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, an ambient light sensor 380L, a bone conduction sensor 380M, etc.

[0087] It is to 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 shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0088] The processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0089] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0090] The processor 310 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. The memory may store instructions or data that the processor 310 has just used or cyclically used. If the processor 310 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.

[0091] In some embodiments, the processor 310 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0092] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor and baseband processor.

[0093] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0094] The mobile communication module 350 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied in electronic devices. The mobile communication module 350 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 350 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be set in the processor 310. In some embodiments, at least some of the functional modules of the mobile communication module 350 can be set in the same device as at least some of the modules of the processor 310.

[0095] The wireless communication module 360 ​​can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 360 ​​can be one or more devices integrating at least one communication processing module. The wireless communication module 360 ​​receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 310. The wireless communication module 360 ​​can also receive the signal to be sent from the processor 310, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0096] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 350, and the antenna 2 is coupled to the wireless communication module 360, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology.

[0097] The electronic device implements the display function through a GPU, a display screen 394, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs that execute program instructions to generate or change display information.

[0098] The display screen 394 is used to display images, videos, etc. The display screen 394 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 394, where N is a positive integer greater than 1.

[0099] The electronic device can realize the shooting function through the ISP, the camera 393, the video codec, the GPU, the display screen 394 and the application processor, etc. In some embodiments, the electronic device can include 1 or N cameras 393, where N is a positive integer greater than 1.

[0100] The internal memory 321 can be used to store computer executable program codes, which include instructions. The processor 310 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 321. The internal memory 321 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data established during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0101] The acceleration sensor 380E can periodically collect acceleration data of the electronic device at a certain frequency. For example, the acceleration magnitude of the electronic device in various directions (generally XYZ three-axis directions) can be collected.

[0102] Of course, it is understandable that the above Figure 3 The figure is only an exemplary description when the electronic device is in the form of a mobile phone. If the electronic device is in the form of a tablet computer, a handheld computer, a PC, a PDA, a wearable device (such as a smart watch, a smart bracelet), etc., the structure of the electronic device may include Figure 3 The structure shown in the figure is less than Figure 2 More structures are shown in the figure, which are not limited here.

[0103] It is understandable that, generally speaking, the realization of electronic device functions requires not only hardware support but also software cooperation.

[0104] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device is illustrated.

[0105] In some examples, the system block diagram of the electronic device provided by the embodiments of the present application can be as follows: Figure 4 shown.

[0106] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. The system is divided into four layers, from top to bottom, namely the application layer, the application framework layer (ie, the framework layer), the kernel layer, and the CPU (the CPU may include a large core, a medium core, and a small core).

[0107] The application layer can include a series of application packages. Figure 4 As shown, the application layer package may include a video application, a navigation application, a shopping application, a news application, a music application, an e-book application, and the like.

[0108] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0109] like Figure 4 As shown, in an embodiment of the present application, the application framework layer may include a scene recognition module and a computing power switching module.

[0110] The scene recognition module can determine the current application scene of the electronic device by the user. For example, the scene recognition module can determine the current application scene by identifying user behavior or user scene. After the scene recognition module determines the current application scene of the electronic device, the scene recognition module can send the current application scene to the computing power switching module.

[0111] The computing power switching module can be used to receive the current application scenario sent by the scenario recognition module. The computing power switching module can also be used to switch the computing power model according to the recognized scenario. That is, the computing power switching module can determine the actual computing power of each core of the CPU corresponding to the current application scenario from the configuration file corresponding to the current application scenario according to the current application scenario.

[0112] After the computing power switching module determines the actual computing power of each core of the CPU corresponding to the current application scenario, the computing power switching module can send the actual computing power of each core of the CPU corresponding to the current application scenario to the computing power algorithm module of the core.

[0113] like Figure 4As shown, the kernel layer includes a computing power interface (i.e., capacity interface), a computing power algorithm module, and a core selection module. The computing power interface can be used to receive the actual computing power of each core of the CPU corresponding to the current application scenario sent by the computing power switching module in the application framework layer, and send the actual computing power of each core of the CPU corresponding to the current application scenario to the computing power algorithm module in the kernel layer. That is, the computing power switching module in the application framework layer can send the actual computing power of each core of the CPU corresponding to the current application scenario to the computing power algorithm module in the kernel layer through the computing power interface.

[0114] The computing power algorithm module can be used to receive the actual computing power of each core of the CPU corresponding to the current application scenario sent by the computing power switching module in the application framework layer. The computing power algorithm module can also be used to determine the set of CPU cores adapted to the computing power based on the actual computing power of each core of the CPU corresponding to the current application scenario. That is, the computing power algorithm module in the core of the electronic device can determine the remaining computing power corresponding to each core of the CPU in the current application scenario based on the actual computing power corresponding to each core in the CPU in the current application scenario and the computing power corresponding to the existing tasks in the current application scenario. Afterwards, the computing power algorithm module in the core of the electronic device can determine one or more cores that can execute the tasks that need to be executed in the current application scenario, that is, the set of CPU cores adapted to the computing power, based on the remaining computing power corresponding to each core in the CPU in the current application scenario and the computing power of the tasks that need to be executed in the current application scenario.

[0115] In some scenarios, the computing power algorithm module determines the set of CPU cores that are adapted to the computing power based on the actual computing power of each core of the CPU corresponding to the current application scenario. After the computing power algorithm module receives the actual computing power of each core of the CPU corresponding to the current application scenario, the computing power algorithm module can reset the maximum computing power of each core of the CPU according to the actual computing power of each core of the CPU corresponding to the current application scenario, that is, reset the computing power of each core of the CPU from the default computing power to the actual computing power corresponding to the current application scenario.

[0116] Afterwards, the computing power algorithm module in the kernel can determine the remaining computing power corresponding to each core in the CPU in the current application scenario based on the actual computing power corresponding to each core in the CPU in the current application scenario and the computing power corresponding to the existing tasks in the current application scenario. Afterwards, the computing power algorithm module in the kernel can determine one or more cores that can execute the tasks that need to be executed in the current application scenario, that is, the set of CPU cores with computing power adaptation, based on the remaining computing power corresponding to each core in the CPU in the current application scenario and the computing power of the tasks that need to be executed in the current application scenario.

[0117] The energy efficiency ratio core selection module in the kernel can determine the core that can execute the tasks that need to be executed in the current application scenario and has the lowest power consumption (that is, the core with lower energy efficiency, such as the large core, medium core or small core in the CPU) among the one or more cores (that is, the set of cores of the CPU with matching computing power) to execute the tasks that need to be executed in the current application scenario.

[0118] It should be noted that the kernel may also include other core selection modules, such as a vip core selection module, a core selection order module based on boost parameters, and a fast path core selection module. In the embodiment of the present application, the specific types of other core selection modules included in the kernel of the electronic device are not limited. In the embodiment of the present application, after the computing power algorithm module in the kernel of the electronic device obtains the set of cores of the CPU that is compatible with the computing power, it is the energy efficiency ratio core selection module in the kernel of the electronic device. In the set of cores of the CPU that is compatible with the computing power, a core with relatively low energy efficiency is selected to perform the tasks that need to be performed in the current application scenario.

[0119] After the energy efficiency ratio core selection module in the kernel selects a core with relatively low energy efficiency, the energy efficiency ratio core selection module in the kernel can notify the CPU of the electronic device so that the core with relatively low energy efficiency in the CPU of the electronic device performs the tasks that need to be performed in the current application scenario.

[0120] The methods in the following embodiments can all be implemented in an electronic device (such as a mobile phone) having the above hardware structure or software structure.

[0121] In some examples, in conjunction with Figure 5 , the control method provided in the embodiment of the present application is described in detail, and the control method can be applied to electronic devices (such as mobile phones, etc.). Figure 5 As shown, the control method may include the following S501-S509.

[0122] S501. The electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios.

[0123] In order to implement the control method provided in the embodiment of the present application, that is, in order to realize that when an electronic device determines one or more cores that can execute a task that needs to be executed in the current application scenario, the electronic device can determine the core corresponding to executing the task based on the actual computing power corresponding to each core in the CPU in the current application scenario, the electronic device can first determine the actual computing power corresponding to each core in the CPU in different application scenarios.

[0124] In some examples, the application scenario may be a scenario corresponding to an application running in the foreground of the electronic device, that is, when the application running in the foreground of the electronic device is different, the application scenario of the electronic device is different. It should be noted that the application running in the foreground of the electronic device may be an application built into the electronic device or a third-party application, which is not limited in the embodiments of the present application.

[0125] For example, the application that can be run in the foreground of the electronic device may be a video application, a navigation application, a shopping application, a news application, a music application, or an e-book application. Therefore, the application scenario of the electronic device may include a video application scenario, a navigation application scenario, a shopping application scenario, a news application scenario, a music application scenario, and an e-book application scenario. It should be noted that the specific types of application scenarios of the electronic device are not limited in the embodiments of the present application.

[0126] It should be noted that different application scenarios may include a first application scenario and a second application scenario. The first application scenario may be an application scenario corresponding to the first application, and the second application scenario may be an application scenario corresponding to the second application. The first application may be different from the second application. That is, the first application scenario is an application scenario corresponding to when the first application is running in the foreground of the electronic device. The second application scenario is an application scenario corresponding to when the second application is running in the foreground of the electronic device.

[0127] It should be noted that the types of instructions executed by each core in the CPU of an electronic device may include integer instructions, floating-point instructions, load instructions, storage instructions, immediate branch instructions, and data processing instructions, etc. In different application scenarios (i.e., different applications are running in the foreground of the electronic device), the types of instructions executed by each core in the CPU of the electronic device are different, and the number of instructions corresponding to different types is different. Since the computing power corresponding to each core in the CPU is the number of instructions that can be processed when each core in the CPU runs at the highest frequency, therefore, in different application scenarios (i.e., different applications are running in the foreground of the electronic device), the types of instructions executed by each core in the CPU of the electronic device are different, and the number of instructions corresponding to different types is different, resulting in different actual computing power corresponding to each core in the CPU of the electronic device.

[0128] For example, taking the application scenarios of video application scenarios and music application scenarios, the types of instructions executed by each core in the CPU of the electronic device include load instructions, storage instructions, data processing instructions, floating-point operation instructions, instructions of designated hardware accelerators, encryption-related instructions, immediate branch instructions, indirect branch instructions and return instructions. Figure 6 As shown, when the application scenario is a video application scenario and when the application scenario is a music application scenario, the number of loading instructions (i.e., raw-id-spec), the number of storage instructions (i.e., raw-st-spec), the number of data processing instructions (i.e., raw-dp-spec), the number of floating-point operation instructions (i.e., raw-vfp-spec), the number of instructions of the specified hardware accelerator (i.e., raw-ase-spec), the number of encryption-related instructions (i.e., raw-crypto-spec), the number of immediate branch instructions (i.e., raw-br-immed-spec), the number of indirect branch instructions (i.e., raw-br-indirect-spec) and the number of return instructions (i.e., raw-br-return-spec) executed by each core in the CPU of the electronic device are schematically illustrated.

[0129] like Figure 6 As shown, when the application scenario is a video application scenario, that is, when the foreground of the electronic device is running a video application, and when the application scenario is a video application scenario, that is, when the foreground of the electronic device is running a music application, the number of instructions loaded by each core in the CPU of the electronic device (i.e., raw-id-spec), the number of storage instructions, the number of data processing instructions, the number of floating-point operation instructions, the number of instructions of the specified hardware accelerator, the number of encryption-related instructions, the number of immediate branch instructions, the number of indirect branch instructions, and the number of return instructions are all different. Therefore, when the foreground of the electronic device is running a video application or a music application, the actual computing power corresponding to each core in the CPU of the electronic device is different. Therefore, when the application scenario is a video application scenario, that is, when the foreground of the electronic device is running a video application, and when the application scenario is a video application scenario, that is, when the foreground of the electronic device is running a music application, the actual computing power corresponding to each core in the CPU of the electronic device is different.

[0130] In some examples, the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios. In different application scenarios (i.e., different applications are running in the foreground of the electronic device), the electronic device uses a benchmark test (i.e., a benchmark test) to obtain the actual computing power of each core in the CPU.

[0131] Benchmark testing is a standardized performance testing method used to measure the performance of a device or system. For the CPU, benchmark testing can measure the performance of different cores when performing various tasks, that is, the actual computing power of different cores in the CPU. These tasks may include mathematical calculations, image processing, physical simulations, etc., which represent common computing requirements in actual applications.

[0132] When performing a benchmark test, the test software will design a series of tasks and assign them to different cores of the CPU for execution. The test software will then record the time, speed, and other performance indicators of each core executing the task. By comparing the performance data of different cores, the actual computing power of each core in different application scenarios can be obtained.

[0133] It should be noted that the specific method for obtaining the actual computing power of each core in the CPU in different application scenarios is not limited in the embodiments of the present application, that is, it can be obtained through a benchmark test (i.e., a benchmark test), or it can be obtained through other methods, such as a main frequency and core number calculation method, an architecture and instruction set analysis method, or an actual operation test. In the embodiments of the present application, an electronic device is used to obtain the actual computing power of each core in the CPU in different application scenarios through a benchmark test (i.e., a benchmark test) as an example for schematic illustration.

[0134] The main frequency and the number of cores are calculated in the following way: the main frequency is the number of times the CPU oscillates per second, which determines the CPU's operating speed. The number of cores is the number of independent processing units in the CPU, which determines the CPU's parallel computing capability. By combining the main frequency and the number of cores, the theoretical peak computing power of the CPU can be roughly calculated. But please note that this is only a theoretical value, and the actual computing power will also be affected by other factors.

[0135] In some examples, the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios, which can be, under different application scenarios (i.e., different applications are running in the foreground of the electronic device), the electronic device determines the actual computing power corresponding to each core in the CPU at different frequencies. In other words, the actual computing power corresponding to each core in the CPU under different application scenarios may include the actual computing power corresponding to each core in the CPU at different frequencies under different application scenarios. The actual computing power corresponding to each core in the CPU at different frequencies is the maximum computing power of each core in the CPU at different frequencies.

[0136] That is to say, in different application scenarios (i.e., different applications are running in the foreground of the electronic device), the electronic device uses a benchmark test (i.e., a benchmark test) to obtain the actual computing power corresponding to each core in the CPU at different frequencies.

[0137] In some examples, after the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios, the electronic device can store the actual computing power corresponding to each core in the CPU under different application scenarios. Thus, after determining the current application scenario, the electronic device can determine the actual computing power corresponding to each core in the CPU under the current application scenario from the actual computing power corresponding to each core in the CPU under different application scenarios stored by the electronic device.

[0138] In some examples, the electronic device stores the actual computing power corresponding to each core in the CPU under different application scenarios. The electronic device stores the actual computing power corresponding to each core in the CPU under different application scenarios in configuration files corresponding to different application scenarios.

[0139] In some examples, when the electronic device stores the actual computing power corresponding to each core in the CPU under different application scenarios, the electronic device may also store the corresponding relationship between the application scenario and the actual computing power corresponding to each core in the CPU under the application scenario. Thus, after the electronic device determines the application scenario, the electronic device may determine the actual computing power corresponding to each core in the CPU corresponding to the application scenario based on the corresponding relationship between the application scenario and the actual computing power corresponding to each core in the CPU under the application scenario.

[0140] For example, after the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios, the electronic device can store the actual computing power corresponding to each core in the CPU under different application scenarios, as well as the correspondence between the application scenarios and the actual computing power corresponding to each core in the CPU under the application scenarios, in configuration files corresponding to different application scenarios.

[0141] In some examples, after the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios, for each application scenario, the electronic device can obtain the measured energy efficiency ratio curve of each core in the CPU under the application scenario based on the actual computing power corresponding to each core in the CPU under the application scenario and the power of each core of the CPU at each frequency point.

[0142] For example, combined with Figure 7 As shown, taking the CPU of an electronic device including a medium core and a small core as an example, the energy efficiency ratio of different cores in the electronic device is schematically explained.

[0143] like Figure 7 As shown, Figure 7The horizontal axis in can be expressed as frequency, and the vertical axis can be the power corresponding to any core in the CPU at a certain frequency. For any core in the CPU, by calculating the ratio of its corresponding power at each frequency to its corresponding maximum computing power, the default energy efficiency ratio curve corresponding to the core can be obtained, such as Figure 7 Curve 04 in the figure is the default energy efficiency ratio curve for the small core. Figure 7 Curve 07 in the figure is the default energy efficiency ratio curve of the core.

[0144] After the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios (i.e., the actual computing power corresponding to each core in the CPU at different frequencies under different application scenarios), the electronic device can obtain the measured energy efficiency ratio curve corresponding to each core in the CPU under different application scenarios based on the actual computing power corresponding to each core in the CPU at different frequencies and the power of each core in the CPU at each frequency point. Figure 7 Curve 05 in the figure is the measured energy efficiency ratio curve of the small core. Figure 7 Curve 07 in the figure is the measured energy efficiency ratio curve of China National Nuclear Corporation.

[0145] Combination Figure 7 It can be seen that the measured energy efficiency ratio curve of the small core is significantly different from the default energy efficiency ratio curve, that is, in different application scenarios, the actual computing power of the small core is significantly less than the default value. And from the energy efficiency ratio curve, the actual energy efficiency ratio of the small core for high frequency points is higher than the energy efficiency ratio of the medium core for low frequency points, and the default energy efficiency ratio of the small core for high frequency points is basically the same as the energy efficiency ratio of the low frequency points corresponding to the medium core. However, in fact, the computing power of the high frequency points corresponding to the small core is basically the same as the computing power of the low frequency points corresponding to the medium core. When the electronic device uses the measured energy efficiency ratio curve (that is, according to the actual computing power of the cores in the CPU in different application scenarios, determine the core to execute the task), the computing power of the small core will be lower than the default computing power. Therefore, when scheduling tasks, the electronic device can place more tasks on the medium core, so that the task load on the CPU is more balanced and more power-saving.

[0146] S502: The electronic device determines a current application scenario.

[0147] After the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios, the user can use the electronic device. When the user uses the electronic device, the electronic device can determine the current application scenario.

[0148] In some examples, the electronic device determines the current application scenario, which can be that the electronic device determines the application currently running in the foreground (also referred to as the first application). After the electronic device determines the application currently running in the foreground, the electronic device can determine the current application scenario (also referred to as the first application) based on the application currently running in the foreground. For example, when the electronic device determines that the application currently running in the foreground is a video application, the electronic device can determine that the current application scenario is a video application scenario.

[0149] In some examples, the electronic device determines the application currently running in the foreground, which can be determined by the electronic device according to the user's operation of opening the application on the electronic device. For example, when the electronic device receives the user's operation of opening the video application on the electronic device, the electronic device can determine that the application currently running in the foreground is the video application, that is, the current application scenario is the video application scenario.

[0150] It should be noted that the specific manner in which the electronic device determines the current application scenario is not limited in the embodiments of the present application. The embodiments of the present application are illustrated by taking the electronic device determining the current application scenario through the application currently running in the foreground as an example.

[0151] S503: The electronic device determines, according to the current application scenario, the actual computing power corresponding to each core in the CPU corresponding to the current application scenario.

[0152] After the electronic device determines the current application scenario, the electronic device can determine the actual computing power corresponding to each core in the CPU corresponding to the current application scenario according to the current application scenario. Thus, the electronic device can determine the core among the multiple cores of the CPU that can execute the task of the current application scenario based on the actual computing power corresponding to each core in the CPU corresponding to the current application scenario.

[0153] That is, after the electronic device determines that the current application scenario is the first application scenario, the electronic device can determine the first actual computing power corresponding to each core in the CPU in the first application scenario according to the first application scenario. That is, the first actual computing power includes the actual computing power corresponding to each core in the CPU in the first application scenario.

[0154] In some examples, the electronic device determines the actual computing power corresponding to each core in the CPU corresponding to the current application scenario based on the current application scenario. The electronic device can determine the actual computing power corresponding to each core in the CPU corresponding to the current application scenario from a configuration file corresponding to the current application scenario based on the current application scenario and the correspondence between the application scenario and the actual computing power corresponding to each core in the CPU under the application scenario.

[0155] In some examples, the actual computing power corresponding to each core in the CPU under different application scenarios stored in the electronic device may be the actual computing power corresponding to each core in the CPU at different frequencies under different application scenarios. Therefore, after the electronic device determines the current application scenario, the electronic device may first determine the frequency of the CPU corresponding to the current application scenario. That is, after the electronic device determines that the current application scenario is the first application scenario, the electronic device may first determine the frequency of the CPU corresponding to the first application scenario (i.e., the first frequency).

[0156] Afterwards, the electronic device can determine the actual computing power corresponding to each core in the CPU at the frequency of the CPU corresponding to the current application scenario from the actual computing power corresponding to each core in the CPU at different frequencies under different application scenarios stored in the electronic device, based on the frequency of the CPU corresponding to the current application scenario, the current application scenario, and the correspondence between the application scenario and the actual computing power corresponding to each core in the CPU under the application scenario. That is, the electronic device can determine the first actual computing power corresponding to each core in the CPU corresponding to the first application scenario at the first frequency among the actual computing power corresponding to each core in the CPU under different application scenarios.

[0157] It should be noted that the frequency of the CPU corresponding to the current application scenario is the frequency corresponding to the CPU of the electronic device (ie, the core in the CPU) when executing the task corresponding to the current application scenario.

[0158] That is to say, the electronic device can determine the frequency of the CPU when the electronic device's CPU (i.e., the core in the CPU) executes the task corresponding to the current application scenario based on the task corresponding to the current application scenario (the thread corresponding to the current application scenario). For example, after the electronic device determines the current application scenario, the electronic device can first determine the type of task corresponding to the current application scenario. The types of tasks corresponding to the current application scenario may include complex tasks and simple tasks. Complex tasks, i.e., the types of tasks corresponding to the current application scenario, are tasks for running large games, performing video editing tasks, processing large amounts of data, and the like. Simple tasks refer to daily tasks such as browsing the web, sending emails, and the like. Different task types have different requirements for CPU performance.

[0159] Afterwards, the electronic device can determine the frequency corresponding to the CPU according to the type of task corresponding to the current application scenario. For example, when the type of task corresponding to the current application scenario includes a complex task, the electronic device can determine that the frequency corresponding to the CPU is a higher frequency. For another example, when the type of task corresponding to the current application scenario includes a simple task, the electronic device can determine that the frequency corresponding to the CPU is a lower frequency.

[0160] It should be noted that in the embodiments of the present application, the specific method for determining the frequency of the CPU corresponding to the current application scenario by the electronic device is not limited. In the examples of the present application, the frequency corresponding to the CPU (i.e., the core in the CPU) of the electronic device when executing the task corresponding to the current application scenario according to the task corresponding to the current application scenario (the thread corresponding to the current application scenario) is used as an example for schematic illustration.

[0161] It should be noted that the tasks corresponding to the current application scenario may include tasks corresponding to the current application (ie, the application currently running in the foreground of the electronic device), and may also include tasks corresponding to the current application scenario in the system of the electronic device.

[0162] S504: The electronic device determines the computing power corresponding to the existing tasks in the CPU.

[0163] After the electronic device determines the actual computing power corresponding to each core in the CPU corresponding to the current application scenario according to the current application scenario, the electronic device can determine the computing power corresponding to the existing tasks in the CPU. Thus, the electronic device can determine the remaining computing power corresponding to each core in the CPU under the current application scenario based on the computing power corresponding to the existing tasks in the CPU.

[0164] That is, after the electronic device determines the actual computing power corresponding to each core in the CPU corresponding to the first application scenario according to the first application scenario, the electronic device can determine the first computing power corresponding to the existing tasks in the CPU. The first computing power is the existing tasks in the CPU in the first application scenario.

[0165] In some examples, the computing power corresponding to the existing tasks in the CPU of the electronic device may include the computing power corresponding to the existing tasks of each core in the CPU. That is, the computing power corresponding to the existing tasks in the CPU of the electronic device may include the sum of the computing power corresponding to the existing tasks in the task queue corresponding to each core in the CPU.

[0166] In some examples, the electronic device determines the computing power corresponding to the existing tasks in the CPU by first determining the sum of the existing tasks of each core in the CPU. Then, the electronic device can convert the sum of the existing tasks of each core in the CPU to obtain the computing power corresponding to the existing tasks in the CPU.

[0167] It should be noted that the specific method for the electronic device to determine the computing power corresponding to the existing tasks in the CPU is not limited in the embodiment of the present application. In the embodiment of the present application, the electronic device first determines the sum of the existing tasks of each core in the CPU. Afterwards, the electronic device can convert the sum of the existing tasks of each core in the CPU to obtain the computing power corresponding to the existing tasks in the CPU as an example for schematic illustration.

[0168] In some examples, the electronic device converts the sum of the existing tasks of each core in the CPU to obtain the computing power corresponding to the existing tasks in the CPU, so that the electronic device can determine the number and type of tasks currently running on each core in the CPU and the demand for resources. Afterwards, the electronic device can obtain the computing power corresponding to each core in the CPU by analyzing the number and type of tasks currently running on each core in the CPU and the demand for resources, thereby obtaining the computing power corresponding to the existing tasks in the CPU (i.e., the sum of the computing power corresponding to each core in the CPU).

[0169] S505. The electronic device determines the remaining computing power corresponding to each core in the CPU in the current application scenario according to the computing power corresponding to the existing tasks in the CPU and the actual computing power corresponding to each core in the CPU corresponding to the current application scenario.

[0170] After the electronic device determines the computing power corresponding to the existing tasks in the CPU, the electronic device can determine the remaining computing power corresponding to each core in the CPU in the current application scenario based on the computing power corresponding to the existing tasks in the CPU and the actual computing power corresponding to each core in the CPU corresponding to the current application scenario. Thus, the electronic device can determine the core in the CPU that can execute the task of the current application scenario corresponding to the current application scenario based on the remaining computing power corresponding to each core in the CPU in the current application scenario.

[0171] That is, after the electronic device determines the first computing power corresponding to the existing task in the CPU in the first application scenario, the electronic device can determine the first remaining computing power corresponding to each core in the CPU in the first application scenario based on the first computing power corresponding to the existing task in the CPU and the first actual computing power. That is, the first remaining computing power may include the remaining computing power corresponding to each core in the CPU in the first application scenario. Thus, the electronic device can determine the first core that can execute the task corresponding to the first application scenario based on the first remaining computing power and the computing power of the task corresponding to the first application scenario.

[0172] In some examples, the electronic device determines the remaining computing power corresponding to each core in the CPU in the current application scenario based on the computing power corresponding to the existing tasks in the CPU and the actual computing power corresponding to each core in the CPU corresponding to the current application scenario. The electronic device first updates the default computing power corresponding to each core in the CPU to the sum of the actual computing power corresponding to each core in the CPU corresponding to the current application scenario. The electronic device can subtract the actual computing power corresponding to each core in the CPU corresponding to the current application scenario from the computing power corresponding to the existing tasks in the CPU, thereby obtaining the remaining computing power corresponding to each core in the CPU in the current application scenario.

[0173] S506: The electronic device determines the computing power corresponding to the task of the current application scenario according to the current application scenario.

[0174] After the electronic device determines the remaining computing power corresponding to each core in the CPU in the current application scenario, the electronic device can determine the computing power corresponding to the task of the current application scenario according to the current application scenario. Thus, the electronic device can determine at least one core in the CPU that can execute the task of the current application scenario based on the remaining computing power corresponding to each core in the CPU in the current application scenario and the computing power corresponding to the task of the current application scenario.

[0175] The task of the current application scenario is the task (also called a thread) that the electronic device needs to perform in the current application scenario. It should be noted that the task of the current application scenario may include the task corresponding to the current application (i.e., the application currently running in the foreground of the electronic device), and may also include the task corresponding to the current application scenario in the system of the electronic device in the current application scenario. This is not limited in the embodiments of the present application.

[0176] In some examples, the electronic device determines the computing power corresponding to the task of the current application scenario based on the current application scenario. The electronic device can determine the task corresponding to the current application scenario (i.e., the task that the electronic device needs to perform in the current application scenario) based on the current application scenario. It should be noted that the task corresponding to the current application scenario can also be an instruction that the electronic device needs to execute in the current application scenario. Afterwards, the electronic device can determine the computing power corresponding to the task of the current application scenario based on the task corresponding to the current application scenario.

[0177] It should be noted that the specific implementation method of the electronic device determining the task of the current application scenario corresponding to the current application scenario according to the current application scenario is not limited in the embodiments of the present application. The specific implementation method of the electronic device determining the computing power corresponding to the task of the current application scenario according to the task corresponding to the current application scenario is not limited in the embodiments of the present application.

[0178] It should be noted that in the embodiments of the present application, the electronic device determines the actual computing power corresponding to each core in the CPU corresponding to the current application scenario based on the current application scenario, and determines the remaining computing power corresponding to each core in the CPU under the current application scenario based on the computing power corresponding to the existing tasks in the CPU and the actual computing power corresponding to each core in the CPU corresponding to the current application scenario. The electronic device does not limit the order in which the computing power corresponding to the tasks of the current application scenario is determined based on the current application scenario.

[0179] That is, after S502, the electronic device may first execute S503-S505, and then execute S506; the electronic device may first execute S506, and then execute S503-S505; the electronic device may also execute S503-S505 and S506 simultaneously. In the embodiment of the present application, the electronic device may first execute S503-S505, and then execute S506 after S502, for example.

[0180] In some examples, after the electronic device determines the task corresponding to the current application scenario based on the current application scenario, the electronic device may also determine the frequency corresponding to the CPU of the electronic device based on the task of the current application scenario.

[0181] That is to say, the electronic device can determine the frequency of the CPU (i.e., the core in the CPU) when the electronic device performs the task of the current application scenario based on the task corresponding to the current application scenario. For example, after the electronic device determines the current application scenario, the electronic device can first determine the type of task of the current application scenario. The types of tasks in the current application scenario can include complex tasks and simple tasks. Complex tasks, i.e., the types of tasks corresponding to the current application scenario, are tasks for running large games, performing video editing tasks, processing large amounts of data, and the like. Simple tasks refer to daily tasks such as browsing the web, sending emails, and the like. Different task types have different requirements for CPU performance.

[0182] Afterwards, the electronic device can determine the frequency corresponding to the CPU according to the type of task in the current application scenario. For example, when the type of task in the current application scenario includes a complex task, the electronic device can determine that the frequency corresponding to the CPU is a higher frequency. For another example, when the type of task in the current application scenario includes a simple task, the electronic device can determine that the frequency corresponding to the CPU is a lower frequency.

[0183] It should be noted that in the embodiments of the present application, the specific method for the electronic device to determine the CPU frequency corresponding to the task of the current application scenario is not limited. In the examples of the present application, the frequency corresponding to the CPU (i.e., the core in the CPU) of the electronic device when executing the task of the current application scenario is determined according to the task of the current application scenario (the thread corresponding to the current application scenario) is used as an example for schematic illustration.

[0184] S507: The electronic device determines at least one core in the CPU that can execute the task of the current application scenario according to the computing power corresponding to the task of the current application scenario and the remaining computing power corresponding to each core in the CPU under the current application scenario.

[0185] After the electronic device determines the computing power corresponding to the task of the current application scenario according to the current application scenario, the electronic device can determine at least one core (also referred to as the first core) in the CPU that can execute the task of the current application scenario according to the computing power corresponding to the task of the current application scenario and the remaining computing power corresponding to each core in the CPU under the current application scenario. The first core can be one core or multiple cores. Thus, the electronic device can determine the target core from at least one core in the CPU that can execute the task of the current application scenario, and execute the task of the current application scenario through the target core.

[0186] In some examples, the electronic device determines at least one core in the CPU that can execute the task of the current application scenario based on the computing power corresponding to the task of the current application scenario and the remaining computing power corresponding to each core in the CPU in the current application scenario. The electronic device can determine that in the current application scenario, among multiple cores of the CPU, the core whose remaining computing power is greater than the computing power corresponding to the task of the current application scenario is at least one core in the CPU that can execute the task of the current application scenario.

[0187] S508: The electronic device determines a first target kernel according to at least one kernel in the CPU that can execute tasks in the current application scenario.

[0188] After the electronic device determines at least one core in the CPU that can execute the task of the current application scenario, the electronic device can determine a first target core according to the at least one core of the CPU that can execute the task of the current application scenario. Thus, the electronic device executes the task to be executed (i.e., the task corresponding to the current application scenario) through the target core of the CPU.

[0189] In some examples, the electronic device determines the first target kernel according to at least one kernel (i.e., the first kernel) in the CPU that can execute the task of the current application scenario. The electronic device may determine the kernel with the lowest energy consumption among at least one kernel that can execute the task of the current application scenario as the first target kernel. That is, when the first kernel that can execute the task corresponding to the first application scenario includes multiple kernels, the electronic device may determine the kernel with the lowest energy efficiency ratio among the first kernels as the first target kernel. Thus, the electronic device can execute the task corresponding to the first application scenario through the first target kernel.

[0190] In some examples, the electronic device determines the target core based on at least one core in the CPU that can perform the task of the current application scenario. The electronic device can determine the core with the lowest energy efficiency ratio among at least one core that can perform the task of the current application scenario as the target core based on the frequency corresponding to the CPU. That is, after the electronic device determines at least one core in the CPU that can perform the task of the current application scenario, the electronic device can determine the energy efficiency ratio corresponding to at least one core in the CPU that can perform the task of the current application scenario corresponding to the CPU frequency in the current application scenario based on the energy efficiency ratio curves corresponding to the frequency corresponding to the CPU in the current application scenario and the at least one core in the CPU that can perform the task of the current application scenario. Afterwards, the electronic device can determine the core with the lowest energy efficiency ratio among at least one core in the CPU that can perform the task of the current application scenario at the frequency corresponding to the CPU in the current application scenario as the target core.

[0191] For example, continue to combine Figure 7 As shown, when the CPU of an electronic device includes a medium core and a small core, the energy efficiency of different cores in the electronic device is as follows: Figure 7 As shown, Figure 7 Curve 04 in the figure is the default energy efficiency ratio curve for the small core. Figure 7 Curve 07 in the figure is the default energy efficiency ratio curve of the core. Figure 7 Curve 05 in the figure is the measured energy efficiency ratio curve of the small core. Figure 7 Curve 07 in the figure is the measured energy efficiency ratio curve of China National Nuclear Corporation.

[0192] When the electronic device determines that at least one core in the CPU that can perform the task of the current application scenario includes a medium core and a small core in the CPU, the electronic device can determine the energy efficiency ratio corresponding to the at least one core in the CPU that can perform the task of the current application scenario corresponding to the CPU frequency in the current application scenario based on the frequency corresponding to the CPU in the current application scenario and the energy efficiency ratio curves corresponding to at least one core in the CPU that can perform the task of the current application scenario (i.e., the medium core and the small core in the CPU). Afterwards, the electronic device can determine the core with the lowest energy efficiency ratio among at least one core in the CPU that can perform the task of the current application scenario at the frequency corresponding to the CPU in the current application scenario as the target core.

[0193] Combination Figure 7As shown, when the frequency corresponding to the CPU in the current application scenario is the high frequency point corresponding to the small core, since the actual energy efficiency ratio of the high frequency point corresponding to the small core is higher than the energy efficiency ratio of the low frequency point corresponding to the medium core, and the default energy efficiency ratio of the high frequency point corresponding to the small core is basically the same as the energy efficiency ratio of the low frequency point corresponding to the medium core, the actual computing power of the small core is significantly less than the default value. Therefore, when the electronic device determines that at least one core in the CPU that can execute the task of the current application scenario includes the medium core and the small core in the CPU, the electronic device can determine the medium core in the CPU as the target core, so that the task load on the CPU is more balanced and more power-saving.

[0194] S509: The electronic device executes a task corresponding to the current application scenario through the first target kernel.

[0195] After the electronic device determines the target core of the CPU based on at least one core of the CPU that can execute the task of the current application scenario, the electronic device can execute the task to be executed (ie, the task corresponding to the current application scenario) through the target core of the CPU.

[0196] The solution of the present application, when the electronic device determines the core in the CPU that can perform the corresponding task and has low energy consumption, it does not determine the core corresponding to the task based on the default computing power of different cores in the CPU, but determines the core corresponding to the task based on the actual computing power corresponding to each core in the CPU in the current application scenario. Because the actual computing power corresponding to each core in the CPU is different from the default computing power corresponding to it in different application scenarios. Therefore, according to the actual computing power corresponding to each core in the CPU in the current application scenario, the core corresponding to the task can be accurately determined. That is, when it is determined that the core corresponding to the task is accurate, it can avoid high power consumption of the electronic device or slow response speed of the electronic device, thereby improving the user experience.

[0197] In some examples, in conjunction with Figure 8 , the control method provided in the embodiment of the present application is described in detail, and the control method can be applied to electronic devices (such as mobile phones, etc.). Figure 8 As shown, the control method may include the following S801-S812.

[0198] S801. The electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios.

[0199] In order to implement the control method provided in the embodiment of the present application, that is, in order to realize that when an electronic device determines one or more cores that can execute a task that needs to be executed in the current application scenario, the electronic device can determine the core corresponding to the task based on the actual computing power corresponding to each core in the CPU in the current application scenario, the electronic device can first determine the actual computing power corresponding to each core in the CPU in different application scenarios.

[0200] In some examples, the application scenario may be a scenario corresponding to an application running in the foreground of the electronic device, that is, when the application running in the foreground of the electronic device is different, the application scenario of the electronic device is different. It should be noted that the application running in the foreground of the electronic device may be an application built into the electronic device or a third-party application, which is not limited in the embodiments of the present application.

[0201] In some examples, the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios, which can be, under different application scenarios (i.e., different applications are running in the foreground of the electronic device), the electronic device determines the actual computing power corresponding to each core in the CPU at different frequencies. In other words, the actual computing power corresponding to each core in the CPU under different application scenarios may include the actual computing power corresponding to each core in the CPU at different frequencies under different application scenarios. The actual computing power corresponding to each core in the CPU at different frequencies is the maximum computing power of each core in the CPU at different frequencies.

[0202] For the specific implementation method of the electronic device determining the actual computing power corresponding to each core in the CPU under different application scenarios in the embodiment of the present application, reference may be made to the above S501, and the embodiment of the present application will not be repeated here.

[0203] S802: The electronic device runs a first application.

[0204] After the electronic device determines the actual computing power corresponding to each core in the CPU under different application scenarios, the electronic device can run the first application, that is, the electronic device runs the first application in the foreground.

[0205] The first application may be a third-party application in the electronic device, or may be an application built into the electronic device, which is not limited in the embodiments of the present application.

[0206] In some examples, the first application may be a video application, or a music application, etc. The specific type of the first application is not limited in the embodiments of the present application.

[0207] S803: The electronic device determines, according to the first application program, that the current application scenario is the first application scenario.

[0208] After the electronic device runs the first application, the electronic device can determine, based on the first application, that the current application scenario is the application scenario corresponding to the first application, that is, the current application scenario is the first application scenario.

[0209] In the embodiment of the present application, the electronic device determines that the current application scenario is the first application scenario according to the first application. For a specific implementation method, reference may be made to the above S502, and the embodiment of the present application will not be repeated here.

[0210] S804: The electronic device determines, according to the first application scenario, an actual computing power corresponding to each core in the CPU corresponding to the first application scenario.

[0211] After the electronic device determines that the current application scenario is the first application scenario, the electronic device may determine the actual computing power corresponding to each core in the CPU corresponding to the first application scenario (also referred to as the first actual computing power) according to the first application scenario. That is, the first actual computing power may include the actual computing power corresponding to each core in the CPU under the first application scenario.

[0212] In some examples, the electronic device determines, according to the first application scenario, a first actual computing power corresponding to each core in the CPU in the first application scenario, which may include: the electronic device determines, according to the first application scenario, a first frequency corresponding to the CPU in the first application scenario. Afterwards, the electronic device may determine, among the actual computing power corresponding to each core in the CPU in different application scenarios, the first actual computing power corresponding to each core in the CPU corresponding to the first application scenario at the first frequency.

[0213] After the electronic device determines the actual computing power corresponding to each core in the CPU corresponding to the first application scenario according to the first application scenario, the electronic device can update the default computing power corresponding to each core in the CPU according to the first actual computing power. That is, the default computing power corresponding to each core in the CPU is updated to its actual computing power corresponding to the first application scenario, so that the electronic device can determine the core that can execute the task corresponding to the first application scenario based on the first actual computing power.

[0214] In the embodiment of the present application, the electronic device determines the specific implementation method of the actual computing power corresponding to each core in the CPU corresponding to the first application scenario according to the first application scenario. Please refer to the above S503, and the embodiment of the present application will not be repeated here.

[0215] S805. The electronic device determines a first target core in the CPU based on the actual computing power corresponding to each core in the CPU corresponding to the first application scenario.

[0216] After the electronic device determines the actual computing power corresponding to each core in the CPU corresponding to the first application scenario according to the first application scenario, the electronic device can determine the first target core in the CPU based on the actual computing power corresponding to each core in the CPU corresponding to the first application scenario.

[0217] In some examples, the electronic device determines the first target core in the CPU based on the actual computing power corresponding to each core in the CPU corresponding to the first application scenario. The electronic device may first determine the computing power corresponding to the existing tasks in the CPU (i.e., the first computing power). Afterwards, the electronic device may determine the remaining computing power corresponding to each core in the CPU under the first application scenario (i.e., the first remaining computing power) based on the computing power corresponding to the existing tasks in the CPU and the actual computing power corresponding to each core in the CPU corresponding to the first application scenario. That is, the first remaining computing power may include the remaining computing power corresponding to each core in the CPU under the first application scenario.

[0218] Afterwards, the electronic device can determine the computing power corresponding to the task of the current application scenario (i.e., the first application scenario) based on the current application scenario. Afterwards, the electronic device can determine at least one core (i.e., the first core) in the CPU that can execute the task of the current application scenario based on the computing power corresponding to the task of the current application scenario and the remaining computing power corresponding to each core in the CPU under the current application scenario. Afterwards, the electronic device can determine the first target core based on at least one core in the CPU that can execute the task of the current application scenario, that is, the electronic device can determine the core with the lowest energy efficiency ratio among at least one core in the CPU that can execute the task of the current application scenario at the frequency corresponding to the CPU under the first application scenario as the first target core.

[0219] In the embodiment of the present application, the electronic device determines the specific implementation method of the first target core in the CPU based on the actual computing power corresponding to each core in the CPU corresponding to the first application scenario. Please refer to the above S504-S509, and the embodiment of the present application will not be repeated here.

[0220] S806: The electronic device executes a task corresponding to the first application scenario through the first target kernel in the CPU.

[0221] After the electronic device determines that the target core is the first core in the CPU, the electronic device may execute the task corresponding to the first application scenario (ie, the task corresponding to the current application scenario) through the first target core in the CPU.

[0222] S807: The electronic device receives a switching operation from the user.

[0223] After the electronic device executes the task corresponding to the first application scenario through the first core in the CPU, the electronic device can receive a switching operation from the user. The switching operation from the user can be used to trigger the electronic device to switch to running the second application, that is, to trigger the electronic device to switch from running the first application in the foreground to running the second application in the foreground.

[0224] S808. In response to the user's switching operation, the electronic device runs a second application.

[0225] After the electronic device receives the switching operation from the user, the electronic device may run the second application in response, that is, the electronic device runs the second application in the foreground.

[0226] The second application is different from the first application. For example, when the first application is a video application, the second application may be a music application.

[0227] In some examples, the task type of the task corresponding to the application scenario corresponding to the second application is different from the task type of the task corresponding to the application scenario corresponding to the first application. For example, when the task type of the task corresponding to the application scenario corresponding to the first application (i.e., the first application scenario) is a complex task, such as a large-scale game task, a video editing task, a large amount of data processing task, etc., the task type of the task corresponding to the application scenario corresponding to the second application (i.e., the second application scenario) can be a simple task, such as browsing the web, sending emails, etc.

[0228] S809: The electronic device determines, based on the second application program, that the current application scenario is a second application scenario.

[0229] After the electronic device runs the second application, the electronic device can determine that the current application scenario is the second application scenario based on the second application, that is, the current application scenario is switched from the first application scenario to the second application scenario.

[0230] In the embodiment of the present application, the electronic device determines that the current application scenario is the second application scenario according to the second application program. For a specific implementation method, reference may be made to the above S502, which will not be described in detail in the embodiment of the present application.

[0231] S810. The electronic device determines, according to the second application scenario, an actual computing power corresponding to each core in the CPU corresponding to the second application scenario.

[0232] After the electronic device determines that the current application scenario is the second application scenario, the electronic device may determine the actual computing power corresponding to each core in the CPU corresponding to the second application scenario (also referred to as the second actual computing power) according to the second application scenario. That is, the second actual computing power may include the actual computing power corresponding to each core in the CPU in the second application scenario.

[0233] In some examples, the electronic device determines, according to the second application scenario, the second actual computing power corresponding to each core in the CPU in the second application scenario, which may include: the electronic device determines, according to the second application scenario, the second frequency corresponding to the CPU in the second application scenario. Afterwards, the electronic device may determine, among the actual computing power corresponding to each core in the CPU in different application scenarios, the second actual computing power corresponding to each core in the CPU corresponding to the second application scenario at the second frequency.

[0234] After the electronic device determines the actual computing power corresponding to each core in the CPU corresponding to the second application scenario according to the second application scenario, the electronic device can update the computing power corresponding to each core in the CPU according to the second actual computing power. That is, the first actual computing power corresponding to each core in the CPU is updated to its actual computing power corresponding to the second application scenario, so that the electronic device can determine the core that can execute the task corresponding to the second application scenario based on the second actual computing power.

[0235] In the embodiment of the present application, the electronic device determines the specific implementation method of the actual computing power corresponding to each core in the CPU corresponding to the second application scenario according to the second application scenario. Please refer to the above S503, and the embodiment of the present application will not be repeated here.

[0236] S811. The electronic device determines a second target core in the CPU based on an actual computing power corresponding to each core in the CPU corresponding to the second application scenario.

[0237] After the electronic device determines the actual computing power corresponding to each core in the CPU corresponding to the second application scenario according to the second application scenario, the electronic device can determine the second target core in the CPU based on the actual computing power corresponding to each core in the CPU corresponding to the second application scenario.

[0238] The second target kernel in the CPU may be different from the first target kernel. For example, when the first application is a video application, the first target kernel in the CPU may be a medium kernel in the CPU. When the second application is a music application, the second target kernel in the CPU may be a small kernel or a medium kernel in the CPU.

[0239] In some examples, the electronic device determines the second target core in the CPU based on the actual computing power corresponding to each core in the CPU corresponding to the second application scenario. The electronic device may first determine the computing power (i.e., the second computing power) corresponding to the existing task in the CPU. The second computing power is the computing power corresponding to the existing task in the CPU in the second application scenario.

[0240] Afterwards, the electronic device can determine the remaining computing power (i.e., the second remaining computing power) corresponding to each core in the CPU in the current application scenario based on the computing power corresponding to the existing tasks in the CPU and the actual computing power corresponding to each core in the CPU corresponding to the current application scenario. That is, the second remaining computing power may include the remaining computing power corresponding to each core in the CPU in the second application scenario.

[0241] Afterwards, the electronic device can determine the computing power corresponding to the task of the current application scenario (i.e., the task that the electronic device needs to perform in the second application scenario) based on the second application scenario. Afterwards, the electronic device can determine at least one core (i.e., the second core) in the CPU that can perform the task of the current application scenario based on the computing power corresponding to the task of the current application scenario and the remaining computing power corresponding to each core in the CPU in the second application scenario. Afterwards, the electronic device can determine the second target core based on at least one core in the CPU that can perform the task of the current application scenario, that is, the electronic device can determine the core with the lowest energy efficiency ratio among at least one core in the CPU that can perform the task of the current application scenario at the frequency corresponding to the CPU in the second application scenario as the second target core.

[0242] In the embodiment of the present application, the electronic device determines the specific implementation method of the second target core in the CPU based on the actual computing power corresponding to each core in the CPU corresponding to the second application scenario. Please refer to the above S504-S509, and the embodiment of the present application will not be repeated here.

[0243] S812: The electronic device executes a task corresponding to the second application scenario through the second target kernel in the CPU.

[0244] After the electronic device determines the second target kernel in the CPU, the electronic device may execute the task corresponding to the second application scenario through the second target kernel in the CPU.

[0245] In the solution of the present application, when the electronic device determines the core in the CPU that can perform the corresponding task and has low energy consumption, it does not determine the core corresponding to the task based on the default computing power of different cores in the CPU, but determines the core corresponding to the task based on the actual computing power corresponding to each core in the CPU in the current application scenario. Because the actual computing power corresponding to each core in the CPU is different from the default computing power corresponding to it in different application scenarios. Therefore, according to the actual computing power corresponding to each core in the CPU in the current application scenario, the core corresponding to the task can be accurately determined. That is, when it is determined that the core corresponding to the task is accurate, it can avoid high power consumption of the electronic device or slow response speed of the electronic device, thereby improving the user experience.

[0246] It should be understood that the division of units or modules (hereinafter referred to as units) in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or physically separated. And the units in the device can all be implemented in the form of software calling through processing elements; or all in the form of hardware; or some units can be implemented in the form of software calling through processing elements, and some units can be implemented in the form of hardware.

[0247] For example, each unit can be a separately established processing element, or it can be integrated in a certain chip of the device. In addition, it can also be stored in a memory in the form of a program, and called and executed by a certain processing element of the device. In addition, all or part of these units can be integrated together, or they can be implemented independently. The processing element described here can also be called a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each unit above can be implemented by an integrated logic circuit of hardware in the processor element or in the form of software called by a processing element.

[0248] In one example, the unit in the above apparatus may be one or more integrated circuits configured to implement the above method, such as one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of at least two of these integrated circuit forms.

[0249] For another example, when the units in the device can be implemented in the form of a processing element scheduling program, the processing element can be a general-purpose processor, such as a CPU or other processor that can call a program. For another example, these units can be integrated together and implemented in the form of a system on a chip SOC.

[0250] In one implementation, the units of the above apparatus implementing the corresponding steps in the above method can be implemented in the form of a processing element scheduling program. For example, the apparatus may include a processing element and a storage element, and the processing element calls the program stored in the storage element to execute the method described in the above method embodiment. The storage element may be a storage element on the same chip as the processing element, that is, an on-chip storage element.

[0251] In another implementation, the program for executing the above method may be in a storage element on a different chip from the processing element, i.e., an off-chip storage element. In this case, the processing element calls or displays the program on the on-chip storage element from the off-chip storage element to call and execute the method described in the above method embodiment.

[0252] For example, an embodiment of the present application may also provide a device, such as an electronic device, which may include a processor and a memory for storing instructions executable by the processor. When the processor is configured to execute the above instructions, the electronic device implements the control method described in the above embodiment. The memory may be located inside the electronic device or outside the electronic device. And the processor includes one or more.

[0253] In another implementation, the unit of the device implementing each step in the above method may be configured as one or more processing elements, which may be arranged on the corresponding electronic device, and the processing element here may be an integrated circuit, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of these integrated circuits. These integrated circuits may be integrated together to form a chip.

[0254] For example, the present application also provides a chip, which can be applied to the above electronic device. The chip includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a line; the processor receives and executes computer instructions from the memory of the electronic device through the interface circuit to implement the method described in the above method embodiment.

[0255] An embodiment of the present application also provides a computer program product, including computer instructions executed by the above-mentioned electronic device.

[0256] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0257] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0258] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0259] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0260] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, such as a program. The software product is stored in a program product, such as a computer-readable storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0261] For example, the embodiment of the present application may also provide a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by an electronic device, the electronic device implements the control method described in the above method embodiment.

[0262] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A control method, characterized in that: Applied to an electronic device, the central processing unit (CPU) of the electronic device includes multiple cores, and the method includes: The electronic device runs a first application; The electronic device determines a first application scenario according to the first application program; The electronic device determines, according to the first application scenario, a first actual computing power corresponding to each core in the CPU in the first application scenario; The electronic device updates the default computing power corresponding to each core in the CPU according to the first actual computing power, so that the electronic device determines the core that can execute the task corresponding to the first application scenario based on the first actual computing power.

2. The method according to claim 1, characterized in that Before the electronic device determines, according to the first application scenario, a first actual computing power corresponding to each core in the CPU in the first application scenario, the method further includes: The electronic device determines, according to different application scenarios, actual computing power corresponding to each core in the CPU under the different application scenarios; the different application scenarios include the first application scenario; The electronic device stores the actual computing power corresponding to each core in the CPU under the different application scenarios.

3. The method according to claim 2, characterized in that The actual computing power corresponding to each core in the CPU under the different application scenarios includes the actual computing power corresponding to each core in the CPU corresponding to the different application scenarios at different frequencies.

4. The method according to claim 3, characterized in that The electronic device determines, according to the first application scenario, a first actual computing power corresponding to each core in the CPU in the first application scenario, including: The electronic device determines, according to the first application scenario, a first frequency corresponding to the CPU in the first application scenario; The electronic device determines, in the actual computing power corresponding to each core in the CPU under the different application scenarios, the first actual computing power corresponding to each core in the CPU corresponding to the first application scenario under the first frequency.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The electronic device determines a first computing power corresponding to an existing task in the CPU in the first application scenario; The electronic device determines, according to the first computing power corresponding to the existing tasks in the CPU and the first actual computing power, a first remaining computing power corresponding to each core in the CPU in the first application scenario; The electronic device determines a first kernel capable of executing the task corresponding to the first application scenario according to the first remaining computing power and the computing power of the task corresponding to the first application scenario.

6. The method according to claim 5, characterized in that In a case where the first kernel capable of executing the task corresponding to the first application scenario includes a plurality of kernels, the method further includes: The electronic device determines, among the first cores, a core with the lowest energy efficiency ratio as a first target core; The electronic device executes the task corresponding to the first application scenario through the first target kernel.

7. The method according to claim 1, characterized in that The method further comprises: The electronic device receives a switching operation by a user; In response to the switching operation, the electronic device runs a second application; the second application is different from the first application; The electronic device determines a second application scenario according to the second application program; The electronic device determines, according to the second application scenario, a second actual computing power corresponding to each core in the CPU in the second application scenario; The electronic device updates the first actual computing power corresponding to each core in the CPU according to the second actual computing power, so that the electronic device determines the core that can execute the task corresponding to the second application scenario based on the second actual computing power.

8. The method according to claim 7, characterized in that The electronic device determines, according to the second application scenario, a second actual computing power corresponding to each core in the CPU in the second application scenario, including: The electronic device determines, according to the second application scenario, a second frequency corresponding to the CPU in the second application scenario; The electronic device determines, in the actual computing power corresponding to each core in the CPU under the different application scenarios, the second actual computing power corresponding to each core in the CPU corresponding to the second application scenario under the second frequency.

9. The method according to claim 7 or 8, characterized in that: The method further comprises: The electronic device determines a second computing power corresponding to the existing task in the CPU in the second application scenario; The electronic device determines, according to the second computing power corresponding to the existing tasks in the CPU and the second actual computing power, a second remaining computing power corresponding to each core in the CPU in the second application scenario; The electronic device determines a second kernel capable of executing the task corresponding to the first application scenario according to the second remaining computing power and the computing power of the task corresponding to the second application scenario.

10. The method according to claim 9, characterized in that In a case where the second kernel capable of executing the task corresponding to the second application scenario includes a plurality of kernels, the method further includes: The electronic device determines, among the second cores, a core with the lowest energy efficiency ratio as a second target core; The electronic device executes the task corresponding to the second application scenario through the second target kernel.

11. An electronic device, characterized in that: The electronic device comprises a processor and a memory for storing instructions executable by the processor; when the processor is configured to execute the instructions, the electronic device implements the method according to any one of claims 1 to 10.

12. A computer-readable storage medium having computer program instructions stored thereon; characterized in that: When the computer program instructions are executed by an electronic device, the electronic device implements the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Computing power resource allocation method and device and storage medium

    CN114296912A

  • CPU scheduling method and device, terminal equipment and storage medium

    CN115048209A

  • Computing network, computing force measurement method, scheduling device and related products

    CN115373836A

  • Task scheduling method, electronic equipment, chip system and storage medium

    CN115904647A

  • Task scheduling method, electronic equipment and computer readable storage medium

    CN117632400A