Task processing method, device, electronic device, computer readable medium and product
By obtaining the target task load in a multi-core processor system and using the Lagrange multiplier method to calculate the optimal task allocation scheme, the problem of low task allocation efficiency in the existing technology is solved and the core processor power consumption is maximized. optimization.
Patent Information
- Application Number
- CN202111321605.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-09
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-11-09
AI Technical Summary
When the existing technology handles task allocation of multi-core processors, the power consumption efficiency is low, and the task load allocation between different core architectures cannot be effectively optimized, resulting in high power consumption of the core processor.
A task processing method is proposed. By obtaining the target task load, determining the target combination, and rationally allocating tasks to the first core processor and the second core processor to optimize power consumption, the Lagrange multiplier method and other methods are used to calculate the optimal Optimal task allocation scheme ensures that the power consumption of the core processor is minimized when executing tasks.
It achieves efficient distribution of multi-core processor task loads, reduces the power consumption of core processors, and improves the overall power efficiency of the system.
Smart Images

Figure CN114064272B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of processor technology, and more specifically, to a task processing method, device, electronic device, computer-readable medium and product. Background Art
[0002] At present, the performance of electronic devices is getting higher and higher, and the number of core processors they are equipped with is also increasing. Some electronic devices can also be equipped with core processors with more than one architecture. However, for a large number of core processors and core processors with different architectures, the existing task allocation capabilities are insufficient, resulting in low core power efficiency. Summary of the invention
[0003] The present application proposes a task processing method, device, electronic device, computer-readable medium and product to improve the above-mentioned defects.
[0004] In a first aspect, an embodiment of the present application provides a task processing method, which is applied to an electronic device, wherein the electronic device includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor, wherein the first core processor and the second core processor have different power consumptions when executing the same task load, and the method includes: obtaining a target task load, wherein the target task load includes multiple subtasks; determining a target combination based on the target task load, wherein the target combination is used to characterize a target number of the first core processor and a target number of the second core processor, and the power consumption of the processor corresponding to the target combination when executing the target task load is the target power consumption; based on the target combination, determining the subtasks to be processed for each core processor in the target combination.
[0005] In a second aspect, an embodiment of the present application further provides a task processing device, which is applied to an electronic device, wherein the electronic device includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor, and the device includes: an acquisition unit, a first processing unit, and a second processing unit. The acquisition unit is used to acquire a target task load, wherein the target task load includes a plurality of subtasks; the first processing unit is used to determine a target combination based on the target task load, wherein the target combination is used to characterize a target number of the first core processor and a target number of the second core processor, and the power consumption of the processor corresponding to the target combination when executing the target task load is the target power consumption, and the target power consumption satisfies a preset condition; the second processing unit is used to determine the subtasks to be processed of each core processor in the target combination based on the target combination.
[0006] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the above method.
[0007] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
[0008] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program / instructions, which implement the above method when executed by a processor.
[0009] The task processing method, device, electronic device, computer-readable medium and product provided by the present application, when the electronic device includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor, first obtains the target task load, then determines the target combination based on the target task load, and finally determines the subtasks to be processed of each core processor in the target combination based on the target combination. For an electronic device having a first core processor and a second core processor, different task loads can be reasonably allocated to the first core processor and the second core processor, so as to obtain the power consumption of the core processor with the lowest task load.
[0010] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0012] Figure 1 A diagram showing an electronic device to which a task processing method provided by an embodiment of the present application is applied;
[0013] Figure 2 A method flow chart of a task processing method provided by an embodiment of the present application is shown;
[0014] Figure 3 A schematic diagram of a derivation of a task processing method provided in an embodiment of the present application is shown;
[0015] Figure 4 A schematic diagram of a derivation of a task processing method provided in an embodiment of the present application is shown;
[0016] Figure 5 A method flow chart of a task processing method provided by an embodiment of the present application is shown;
[0017] Figure 6 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0018] Figure 7 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0019] Figure 8 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0020] Fig. 9 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0021] Fig.10 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0022] Fig.11 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0023] Fig.12 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0024] Fig.13 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0025] Fig.14 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0026] Fig.15 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0027] Fig.16 A schematic diagram of a derivation of a task processing method provided by an embodiment of the present application is shown;
[0028] Fig.17 A method flow chart of a task processing method provided by an embodiment of the present application is shown;
[0029] Fig.18A method flow chart of a task processing method provided by another embodiment of the present application is shown;
[0030] Fig.19 A method flow chart of a task processing method provided by another embodiment of the present application is shown;
[0031] Fig. 20 A schematic diagram showing a derivation of a task processing method provided by another embodiment of the present application is shown;
[0032] Fig.21 A schematic diagram showing a derivation of a task processing method provided by another embodiment of the present application is shown;
[0033] Fig. 22 A method flow chart of a task processing method provided by another embodiment of the present application is shown;
[0034] Fig.23 A unit block diagram of a task processing device provided by an embodiment of the present application is shown;
[0035] Fig.24 A schematic diagram of an electronic device provided by an embodiment of the present application is shown;
[0036] Fig.25 A structural block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown;
[0037] Fig.26 A structural block diagram of a computer program product provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0038] For the letter symbols appearing in this application, the following Table 1 provides a comparison of the letter symbols and their Chinese explanations.
[0039] Table 1
[0040]
[0041]
[0042]
[0043] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0044] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0045] With the advancement of technology and the development of demand, the central processing unit of modern personal computers, mobile phones, etc. has gradually evolved from a single processing core in the past to multiple processing cores today. Among them, different cores in the processor may be of the same core architecture or different core architectures.
[0046] In order to adapt to different application scenarios, the processors of current mainstream mobile phones usually adopt a heterogeneous multi-core structure. For example, the Qualcomm Snapdragon 888 processor used by many mainstream mobile phones has 8 cores, including 1 ARM CortexX1 core, 3 ARM Cortex A78 architecture large cores and 4 ARM Cortex A55 architecture small cores. In addition, Apple's A14 processor has 6 cores, including 2 large cores and 4 small cores.
[0047] This heterogeneous multi-core processor architecture can flexibly support computing tasks in different scenarios. Generally, large cores are suitable for processing high-concurrency and high-complexity computing tasks, while small cores are suitable for processing occasional and low-complexity computing tasks.
[0048] However, the inventors found in their research that existing solutions are insufficient in their ability to reduce the power consumption of core processors by allocating tasks to large and small cores according to actual conditions, and there is no theoretical analysis or solution design for the optimal number of activated cores for each core architecture when power consumption is lowest.
[0049] Therefore, in order to overcome the above-mentioned defects, the present application provides a task processing method, device, electronic device, computer-readable medium and product. For an electronic device having a first core processor and a second core processor, different task loads can be reasonably allocated to the first core processor and the second core processor, so as to obtain the power consumption of the core processor with the lowest task load to complete the task.
[0050] See also Figure 1 , Figure 1 A task processing method provided by an embodiment of the present application is shown, and the method can be applied to an electronic device 100, and the electronic device 100 includes a core processor 110 and a system 120, wherein the system 120 and the core processor 110 are connected. The core processor 110 is used to process the task load assigned by the system 120, and the system 120 is used to process the task load to be assigned, and the optimal allocation method is comprehensively obtained according to the information of the processor, and then the task load allocation method is sent to the core processor 110. The electronic device 100 can be a computer, a laptop, a mobile phone, a tablet computer, a vehicle-mounted mobile device, etc., and can also be any other system composed of distributed heterogeneous processing units, such as a large or supercomputer, a large server, etc. The core processor 110 includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor, wherein the first core processor and the second core processor have different power consumption when executing the same task load. Among them, a core processor can be a single processing core in a multi-core processor, such as a single processing core in a computer processor with a multi-core architecture, a single processing core in a mobile phone processor, or a single processing core in a graphics processor (Graphics Processing Unit, GPU) with a multi-core architecture, or a single processing core in a neural network processor (Neural-Network Processing Units, NPU) with a multi-core architecture, or a single or multiple core processor in a computer system, such as a single processor in a computer system with multiple processors, or a processing unit composed of a single or multiple processors, such as a single computing board in a large server or supercomputer, or a single personal computer, mobile phone, tablet computer, etc. that can be connected and combined through a network, or any device that can independently process a certain task and can be combined to complete a complex task. The core processor 110 can be a computer CPU core, a mobile phone CPU core, a field programmable gate array (Field Programmable Gate Array, FPGA) circuit, a graphics processor core, a neural network processor core, an optical processor, a quantum processor, etc. The system 120 can be an operating system, or an application with a task load distribution function running in the operating system.
[0051] Further, for an embodiment provided by the present application, the first core processing and the second core processing are two core processors with different architectures, and the core processors with different architectures have different power consumption when executing the same task load. For example, the first core processor can be a large core, and the second core processor can be a small core. Then when completing the same task load t, the power consumption of the large core is a, and the power consumption of the small core is b, where a is not equal to b. When the cores of different architectures execute the same task load, the required operating frequency, power consumption, etc. are different. For example, the ARM Cortex-A78 large core and the Cortex-A55 small core, the depth of the Cortex-A78 large core instruction pipeline is higher than the depth of the Cortex-A55 small core instruction pipeline. A longer instruction pipeline depth means a higher degree of parallelism when processing tasks. Accordingly, for tasks that can be processed in parallel through instruction pipelines, the processing speed of the large core is higher than that of the small core. For tasks of the same complexity and that can be processed in parallel, the minimum operating frequency required by the large core may be lower than that of the small core, and the corresponding power consumption of the large core may be less than that of the small core. On the other hand, for tasks with a low degree of parallelism, such as frequent program branch jumps, a longer instruction pipeline means a longer context switching time. To handle such tasks, the main frequency required by the large core may be higher than that of the small core, and the corresponding power consumption of the large core may be greater than that of the small core.
[0052] See also Figure 2 , Figure 2 A task processing method provided by an embodiment of the present application is shown, and the method can be applied to Figure 1 The electronic device shown includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor. Specifically, the method includes steps S210 to S230.
[0053] S210: Obtain target task load.
[0054] A target task load is obtained, where the target task load includes multiple subtasks.
[0055] The task load is the task undertaken by the core processor, and the task load may be of different types. For example, in some implementations, the task load may be a video codec processing task load, or an audio codec task load, etc.
[0056] Further, the target task load is the task load that needs to be completed this time. The target load can be a type of task load, for example, it can be a video codec processing task load, or an audio codec task load. The target load can also be a combination of multiple types of task loads, for example, it can be a combination of a video codec processing task load and an audio codec task load.
[0057] It should be noted that in the same environment, such as the same temperature, humidity, etc., when the same core processes different types of tasks, its power consumption may be different even if the operating frequency, operating voltage, etc. are the same. Therefore, in order to ensure that the task processing complexity remains constant during the entire event period of the overall task and the divided subtasks, when the target load is a combination of multiple types of task loads, the proportion of different types of tasks should remain unchanged during the task duration, and the processing complexity of each task during the task duration remains unchanged.
[0058] Furthermore, the target task load may be a single task, which may be divided into multiple parallel subtasks of equal or different complexity as required. Each subtask may be processed on a single core processor, which may be a core of any architecture, such as a large core or a small core.
[0059] It is easy to understand that the additional power consumption introduced by the process of subtask division and the collection and arrangement of subtask processing results is far less than the core processor completing the target task load, so the additional power consumption can be ignored. And under the same environment, for example, the same temperature, humidity, etc., the power consumed by the core of the same architecture when processing the same type of task is the same.
[0060] S220: Determine a target combination based on the target task load.
[0061] A target combination is determined based on the target task load, the target combination is used to characterize the target number of the first core processor and the target number of the second core processor, the power consumption of the processor corresponding to the target combination when executing the target task load is the target power consumption, and the target power consumption is less than a threshold. The threshold can be the minimum power consumed by the processor corresponding to the target combination when executing the target task plus a very small variable. For example, the variable can be a, and a can be an extremely small positive number.
[0062] In one embodiment provided by the present application, the first core processor may be a large core, and the second core processor may be a small core. There may be four large cores and four small cores. In another embodiment provided by the present application, the first core processor may also be a core of a central processing unit, and the second core processor may also be a core of a graphics processor. There may be four cores of the central processing unit and four cores of the graphics processor.
[0063] It should be noted that the first core processor and the second core processor do not constitute a limitation on the type of processor in the embodiments provided in the present application. The type of processor in the embodiments provided in the present application can also be multiple types, and the multiple types are greater than or equal to two.
[0064] See also Figure 3 For an implementation method provided by the present application, it can be assumed that the relationship between the power consumption P and the task load t of the same architecture core is similar to the relationship between the power consumption P and the operating frequency f, which is presented as follows: Figure 3 The slope shown is a non-negative convex function whose slope increases with the increase of task load t. The value of power function P(t) increases with the increase of task load t. And the slope of P(t) will continue to increase with the increase of t, that is, when t increases, the proportion of increase in core power consumption is greater than the proportion of increase in t. When the task load approaches 0, the core still has a certain power consumption, such as static power consumption, leakage power consumption, etc., that is, the intersection of P(t) and the vertical axis (power axis) is above the origin. Among them, the tangent point A of the tangent line passing through the origin and tangent to P(t) and P(t) is the optimal power efficiency point, where the horizontal axis of point A is t0 and the vertical axis is P(t0). When the core works at this position, it has the highest power efficiency, that is, the power consumption required for the unit task load corresponding to point A is the lowest, or the task load that can be processed under the condition of unit power consumption is the highest. It is easy to understand that as the task load t increases, the power P tends to rise in a straight line. When the task load t reaches the limit, it is equivalent to reaching the maximum task load that the core can handle. At this time, no matter how the power is increased, it cannot handle more task load t.
[0065] It is easy to understand that the power consumption of the core processor can obey the above characteristics, but the relationship curves between the power consumption P and the task load t of the cores of different architectures are different. Usually, the power consumption of the small core at a lower task load is less than that of the large core; while at a higher task load, the power consumption of the small core is greater than that of the large core. From the perspective of power consumption, in general, the large core is suitable for processing tasks with higher complexity, and the small core is suitable for processing tasks with lower complexity.
[0066] It should be noted that Figure 3The power consumption-task load function relationship is applicable to most integrated circuit chips. However, this does not constitute a limitation to the present application. The embodiments provided in the present application can be extended to scenarios where the power consumption-task load function relationship of the core or basic processing unit is any other legal shape.
[0067] See also Figure 4 For one embodiment of the present application, the optimal power efficiency point of the large core is denoted as A B , the corresponding task load is t B0 , the corresponding power consumption is P B (t B0 ); The optimal power efficiency point of the small core is recorded as A L , the corresponding task load is t L0 , the corresponding power consumption is P B (t L0 ). Curve P B (t) and P L The intersection point of (t) is denoted as E, and the corresponding task load is t E . Figure 2 Point A shown in B The corresponding large core has the best power efficiency, which is higher than point A. L The corresponding small core has the optimal power efficiency. When the task load t is less than t E When processing the same task load, the power consumed by the small core is less than the power consumed by the large core; when the task load t is greater than t E When processing the same task load, the power consumed by the small core is greater than the power consumed by the large core.
[0068] It should be noted that the above Figure 4 The t shown in L0 ,t B0 and t E The relative size relationship is only for illustration and does not constitute a limitation to the present application. The present application embodiment also does not limit the relative size relationship of the optimal power efficiency of the large core and the small core in actual applications.
[0069] For some implementations, the core architecture may be a large core and a small core, and the number of the large core and the number of the small core are at least one. In this case, the minimum power consumption of the core processor to complete the task load can be analyzed.
[0070] At this time, assume that the number of large cores carrying tasks is recorded as N B (N B ≥1), the number of small cores is recorded as N L (N L ≥1). The mth (1≤m≤N B The task load carried by the large core is denoted as TBm . The nth (1≤n≤N L The task load carried by ) small cores is recorded as T Ln . Then we have:
[0071]
[0072] At this point, the total power consumed by all cores is:
[0073]
[0074] Obviously, under the conditions shown in formula 1, the P shown in formula 2 is obtained. Total The process of minimizing the value of is a problem of finding an extreme value with constraints, so it can be solved using the Lagrange multiplier method. The Lagrange multiplier method is a method for finding the extreme value of a multivariate function whose variables are restricted by one or more conditions.
[0075] For some implementations, when the number of large cores and small cores N B 、N L When is a known value, in addition to satisfying the constraints of formula 1, the following conditions must also be met:
[0076] T Bm ≥0, (1≤m≤N B ) (Formula 3)
[0077] T Ln ≥0, (1≤n≤N L ) (Formula 4)
[0078] At a given N B 、N L Under the condition of, under the constraints of formula 1, formula 3 and formula 4, the generalized Lagrangian function for finding the minimum value of formula 2 is:
[0079]
[0080] Equation 5 is used to obtain The partial derivative of , and make the partial derivative equal to 0, we have:
[0081]
[0082]
[0083] Combining the above formulas, we can get the core processor power consumption P Total Smallest The values of parameters such as . According to the Karush Kuhn Tucker conditions (KKT) specified by the Lagrange multiplier method, the Karush Kuhn Tucker conditions (KKT) are necessary conditions for the optimal solution of nonlinear programming. The Karush Kuhn Tucker conditions (KKT) generalize the constrained optimization problems involving equations handled by the Lagrange multiplier method to inequalities. In practical applications, the Karush Kuhn Tucker conditions (KKT) generally do not have algebraic solutions, and many optimization algorithms can be used for numerical calculations. Therefore, in the process of solving the above system of equations, in addition to satisfying the constraints of Formula 1, Formula 3, and Formula 4, the following conditions must also be met:
[0084] α Bm ≥0, (1≤m≤N B ) (Formula 6)
[0085] α Ln ≥0, (1≤n≤N L ) (Formula 7)
[0086] α Bm ·(-T Bm )=0,(1≤m≤N B ) (Formula 8)
[0087] α Ln ·(-T Ln )=0,(1≤n≤N L ) (Formula 9)
[0088] It can be seen from formula 8 and formula 9 that when T Bm ≠0, there must be α Bm =0; when T Ln ≠0, there must be α Ln = 0. So for all non-zero values of T Bm and T Ln , there must be α Bm =0 and α Ln =0.
[0089] Thus, for all non-zero values of T Bm and T Ln ,(1≤m≤N B , 1≤n≤N L ), both have:
[0090]
[0091] That is, P TotalWhen the minimum value is obtained, the derivatives of the power consumption-task load curve corresponding to the task loads carried by all the large cores and small cores assigned to the task are the same.
[0092] It can be seen from the above embodiments that P B (t) and P L The slope of (t) is monotonically increasing within the domain. Then Formula 10 is satisfied, and P Total The smallest of all T Bm (1≤m≤N B ) are the same and have a unique solution, denoted by T B_Best Similarly, formula 10 is satisfied, and P Total The smallest of all T Ln (1≤n≤N L ) are also the same and have a unique solution, denoted by T L_Best Therefore, when tasks are processed by cores of two different architectures, in the task allocation scheme with the lowest core processor power consumption, the cores of the same architecture, for example, large cores or small cores, carry the same task load. This conclusion is valid for the number of large cores carrying tasks, N. B and the number of small cores is N L This holds true for any known value of .
[0093] For some other implementations, when the number of large cores and small cores N B 、N L When unknown, the tasks carried by all large cores can be recorded as The tasks carried by all small cores are
[0094] At this time, Formula 1 and Formula 2 can be written as Formula 10 and Formula 11 respectively.
[0095] N B ·T B +N L ·T L =T (Formula 10)
[0096] At this point, the total power consumed by all cores can be rewritten as:
[0097] P Total =N B ·P B (T B )+N L ·P L (T L ) (Formula 11)
[0098] The number of large cores N B and the number of small cores N LWhen unknown, under the constraints shown in formula 11, calculate P shown in formula 10 Total The process of obtaining the minimum value of can also be solved by the Lagrange multiplier method. In addition to satisfying the conditions shown in formula 10, the following constraints must also be considered:
[0099] T B ≥0 (Formula 12)
[0100] T L ≥0 (Formula 13)
[0101] N B ≥0 (Formula 14)
[0102] N L ≥0 (Formula 15)
[0103] At this time, the Lagrangian function of formula 11 can be written as:
[0104] L(T B , T L , N B , N L )=N B ·P B (T B )+N L ·P L (T L )+α BT ·(-T B )+α LT ·(-T L )+α BN ·(-N B )+α LN ·(-N L )+β·(N B ·T B +N L ·T L -T) (Formula 16)
[0105] Equation 14 is used to obtain the value of B , T L , N B , N L The partial derivative of , and make the partial derivative equal to 0, we have:
[0106]
[0107]
[0108]
[0109]
[0110] When solving the above system of equations, in addition to satisfying the constraints of Formula 10, Formula 12, Formula 13, Formula 14, and Formula 15, according to the Carlo-Kuhn-Tucker condition KKT constraint, the following conditions must also be satisfied:
[0111] α BT ≥0 (Formula 18-a)
[0112] α BT ·(-T B )=0 (Formula 18-b)
[0113] α LT ≥0 (Formula 18-c)
[0114] α LT ·(-T L )=0(Formula 18-d)
[0115] α BN ≥0 (Formula 18-e)
[0116] α BN ·(-N B )=0 (Formula 18-f)
[0117] α LN ≥0 (Formula 18-g)
[0118] α LN ·(-N L )=0 (Formula 18-h)
[0119] From formula 18-a and formula 18-b, we can see that when T B ≠0, there must be α BT = 0. From formula 18-e and formula 18-f, it can be seen that when N B ≠0, there must be α BN = 0. Therefore, when T B ≠0 and N B ≠0, α BT =α BN =0, then formula 17-c gives:
[0120]
[0121] Substituting formula 19 into formula 17-a, we get:
[0122]
[0123] The solution of formula 20 is Figure 2 Middle curve P B (t) The horizontal axis corresponding to the optimal power efficiency point t B0,Right now:
[0124] T B =t B0 (Formula 21)
[0125] Similarly, according to Formula 18-c, Formula 18-d, Formula 18-g and Formula 18-h, we can conclude that when T L ≠0 and N L ≠0, α LT =α LN =0, then from formula 17-b and formula 17-d we can get:
[0126]
[0127] The solution of formula 21 is Figure 2 Middle curve P L (t) The horizontal axis corresponding to the optimal power efficiency point t L0 ,Right now:
[0128] T L =t L0 (Formula 23)
[0129] From Formula 20 and Formula 22, we can see that only when the following conditions are met:
[0130]
[0131] That is, only when P B (t) and P L When the optimal power efficiency point of (t) coincides, T B =t B0 and T L =t L0 It is possible to be a legal solution, and at this time:
[0132] T B =T L =t B0 =t L0 (Formula 25)
[0133] However, even if P B (t) and P L (t) coincides with the optimal power efficiency point. Formula 25 cannot guarantee that it is the final legal solution because it also needs to consider N B and N L They must all be non-negative integers and must satisfy the conditions of Formula 10. B =T L =t B0 =t L0 Substituting into formula 10, we have:
[0134] (NB +N L )·t B0 =(N B +N L )·t L0 =T (Formula 26)
[0135] From Formula 25 and Formula 26, we can conclude that: if and only if P B (t) and P L The optimal power efficiency point of the large core and the small core coincides, and the total task volume T is the task load t corresponding to the common optimal power efficiency point of the large core and the small core B0 =t L0 The solutions of Formula 25 and Formula 26 are valid solutions only when the value of is an integer multiple of . However, it is easy to understand that such strict conditions are usually not met in reality, especially when P B (t) and P L The condition that the optimal power efficiency point of (t) coincides with each other is usually not satisfied. This can be seen in Figure 4 Because small cores are usually suitable for processing tasks with lower complexity, while large cores are usually suitable for processing tasks with higher complexity, that is, the task load corresponding to the optimal power efficiency point of the large core is usually greater than the task load corresponding to the optimal power efficiency point of the small core, that is, generally t B0 >t L0 On the other hand, the condition "the total task volume T is the task load t corresponding to the common optimal power efficiency point of the large core and the small core B0 =t L0 An integer multiple of "is usually not met.
[0136] Therefore, it is necessary to transform the above formula 11. Divide both sides of formula 11 by the total task T to obtain the power consumption corresponding to the unit task load, denoted as ρ, then:
[0137]
[0138] The power consumed by each large core per unit task load is denoted as ρ B , the power consumed by each small core unit task load is recorded as ρ L , so we have:
[0139]
[0140]
[0141] Then P B (T R ) and P L (T L ) can be written as:
[0142] P B (T B )=ρ B ·T B (Formula 30)
[0143] P L (T L )=ρ L ·T L (Formula 31)
[0144] Substituting formula 30 and formula 31 into formula 27, we have:
[0145]
[0146] Subtract ρ from both sides of Equation 32 B ,have to:
[0147]
[0148] Similarly, we can get:
[0149]
[0150] Obviously when N L ·T L =0,ρ=ρ B ; N B ·T B =0,ρ=ρ L That is, when only one core carries all tasks, the overall power consumed per task load is equal to the power consumed per task load of each core of that core. In other words, the overall power efficiency is equal to the power efficiency of a single core.
[0151] make:
[0152]
[0153]
[0154] Obviously α B and α L are the proportions of all tasks carried by all big cores and all small cores to the total tasks, and they satisfy:
[0155] α B +α L =1 (Formula 37)
[0156] α B and α L Substituting the two into formula 32, we have:
[0157] ρ=α B ·ρB +α L ·ρ L =α B ·ρ B +(1-α B )·ρ L =(1-α L )·ρ B +α L ·ρ L (Formula 38)
[0158] That is, the overall power consumed per unit task load is equal to the weighted sum of the power consumed per unit task load of each large core and the power consumed per unit task load of each small core. B and α L It is the ratio of the total workload carried by all cores of each architecture to the total raw workload.
[0159] Further, for an implementation mode provided by the present application, the core processors may have different combinations, for example, a combination of 1 large core and 1 small core, a combination of 2 large cores and 1 small core, etc.
[0160] For different task loads, an optimal combination can be determined as a target combination. The power consumption of the core processor corresponding to the target combination when executing the target task load is the target power consumption, and the target power consumption meets a preset condition. In one embodiment of the present application, the preset condition can be to use the minimum value of the power consumption of the core processor when executing the target task load as the target power consumption, and use the core combination corresponding to the target power consumption as the target combination.
[0161] For some implementations, all possible combinations of core processors can be traversed to obtain the minimum power consumption corresponding to each different core combination when executing the target task load, and then the target power consumption can be obtained through the Lagrange multiplier method. The core combination corresponding to the target power consumption is the target combination.
[0162] For some other implementations, the target combination corresponding to the target task load may be read out through a pre-obtained combination table.
[0163] Furthermore, the detailed steps for obtaining the target combination can be found in the subsequent implementation methods.
[0164] S230: Based on the target combination, determine the subtask to be processed of each core processor in the target combination.
[0165] The subtask to be processed of each core processor is the first subtask to be processed or the second subtask to be processed. For a determined target combination, the target power consumption and the first task load corresponding to the large core and the second task load corresponding to the small core can be obtained by the Lagrange multiplier method, and the first task load is used as the first subtask to be processed, and the second task load is used as the second subtask to be processed.
[0166] The task processing method provided by the present application, when the electronic device includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor, first obtains a target task load, then determines a target combination based on the target task load, and finally determines the subtasks to be processed of each core processor in the target combination based on the target combination. For an electronic device having a first core processor and a second core processor, different task loads can be reasonably allocated to the first core processor and the second core processor, so as to obtain the power consumption of the core processor with the lowest load for completing the task.
[0167] See also Figure 5 , Figure 5 A task processing method provided by an embodiment of the present application is shown, and the method can be applied to Figure 1 The electronic device shown includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor. Specifically, the method includes steps S510 to S560.
[0168] Step S510: Obtain target task load.
[0169] Among them, step S510 has been described in detail in the above embodiment and will not be repeated here.
[0170] Step S520: Acquire core information of the at least one core processor.
[0171] Core information of the at least one core processor is obtained, where the core information includes a first total number of first core processors and a second total number of second core processors.
[0172] The core information may include the type of the core. For example, in one embodiment of the present application, the type of the core may be a first core processor or a second core processor.
[0173] Furthermore, the core information may also include the number of cores corresponding to each core type. For example, in one embodiment of the present application, there may be four first core processors and four second core processors.
[0174] Step S530: Based on the core information, determine at least one core combination of the at least one core processor.
[0175] The core combination is used to characterize the number of the first core processor and the second core processor. For example, in an embodiment provided by the present application, the core combination may be 3 large cores and 1 small core.
[0176] Furthermore, it is also necessary to determine the core combination based on the core information. It is easy to understand that the number of any core processors in the determined core combination should be less than or equal to the number of core processors of the type corresponding to the core information. For example, the core information indicates that the number of first core processors is 4 and the number of second core processors is 4, then the number of first processors in any core combination should be less than or equal to 4, and the number of second processors should be less than or equal to 4. Specifically, in an embodiment of the present application, it can be a combination of 2 first core processors and 2 second core processors.
[0177] Step S540: Determine a first power consumption of each processor of the core combination when executing the target task load.
[0178] In one embodiment of the present application, the first power consumption is the minimum power consumption of each processor of the core combination when executing the target task load, wherein the power consumption P Total Given by formula 11.
[0179] For some implementations, the number of large cores and small cores may be unlimited, and in this case, the solution with the lowest power consumption for processing task T may be analyzed and derived. For example, when there are large-scale computing tasks to be processed, tens of thousands of computing units may be used. Under such conditions, it can be approximately understood that the number of core processors is unlimited.
[0180] See also Figure 6 It is easy to understand that, taking the large core as an example, when the target task load T is less than the optimal power efficiency point t of the large core B0 When the target task load T is greater than the optimal power efficiency point t of the large core, the power consumption of using one core to process all tasks is the lowest. B0 When , all the equal division points of T are traversed, and the number of equal divisions corresponding to the equal division point with the highest power efficiency is taken as the number of working cores, and the original target task load T is evenly distributed to each core according to the task load, and the total power consumption is the lowest.
[0181] According to this characteristic, taking the large core as an example, we can obtain the power consumption curve of all large core unit task loads when the target task load changes from 0 to T and the lowest core processor power consumption is achieved, as shown in Figure 6As shown. The horizontal axis is T B_All , that is, T B_All =N B ·T B Assume that the power consumed by each large core unit task load is recorded as:
[0182]
[0183] Please continue reading Figure 6 , Figure 6 The vertical axis is the power consumed by each large core unit task load ρ B The curve represents ρ B (T B_All ) As the target task load T carried by the large core B_All It can be seen that with the change of T B_All As the power consumption of each large core unit task load increases, the power consumed by each large core unit task load decreases in a phase fluctuation, and each band corresponds to an optimal number of large cores N B The lowest point in each band corresponds to the target task load, which is exactly the task load corresponding to the optimal power efficiency point t B0 At this time, each core is working at the optimal power efficiency point and has the highest power efficiency.
[0184] ρ B (T B_All ) curve adjacent wave segment connection, that is, in order to achieve the lowest core processor power consumption, with the increase of the target task load caused by the large number of cores N B For example, N B and N B +1 task demarcation point, assuming that the total amount of tasks corresponding to this demarcation point is recorded as At the demarcation point, N B cores and N B +1 core, the power efficiency of each core is the same. This formula can be used to determine the demarcation points of all segments and the number of cores in each segment. After determining the boundaries of each segment and the number of cores, we can get ρ as shown in formula 39 B (T B_All ) Analytical expression for a piecewise function over its entire domain.
[0185] See also Figure 7 For other implementations, the power consumption per unit task load of the small core also has the same characteristics. When the target task load T is less than the optimal power efficiency point t of the small core B0 When the target task load T is less than the optimal power efficiency point t of the small core, the power consumption of using one core to process all tasks is the lowest.L0 When , all the equal division points of T are traversed, and the number of equal divisions corresponding to the equal division point with the highest power efficiency is taken as the number of working cores, and the original target task load T is evenly distributed to each core according to the task load, and the total power consumption is the lowest.
[0186] The horizontal axis T L_All is the target task load carried by all small cores, and obviously there is T L_All =N L ·T L The vertical axis is the power consumed by each small core unit task load ρ L . Similarly, there are:
[0187]
[0188] From formula 35, we can see that when the total task load T = N B ·T B +N L ·T L When α is known, B It can be written as:
[0189]
[0190] See also Figure 8 , where the vertical axis α B The ratio of the task load carried by the large core to the total original task load, and the horizontal axis T B_All is the target task load carried by all large cores. Then α shown in Formula 41 B It's about T B_All A linear function of .
[0191] Therefore, α in Formula 38 B ·ρ B It can be written as:
[0192]
[0193] See also Fig. 9 , where the vertical axis α B ·ρ B The horizontal axis T is the product of the power consumed by each large core unit task load and the power consumed by each large core unit task load. B_All The target task load carried by all big cores. B ·ρ B About T B_All The functional relationship is Figure 6 and Figure 8 The product of the two curves shown.
[0194] See also Fig.10 , where the vertical axis αL ·ρ L The horizontal axis T is the product of the power consumed by each small core unit task load and the power consumed by each small core unit task load. B_All is the target task load carried by all large cores. It is easy to understand that α L ·ρ L It can be expressed as:
[0195]
[0196] Among them, α L ·ρ L About T B_All The functional relationship of Fig.10 shown.
[0197] Based on the above, ρ in formula 38 can be expressed as:
[0198]
[0199] See also Fig.11 , Fig.11 It shows that ρ is related to T B_All The function curve of Fig.11 for Fig. 9 and Fig.10 The sum of the function curves shown in the two figures. Fig.11 In the example shown, the vertical axis ρ is the power consumption per unit task load, and the horizontal axis T B_All is the target task load carried by all large cores. It can be seen that when the number of large cores is 5 and the number of small cores is 1, ρ reaches the lowest value, as shown by point A in the figure. Point A corresponds to the optimal power efficiency that can be obtained when processing the target task load T when the number of large cores and small cores is not 0.
[0200] Can remember Fig.11 The target task load carried by the large core corresponding to point A is T B_All =T B_All_Best , at this time, the task load carried by each large core is The task load carried by each small core is And the unit task load corresponding to point A is ρ(T B_All_Best ), then ρ(T B_All_Best ) is the minimum total power consumed per unit task load when processing total task T when the number of large cores and small cores is not 0. ρ(T B_All_Best )·T is the minimum total power consumed when processing total task T when the number of large cores and small cores is not 0, recorded as
[0201]
[0202] Furthermore, we need to consider the scenario when all tasks are assigned to the cores of the same architecture, that is, the power consumption of the core processor when the number of large cores or small cores is 0. Taking the large core as an example, when all task loads are processed by the large core, the number of large cores with the lowest power consumption can be recorded as N B (T), then the task load carried by each large core is Then the minimum total power consumed when processing the total task T using only the big core is recorded as:
[0203]
[0204] Similarly, the same method is used to obtain the number of small cores when only small cores are used to process the total task T, which is recorded as N L (T), then the minimum total power consumed by all small cores is recorded as:
[0205]
[0206] For other embodiments of the present application, the number of cores may be limited. For example, for an electronic device, its core may include two architectures, a large core and a small core. There are 4 large cores and 4 small cores. At this time, the solution with the lowest power consumption for processing task T can be analyzed and derived.
[0207] Please continue reading Figure 6 Taking the large core as an example, due to the limited number, when the large core carries different sizes of task loads, the power consumed by its unit task load cannot be the same as Figure 6 As shown in the figure, as the target task load increases, the load decreases step by step. B_All Exceed Figure 6 When the task load corresponding to the maximum number of available cores shown in is segmented, since there are no more cores available, the total task load can only be carried by the maximum number of available cores. Under this condition, the task load carried by each core will increase as the target task load increases.
[0208] Please also read Figure 6 and Figure 7 , assuming Figure 6 The target task load of all large cores corresponding to the dividing point between "number of cores = 4" and "number of cores = 5" is recorded as T B_All_45 . Assume that Figure 7 The target task load of all small cores corresponding to the dividing point between "number of cores = 4" and "number of cores = 5" is recorded as T L_All_45 . Remember T B_All_45 With T L_All_45 The smaller value is TB_45_L_45_Min , that is, T B_45_L_45_Min =Min(T B_All_45 , T L_All_45 ).
[0209] Obviously, when the number of large cores and small cores is limited to 4, when the target task load T to be processed is less than or equal to T B_45_L_45_Min When , the solution for the lowest core processor power consumption for processing task T can still be obtained by the method shown in the above embodiment when the number of cores is not limited.
[0210] Furthermore, when the target task load T to be processed is greater than T B_45_L_45_Min When the method shown in the above embodiment in which the number of cores is not limited is used, the number of large cores or small cores in the solution of the minimum core processor power consumption for processing task T may exceed the number of available cores. For example, it is determined that the required number of large cores is 5, which is greater than the actual number of large cores, 4. Then a new method is needed to determine the number of large and small cores and the size of the task load carried by each core.
[0211] Please also read Figure 6 and Fig.12 ,exist Figure 6 If the number of large cores is limited, for example, 4 large cores, then formula 39 can be used to obtain Fig.12 The ρ shown B (T B_All ) About the target task load T carried by all big cores B_All The curve of Fig.12 The vertical axis ρ B The horizontal axis T is the power consumed by each large core unit task load. B_All is the target task load carried by all big cores. At this time, when the target task load carried by all big cores T B_All When the boundary between "number of cores = 3" and "number of cores = 4" is exceeded, the number of large cores that achieves the lowest core processor power consumption will always be equal to 4, which is the maximum number of available large cores.
[0212] Similarly, please also refer to Figure 7 and Fig.13 ,exist Figure 7 If the number of small cores is limited, for example, 4 small cores, then formula 40 can be used to obtain Fig.13 The ρ shown L (T L_All ) About the target task load T carried by all small cores L_All The curve of Fig.13 The vertical axis ρ LThe horizontal axis T is the power consumed by each small core unit task load. L_All is the target task load carried by all small cores. At this time, when the target task load carried by all small cores T L_All When the boundary between "number of cores = 3" and "number of cores = 4" is exceeded, the number of small cores that achieves the lowest core processor power consumption will always be equal to 4, which is the maximum number of available small cores.
[0213] For further information, please also refer to Figure 6 and Fig.14 , for a large core, when T B_All Exceed Figure 6 When the task load corresponding to the four large cores shown in the figure is segmented, the α represented by formula 42 B ·ρ B About T B_All The function curve relationship will be as follows Fig.14 As shown, the vertical axis α B ·ρ B The horizontal axis T is the product of the power consumed by each large core unit task load and the power consumed by each large core unit task load. B_All Target task load carried by all big cores.
[0214] Similarly, please also refer to Figure 7 and Fig.15 , for a small core, when T L_All Exceed Figure 7 When the task load corresponding to the four small cores shown in the figure is segmented, the α represented by formula 43 L ·ρ L About T B_All The function curve relationship will be as follows Fig.15 As shown, the vertical axis α L ·ρ L The horizontal axis T is the product of the power consumed by each small core unit task load and the power consumed by each small core unit task load. B_All Target task load carried by all big cores.
[0215] For further information, see Fig.16 , then ρ expressed by formula 44 is about T B_All The function curve is Fig.14 and Fig.15 The sum of the curves shown in the two figures is Fig.16 As shown, the vertical axis α B ·ρ B The horizontal axis T is the product of the power consumed by each large core unit task load and the power consumed by each large core unit task load. B_All The target task load carried by all large cores. Fig.16In the example shown, when the number of large cores = 2 and the number of small cores = 4, ρ reaches the lowest value, as shown at point A in the figure. The target task load carried by the large core corresponding to point A is T B_All =T B_All_Best , at this time, the task load carried by each large core is The task load carried by each small core is And the unit task load corresponding to point A is ρ(T B_All_Best ), then ρ(T B_All_Best ) is the minimum total power consumed by the unit task load when processing the total task T. Then That is, when the number of large cores and small cores is not equal to 0, the minimum total power consumed when processing the total task T.
[0216] Please read further Fig.16 , where the lowest point A is either on the curve ρ = α B ·ρ B +α L ·ρ L The rightmost or leftmost side of B ·ρ B +α L ·ρ L The middle of the curve is about T B_All The position where the derivative is 0. Moreover, when point A is on the curve ρ = α B ·ρ B +α L ·ρ L When the curve is at the far right or far left, it means that when all task loads are carried by one core, the power consumed is the lowest. When the lowest point A is in the middle of the curve, under the condition that the number of large cores and small cores is known, this point can be calculated using the Lagrange multiplier method in the above embodiment.
[0217] For some embodiments, In the whole range of B_All The derivatives of may not be 0. In this case, point A must be on the curve ρ = α B ·ρ B +α L ·ρ L When A is not on the curve ρ=α B ·ρ B +α L ·ρ L When the rightmost or leftmost In the range, when there are one or more ρ about T B_All When the derivative of is 0, point A must be the one with the smallest ρ value.
[0218] See also Fig.17 In order to more clearly describe step S540, this step can also be divided into step S541 and step S542.
[0219] Step S541: constructing a power consumption function based on the core combination.
[0220] Step S542: obtaining the minimum value of the power consumption function of each core combination based on the Lagrange multiplier method as the first power consumption of the core combination.
[0221] For one embodiment of the present application, in the case of two core architectures, for example, a large core and a small core, and when the number of cores of any architecture is not limited, for example, when a large computer system or a cloud server performs large-scale computing tasks, the computing units required to be used can be approximated to be unlimited, and a theory and method for obtaining the minimum value of the power consumption function of each core combination are given.
[0222] For some implementations, all tasks T may be assigned to the cores of one architecture. For example, assigning all tasks T to the big cores yields the number N of big cores with the lowest power consumption. B (T), the task load carried by each core and the total load consumed by all big cores
[0223] For some other implementations, all tasks may be assigned to the small cores to obtain the number N of small cores with the lowest power consumption. L (T), the task load carried by each core and the total load consumed by all small cores
[0224] Please continue reading Fig.11 For some other implementations, all tasks can be assigned to the cores of the two architectures. B and N L When both are not 0, the calculation is as follows Fig.11 Point A shows the number of large cores N with the lowest core processor power consumption B , the total task load carried by all large cores is T B_All_Best (0≤T B_All_Best ≤T), the task load carried by each large core And the number of small cores N L , the task load carried by each small core
[0225] It can be proved that in N B and NL are not 0, and the number of available large cores and small cores is not limited. Fig.11 The lowest point A is either on the curve ρ = α B ·ρ B +α L ·ρ L The rightmost or leftmost side of B ·ρ B +α B ·ρ L The middle of the curve is about T B_All The position where the derivative of is 0. It should be noted that when point A is on the curve ρ = α B ·ρ B +α L ·ρ L When it is on the far right or left side, it means that when all task loads are carried by one core, the power consumption is the lowest. In this case, the solution for the lowest power consumption will be obtained from the above embodiment. or When point A is in the middle of the curve, different combinations of the number of large cores and small cores can be traversed, and for each combination, the Lagrange multiplier method in the aforementioned embodiment is used to find the point with the lowest core processor power consumption when the number of cores of different architectures is known. The core combination with the lowest core processor power consumption among all the legal combinations of the number of large cores and small cores is selected, which is as follows: Fig.11 The core combination of the large core and the small core at point A, the lowest point in the graph, is the target combination.
[0226] In some cases, at 0 ≤ T B_All ≤T, ρ is about T B_All The derivatives of may not be 0. At this time, the method shown in the Lagrange multiplier method in the above embodiment is used to find the point with the lowest core processor power consumption, and the point that is not 0≤T B_All ≤T. Fig.11 The lowest point A shown in must be on the curve ρ = α B ·ρ B +α L ·ρ L The far right or far left side.
[0227] Furthermore, when A is not on the curve ρ = α B ·ρ B +α L ·ρ L When the rightmost or leftmost In the range, when there are one or more ρ about T B_AllWhen the derivative of is 0, point A must be the one with the smallest ρ value.
[0228] To obtain each first power consumption corresponding to each core combination, it is necessary to traverse all combinations of the number of large cores and small cores (N B , N L ). For all legal (N B , N L ) combinations, the Lagrange multiplier method in the above embodiment, when the number of cores of different architectures is known, can be used to find the lowest power consumption under each combination condition. Select the combination with the lowest core processor power consumption (N B , N L ) combination. At this time, T B_All_Best =N B ·T B_Best ,
[0229] Furthermore, when the number of large cores and small cores is unlimited, (N B , N L ) have infinite combinations, and the following method can be used to narrow the search scope.
[0230] From Figure 3 and Figure 4, we can see that when achieving the lowest total power, the maximum possible value of the number of cores is:
[0231]
[0232] For any legal number of large cores N B (1≤N B ≤N B_Max ), the range of the task load carried by all the big cores to achieve the lowest power consumption is:
[0233] ((N B -1)·t B0 ,(N B +1)·t B0 ) (Formula 49)
[0234] Then correspondingly, given the number of large cores N B Under the condition of , the task load range of the small core is:
[0235] ((T-(N B +1)·t B0 ), (T-(N B -1)·t B0 )) (Formula 50)
[0236] Similarly, given the number of large cores N B Under the condition of , the minimum number of small cores to achieve the lowest power consumption is:
[0237]
[0238] Then given the number of large cores N B Under the condition of , the maximum number of small cores to achieve the lowest power consumption is:
[0239]
[0240] Further, traverse all the above (N B , N L ) combination, that is, traverse all the combinations that meet the conditions and N B , N L ) combination, the Lagrange multiplier method in the above embodiment is used to obtain each (N B , N L ) combination conditions, and select the one with the lowest core processor power consumption (N B , N L ) combination, that is, the combination with the lowest power consumption of the core processor that can be obtained under the condition that the number of cores is not limited and the number of large and small cores is not 0. The lowest power obtained in this case is as shown in formula 45, which is:
[0241] For another embodiment of the present application, in the case of two core architectures, and when the number of cores of any architecture is limited, a theory and method for obtaining the minimum value of the power consumption function of each core combination is provided. For example, an electronic device has a large core and a small core, wherein there are 4 large cores and 4 small cores.
[0242] Further, for some implementations, all tasks T may be assigned to cores of a certain architecture. For example, all tasks T may be assigned to large cores to obtain the number N of large cores with the lowest power consumption. B (T)(N B (T)≤4), the task load carried by each core and the total load consumed by all big cores It should be noted that the maximum available number of big cores here is the maximum number of cores of this type. In this embodiment, the maximum available number of big cores may be 4.
[0243] For some other implementations, all tasks may be assigned to the small cores to obtain the number N of small cores with the lowest power consumption. L (T)(N L (T)≤4), the task load carried by each small core and the total load consumed by all small cores It should be noted that the minimum available number of small cores here is the minimum number of cores of this type. In this embodiment, the minimum available number of small cores may be 4.
[0244] For some other implementations, all tasks may also be assigned to the cores of the two architectures. B and N L When both are not 0, we can calculate Fig.16 Point A in the middle shows the number of large cores N corresponding to the lowest core processor power consumption B , the total task load carried by all large cores is T B_All_Best , the task load carried by each large core And the number of small cores N L , the task load carried by each small core
[0245] Furthermore, we can traverse all the combinations of the number of large cores and small cores (N B , N L ), for all legal (N B , N L ) combinations, using the Lagrange multiplier method of the above embodiment to find the minimum power consumption under each combination condition. Select the combination with the lowest core processor power consumption (N B , N L ) combination, and the corresponding T B_Best and T L_Best As the final result.
[0246] Since the number of large cores and small cores in this embodiment is limited, traversing (N B , N L ) combination, the number of large cores and small cores can be further limited based on the unlimited number of the aforementioned embodiments (N B , N L ) combination range, speeding up the calculation process. Specifically, if in this embodiment, there are 4 large cores and 4 small cores, the maximum possible value of the number of large cores when the lowest total power is obtained is:
[0247]
[0248] For any legal number of large cores N B (1≤N B ≤N B_Max ), the range of task loads carried by all large cores when the lowest power consumption is achieved is recorded as: (T B_All_Min (N B), T B_All_Max (N B )).
[0249] For all N B , T B_All_Min (N B )=(N B -1)·t B0 When 1≤N B <4, T B_All_Max (N B )=(N B +1)·t B0 When N B =4, T B_All_Max (N B )=Max((N B +1)·t B0 , T).
[0250] Then correspondingly, given the number of large cores N B Under the condition of , the task load range of all small cores is:
[0251] ((TT B_All_Max (N B )), (TT B_All_Min (N B ))) (Formula 54)
[0252] Then given the number of large cores N B Under the condition of , the maximum number of small cores to achieve the lowest power consumption is:
[0253]
[0254] Given the number of large cores N B Under the condition of , the minimum number of small cores to achieve the lowest power consumption is:
[0255]
[0256] Therefore, traversing all the above (N B , N L ) combination, that is, traverse all combinations that meet the condition 1≤N B ≤N B_Max and N L_Min (N B )≤N L ≤N L_Max (N B ) of (N B , N L ) combination, the Lagrange multiplier method in the above embodiment is used to obtain each (N B , N L) combination conditions, and select the one with the lowest core processor power consumption (N B , N L ) combination, that is, the combination of large and small cores with the lowest core processor power consumption that can be obtained under the condition that the number of cores is not limited and the number of large and small cores is not 0. The lowest core processor power consumption obtained in this case is shown in formula 45, which is:
[0257] For another implementation of the present application, the number of core processors of some types may be unlimited, while the number of core processors of other types may be limited. For example, when the first core processor is a large core and the second core processor is a small core, the number of large cores may be unlimited, while the number of small cores may be limited to 4. At this time, the analysis of the minimum core processor power consumption may be combined with the method described in the above embodiment, which will not be repeated here.
[0258] In the above embodiment, the lowest core processor power consumption corresponding to each core combination is the first power consumption.
[0259] Step S550: searching for a second power consumption with the minimum power consumption among the first power consumptions as the target power consumption.
[0260] In one embodiment of the present application, the core combination corresponding to the target power consumption is used as the target combination. The preset condition may be to use the minimum value of the power consumption of the core processor when executing the target task load as the target power consumption, and use the core combination corresponding to the target power consumption as the target combination.
[0261] Furthermore, each of the first power consumptions may be compared in size, and the first power consumption corresponding to the minimum value may be selected as the second power consumption.
[0262] For example, for some embodiments of the present application, when the number of core processors is not limited, the total power in Formula 45, Formula 46 and Formula 47 in the above-mentioned embodiments can be compared. and The size of the total power is selected, and the solution with the smallest total power and its corresponding number of large cores and small cores and task allocation method are selected as the final solution, so that the power consumption corresponding to the lowest core processor can be obtained, and this power consumption is the target power consumption that meets the preset conditions. In some embodiments, and Two or even three of them may be the same, for example, and Same, or and The same. That is, the minimum core processor power consumption corresponding to the three solutions is the same. Under this condition, any one of the solutions can be selected.
[0263] For other embodiments of the present application, when the number of core processors is limited, the target power consumption can be obtained by using the same method as in the previous embodiment, which will not be described in detail here. Since the number of available large cores and small cores in this embodiment is limited, the number of large cores and small cores to be searched can be further reduced based on the previous embodiment. B and N L combination range.
[0264] In some embodiments, there may be more than one combination of the number of large and small cores (N) when achieving the lowest core processor power consumption. B , N L ), under this condition, any combination can be selected as the final result.
[0265] Step S560: Based on the target combination, determine the subtasks to be processed for each core processor in the target combination.
[0266] Among them, step S560 has been described in detail in the above embodiment and will not be repeated here.
[0267] The task processing method provided by the present application, when the electronic device includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor, first obtains a target task load, then determines a target combination based on the target task load, and finally determines the subtasks to be processed of each core processor in the target combination based on the target combination. For an electronic device having a first core processor and a second core processor, different task loads can be reasonably allocated to the first core processor and the second core processor, so as to obtain the power consumption of the core processor with the lowest load for completing the task.
[0268] See also Fig.18 , Fig.18 A task processing method provided by an embodiment of the present application is shown, and the method can be applied to Figure 1 The electronic device shown includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor. Specifically, the method includes steps S1810 to S1840.
[0269] Step S1810: Obtain target task load.
[0270] Among them, step S1810 has been described in detail in the above embodiment and will not be repeated here.
[0271] Step S1820: Obtain a combination table.
[0272] A combination table is obtained, wherein the combination table includes optimal combinations corresponding to different task loads, and the power consumption of the core processor of the optimal combination when executing the task load corresponding to the optimal combination meets a preset condition.
[0273] For another implementation of the present application, a method based on a combination table can also be designed to solve the number combination (N) of large cores and small cores with the lowest power consumption corresponding to the task load T when the number of cores is not limited. B , N L ).
[0274] In order to reduce the processing amount, the number of large cores and small cores with the lowest power consumption corresponding to different task loads T can be combined in advance (N B , N L ) is made into a table in advance. In practical applications, the number of large cores and small cores can be directly obtained by looking up the table according to the task load T (N B , N L )’s specific value.
[0275] For another embodiment of the present application, a method based on a combination table can also be designed to solve the number combination (N) of large cores and small cores with the lowest power consumption corresponding to the task load T when the number of cores is limited. B , N L ). The number of large cores and small cores with the lowest power consumption corresponding to different task loads T can be combined in advance (N B , N L ) is made into a table in advance. In practical applications, directly look up the table according to T to get (N B , N L )’s specific value.
[0276] For a more detailed description of step S1820, see Fig.19 , step S1820 can also be divided into step S1821 and step S1822.
[0277] Step S1821: Obtain core information.
[0278] Step S1822: searching the combination table set for the combination table corresponding to the core information.
[0279] The core information is obtained, the core information including a first total number of first core processors and a second total number of second core processors. A combination table corresponding to the core information is searched from a combination table set, the combination table set being a combination table corresponding to each core information obtained in advance.
[0280] In some embodiments, the core information may include the type of the core. For example, in one embodiment of the present application, the type of the core may be a first core processor or a second core processor.
[0281] Furthermore, the core information may also include the number of cores corresponding to each core type. For example, in one embodiment of the present application, there may be four first core processors and four second core processors.
[0282] In some embodiments, the combination tables corresponding to different core information can be collected and organized into a combination table set in advance, and the combination table set can be stored in a cloud server. Different electronic devices can correspond to different core information, and therefore have different combination tables. When task processing is required, the core information of the electronic device can be first obtained, and then the combination table corresponding to the core information can be found in the combination table set as the combination table for task processing of the electronic device.
[0283] Step S1830: Based on the combination table, find the optimal combination corresponding to the target task load as the target combination.
[0284] See also Fig. 20 For some embodiments, over the entire definition domain of the target task load T, when the number of available large cores and small cores is not limited, as T changes, the number of large cores and small cores with the lowest power consumption presents a piecewise gradual change characteristic, where Fig. 20 The vertical axis is the number of cores corresponding to the minimum total power consumption, and the horizontal axis is the task load. It is easy to understand that when the target task load T is large enough, all tasks will be assigned to a core of one architecture, that is, the core with higher optimal power efficiency. For other implementations, when the optimal power efficiency of the large core is higher than the optimal power efficiency of the small core, when the target task load T is greater than a certain threshold value, for example Fig. 20 This threshold value is T Threshold,Max , the lowest core processor power consumption can be obtained by having the large core carry all task loads. Conversely, when the optimal power efficiency of the small core is higher than the optimal power efficiency of the large core, when the target task load T is greater than a certain threshold value, the lowest core processor power consumption can be obtained by having the small core carry all task loads.
[0285] Therefore, a table may be used to store in advance the different core numbers corresponding to each segment of the target task load T. Referring to Table 2, the table of mapping relationship between the task load and the number of large cores and small cores obtained according to the above embodiment can be expressed as Table 2.
[0286] Table 2
[0287]
[0288] The values of all task load cutoff points corresponding to the first column in Table 2 meet the following conditions:
[0289] T Threshold,1 <T Threshold,2 <T Threshold,3 <…<T Threshold,Max
[0290] Based on Table 2, the number of large cores and small cores with the lowest power consumption and the task allocation scheme for each core are determined.
[0291] For some implementations, when the target task load T≤T Threshold,1 When T in Table 2 is used Threshold,1 The number of big cores and small cores in that row is taken as the actual number of big cores and small cores in the end, and 0 big cores and 1 small core are used at that time.
[0292] Furthermore, a general description can be made: when the target task load T satisfies the condition T Threshold,i-1 <T≤T Threshold,i (i>1), use T in Table 2 Threshold,i The number of big cores and small cores in that row is taken as the actual number of big cores and small cores in the end.
[0293] Furthermore, when the target task load T satisfies the condition T>T Threshold,Max When the minimum core processor power consumption solution corresponds to all task loads, they will be allocated to the core with the best power efficiency. For the embodiment of the present application, all tasks will be allocated to the large core. At this time, the method described in the above embodiment can be used to determine the number of large cores, which will not be repeated here.
[0294] For other implementations of the present application, please refer to Table 3. When the target task load T satisfies the condition T>T Threshold,Max When the number of large cores in each segment of the task load T is determined in advance, Table 3 can be prepared.
[0295] Table 3
[0296] Task load cut-off point Large number of cores <![CDATA[T Threshold_Big,1 ]]> 7 <![CDATA[T Threshold_Big,2 ]]> 8 <![CDATA[T Threshold_Big,3 ]]> 9 <![CDATA[T Threshold_Big,4 ]]> 10 … …
[0297] The values of all task load cutoff points corresponding to the first column in Table 3 meet the following conditions:
[0298] T Threshold,Max <T Threshold_Big,1 <T Threshold_Big,2 <T Threshold_Big,3 <…
[0299] When the target task load T>T Threshold,Max When, based on Table 3, the number of large cores with the lowest power consumption is determined.
[0300] When the target task load T Threshold,Max <T≤T Threshold_Big,1 When T in Table 3 is used Threshold_Big,1 The number of big cores in that row is taken as the actual number of big cores in the end.
[0301] When T satisfies the condition T Threshold_Biq,i-1 <T≤T Threshold_Big,i (i>1), use T in Table 3 Threshold_Big,i The number of large cores in that row is taken as the actual number of large cores in the end. After the number of large cores is determined, the task load carried by each large core is the target task load divided by the determined number of large cores.
[0302] See also Fig.21 ,For the case where the number of large cores and small cores is limited, as the target task load T increases, the number of large cores and small cores finally selected will stabilize at the maximum number of available large cores and small cores, where Fig.21 The vertical axis is the number of cores corresponding to the lowest total power consumption, and the horizontal axis is the task load. When the number of large cores and small cores is limited, as T changes, the number of large cores and small cores with the lowest power consumption presents a step-by-step change characteristic. For some embodiments, when the target task load T is greater than the threshold value T Threshold,Max When processing the total task T, the number of big cores and small cores corresponding to the lowest core processor power consumption solution will be the maximum number of available big cores and small cores.
[0303] Further, referring to Table 4, the mapping relationship between different task loads and the number of large cores and small cores under the condition of obtaining the lowest core processor power consumption can be made into a table. It is easy to understand that since the number of large cores and small cores is limited, the size of the table must also be limited.
[0304] Table 4
[0305]
[0306] The values of all task load cutoff points corresponding to the first column in Table 4 meet the following conditions:
[0307] T Threshold,1 <T Threshold,2 <T Threshold,3 <…<T Threshold,Max
[0308] Based on Table 4, the number of large cores and small cores with the lowest power consumption, as well as the task allocation scheme for each core are determined.
[0309] For some implementations, when the target task load T≤T Threshold,1 When T in Table 4 is used Threshold,1 The number of big cores and small cores in that row is taken as the actual number of big cores and small cores in the end.
[0310] Furthermore, a general description can be made: when the target task load T satisfies the condition T Threshold,i-1 <T≤T Threshold,i (i>1), use T in Table 4 Threshold,i The number of big cores and small cores in that row is taken as the actual number of big cores and small cores in the end.
[0311] Furthermore, when the target task load T satisfies the condition T>T Threshold,Max When the number of large cores and small cores is the maximum available number, in one embodiment of the present application, there are 4 large cores and 4 small cores.
[0312] Furthermore, after obtaining the optimal combination corresponding to the target task load in the above embodiment, the optimal combination is used as the target combination.
[0313] Step S1840: Based on the target combination, determine the subtasks to be processed of each core processor in the target combination.
[0314] Among them, step S1840 has been described in detail in the above embodiment and will not be repeated here.
[0315] The task processing method, device, electronic device, computer-readable medium and product provided by the present application, when the electronic device includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor, first obtains the target task load, then determines the target combination based on the target task load, and finally determines the subtasks to be processed of each core processor in the target combination based on the target combination. For an electronic device having a first core processor and a second core processor, the target combination can be quickly obtained based on a combination table, so as to obtain a task allocation method for the core processor corresponding to the power consumption of the core processor with the lowest load to complete the task. This method of searching the combination table greatly reduces the processing complexity without affecting the correctness of the final result.
[0316] See also Fig. 22 , Fig. 22 A task processing method provided by an embodiment of the present application is shown, and the method can be applied to Figure 1 The electronic device shown includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor. Specifically, the method includes steps S2210 to S2260.
[0317] Step S2210: Obtain target task load.
[0318] Step S2220: Determine a target combination based on the target task load.
[0319] Among them, step S2210 and step S2220 have been described in detail in the above embodiments and will not be repeated here.
[0320] Step S2230: constructing a power consumption function based on the target combination.
[0321] Step S2240: Obtaining the minimum value of the power consumption function based on the Lagrange multiplier method.
[0322] The above embodiments have described in detail the method of constructing a power consumption function based on a core combination and then obtaining the minimum value of the power consumption function based on the Lagrange multiplier method. In this embodiment, only the core combination needs to be replaced with the target combination to obtain the minimum value of the power consumption function corresponding to the target combination.
[0323] Step S2250: Obtain a first task load executed by the first core processor and a second task load executed by the second core processor corresponding to the minimum value of the power consumption function.
[0324] In an embodiment of the present application, for the minimum value of the power consumption function corresponding to the target combination that has been obtained, the task load corresponding to each core that constitutes the minimum value of the power consumption function can be determined. Among them, the task load may include a first task load and a second task load. The first task load is the task load borne by each first core processor, and the second task load is the task load borne by each second core processor. For example, for some embodiments, each large core can bear the first task load, and each small core can bear the second task load.
[0325] For the task load corresponding to each type of core that constitutes the minimum value of the power consumption function, divide it by the number of cores of the corresponding type in the target combination, and you can get the task load corresponding to each core processor of this type, that is, the first task load or the second task load. For example, the task load of the first core processor that constitutes the minimum value of the power consumption function is 60, and the task load of the second core processor that constitutes the minimum value of the power consumption function is 40, and there are 4 first core processors and 2 second cores in the target combination. It can be known that the first task load is 60 / 4=15, and the second task load is 40 / 2=20.
[0326] Step S2260: taking the first task load as the first to-be-processed subtask, and taking the second task load as the second to-be-processed subtask.
[0327] The first task load and the second task load have been acquired in step S2250. For some implementations, the first task load may be used as a first subtask to be processed, and the second task load may be used as a second subtask to be processed.
[0328] The task processing method, device, electronic device, computer-readable medium and product provided by the present application, when the electronic device includes at least one core processor, and the at least one core processor includes at least one of a first core processor and a second core processor, first obtains the target task load, then determines the target combination based on the target task load, and finally determines the subtasks to be processed of each core processor in the target combination based on the target combination. For an electronic device having a first core processor and a second core processor, different task loads can be reasonably allocated to the first core processor and the second core processor, so as to obtain the power consumption of the core processor with the lowest task load.
[0329] See also Fig.23, which shows a structural block diagram of a task processing device 2300 provided in an embodiment of the present application, the device includes at least one core processor, the at least one core processor includes at least one of a first core processor and a second core processor, wherein the first core processor and the second core processor have different power consumption when executing the same task load, and the device may include: an acquisition unit 2310, a first processing unit 2320, and a second processing unit 2330.
[0330] The acquisition unit 2310 is used to acquire a target task load, where the target task load includes multiple subtasks.
[0331] The first processing unit 2320 is used to determine a target combination based on the target task load, where the target combination is used to characterize a target number of first core processors and a target number of second core processors, and the power consumption of the processor corresponding to the target combination when executing the target task load is the target power consumption.
[0332] Furthermore, the first processing unit 2320 is further configured to search for a second power consumption with the minimum power consumption from among the first power consumptions as the target power consumption.
[0333] Furthermore, the first processing unit 2320 is also used to construct a power consumption function corresponding to each of the core combinations; and obtain the minimum value of the power consumption function of each core combination based on the Lagrange multiplier method as the first power consumption of the core combination.
[0334] Furthermore, the first processing unit 2320 is also used to obtain a combination table, which includes optimal combinations corresponding to different task loads, and the power consumption of the core processor of the optimal combination meets preset conditions when executing the task load corresponding to the optimal combination; based on the combination table, the optimal combination corresponding to the target task load is found as the target combination.
[0335] Furthermore, the first processing unit 2320 is also used to obtain core information, which includes a first total number of first core processors and a second total number of second core processors; and to search for a combination table corresponding to the core information in a combination table set, wherein the combination table set is a combination table corresponding to each core information obtained in advance.
[0336] Furthermore, the first processing unit 2320 is also used to obtain core information of the at least one core processor, the core information including a first total number of first core processors and a second total number of second core processors; based on the core information, determine at least one core combination of the at least one core processor, the core combination being used to characterize the number of the first core processor and the second core processor; determine a first power consumption of each processor of the core combination when executing the target task load; search the first power consumption that meets the preset conditions from the first power consumption as the target power consumption, and the core combination corresponding to the target power consumption is used as the target combination.
[0337] The second processing unit 2330 is used to determine the subtask to be processed of each core processor in the target combination based on the target combination.
[0338] Furthermore, the second processing unit 2330 is also used to construct a power consumption function based on the target combination; obtain the minimum value of the power consumption function based on the Lagrange multiplier method; obtain the first task load executed by the first core processor and the second task load executed by the second core processor corresponding to the minimum value of the power consumption function; use the first task load as the first subtask to be processed, and use the second task load as the second subtask to be processed.
[0339] Furthermore, the first core processor is a large core processor, and the second core processor is a small core processor.
[0340] Furthermore, the target power consumption is less than a threshold.
[0341] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0342] In several embodiments provided in the present application, the coupling between the units may be electrical, mechanical or other forms of coupling.
[0343] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0344] Please refer to Fig.24, which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 2400 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, etc. The electronic device 2400 in the present application may include one or more of the following components: a processor 2410, a memory 2420, and one or more applications, wherein the one or more applications may be stored in the memory 2420 and configured to be executed by one or more processors 2410, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0345] The processor 2410 may include one or more processing cores. The processor 2410 uses various interfaces and lines to connect the various parts of the entire electronic device 2400, and executes various functions and processes data of the electronic device 2400 by running or executing instructions, programs, code sets or instruction sets stored in the memory 2420, and calling data stored in the memory 2420. Optionally, the processor 2410 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 2410 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 2410, and it can be implemented separately through a communication chip.
[0346] The memory 2420 may include a random access memory (RAM) or a read-only memory (ROM). The memory 2420 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 2420 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the electronic device 2400 during use, etc.
[0347] Please refer to Fig.25, which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 2510 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0348] The computer readable storage medium 2500 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 2500 includes a non-transitory computer-readable storage medium. The computer readable storage medium 2500 has storage space for program code 2510 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 2510 can be compressed, for example, in an appropriate form.
[0349] Please refer to Fig.26 , which shows a structural block diagram 2600 of a computer program product provided in an embodiment of the present application. The computer program product 2600 includes a computer program / instruction 2610, and the steps of the above method are implemented when the computer program / instruction 2610 is executed by a processor.
[0350] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A task processing method, It is characterized in that Applied to an electronic device, the electronic device includes at least one core processor, the at least one core processor includes at least one of a first core processor and a second core processor, wherein the first core processor and the second core processor have different power consumptions when executing the same task load, and the method includes: Acquire a target task load, wherein the target task load includes a plurality of subtasks; Determine a target combination based on the target task load, the target combination is used to represent a target number of the first core processor and a target number of the second core processor, and the power consumption of the processor corresponding to the target combination when executing the target task load is the target power consumption; constructing a power consumption function based on the target combination; Obtaining a minimum value of the power consumption function based on a Lagrange multiplier method; Obtaining a first task load executed by the first core processor and a second task load executed by the second core processor corresponding to the minimum value of the power consumption function; The first task load is taken as a first subtask to be processed, and the second task load is taken as a second subtask to be processed.
2. The method according to claim 1, It is characterized in that The determining of the target combination based on the target task load includes: Acquire core information of the at least one core processor, the core information including a first total number of first core processors and a second total number of second core processors; Based on the core information, determining at least one core combination of the at least one core processor, the core combination being used to characterize the number of the first core processor and the second core processor; Determining a first power consumption of each processor of the core combination when executing the target task load; A second power consumption that meets a preset condition is searched from the first power consumption to be used as a target power consumption, and a core combination corresponding to the target power consumption is used as a target combination.
3. The method according to claim 2, It is characterized in that The searching the first power consumption for a second power consumption that meets a preset condition as the target power consumption includes: A second power consumption with the minimum power consumption is searched from among the first power consumptions to be used as the target power consumption.
4. The method according to claim 2, It is characterized in that The determining of a first power consumption of each processor of the core combination when executing the target task load includes: Constructing a power consumption function corresponding to each core combination; The minimum value of the power consumption function of each core combination is obtained based on the Lagrange multiplier method as the first power consumption of the core combination.
5. The method according to claim 1, It is characterized in that The determining of the target combination based on the target task load includes: Acquire a combination table, the combination table including optimal combinations corresponding to different task loads, the power consumption of the core processors of the optimal combination when executing the task load corresponding to the optimal combination meets a preset condition, and the optimal combination is a combination of a first number of first core processors and a second number of second core processors with the lowest power consumption corresponding to the task load; Based on the combination table, searching for the optimal combination corresponding to the target task load as the target combination; The obtaining of the combination table comprises: Acquire core information, the core information including a first total number of first core processors and a second total number of second core processors; The combination table corresponding to the core information is searched from the combination table set, wherein the combination table set is a combination table corresponding to each core information obtained in advance.
6. The method according to claim 1, It is characterized in that The first core processor is a large core processor, and the second core processor is a small core processor.
7. The method according to any one of claims 1 to 6, It is characterized in that The target power consumption is less than a threshold value.
8. A task processing device, It is characterized in that Applied to an electronic device, the electronic device includes at least one core processor, the at least one core processor includes at least one of a first core processor and a second core processor, wherein the first core processor and the second core processor have different power consumptions when executing the same task load, and the device includes: An acquisition unit, used for acquiring a target task load, wherein the target task load includes a plurality of subtasks; A first processing unit is used to determine a target combination based on the target task load, where the target combination is used to represent a target number of first core processors and a target number of second core processors, and a power consumption of a processor corresponding to the target combination when executing the target task load is a target power consumption; The second processing unit is used to construct a power consumption function based on the target combination; obtain the minimum value of the power consumption function based on the Lagrange multiplier method; obtain the first task load executed by the first core processor and the second task load executed by the second core processor corresponding to the minimum value of the power consumption function; use the first task load as the first subtask to be processed and the second task load as the second subtask to be processed.
9. An electronic device, It is characterized in that include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.
11. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Automatic load balancing for heterogeneous cores
CN103562870A
Core binding method and device, terminal and storage medium
CN109947569A
Processor core configuration method and device, terminal and storage medium
CN110955499A
Scheduling method and device of multi-core processor and terminal
CN110968415A
Task processing method, multi-core processor and computer equipment
CN112799838A
