A control method and electronic device

By determining the actual computing power of the CPU core in the current application scenario within an electronic device, and combining this with the existing task computing power to select the core with the lowest energy efficiency to execute the task, the problem of inaccurate power consumption and response speed in existing technologies is solved, thus improving the user experience.

CN119248466BActive Publication Date: 2025-12-05HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, electronic devices cannot accurately select CPU cores to execute tasks based on the actual computing power in different application scenarios, resulting in high power consumption or slow response speed, which affects the user experience.

Method used

By determining the actual computing power of each CPU core in the current application scenario and combining it with the computing power of existing tasks, the core with the lowest energy efficiency is selected to execute the task, thus avoiding reliance on the default computing power.

Benefits of technology

Accurately select the kernel to execute tasks to avoid excessive power consumption or slow response speed, thereby improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248466B_ABST
    Figure CN119248466B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a control method and an electronic device, relates to the field of electronic devices, and can accurately determine the core of the CPU corresponding to the task of the electronic device, thereby improving the use experience of the user. The specific scheme is as follows: the electronic device runs a first application program; the electronic device determines a first application scene according to the first application program; the electronic device determines the first actual computing power corresponding to each core of the CPU in the first application scene according to the first application scene; and the electronic device updates the default computing power corresponding to each core of the CPU according to the first actual computing power, so that the electronic device determines the core 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] This application relates to the field of electronic devices, and more particularly to a control method and an electronic device. Background Technology

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

[0003] Electronic devices can use an energy-aware scheduler (EAS) mechanism to select different CPU cores to execute tasks. When an electronic device uses the EAS mechanism to select different CPU cores to execute a task, it determines the CPU core that can execute the task and has the lowest energy consumption based on the computing power of the different CPU cores and the computing power required for the task.

[0004] For any given CPU core, its computing power is provided by the manufacturer and represents a default value. However, the computing power of CPU cores varies depending on the application scenario of the electronic device, and is not a manufacturer-provided default value. Therefore, when an electronic device determines which CPU core can execute a specific task with low power consumption, it cannot accurately identify the core to perform the task based on the default computing power of different cores, leading to a poor user experience. Summary of the Invention

[0005] This application provides a control method and an electronic device that can accurately determine the CPU core corresponding to the task executed by the electronic device, thereby improving the user experience.

[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0007] In a first aspect, embodiments of this application provide a control method applied to an electronic device. The control method may include: the electronic device running a first application; the electronic device determining a first application scenario based on the first application; the electronic device determining a first actual computing power corresponding to each core in the CPU under the first application scenario based on the first application scenario; and the electronic device updating the default computing power corresponding to each core in the CPU based on the first actual computing power, so that the electronic device can determine the core capable of executing 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 an electronic device determines which kernel can execute the task corresponding to the current application scenario (i.e., the first application scenario), it determines the kernel based on the actual computing power of each core in the CPU under the current application scenario, rather than based on the default computing power of different cores in the CPU. Since the actual computing power of each core in the CPU differs from its default computing power under different application scenarios, accurately determining the kernel to execute the task based on the actual computing power of each core in the CPU under the current application scenario improves the user experience.

[0009] In conjunction with the first aspect, in another possible implementation, before the electronic device determines the first actual computing power corresponding to each core in the CPU under the first application scenario based on the first application scenario, the control method may further include: the electronic device determining the actual computing power corresponding to each core in the CPU under different application scenarios based on different application scenarios; different application scenarios include the first application scenario; the electronic device storing the actual computing power corresponding to each core in the CPU under different application scenarios.

[0010] Based on this possible implementation, since the electronic device can determine and store the actual computing power corresponding to each core of the CPU in 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 of the CPU in the first application scenario from the stored actual computing power corresponding to each core of the CPU in different application scenarios.

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

[0012] Based on this possible implementation, since the actual computing power of each core in the CPU under different application scenarios can be included at different frequencies and for different application scenarios, when the electronic device determines the first application scenario, the electronic device can accurately determine the actual computing power of each core in the CPU under the first application scenario from the stored actual computing power of each core in the CPU under different application scenarios.

[0013] In conjunction with the first aspect, in another possible implementation, the electronic device determines the first actual computing power corresponding to each core in the CPU under the first application scenario based on the first application scenario. This may include: the electronic device determining the first frequency corresponding to the CPU under the first application scenario based on the first application scenario; the electronic device determining the first actual computing power corresponding to each core in the CPU under the first application scenario at the first frequency, among the actual computing power corresponding to each core in the CPU under different application scenarios.

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

[0015] In conjunction with the first aspect, in another possible implementation, the control method may further include: the electronic device determining the first computing power corresponding to the existing task in the CPU under the first application scenario; the electronic device determining 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; and the electronic device determining the first core capable of executing 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 under the first application scenario based on the first computing power corresponding to the existing tasks in the CPU and the first actual computing power. Then, based on the first remaining computing power corresponding to each core in the CPU under the first application scenario, it determines the first core capable of executing the tasks corresponding to the first application scenario. This allows for the accurate identification of the cores capable of executing the tasks corresponding to the first application scenario.

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

[0018] Based on this possible implementation, the electronic device selects the most energy-efficient core from the first cores capable of executing the task corresponding to the first application scenario as the target core. Therefore, when the electronic device executes the task corresponding to the first application scenario using this target core, it can ensure the performance of the electronic device while avoiding high power consumption.

[0019] In conjunction with the first aspect, in another possible implementation, the control method may further include: the electronic device receiving a user's switching operation; in response to the switching operation, the electronic device running a second application; the second application being different from the first application; the electronic device determining a second application scenario based on the second application; the electronic device determining a second actual computing power corresponding to each core in the CPU under the second application scenario based on the second application scenario; and the electronic device updating the first actual computing power corresponding to each core in the CPU based on the second actual computing power, so that the electronic device can determine the core capable of executing the task corresponding to the second application scenario based on the second actual computing power.

[0020] Based on this possible implementation, when an electronic device switches between its current application scenario (i.e., switches to a second application scenario), the device can determine the kernel capable of executing the task corresponding to the current application scenario (i.e., the second application scenario) based on the actual computing power of each CPU core in the second application scenario, rather than relying on the default computing power of different CPU cores. Since the actual computing power of each CPU core differs from its default computing power in different application scenarios, accurately determining the kernel for the task in the switched application scenario based on the actual computing power of each CPU core in the switched application scenario improves the user experience.

[0021] In conjunction with the first aspect, in another possible implementation, 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. This may include: the electronic device determining the second frequency corresponding to the CPU under the second application scenario based on the second application scenario; the electronic device determining the second actual computing power corresponding to each core in the CPU under the second application scenario at the second frequency, among the actual computing power corresponding to each core in the CPU under different application scenarios.

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

[0023] In conjunction with the first aspect, in another possible implementation, the control method may further include: the electronic device determining the second computing power corresponding to the existing task in the CPU under the second application scenario; the electronic device determining 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; and the electronic device determining the second core capable of executing 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 an application scenario switch, 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 tasks in the CPU after the application scenario switch, as well as the second actual computing power. Then, based on the second remaining computing power corresponding to each core in the CPU under the second application scenario, it determines the second core capable of executing the tasks corresponding to the second application scenario. This allows for accurate identification of the cores capable of executing the tasks corresponding to the second application scenario.

[0025] In conjunction with the first aspect, in another possible implementation, where the second kernel capable of executing the task corresponding to the second application scenario includes multiple kernels, the above control method may further include: the electronic device determining the kernel with the lowest energy efficiency ratio among the second kernels as the second target kernel; the electronic device executing the task corresponding to the second application scenario through the second target kernel.

[0026] Based on this possible implementation, after the application scenario switches, the electronic device determines the core with the lowest energy efficiency among the second cores capable of executing the task corresponding to the second application scenario as the target core. Therefore, when the electronic device executes the task corresponding to the second application scenario based on this target core, it can ensure the performance of the electronic device and avoid high power consumption.

[0027] Secondly, embodiments of this application provide a control device that can be applied to an electronic device to implement the method described in the first aspect. The functions of this control device can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned functions, such as a running module, a determining module, and an updating module.

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

[0029] The determination module can be used to determine the first application scenario based on the first application.

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

[0031] The update module can be used to update the default computing power corresponding to each core in the CPU based on 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] Thirdly, a control device is provided, which has the function of implementing the method described in the first aspect. This 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-described function.

[0033] Fourthly, 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 to cause the control device to perform the control method as described in any one of the first aspects above.

[0034] Fifthly, embodiments of this application provide 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 causes the electronic device to implement the control method as described in any one of the first aspects or possible implementations of the first aspect.

[0035] In a sixth aspect, embodiments of this application provide a computer program product including computer-readable code that, when executed in an electronic device, causes the electronic device to implement the control method as described in any one of the first aspects or possible implementations of the first aspect.

[0036] In a seventh aspect, an apparatus (e.g., a system-on-a-chip) is provided, comprising a processor for supporting an electronic device in performing the functions described in the first aspect above. In one possible design, the apparatus further comprises a memory for storing program instructions and data necessary for the electronic device. When the apparatus is a system-on-a-chip, it may be composed of chips or may include chips 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 descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0038] Figure 1 This is a schematic diagram showing the default energy efficiency ratio curves of different cores in the CPU of an electronic device.

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

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

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

[0042] Figure 5 A flowchart illustrating a control method provided in an embodiment of this application. Figure 1 ;

[0043] Figure 6 A schematic diagram showing the instruction distribution of the CPU in different application scenarios;

[0044] Figure 7 This is a schematic diagram showing the default energy efficiency ratio curves and actual energy efficiency ratio curves of different cores in the CPU of electronic devices.

[0045] Figure 8 A flowchart illustrating a control method provided in an embodiment of this application. Figure 2 . Detailed Implementation

[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort 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 construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0048] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, 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 relationship between related persons, indicating that three relationships can exist, for example, A and / or B can mean: A alone, A and B simultaneously, and B alone.

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

[0050] For example, the CPU of an electronic device can include large cores, medium cores, and small cores. The large cores, medium cores, and small cores of a CPU are different types of cores in processor design, with different clock speeds, architectures, and functional roles, which can optimize the CPU's performance and energy efficiency.

[0051] Large cores are typically high-performance cores with higher frequencies and greater computing power, making them suitable for handling tasks requiring high performance, such as running large applications and graphics-intensive games. Large cores usually operate at higher voltages and frequencies, thus consuming more energy, but providing faster response times and greater computing power.

[0052] Little cores are typically low-performance cores used to handle simpler tasks, such as lightweight applications like browsers, email, and music playback. Little cores have lower frequencies and weaker computing power (i.e., computational power), resulting in lower power consumption, which extends battery life and reduces power consumption. When handling these simple tasks, little cores can complete them with lower power consumption, thus better meeting energy efficiency requirements.

[0053] Medium cores typically fall between large and small cores, striking a balance between performance and power consumption. Medium cores can perform well in moderately demanding tasks, offering higher performance than small cores while consuming less power than large cores.

[0054] In other words, when an electronic device's CPU includes large, medium, and small cores, the device can utilize the large cores to perform high-performance tasks. In this case, the device has high computing power but also high power consumption. Alternatively, the device can use the small cores to perform simple tasks (or tasks with low performance requirements). In this case, the device has lower computing power and lower power consumption. Finally, the device can use the medium cores to perform tasks. In this case, the computing power is greater than that of the device with small cores but less than that of the device with large cores, and the power consumption is also greater than that of the device with small cores but less than that of the device with large cores.

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

[0056] When an electronic device's CPU includes large, medium, and small cores, the device can use an energy-aware scheduler (EAS) mechanism to select different CPU cores to execute the corresponding tasks. When an electronic device uses the EAS mechanism to select different CPU cores to execute a task, it determines the CPU core that can perform the task and has the lowest energy consumption based on the computing power of the different CPU cores and the computing power required for the task.

[0057] In other words, when an electronic device needs to perform a high-performance task, it can determine to use the CPU's large cores to execute that task, thus increasing the device's computing power and providing faster response times and higher computational capabilities. Alternatively, when an electronic device needs to perform a low-performance task, it can determine to use the CPU's small cores to execute that task, thus reducing the device's power consumption.

[0058] For any given CPU core, its corresponding computing power is a fundamental concept in kernel scheduling. It reflects the computing capability of a CPU and is used to distinguish CPUs with different architectures. The formula for calculating the maximum computing power of any given CPU core is as described in Formula 1 below.

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

[0060] Here, capacity_dmips_mhz can represent the number of Dhrystone Million Instructions Per Second (DMIPS) that any core of the CPU can execute at a frequency of megahertz (MHz), cpuinfo_max_freq can represent the maximum frequency supported by the CPU core, and capacity can represent the maximum computing power of the CPU core.

[0061] It's important to note that the computing power of different frequencies within the same CPU core is linearly related to the frequency. In other words, the computing power of a CPU core at a given frequency = (CPU frequency / CPU maximum frequency) * CPU maximum computing power. That is, the computing power of a CPU core at a given frequency equals the CPU core frequency divided by the CPU core's maximum frequency, then multiplied by the CPU core's maximum computing power.

[0062] When an electronic device selects different CPU cores to execute corresponding tasks via the EAS mechanism, it requires not only the computing power of each CPU core but also the power consumption of each core at each frequency. The electronic device can obtain the power of each CPU core at each frequency through its included energy management module (i.e., the Energy Model module). When the electronic device obtains the power of each CPU core at each frequency (i.e., frequency) through its included energy management module, it can be determined using the following formula (Formula 2).

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

[0064] Here, C can represent the CPU's capacitor, V can represent the CPU's voltage at a certain frequency, freq can represent the CPU's frequency, and Power can represent the power of any core of the CPU at a certain frequency.

[0065] For any given CPU core, its energy efficiency ratio (EER) is the ratio of its power consumption to its maximum computing power at a given frequency, expressed as power / capacity. Generally, for any CPU core at a given frequency, a lower EER indicates better energy efficiency. Therefore, when an electronic device uses the EAS (Energy Efficiency System) mechanism to select different CPU cores to execute a task, the device can choose the core with the lower EER frequency. Typically, the EER of a small CPU core is better than that of a medium CPU core, and the EER of a medium CPU core is better than that of a large CPU core. In other words, at the same frequency, the EER of a small CPU core is lower than that of a medium CPU core, and the EER of a medium CPU core is lower than that of a large CPU core.

[0066] For example, combining Figure 1 As shown, taking the CPU of an electronic device, which includes large cores, medium cores, and small cores, as an example, the energy efficiency ratio of different cores in an electronic device is illustrated.

[0067] like Figure 1 As shown, Figure 1 The horizontal axis in the graph represents frequency, and the vertical axis represents the power consumption of any CPU core at a given frequency. By calculating the ratio of the power consumption to the maximum computing power of any CPU core at each frequency, the energy efficiency ratio (EER) curve for that core can be obtained. The EER curves for large CPU cores are shown below. Figure 1 As shown in curve 01, the energy efficiency ratio curve of the CPU's mid-core 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 in curve 03. (Through...) Figure 1 As shown, it can be seen that, overall, the energy efficiency ratio (EER) of the small cores in the CPU (EER 03) is better than that of the medium cores (EER 02) (meaning that, overall, the EER of the small cores in the CPU is lower than that of the medium cores), and the EER of the medium cores (EER 02) is better than that of the large cores (EER 01) (meaning that, overall, the EER of the medium cores in the CPU is lower than that of the large cores). In other words, at the same frequency, the EER of the small cores in the CPU is lower than that of the medium cores, and the EER of the medium cores is lower than that of the large cores.

[0068] Therefore, when an electronic device uses the EAS mechanism to select different cores in the CPU to execute a task, if both the large and medium cores of the CPU can execute the task, the device can choose the medium core to perform the task, thus achieving lower power consumption without affecting performance. Similarly, if both the medium and small cores of the CPU can execute the task, the device can choose the small core to perform the task, again achieving lower power consumption without affecting performance.

[0069] For any given CPU core, its computing power is provided by the manufacturer. This power is derived from a comprehensive evaluation of any given core across various application scenarios, without considering the differences in those scenarios. Therefore, the computing power of any CPU core is a default value, and usually a fixed one. However, the computing power of a CPU core varies depending on the application scenario of the electronic device, and is not a default value provided by the manufacturer. In other words, the execution performed by the CPU core differs depending on the application scenario of the electronic device, hence the corresponding computing power of each CPU core varies and is not a default value provided by the manufacturer.

[0070] Therefore, when an electronic device determines which CPU core is capable of executing a task and has low power consumption, it cannot accurately identify the core that will perform the task based on the default computing power of different CPU cores. Inaccurate identification of the core can lead to higher power consumption or slower response times in the electronic device. For example, if the core assigned to the task is determined to be a large core, but a smaller core can also execute the task, the electronic device will consume more power. Conversely, if the core assigned to the task is determined to be a small core, but the task is a high-performance task, the electronic device will execute it using the smaller core, resulting in slower response times.

[0071] To address the aforementioned problems, this application provides a control method applied to an electronic device. The control method includes the electronic device first determining the current application scenario. Then, the electronic device can determine the actual computing power corresponding to each core in the CPU under the current application scenario. Next, the electronic device can determine the remaining computing power corresponding to each core in the CPU under the current application scenario based on the actual computing power corresponding to each core in the CPU under the current application scenario and the computing power corresponding to existing tasks under the current application scenario. Then, the electronic device can determine one or more cores capable of executing the tasks required in the current application scenario based on the remaining computing power corresponding to each core in the CPU under the current application scenario and the computing power of the tasks to be executed under the current application scenario. Thus, the electronic device can determine the core with the lowest power consumption among these one or more cores to execute the tasks required in the current application scenario, and then execute the tasks required in the current application scenario.

[0072] In this application, when an electronic device determines which CPU core can execute a corresponding task and has low power consumption, it does not determine the core based on the default computing power of different CPU cores. Instead, it determines the core based on the actual computing power of each CPU core in the current application scenario. Since the actual computing power of each CPU core differs from its default computing power in different application scenarios, accurately determining the core for the task based on the actual computing power of each CPU core in the current application scenario ensures accurate identification. This accurate identification of the core avoids excessive power consumption or slow response times in the electronic device, thereby improving the user experience.

[0073] The control method provided in the embodiments of this application is described below.

[0074] The following is combined Figure 2 The principle of the control method provided in the embodiments of this application is illustrated below. For example... Figure 2 As shown, the application scenarios of electronic devices can include video application scenarios, navigation application scenarios, shopping application scenarios, news application scenarios, music application scenarios, and e-book application scenarios, etc.

[0075] Electronic devices can first determine the actual computing power of each CPU core under different application scenarios. For example, when an electronic device is in different scenarios, it can use benchmark tests (such as benchmark tests) to obtain the actual computing power of different CPU cores under those application scenarios.

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

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

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

[0079] Once the electronic device identifies the current application scenario, it can obtain the actual computing power of each CPU core in that shopping application scenario from the configuration file corresponding to that scenario.

[0080] Subsequently, the computing power algorithm module within the electronic device's kernel can obtain a set of CPU cores with compatible computing power. That is, the computing power algorithm module within the electronic device's kernel can determine the remaining computing power of each CPU core in the current application scenario, based on the actual computing power of each CPU core and the computing power of existing tasks in the current application scenario. Then, based on the remaining computing power of each CPU core in the current application scenario and the computing power of the tasks to be executed in the current application scenario, the computing power algorithm module within the electronic device's kernel can determine one or more cores capable of executing the tasks required in the current application scenario—that is, the set of CPU cores with compatible computing power.

[0081] Subsequently, the energy efficiency ratio core selection module in the core of the electronic device can determine the core with the lowest power consumption (i.e., the core with the lowest energy efficiency, such as the large core, medium core or small core in the CPU) from one or more cores (i.e. the set of CPU cores with computing power adapted) to execute the task required in the current application scenario, so as to execute the task required in the current application scenario.

[0082] It should be noted that the kernel of an 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. This application embodiment does not limit the specific types of other core selection modules included in the kernel of the electronic device. In this application embodiment, after the computing power algorithm module in the kernel of the electronic device obtains the set of CPU cores with computing power adaptation, the energy efficiency ratio core selection module in the kernel of the electronic device selects a core with lower energy efficiency from the set of CPU cores with computing power adaptation to execute the task required in the current application scenario.

[0083] After the energy efficiency ratio core selection module in the kernel of the electronic device selects the core with lower energy efficiency, the energy efficiency ratio core selection module in the kernel of the electronic device can notify the CPU of the electronic device so that the core with lower energy efficiency in the CPU of the electronic device can execute the task required for the current application scenario.

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

[0085] For example, taking a mobile phone as an electronic device, Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this 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, a headphone jack 370D, a sensor module 380, buttons 390, a motor 391, an indicator 392, a camera 393, a display screen 394, and a subscriber identification module (SIM) card interface 395, etc. The sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, a barometric pressure sensor 380C, a magnetic sensor 380D, an accelerometer 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 understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0088] Processor 310 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. The different processing units may be independent devices or integrated into one or more processors.

[0089] A controller can be the nerve center and command center of an electronic device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.

[0090] The processor 310 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. This memory can store instructions or data that the processor 310 has just used or that are used repeatedly. If the processor 310 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, 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. Interfaces 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 electronic devices can be realized through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor and baseband processor, etc.

[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 one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0094] The mobile communication module 350 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G in electronic devices. The mobile communication module 350 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 350 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 350 may be housed in the processor 310. In some embodiments, at least some functional modules of the mobile communication module 350 and at least some modules of the processor 310 may be housed in the same device.

[0095] The wireless communication module 360 ​​can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. 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 antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 310. The wireless communication module 360 ​​can also receive signals to be transmitted from processor 310, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0096] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 350, and antenna 2 is coupled to wireless communication module 360, enabling the electronic device to communicate with networks and other devices via 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 technologies, etc.

[0097] Electronic devices implement display functions 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 performs mathematical and geometric calculations and is used for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or modify display information.

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

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

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

[0101] The 380E accelerometer can periodically collect acceleration data from electronic devices at a certain frequency. For example, it can collect the magnitude of acceleration of electronic devices in various directions (generally the XYZ axes).

[0102] Of course, it is understandable that the above... Figure 3 The illustration shown is merely an example when the electronic device is in the form of a mobile phone. If the electronic device is in the form of a tablet, handheld computer, PC, PDA, wearable device (such as a smartwatch, smart bracelet), or other similar device, the structure of the electronic device may include more advanced features. Figure 3 The fewer structures shown can also include more than Figure 2 The structures shown are not limited here.

[0103] Understandably, the implementation of electronic device functions generally requires not only hardware support but also software cooperation.

[0104] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application's embodiment uses a layered 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 in the embodiments of this application can be as follows: Figure 4 As shown.

[0106] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, [the following is omitted as the text is incomplete and likely refers to a specific implementation or feature]. The system is divided into four layers, from top to bottom: application layer, application framework layer (i.e., framework layer), kernel layer, and CPU (CPU can include large cores, medium cores, and small cores).

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

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

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

[0110] The scene recognition module helps users determine the current application scenario of an electronic device. For example, the scene recognition module can determine the current application scenario by recognizing user behavior or user behavior. After determining the current application scenario, the scene recognition module can send the current application scenario to the computing power switching module.

[0111] The computing power switching module can receive the current application scenario sent by the scenario recognition module. It can also switch computing power models based on the recognized scenario. In other words, the computing power switching module can determine the actual computing power of each CPU core corresponding to the current application scenario from the configuration file corresponding to that scenario.

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

[0113] like Figure 4As shown, the kernel layer includes a computing power interface (i.e., the capacity interface), a computing power algorithm module, and a core selection module. The computing power interface receives the actual computing power of each CPU core corresponding to the current application scenario from the computing power switching module in the application framework layer, and then sends the actual computing power of each CPU core corresponding to the current application scenario to the computing power algorithm module in the kernel layer. In other words, the computing power switching module in the application framework layer can send the actual computing power of each CPU core 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 receive the actual computing power of each CPU core corresponding to the current application scenario from the computing power switching module in the application framework layer. The computing power algorithm module can also determine the set of CPU cores for computing power adaptation based on the actual computing power of each CPU core corresponding to the current application scenario. That is, the computing power algorithm module in the kernel of the electronic device can determine the remaining computing power of each CPU core in the current application scenario based on the actual computing power of each CPU core and the computing power of existing tasks in the current application scenario. Then, the computing power algorithm module in the kernel of the electronic device can determine one or more cores that can execute the tasks required in the current application scenario, i.e., the set of CPU cores for computing power adaptation, based on the remaining computing power of each CPU core and the computing power of the tasks 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 compatible with the computing power based on the actual computing power of each CPU core corresponding to the current application scenario. This can be achieved by the computing power algorithm module receiving the actual computing power of each CPU core corresponding to the current application scenario, and then resetting the maximum computing power of each CPU core according to the actual computing power of each CPU core corresponding to the current application scenario. In other words, the computing power of each CPU core is reset from the default computing power to the actual computing power corresponding to the current application scenario.

[0116] Next, the computing power algorithm module in the kernel can determine the remaining computing power of each CPU core in the current application scenario based on the actual computing power of each CPU core and the computing power of existing tasks in the current application scenario. Then, based on the remaining computing power of each CPU core and the computing power of the tasks to be executed in the current application scenario, the kernel's computing power algorithm module can determine one or more cores capable of executing the tasks required in the current application scenario—that is, the set of CPU cores with matching computing power.

[0117] The energy efficiency ratio core selection module in the kernel can determine the core with the lowest power consumption (i.e., the core with the lowest energy efficiency, such as the large core, medium core or small core in the CPU) from one or more cores (i.e. the set of CPU cores with computing power adapted) to execute the tasks required 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. This application embodiment does not limit the specific types of other core selection modules included in the electronic device's kernel. In this application embodiment, after the computing power algorithm module in the electronic device's kernel obtains the set of CPU cores with matching computing power, the energy efficiency ratio core selection module in the electronic device's kernel selects a core with lower energy efficiency from this set of CPU cores to execute the tasks required in the current application scenario.

[0119] After the energy efficiency ratio core selection module in the kernel selects a kernel with lower energy efficiency, the kernel can notify the CPU of the electronic device so that the lower energy efficiency kernel in the CPU of the electronic device can execute the task required for the current application scenario.

[0120] The methods described in the following embodiments can all be implemented in electronic devices (such as mobile phones) that have the above-described hardware or software structures.

[0121] In some examples, combined with appendix Figure 5 This application provides a detailed description of the control method provided in its embodiments, which can be applied to electronic devices (such as mobile phones). Figure 5 As shown, the control method may include the following S501-S509.

[0122] S501, Electronic devices determine the actual computing power of each core in the CPU under different application scenarios.

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

[0124] In some examples, the application scenario can be the scenario corresponding to the application running in the foreground of the electronic device; that is, the application scenario of the electronic device is different when different applications are running in the foreground. It should be noted that the application running in the foreground of the electronic device can be an application that comes with the electronic device or a third-party application, and this application embodiment does not limit this.

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

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

[0127] It's important to note that the types of instructions executed by each core in the CPU of an electronic device can include integer instructions, floating-point instructions, load instructions, store instructions, immediate branch instructions, and data processing instructions. However, in different application scenarios (i.e., different applications running in the foreground of the electronic device), the types of instructions executed by each core in the CPU of the electronic device differ, and the number of instructions corresponding to each type also differs. Since the computing power corresponding to each core in the CPU is the number of instructions that each core can process when running at its highest frequency, the different types of instructions executed by each core in the CPU of the electronic device, and the different number of instructions corresponding to each type, result in different actual computing power corresponding to each core in the CPU of the electronic device.

[0128] For example, taking video and music application scenarios as examples, the types of instructions executed by each core in the CPU of an electronic device include load instructions, store instructions, data processing instructions, floating-point operation instructions, instructions for specified hardware accelerators, encryption-related instructions, immediate branch instructions, indirect branch instructions, and return instructions. Figure 6 The diagram illustrates the number of load instructions (raw-id-spec), storage instructions (raw-st-spec), data processing instructions (raw-dp-spec), floating-point operation instructions (raw-vfp-spec), instructions specifying hardware accelerators (raw-ase-spec), encryption-related instructions (raw-crypto-spec), immediate branch instructions (raw-br-immed-spec), indirect branch instructions (raw-br-indirect-spec), and return instructions (raw-br-return-spec) executed by each core in the CPU of an electronic device for video applications and music applications.

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

[0130] In some examples, electronic devices determine the actual computing power of each CPU core in different application scenarios. This can be achieved by using benchmark tests to obtain the actual computing power of each CPU core in different application scenarios (i.e., different applications running in the foreground of the electronic device).

[0131] Benchmark testing is a standardized performance testing method used to measure the performance of a device or system. For CPUs, benchmark testing measures the performance of different cores when performing various tasks, i.e., the actual computing power of different cores in the CPU. These tasks may include mathematical calculations, image processing, physics simulations, etc., representing common computational needs in real-world applications.

[0132] During benchmark testing, the testing software designs a series of tasks and assigns them to different CPU cores for execution. The software then records the execution time, speed, and other performance metrics for each core. 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 CPU core under different application scenarios is not limited in the embodiments of this application. That is, it can be obtained through benchmark testing, or through other methods, such as clock speed and core count calculation methods, architecture and instruction set analysis methods, or actual operation testing. The embodiments of this application illustrate the example of obtaining the actual computing power of each CPU core under different application scenarios through benchmark testing in an electronic device.

[0134] The calculation method for clock speed and core count is as follows: clock speed is the number of times the CPU oscillates per second, determining its operating speed. Core count is the number of independently operating processing units in the CPU, determining its parallel computing capability. By combining clock speed and core count, the theoretical peak computing power of a CPU can be roughly calculated. However, please note that this is only a theoretical value; actual computing power is affected by other factors.

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

[0136] In other words, in different application scenarios (i.e., different applications running in the foreground of electronic devices), electronic devices use benchmark tests to obtain the actual computing power of each core in the CPU at different frequencies.

[0137] In some examples, after an electronic device determines the actual computing power of each CPU core under different application scenarios, it can store the actual computing power of each CPU core under different application scenarios. Therefore, after determining the current application scenario, the electronic device can, based on the stored actual computing power of each CPU core under different application scenarios, determine the actual computing power of each CPU core under the current application scenario.

[0138] In some examples, storing the actual computing power of each CPU core in different application scenarios in an electronic device can be achieved by storing the actual computing power of each CPU core in a configuration file corresponding to the different application scenarios.

[0139] In some examples, when an electronic device stores the actual computing power corresponding to each core of the CPU under different application scenarios, it can also store the correspondence between the application scenarios and the actual computing power corresponding to each core of the CPU under those application scenarios. Therefore, after the electronic device determines the application scenario, it can determine the actual computing power corresponding to each core of the CPU for that application scenario based on the correspondence between the application scenario and the actual computing power corresponding to each core of the CPU under that application scenario.

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

[0141] In some examples, after the electronic device determines the actual computing power of 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 that application scenario based on the actual computing power of each core in the CPU under that application scenario and the power of each core in the CPU at each frequency point.

[0142] For example, combining Figure 7 As shown, taking the CPU of an electronic device, which includes medium cores and small cores, as an example, the energy efficiency ratio of different cores in an electronic device is illustrated.

[0143] like Figure 7 As shown, Figure 7The horizontal axis in the graph represents frequency, and the vertical axis represents the power consumption of any CPU core at a given frequency. By calculating the ratio of the power consumption to the maximum computing power at each frequency for any given CPU core, the default energy efficiency curve for that core can be obtained, such as... Figure 7 Curve 04 in the figure represents the default energy efficiency ratio curve for small cores. Figure 7 Curve 07 in the figure is the default energy efficiency ratio curve of the core.

[0144] After determining the actual computing power of each CPU core in different application scenarios (i.e., the actual computing power of each CPU core at different frequencies in different application scenarios), the electronic device can obtain the measured energy efficiency ratio curve for each CPU core in different application scenarios based on the actual computing power of each CPU core at different frequencies and the power of each CPU core at each frequency point. For example... 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 the core.

[0145] Combination Figure 7 As can be seen, the measured energy efficiency ratio curve of the small core differs significantly from the default energy efficiency ratio curve. This means that the actual computing power of the small core is significantly lower than the default value in different application scenarios. Furthermore, the energy efficiency ratio curve shows that the actual energy efficiency ratio of the small core at high frequencies is higher than that of the medium core at low frequencies, while the default energy efficiency ratio of the small core at high frequencies is roughly the same as that of the medium core at low frequencies. However, in reality, the computing power of the small core at high frequencies is roughly equal to that of the medium core at low frequencies. When electronic devices use the measured energy efficiency ratio curve (i.e., determining the cores for task execution based on the actual computing power of the CPU cores in different application scenarios), the computing power of the small core will be lower than the default. Therefore, when scheduling tasks, electronic devices can place more tasks on the medium cores, resulting in a more balanced task load on the CPU and greater power savings.

[0146] S502, The electronic device determines the current application scenario.

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

[0148] In some examples, the electronic device determines the current application scenario by identifying the application currently running in the foreground (also known as the first application). After identifying the application currently running in the foreground, the electronic device can determine the current application scenario (also known as the first application) based on the application currently running in the foreground. For example, if 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 currently running application in the foreground based on the user's action of opening an application on the device. For instance, when the electronic device receives a user's action to open a video application on the device, it can determine that the currently running application in the foreground is a video application, meaning the current application scenario is a video application scenario.

[0150] It should be noted that the specific method by which the electronic device determines the current application scenario is not limited in the embodiments of this application. The embodiments of this application illustrate the method by which the electronic device determines the current application scenario through the application currently running in the foreground.

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

[0152] After an electronic device identifies the current application scenario, it can determine the actual computing power of each core in the CPU corresponding to that scenario. Therefore, based on the actual computing power of each core in the CPU for that application scenario, the electronic device can determine which cores within the CPU are capable of executing the tasks required for that application scenario.

[0153] In other words, after an electronic device identifies the current application scenario as the first application scenario, it can determine the first actual computing power corresponding to each core in the CPU under the first application scenario. That is, the first actual computing power includes the actual computing power corresponding to each core in the CPU under the first application scenario.

[0154] In some examples, the electronic device determines the actual computing power of each core in the CPU corresponding to the current application scenario based on the current application scenario. This can be achieved by the electronic device determining the actual computing power of each core in the CPU corresponding to the current application scenario from the 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 of each core in the CPU under the application scenario.

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

[0156] Subsequently, the electronic device can determine the actual computing power of each core in the CPU at the current application scenario's frequency, based on the CPU frequency corresponding to the current application scenario, the current application scenario itself, and the correspondence between the application scenario and the actual computing power of each core in the CPU at different frequencies under different application scenarios stored in the electronic device's database. In other words, the electronic device can determine the first actual computing power of each core in the CPU corresponding to the first application scenario at the first frequency, from the actual computing power of each core in the CPU under different application scenarios.

[0157] It should be noted that the CPU frequency corresponding to the current application scenario is the frequency at which the CPU (i.e., the cores in the CPU) of the electronic device executes the task corresponding to the current application scenario.

[0158] In other words, an electronic device can determine the appropriate CPU frequency (i.e., the CPU cores) to execute the task corresponding to the current application scenario based on that task (the thread corresponding to the current application scenario). For example, after determining the current application scenario, the electronic device can first determine the type of task corresponding to that scenario. The type of task can include complex tasks and simple tasks. Complex tasks include running large games, video editing, and processing large amounts of data. Simple tasks refer to everyday tasks such as browsing the web and sending emails. Different task types have different CPU performance requirements.

[0159] Then, the electronic device can determine the appropriate CPU frequency based on the type of task corresponding to the current application scenario. For example, if the task type in the current application scenario includes complex tasks, the electronic device can determine that the CPU frequency should be higher. Conversely, if the task type in the current application scenario includes simple tasks, the electronic device can determine that the CPU frequency should be lower.

[0160] It should be noted that, in this embodiment, the specific method by which the electronic device determines the CPU frequency corresponding to the current application scenario is not limited. This example illustrates the CPU frequency determined based on the task (thread) corresponding to the current application scenario, showing how the CPU (i.e., the CPU core) executes the task corresponding to the current application scenario.

[0161] It should be noted that the tasks corresponding to the current application scenario can include the tasks corresponding to the current application (i.e., the application currently running in the foreground of the electronic device), as well as the tasks corresponding to the system of the electronic device in the current application scenario.

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

[0163] After an electronic device determines the actual computing power of each core in the CPU corresponding to the current application scenario, it can determine the computing power corresponding to existing tasks in the CPU. Therefore, based on the computing power corresponding to existing tasks in the CPU, the electronic device can determine the remaining computing power corresponding to each core in the CPU for the current application scenario.

[0164] In other words, after the electronic device determines the actual computing power of each core in the CPU corresponding 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 under the first application scenario.

[0165] In some examples, the computing power corresponding to the tasks already performed in the CPU of an electronic device can include the computing power corresponding to the tasks already performed by each core of the CPU. That is, the computing power corresponding to the tasks already performed in the CPU of an electronic device can include the sum of the computing power corresponding to the tasks already performed in the task queue corresponding to each core of 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 for each core of the CPU. Then, the electronic device can calculate the computing power corresponding to the existing tasks in the CPU by discounting the sum of the existing tasks for each core.

[0167] It should be noted that the specific method by which the electronic device determines the computing power corresponding to the existing tasks in the CPU is not limited in the embodiments of this application. The embodiments of this application illustrate this by first determining the sum of the existing tasks of each core in the CPU. Then, the electronic device can calculate 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.

[0168] In some examples, the electronic device calculates the computing power corresponding to the existing tasks on each core of the CPU by summing the existing tasks. Specifically, the electronic device can determine the number, type, and resource requirements of tasks currently running on each core of the CPU. Then, by analyzing the number, type, and resource requirements of tasks currently running on each core of the CPU, the electronic device can obtain the computing power corresponding to each core, thus obtaining the computing power corresponding to the existing tasks on the CPU (i.e., the sum of the computing power corresponding to each core of the CPU).

[0169] S505: The electronic device determines the remaining computing power of each core of the CPU in the current application scenario based on the computing power of the existing tasks in the CPU and the actual computing power of each core in the CPU in the current application scenario.

[0170] Once an electronic device determines the computing power corresponding to existing tasks in its CPU, it can determine the remaining computing power for each core in the CPU within the current application scenario, based on the computing power of those existing tasks and the actual computing power of each core in the CPU. Therefore, the electronic device can determine which CPU cores are capable of executing the tasks corresponding to the current application scenario, based on the remaining computing power of each core in the CPU within the current application scenario.

[0171] In other words, after the electronic device determines the first computing power corresponding to the existing tasks in the CPU under the first application scenario, it can determine 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 tasks in the CPU and the first actual computing power. That is, the first remaining computing power can include the remaining computing power corresponding to each core in the CPU under the first application scenario. Therefore, the electronic device can determine the first core capable of executing the tasks corresponding to the first application scenario based on the first remaining computing power and the computing power of the tasks corresponding to the first application scenario.

[0172] In some examples, the electronic device determines the remaining computing power of each CPU core in the current application scenario based on the computing power of existing tasks in the CPU and the actual computing power of each CPU core in the current application scenario. This can be achieved by first updating the default computing power of each CPU core to the actual computing power of each CPU core in the current application scenario. Then, the electronic device subtracts the actual computing power of each CPU core in the current application scenario from the computing power of existing tasks in the CPU to obtain the remaining computing power of each CPU core in the current application scenario.

[0173] S506. The electronic device determines the computing power corresponding to the task in the current application scenario based on the current application scenario.

[0174] After determining the remaining computing power of each CPU core in the current application scenario, the electronic device can determine the computing power corresponding to the task in the current application scenario. Therefore, based on the remaining computing power of each CPU core in the current application scenario and the computing power corresponding to the task in the current application scenario, the electronic device can determine at least one CPU core capable of executing the task in the current application scenario.

[0175] The task of the current application scenario refers to the task (also known as a thread) that the electronic device needs to execute in the current application scenario. It should be noted that the task of the current application scenario can include the task corresponding to the current application (i.e., the application currently running in the foreground of the electronic device), or it can include the task corresponding to the system of the electronic device in the current application scenario. This application embodiment does not limit this.

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

[0177] It should be noted that the embodiments of this application do not limit the specific implementation method of the electronic device determining the task corresponding to the current application scenario based on the current application scenario. Similarly, the embodiments of this application do not limit the specific implementation method of the electronic device determining the computing power corresponding to the task of the current application scenario based on the task corresponding to the current application scenario.

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

[0179] That is, after S502, the electronic device can first execute S503-S505, and then execute S506; the electronic device can also first execute S506, and then execute S503-S505; or the electronic device can execute S503-S505 and S506 simultaneously. In this embodiment, the example given is that after S502, the electronic device can first execute S503-S505, and then execute S506.

[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 can also determine the CPU frequency of the electronic device based on the task of the current application scenario.

[0181] In other words, an electronic device can determine the appropriate CPU frequency (i.e., the CPU cores) to execute the task corresponding to the current application scenario. For example, after determining the current application scenario, the electronic device can first determine the type of task within that scenario. The task type can include complex tasks and simple tasks. Complex tasks are those that run large games, perform video editing, or process large amounts of data. Simple tasks are everyday tasks such as browsing the web or sending emails. Different task types have different CPU performance requirements.

[0182] Then, the electronic device can determine the appropriate CPU frequency based on the type of task in the current application scenario. For example, if the task type includes complex tasks, the electronic device can determine a higher CPU frequency. Conversely, if the task type includes simple tasks, the electronic device can determine a lower CPU frequency.

[0183] It should be noted that, in this embodiment, the specific method by which the electronic device determines the CPU frequency corresponding to the task of the current application scenario is not limited. This example illustrates the CPU frequency when the electronic device's CPU (i.e., the CPU core) executes the task of the current application scenario based on the task of the current application scenario (the thread corresponding to the current application scenario).

[0184] S507. 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 under the current application scenario.

[0185] After an electronic device determines the computing power corresponding to the task in the current application scenario, it can then determine at least one core (also called the first core) in the CPU capable of executing the task, based on the computing power corresponding to the task and the remaining computing power of 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 the at least one core in the CPU capable of executing the task in the current application scenario and execute the task through that 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. For example, the electronic device determines that among the multiple cores of the CPU in the current application scenario, the core with the remaining computing power 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 the first target kernel based on at least one kernel in the CPU that is capable of executing the task of the current application scenario.

[0188] After an electronic device identifies at least one CPU core capable of executing the task for the current application scenario, it can determine a first target core based on that core. The electronic device then executes the required task (i.e., the task corresponding to the current application scenario) through the target CPU core.

[0189] In some examples, the electronic device determines the first target kernel based on at least one core in the CPU capable of executing the task of the current application scenario (i.e., the first core). Specifically, the electronic device identifies the core with the lowest energy consumption among the at least one core capable of executing the task of the current application scenario as the first target kernel. That is, if there are multiple first cores capable of executing the task corresponding to the first application scenario, the electronic device can identify the core with the lowest energy efficiency among the first cores 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 CPU core capable of executing the task of the current application scenario. This can be achieved by the electronic device identifying the core with the lowest energy efficiency among the at least one core capable of executing the task of the current application scenario, based on the CPU's corresponding frequency. In other words, after identifying at least one CPU core capable of executing the task of the current application scenario, the electronic device can then determine the energy efficiency ratio of the at least one core capable of executing the task of the current application scenario at the corresponding CPU frequency, based on the energy efficiency ratio curves corresponding to the at least one core capable of executing the task of the current application scenario at that CPU frequency. Finally, the electronic device can identify the core with the lowest energy efficiency among the at least one core capable of executing the task of the current application scenario at the corresponding CPU frequency as the target core.

[0191] For example, continue to combine Figure 7 As shown, when the CPU of an electronic device includes medium cores and small cores, the energy efficiency of different cores in the electronic device is as follows: Figure 7 As shown, Figure 7 Curve 04 in the figure represents the default energy efficiency ratio curve for small cores. Figure 7 Curve 07 in the figure represents the default energy efficiency ratio curve for 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 the core.

[0192] When an electronic device identifies at least one CPU core capable of executing the task of the current application scenario, including both the medium and small cores, it can determine the energy efficiency ratio (EER) of that core at the current application scenario's CPU frequency, based on the CPU's frequency and the energy efficiency ratio curves of each core (the medium and small cores). Then, the electronic device can identify the core with the lowest EER among the CPU cores capable of executing the task at the current application scenario's frequency as the target core.

[0193] Combination Figure 7As shown, in the current application scenario, when the CPU frequency corresponds to the high-frequency point of the small core, the actual energy efficiency ratio of the high-frequency point of the small core is higher than that of the low-frequency point of the medium core. However, the default energy efficiency ratio of the high-frequency point of the small core is roughly the same as that of the low-frequency point of the medium core. Therefore, the actual computing power of the small core is significantly lower than the default value. Thus, when an electronic device determines that at least one core in the CPU, including both the medium and small cores, is capable of executing the task in the current application scenario, the electronic device can designate the medium core as the target core, resulting in a more balanced task load on the CPU and greater power savings.

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

[0195] Once an electronic device determines the target core of a CPU based on at least one CPU core capable of executing the task of the current application scenario, the electronic device can execute the required task (i.e., the task corresponding to the current application scenario) through the target core of the CPU.

[0196] The solution in this application addresses this issue by determining which CPU core, with low power consumption, can execute a task. Instead of relying on the default computing power of different CPU cores, the electronic device identifies the appropriate core based on the actual computing power of each CPU core within the current application scenario. Since the actual computing power of each CPU core differs from its default computing power across different application scenarios, accurately determining the core for the task based on the actual computing power of each CPU core within the current application scenario ensures accurate task selection. This precise identification of the appropriate core avoids excessive power consumption or slow response times in the electronic device, thereby improving the user experience.

[0197] In some examples, combined with appendix Figure 8 This application provides a detailed description of the control method provided in its embodiments, which can be applied to electronic devices (such as mobile phones). Figure 8 As shown, the control method may include the following S801-S812.

[0198] S801, electronic devices determine the actual computing power of each core in the CPU under different application scenarios.

[0199] In order to implement the control method provided in this application embodiment, that is, in order to enable the electronic device to determine the core corresponding to execute the task when the electronic device determines one or more cores that can execute the task in the current application scenario, the electronic device can first determine the actual computing power of each core in the CPU in different application scenarios.

[0200] In some examples, the application scenario can be the scenario corresponding to the application running in the foreground of the electronic device; that is, the application scenario of the electronic device is different when different applications are running in the foreground. It should be noted that the application running in the foreground of the electronic device can be an application that comes with the electronic device or a third-party application, and this application embodiment does not limit this.

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

[0202] The specific implementation method for determining the actual computing power of each core in the CPU under different application scenarios in the embodiments of this application can be referred to the above S501, and will not be repeated here.

[0203] S802, The electronic device runs the first application.

[0204] Once the electronic device determines the actual computing power of each core in the CPU for 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 can be a third-party application in the electronic device or an application that comes with the electronic device itself; this application embodiment does not limit this.

[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 this application.

[0207] S803, the electronic device determines the current application scenario as the first application scenario based on the first application application.

[0208] After the electronic device runs the first application, it can determine the current application scenario as the application scenario corresponding to the first application. That is, the current application scenario is the first application scenario.

[0209] The specific implementation method of the electronic device determining the current application scenario as the first application scenario according to the first application in this embodiment can be referred to in S502 above, and will not be repeated here.

[0210] S804. The electronic device determines the actual computing power of each core in the CPU corresponding to the first application scenario based on the first application scenario.

[0211] After an electronic device identifies the current application scenario as the first application scenario, it can determine the actual computing power (also known as the first actual computing power) of each core in the CPU corresponding to the first application scenario. In other words, the first actual computing power can include the actual computing power of each core in the CPU under the first application scenario.

[0212] In some examples, the electronic device determines the first actual computing power corresponding to each core in the CPU under the first application scenario, based on the first application scenario. This may include: the electronic device determining the first frequency of the CPU under the first application scenario. Then, the electronic device can determine, among the actual computing power corresponding to each core in the CPU under different application scenarios, the first actual computing power corresponding to each core in the CPU under the first application scenario at the first frequency.

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

[0214] In this embodiment of the application, the specific implementation method for determining the actual computing power of each core in the CPU corresponding to the first application scenario based on the first application scenario can be referred to in the above S503, and will not be repeated here.

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

[0216] After the electronic device determines the actual computing power of each core in the CPU corresponding to the first application scenario, the electronic device can determine the first target core in the CPU based on the actual computing power of 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 of each core in the CPU corresponding to the first application scenario. This can be achieved by first determining the computing power corresponding to existing tasks in the CPU (i.e., the first computing power). Then, the electronic device can 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 existing tasks in the CPU and the actual computing power corresponding to each core in the CPU under the first application scenario. In other words, the first remaining computing power can include the remaining computing power corresponding to each core in the CPU under the first application scenario.

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

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

[0220] S806: Electronic devices execute tasks corresponding to the first application scenario through the first target kernel in the CPU.

[0221] After the electronic device determines that the target kernel is the first kernel in the CPU, the electronic device can execute the task corresponding to the first application scenario (i.e. the task corresponding to the current application scenario) through the first target kernel in the CPU.

[0222] S807: Electronic devices receive user handover operations.

[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 user's switching operation. The user's switching operation can be used to trigger the electronic device to switch to running a 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 receiving a user's switching operation, the electronic device can run a second application in response, that is, the electronic device runs a second application in the foreground.

[0226] The second application differs from the first application. For example, if the first application is a video application, the second application could be a music application.

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

[0228] S809. The electronic device determines the current application scenario as the second application scenario based on the second application.

[0229] After the electronic device runs the second application, it can determine the current application scenario as the second application scenario based on the second application. That is, the current application scenario switches from the first application scenario to the second application scenario.

[0230] The specific implementation method of the electronic device determining the current application scenario as the second application scenario according to the second application in this embodiment can be referred to in S502 above, and will not be repeated here.

[0231] S810, electronic device, determines the actual computing power of each core in the CPU corresponding to the second application scenario based on the second application scenario.

[0232] After an electronic device identifies the current application scenario as the second application scenario, it can determine the actual computing power (also known as the second actual computing power) of each core in the CPU corresponding to the second application scenario. In other words, the second actual computing power can include the actual computing power of each core in the CPU under the second application scenario.

[0233] In some examples, 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. This may include: the electronic device determining the second frequency of the CPU under the second application scenario. Then, the electronic device can determine the second actual computing power corresponding to each core in the CPU under the second application scenario, at the second frequency, within the actual computing power corresponding to each core in the CPU under different application scenarios.

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

[0235] In this embodiment of the application, the specific implementation method for determining the actual computing power of each core in the CPU corresponding to the second application scenario based on the second application scenario can be referred to the above S503, and will not be repeated here.

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

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

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

[0239] In some examples, the electronic device determines the second target core in the CPU based on the actual computing power of each core in the CPU corresponding to the second application scenario. This can be achieved by the electronic device first determining the computing power (i.e., the second computing power) corresponding to the existing tasks in the CPU. The second computing power refers to the computing power corresponding to the existing tasks in the CPU under the second application scenario.

[0240] Then, the electronic device can determine the remaining computing power (i.e., the second remaining computing power) of 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 under the current application scenario. That is, the second remaining computing power can include the remaining computing power corresponding to each core in the CPU under the second application scenario.

[0241] Then, the electronic device can determine the computing power corresponding to the task in the current application scenario (i.e., the task the electronic device needs to execute in the second application scenario) based on the second application scenario. Next, the electronic device can determine at least one core in the CPU capable of executing the task in the current application scenario (i.e., the second core) based on the computing power corresponding to the task in the current application scenario and the remaining computing power of each core in the CPU in the second application scenario. Finally, the electronic device can determine the second target core based on the at least one core in the CPU capable of executing the task in the current application scenario at the corresponding CPU frequency in the second application scenario. In other words, the electronic device can determine the core with the lowest energy efficiency among the at least one core in the CPU capable of executing the task in the current application scenario at the corresponding CPU frequency in the second application scenario as the second target core.

[0242] In this embodiment of the application, the electronic device determines the specific implementation of the second target core in the CPU based on the actual computing power of each core in the CPU corresponding to the second application scenario. For reference, see S504-S509 above. This embodiment of the application will not be repeated here.

[0243] S812: Electronic devices execute tasks corresponding to the second application scenario through the second target kernel in the CPU.

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

[0245] In this application, when an electronic device determines which CPU core can execute a corresponding task and has low power consumption, it does not determine the core based on the default computing power of different CPU cores. Instead, it determines the core based on the actual computing power of each CPU core in the current application scenario. Since the actual computing power of each CPU core differs from its default computing power in different application scenarios, accurately determining the core for the task based on the actual computing power of each CPU core in the current application scenario ensures accurate identification. This accurate identification of the core avoids excessive power consumption or slow response times in 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 logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, all units in the device can be implemented in software through processing element calls; all units can be implemented in hardware; or some units can be implemented in software through processing element calls, and some units can be implemented in hardware.

[0247] For example, each unit can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as a program in memory, invoked and executed by a processing element within the device. Furthermore, these units can be integrated in whole or in part, or implemented independently. The processing element described here can also be called a processor, which can be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each of the above units can be implemented through integrated logic circuits in the processor element or through software invoked by the processing element.

[0248] In one example, the unit in the above device may be one or more integrated circuits configured to implement the above methods, 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 example, when the units in the device can be implemented through a processing element scheduler, the processing element can be a general-purpose processor, such as a CPU or other processor capable of calling programs. Alternatively, these units can be integrated together to form a system-on-a-chip (SoC).

[0250] In one implementation, the units that implement the corresponding steps in the above methods can be implemented in the form of a processing element scheduler. For example, the device may include a processing element and a storage element, wherein the processing element calls a program stored in the storage element to execute the methods described in the above embodiments. The storage element may be a storage element located on the same chip as the processing element, i.e., an on-chip storage element.

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

[0252] For example, embodiments of this application may also provide an apparatus, such as an electronic device, which may include a processor and a memory for storing processor-executable instructions. When the processor is configured to execute the aforementioned instructions, it causes the electronic device to implement the control method described in the foregoing embodiments. The memory may be located within or outside the electronic device. Furthermore, the processor may include one or more processors.

[0253] In another implementation, the unit implementing each step of the above method can be configured as one or more processing elements, which can be disposed on the corresponding electronic device described above. These processing elements can be integrated circuits, such as one or more ASICs, one or more DSPs, one or more FPGAs, or combinations of these types of integrated circuits. These integrated circuits can be integrated together to form a chip.

[0254] For example, this application also provides a chip that can be applied to the aforementioned electronic device. The chip includes one or more interface circuits and one or more processors; the interface circuits and processors are interconnected via lines; the processor receives and executes computer instructions from the electronic device's memory through the interface circuits to implement the methods described in the above method embodiments.

[0255] This application also provides a computer program product, including computer instructions for operation of the electronic device described above.

[0256] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above 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 this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0258] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0259] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0260] If the integrated unit is implemented as 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 solutions of the embodiments of this application, in essence, or the parts that contribute to related technologies, or all or part of the technical solutions, can be embodied in the form of a software product, such as a program. This software product is stored in a program product, such as a computer-readable storage medium, and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0261] For example, embodiments of this application may also provide a computer-readable storage medium storing computer program instructions thereon. When the computer program instructions are executed by an electronic device, the electronic device causes the electronic device to implement the control method as described in the foregoing method embodiments.

[0262] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A control method characterized by, The method is applied to an electronic device, a central processing unit (CPU) of the electronic device includes a plurality of cores, the cores include small cores, and the method includes: The electronic device runs a first application program; The electronic device determines a first application scenario according to the first application program; The electronic device determines first actual computing power of each core of the CPU corresponding to the first application scenario from actual computing power of each core of the CPU corresponding to different application scenarios according to the first application scenario; wherein the first actual computing power corresponds to the first application scenario; wherein the first actual computing power of the small core is less than the default computing power of the small core in the first application scenario; The electronic device updates the default computing power of each core of the CPU according to the first actual computing power, so that the electronic device determines the core capable of executing the task corresponding to the first application scenario based on the first actual computing power; The electronic device determines first computing power of existing tasks in the CPU in the first application scenario; The electronic device determines first remaining computing power of each core of the CPU in the first application scenario according to the first computing power of the existing tasks in the CPU and the first actual computing power; wherein the first remaining computing power is the remaining computing power of each core of the CPU in the first application scenario; The electronic device determines the first core 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; Before the electronic device determines the first actual computing power of each core of the CPU in the first application scenario according to the first application scenario, the method further includes: The electronic device determines actual computing power of each core of the CPU in 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 of each core of the CPU in the different application scenarios.

2. The method of claim 1, wherein, The actual computing power of each core of the CPU in the different application scenarios includes actual computing power of each core of the CPU corresponding to the different application scenarios at different frequencies.

3. The method of claim 2, wherein, The electronic device determines the first actual computing power of each core of the CPU in the first application scenario according to the first application scenario, including: The electronic device determines a first frequency corresponding to the CPU in the first application scenario according to the first application scenario; The electronic device determines the first actual computing power of each core of the CPU corresponding to the first application scenario at the first frequency from the actual computing power of each core of the CPU in the different application scenarios.

4. The method of claim 1, wherein, In the case that the first core capable of executing the task corresponding to the first application scenario includes a plurality of cores, the method further includes: The electronic device determines the first target core as the core with the lowest energy efficiency ratio in the first core; The electronic device executes a task corresponding to the first application scenario through the first target core.

5. The method of claim 1, wherein, The method further includes: The electronic device receives a switching operation of a user; In response to the switching operation, the electronic device runs a second application program; the second application program is different from the first application program; The electronic device determines a second application scenario according to the second application program; The electronic device determines a second actual computing power corresponding to each core in the CPU in the second application scenario according to 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 a core capable of executing a task corresponding to the second application scenario based on the second actual computing power.

6. The method of claim 5, wherein, The electronic device determines a second actual computing power corresponding to each core in the CPU in the second application scenario according to the second application scenario, including: The electronic device determines a second frequency corresponding to the CPU in the second application scenario according to the second application scenario; The electronic device determines the second actual computing power corresponding to each core in the CPU in the second application scenario at the second frequency among the actual computing powers corresponding to each core in the CPU in the different application scenarios.

7. The method according to claim 5 or 6, characterized in that, The method further includes: The electronic device determines a second computing power corresponding to an existing task in the CPU in the second application scenario; The electronic device determines a second remaining computing power corresponding to each core in the CPU in the second application scenario according to the second computing power corresponding to the existing task in the CPU and the second actual computing power; The electronic device determines a second core capable of executing a 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.

8. The method of claim 7, wherein, In the case where the second core capable of executing a task corresponding to the second application scenario includes a plurality of cores, the method further includes: The electronic device determines a second target core with the lowest energy efficiency ratio in the second core; The electronic device executes a task corresponding to the second application scenario through the second target core.

9. An electronic device, comprising: The electronic device includes a processor and a memory for storing executable instructions of the processor; the processor is configured to execute the instructions, so that the electronic device implements the method of any one of claims 1 to 8.

10. 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 of any one of claims 1 to 8.

Citation Information

Patent Citations

  • 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 and computer readable storage medium

    CN117632400A