Task processing method, electronic device, and computer-readable storage medium
By optimizing resource allocation and integrating it into a pipeline within electronic devices, the problem of low resource allocation efficiency in existing technologies is solved, thereby improving task processing efficiency and device performance.
Patent Information
- Application Number
- CN202210267344.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-03-17
AI Technical Summary
In electronic devices, existing technologies struggle to efficiently allocate resources to improve the efficiency of processor cores in executing tasks, leading to resource waste or insufficiency.
The resource management unit determines the resources required for the tasks to be executed and allocates them to the client. The tasks are then executed according to the connection relationship of each sub-resource pool, integrated into a pipeline, and resource utilization is optimized.
It improves the efficiency of client-side resource utilization in executing tasks, avoids resource waste, and enhances the performance and task processing capabilities of electronic devices.
Smart Images

Figure CN114610493B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to computer architecture technology, and in particular, to a task processing method, an electronic device, and a computer readable storage medium. BACKGROUND
[0002] With the improvement of computer architecture and the rapid development of microprocessor technology, the performance of computers has also been greatly improved. Based on microprocessor technology, electronic devices allocate resources within the electronic device to tasks before executing the tasks; so that the processor cores (or clients) within the electronic device can execute the tasks according to the allocated resources; therefore, improving the efficiency of the processor cores (or clients) in executing the tasks using the resources is a technical problem to be solved. SUMMARY
[0003] The present application provides a task processing method, device, electronic device, and computer readable storage medium.
[0004] According to a first aspect of the present application, a task processing method is provided, comprising:
[0005] A resource management unit within an electronic device determines resources required by a to-be-executed task;
[0006] The resource management unit allocates the resources to a client within the electronic device, so that the client executes the to-be-executed task according to the connection relationship of each sub-resource pool in the resources.
[0007] In the above solution, before the resource management unit allocates the resources to the client, the resource management unit confirms the connection relationship of the adjacent two sub-resource pools corresponding to the resources based on the order of executing the to-be-executed task;
[0008] Alternatively, after the resource management unit allocates the resources to the client, the client confirms the connection relationship of the adjacent two sub-resource pools corresponding to the resources based on the order of executing the to-be-executed task.
[0009] In the above solution, after the connection relationship of the adjacent two sub-resource pools corresponding to the resources is confirmed, the method further comprises:
[0010] In response to the resource management unit confirming the connection relationship of the adjacent two sub-resource pools corresponding to the resources, after the resource management unit confirms the connection relationship of the adjacent two sub-resource pools corresponding to the resources, the resource management unit confirms the switch strategy of all sub-resource pools based on the connection relationship of the adjacent two sub-resource pools.
[0011] In the above solution, after the switch strategy of all sub-resource pools is confirmed, the method further comprises:
[0012] Based on the switching strategy of all sub-resource pools, the resource management unit controls the switching on of the connection network between adjacent first and second sub-resource pools, so that when the client executes the task to be executed, the data output by the first sub-resource pool is input to the second sub-resource pool.
[0013] In the above scheme, after confirming the connection relationship between two adjacent sub-resource pools corresponding to the resource, the method further includes:
[0014] In response to the client confirming the connection relationship between the two adjacent sub-resource pools corresponding to the resource, the client confirms the on / off policy of all sub-resource pools based on the connection relationship between the two adjacent sub-resource pools.
[0015] In the above scheme, after confirming the switching policies of all sub-resource pools, the method further includes:
[0016] Based on the switching strategy of all sub-resource pools, the client controls the switching on and off of the connection network between adjacent first and second sub-resource pools, so that when the client executes the task to be executed, the data output by the first sub-resource pool is input to the second sub-resource pool.
[0017] In the above scheme, the resource management unit within the electronic device determines the resources required for the task to be executed, including:
[0018] The resource management unit receives the tasks to be executed sent by the client;
[0019] Based on the information of the task to be executed, at least one sub-resource pool corresponding to the resources required by the task to be executed is identified.
[0020] In the above scheme, the resource management unit allocates the resources to the client within the electronic device, including:
[0021] The resources in at least one sub-resource pool corresponding to the resources required by the task to be executed in the at least one resource pool are allocated to the client.
[0022] According to a second aspect of this application, a task processing apparatus is provided, the task processing apparatus being applied to a resource management unit within an electronic device, the apparatus comprising:
[0023] The determination unit is used to determine the resources required for the task to be executed.
[0024] an allocation unit, configured to allocate the resources to clients in the electronic device, so that the clients execute the to-be-executed task according to a connection relationship of each sub-resource pool in the resources.
[0025] According to a third aspect of the present application, an electronic device is provided, comprising:
[0026] a processor, a memory and a bus;
[0027] the memory stores executable instructions;
[0028] the processor communicates with the memory through the bus, and when the processor executes the executable instructions stored in the memory, the task processing method described above is implemented.
[0029] According to a fourth aspect of the present application, a computer readable storage medium is provided, which stores executable instructions for being executed by a processor to implement the task processing method described above.
[0030] According to a fifth aspect of the present application, a computer program product is provided, which comprises computer programs / instructions, and when the computer programs / instructions are executed by a processor, the task processing method described above is implemented.
[0031] The task processing method provided by the embodiments of the present application comprises: a resource management unit in an electronic device determines resources required by a to-be-executed task; the resource management unit allocates the resources to clients in the electronic device, so that the clients execute the to-be-executed task according to a connection relationship of each sub-resource pool in the resources; and through integration of each sub-resource pool in the resources according to the connection relationship, the resources required by the to-be-executed task are integrated into a pipeline, so as to improve the efficiency of the clients in executing the to-be-executed task by using the resources.
[0032] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0033] The accompanying drawings are used to better understand the present application, and do not limit the present application. Among them:
[0034] Figure 1 a processing flow diagram of instructions in the related art is shown;
[0035] Figure 2 an optional flow diagram of the task processing method provided by the embodiments of the present application is shown;
[0036] Figure 3An optional flowchart of a resource allocation method provided by the embodiment of the present application is shown.
[0037] Figure 4 An internal resource division schematic diagram of an electronic device provided by the embodiment of the present application is shown.
[0038] Figure 5 A schematic diagram of dividing a sub-resource pool based on a resource allocation strategy provided by the embodiment of the present application is shown.
[0039] Figure 6 A schematic diagram of dividing a sub-resource pool based on a resource allocation strategy provided by the embodiment of the present application is shown.
[0040] Figure 7 Another optional flowchart of a task processing method provided by the embodiment of the present application is shown.
[0041] Figure 8 Another optional flowchart of a task processing method provided by the embodiment of the present application is shown.
[0042] Figure 9 A component structure schematic diagram of an electronic device provided by the embodiment of the present application is shown.
[0043] Figure 10 A hardware structure schematic diagram of an electronic device provided by the embodiment of the present application is shown. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings, and the described embodiments should not be regarded as limiting the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0045] In the following description, "some embodiments" are related to a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subset of all possible embodiments, and can be combined with each other without conflict.
[0046] In the following description, the term "first\second" is only to distinguish similar objects, and does not represent the specific order of the objects, and it can be understood that "first\second" can be interchanged with the specific order or sequence as allowed, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing particular embodiments only and is not intended to be limiting of the application.
[0048] It should be understood that, in various embodiments of the present application, the magnitude of the serial number of each implementation process does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0049] Before the embodiments of the present application are further described in detail, the terms and phrases involved in the embodiments of the present application are explained, and the terms and phrases involved in the embodiments of the present application are applicable to the following explanations.
[0050] 1) Processor core: the most core part inside the processor, also known as processor core.
[0051] 2) Processor: including one or more processor cores, and other components or devices such as memory.
[0052] 3) Pipeline: an implementation technology for overlapping execution of multiple instructions, each step in the pipeline completes a part of the instruction, each step is called a pipeline stage or a pipeline section, the pipeline stages are connected in front and back to form a pipeline; instructions enter one end of the pipeline and exit the other end of the pipeline through these pipeline stages; each pipeline corresponds to a task.
[0053] For the processing flow of instructions in a pipeline, such as Figure 1As shown, the life cycle of an instruction in a pipeline includes fetching, decoding, executing, memory accessing and writing back. The instruction fetching refers to the process of reading an instruction from a memory. The instruction decoding refers to the process of translating the fetched instruction in the memory. After decoding, the operand register index required by the instruction is obtained, and the index can be used to read the operand from a general register file. After decoding, the type of calculation required by the instruction is known, and the required operand has been read from the general register file, and then the instruction execution is performed. The instruction execution refers to the process of performing actual operation on the instruction. For example, if the instruction is an addition operation instruction, the addition operation is performed on the operand; if the instruction is a subtraction operation instruction, the subtraction operation is performed on the operand. The most common component in the execution stage is an ALU, which is a hardware functional unit for implementing specific operations. The memory accessing refers to the process of reading data from a memory or writing data into the memory by a memory access instruction. The writing back refers to the process of writing the result of the instruction execution back to the general register file. If the instruction is a normal operation instruction, the result value comes from the result of the calculation in the execution stage; if the instruction is a memory read instruction, the result comes from the data read from the memory in the memory accessing stage.
[0054] The resource allocated to the processor core refers to a resource for performing each pipeline stage of the pipeline. For example, the resource allocated to the processor core can be a branch prediction resource, a fetching resource, a decoding resource, a renaming resource, an execution resource, etc. The execution resource can include at least one of an operation resource, a register resource and a memory resource. The memory resource can include a cache and a memory, and the cache can include at least one of an L1 cache, an L2 cache and an L3 cache. The memory can be any type of memory such as a flash memory. The decoding resource can include at least one decoder. The renaming resource can include at least one register.
[0055] Figure 2 An optional flowchart of a task processing method provided by an embodiment of the present application is shown, which will be described according to each step.
[0056] In step S101, a resource management unit in the electronic device determines a resource required by a to-be-executed task.
[0057] In some embodiments, the resource management unit in the electronic device receives the to-be-executed task sent by the client, and determines at least one sub-resource pool corresponding to the resource required by the to-be-executed task based on information of the to-be-executed task.
[0058] In implementation, the resource management unit determines information of the to-be-executed task based on the to-be-executed task, allocates target resources (i.e., resources required by the to-be-executed task) for the to-be-executed task based on the information of the to-be-executed task; the target resources are used for the processor core in the electronic device to execute the to-be-executed task; and the target resources include sub-resources corresponding to at least one sub-resource pool.
[0059] In some embodiments, the client can be a processor core in the electronic device.
[0060] The detailed process in which the resource management unit in the electronic device determines resources required by a to-be-executed task will be described later.
[0061] In step S102, the resource management unit allocates the resources to the client in the electronic device, so that the client executes the to-be-executed task according to the connection relationship of each sub-resource pool in the resources.
[0062] In some embodiments, the resource management unit allocates sub-resources in at least one sub-resource pool corresponding to resources required by the to-be-executed task in the at least one resource pool to the client.
[0063] In some embodiments, before the resource management unit allocates the resources to the client, the resource management unit confirms the connection relationship of adjacent two sub-resource pools corresponding to the resources based on the order of executing the to-be-executed task; or after the resource management unit allocates the resources to the client, the client confirms the connection relationship of adjacent two sub-resource pools corresponding to the resources based on the order of executing the to-be-executed task.
[0064] Further, in response to the resource management unit confirming the connection relationship of adjacent two sub-resource pools corresponding to the resources, after the resource management unit confirms the connection relationship of the adjacent two sub-resource pools corresponding to the resources, the resource management unit confirms the switching strategy of all sub-resource pools based on the connection relationship of the adjacent two sub-resource pools. Based on the switching strategy of all sub-resource pools, the resource management unit controls the switch of the connection network between the adjacent first sub-resource pool and the second sub-resource pool to be turned on, integrates the sub-resources in each sub-resource pool in the resources to form a pipeline, so that when the client executes the to-be-executed task, the data output by the first sub-resource pool is input to the second sub-resource pool.
[0065] Alternatively, in response to the client confirming the connection relationship of the adjacent two sub-resource pools corresponding to the resource, after the client confirms the connection relationship of the adjacent two sub-resource pools corresponding to the resource, the client confirms the switching strategy of all sub-resource pools based on the connection relationship of the adjacent two sub-resource pools; the client controls the switching of the connection network between the adjacent first sub-resource pool and the second sub-resource pool to be turned on based on the switching strategy of all sub-resource pools, integrates the sub-resources in each sub-resource pool in the resource to form a pipeline, so that when the client executes the to-be-executed task, the data output by the first sub-resource pool is input to the second sub-resource pool.
[0066] In the embodiments of the present application, the resource management unit inside the electronic device can be a hardware structure inside the electronic device. The resource management unit inside the electronic device determines the resources required for the to-be-executed task; the resource management unit allocates the resources to the client inside the electronic device, so that the client executes the to-be-executed task according to the connection relationship of each sub-resource pool in the resources. Wherein, the resources of a task can also be referred to as the resources of the pipeline corresponding to the task. A task is executed by one processor core (or client) inside the electronic device, or a pipeline is completed by one processor core (or client) inside the electronic device.
[0067] In this way, through the task processing method provided by the embodiments of the present application, the resource management unit inside the electronic device determines the resources required for the to-be-executed task; the resource management unit allocates the resources to the client inside the electronic device, so that the client executes the to-be-executed task according to the connection relationship of each sub-resource pool in the resources; through the connection relationship, each sub-resource pool in the resources is integrated, and the resources required for executing the task are integrated into a pipeline, which improves the efficiency of the client in executing the to-be-executed task using the resources.
[0068] Figure 3 An optional flowchart of the resource allocation method provided by the embodiments of the present application is shown, which will be described according to each step.
[0069] Step S201, the resource management unit inside the electronic device determines the information of the to-be-executed task.
[0070] In some embodiments, the to-be-executed task can refer to the task to be executed by one processor core (or client) inside the electronic device, and one to-be-executed task corresponds to one pipeline.
[0071] In some embodiments, the information of the to-be-executed task can include one or more of the following: the type of the to-be-executed task, the name of the to-be-executed task, the application corresponding to the to-be-executed task, and the execution period of the to-be-executed task.
[0072] In step S202, the resource management unit allocates target resources for the to-be-executed task based on the information of the to-be-executed task; the target resources are used for the processor core in the electronic device to execute the to-be-executed task.
[0073] In implementation, the resource management unit determines a resource allocation strategy based on the information of the to-be-executed task; and allocates target resources for the to-be-executed task based on the resource allocation strategy.
[0074] Specifically, the specific implementation process of the resource management unit determining a resource allocation strategy based on the information of the to-be-executed task can include: the resource management unit first determines the intensity of resources required by the to-be-executed task based on the information of the to-be-executed task, and then determines the resource allocation strategy based on the intensity of resources required by the to-be-executed task. The specific implementation process of the resource management unit allocating target resources for the to-be-executed task based on the resource allocation strategy can include: for each type of resource in the electronic device, the resource management unit divides each type of resource into at least one sub-resource pool based on the resource allocation strategy; and determines the resources in one of the at least one sub-resource pool as the target resources.
[0075] Based on Figure 3 As shown in the task processing method, it can be understood that the embodiments of the present application divide each type of resource included in an electronic device into a resource pool, and allocate resources required for executing a to-be-executed task from the resource pool to the to-be-executed task according to the information of the to-be-executed task.
[0076] In implementation, the resource division schematic diagram in the electronic device is as shown in Figure 4 As shown in the figure: the branch prediction resources included in the electronic device are divided into a branch prediction resource pool, the instruction fetching resources included in the electronic device are divided into an instruction fetching resource pool, the decoding resources included in the electronic device are divided into a decoding resource pool, the renaming resources included in the electronic device are divided into a renaming resource pool, and the execution resources included in the electronic device are divided into an execution resource pool; wherein the execution resources can include one or more of register resources, memory resources, and operation resources. The resource pools are connected through a connection network; wherein the connection network can be a hardware network based on switch control, or any other form of network, which is not limited in the embodiments of the present application.
[0077] Figure 4In the illustrated resource partitioning schematic diagram, the resource management unit manages all the resource pools. In a specific implementation, the resource management unit can also include multiple resource management sub-units, and each resource management sub-unit manages different resource pools. As an example, the resource management unit includes a branch prediction resource sub-management unit, an instruction fetch resource sub-management unit, a decoding resource sub-management unit, a renaming resource sub-management unit, and an execution resource sub-management unit. The branch prediction resource sub-management unit is configured to manage resources in the branch prediction resource pool, the instruction fetch resource sub-management unit is configured to manage resources in the instruction fetch resource pool, the decoding resource sub-management unit is configured to manage resources in the decoding resource pool, the renaming resource sub-management unit is configured to manage resources in the renaming resource pool, and the execution resource sub-management unit is configured to manage resources in the execution resource pool.
[0078] For Figure 4 In the illustrated resource partitioning schematic diagram, each resource pool can be divided into multiple sub-resource pools of the same size, as illustrated in Figure 5 or multiple sub-resource pools of different sizes, as illustrated in Figure 6 The sub-resource pools of the same size refer to the same size of resources included in each sub-resource pool for the same type of resources. The sub-resource pools of different sizes refer to different sizes of resources included in multiple sub-resource pools for the same type of resources.
[0079] The following describes a resource allocation strategy-based sub-resource pool partitioning schematic diagram, as illustrated in Figure 5 and another resource allocation strategy-based sub-resource pool partitioning schematic diagram, as illustrated in Figure 6
[0080] For Figure 5 Each resource pool is divided into sub-resource pools in the smallest resource organization manner based on the resource allocation strategy, and each sub-resource pool includes the smallest unit of resources of the same type. In this way, each resource pool can be divided into the maximum number of sub-resource pools to support the maximum number of processor cores to execute the maximum number of tasks in parallel. As an example, the branch prediction resource pool, the instruction fetch resource pool, the decoding resource pool, the renaming resource pool, and the execution resource pool are all divided into the smallest unit of resources. The branch prediction resource pool is divided into eight branch prediction sub-resource pools, the instruction fetch resource pool is divided into eight instruction fetch sub-resource pools, the decoding resource pool is divided into eight decoding sub-resource pools, the renaming resource pool is divided into eight renaming sub-resource pools, and the execution resource pool is divided into eight execution sub-resource pools. Each sub-resource pool can be used by a processor core to execute a task, Figure 5 The resources illustrated in can support eight processor cores to execute eight tasks in parallel.
[0081] In the process of dividing each resource pool into sub-resource pools, the number of sub-resource pools obtained by dividing each resource pool can be different; for example, the branch prediction resource pool is divided into eight branch prediction sub-resource pools, the instruction fetching resource pool is divided into six instruction fetching sub-resource pools, the decoding resource pool is divided into seven decoding sub-resource pools, the renaming resource pool is divided into eight renaming sub-resource pools, and the execution resource pool is divided into six execution sub-resource pools. In this scenario, five processor cores can support the parallel execution of six tasks.
[0082] In the embodiments of the present application, each resource pool is divided into sub-resource pools in the organization mode of the smallest resource, so that the resources in the electronic device can support the parallel execution of the most number of processor cores, improve the processing capacity of task parallelism, and further improve the performance of the electronic device.
[0083] For Figure 6 , each resource pool is divided into sub-resource pools in different organization modes based on the resource allocation strategy, and the sizes of the resources included in the multiple sub-resource pools are partially different or completely different for the same type of resource. In this way, for the sub-resource pool that includes more resources, the processor core supports the execution of tasks that require strong resources, improving the processing efficiency and processing capacity of the task. As an example, each of the branch prediction resource pool, the instruction fetching resource pool, the decoding resource pool, the renaming resource pool, and the execution resource pool is divided into sub-resource pools in different organization modes; taking the branch prediction resource pool as an example, the branch prediction resource pool is divided into five branch prediction sub-resource pools, and the sizes of the five branch prediction sub-resource pools are partially different and partially the same; Figure 6 The size of the first branch prediction sub-resource pool is greater than the size of the second branch prediction sub-resource pool, and the sizes of the third branch prediction sub-resource pool, the fourth branch prediction sub-resource pool, and the fifth branch prediction sub-resource pool are the same. The first branch prediction sub-resource pool is suitable for tasks that require high branch prediction resources; the third branch prediction sub-resource pool, the fourth branch prediction sub-resource pool, and the fifth branch prediction sub-resource pool are suitable for tasks that require low branch prediction resources; and the second branch prediction sub-resource pool is suitable for tasks that require moderate branch prediction resources (the demand for branch prediction resources is between the highest and the lowest). Among them, the size of the sub-resource pool refers to the amount of resources included in the sub-resource pool.
[0084] For a task, a required sub-resource pool can be selected from any resource pool according to the demand of the task for each type of resource; as an example, a first branch prediction sub-resource pool, a second instruction fetching sub-resource pool, a second decoding sub-resource pool, a third renaming sub-resource pool, and a first execution sub-resource pool are allocated for a task to be executed.
[0085] In the embodiments of the present application, if there is idle or remaining resource in a certain sub-resource pool allocated to the to-be-executed task, the idle or remaining resource can be set to a hibernation mode, so that the idle or remaining resource is not used to execute the task, and the power consumption is reduced. The idle or remaining resource can also be removed from the sub-resource pool, and the idle or remaining resource is divided into other sub-resource pools, so that the idle or remaining resource is fully utilized, and the utilization rate of the resource is improved.
[0086] In the embodiments of the present application, each resource pool is divided into sub-resource pools in different sizes, so that the resource management unit can allocate the required resource to the task according to the demand of the task for each type of resource, avoid the problem of resource waste or insufficient resource to support the processor core to execute the task due to the allocation of fixed resource to each processor core in the related art, improve the efficiency of task execution and the utilization rate of resource, and further improve the performance of the electronic device.
[0087] Figure 7 Another optional flowchart of a task processing method provided by the embodiments of the present application is shown, which will be described according to each step.
[0088] In step S301, the resource management unit in the electronic device determines the required resource of the to-be-executed task.
[0089] The specific process of step S301 is consistent with that of step S101 or steps S201 to S202, which will not be repeated here.
[0090] In step S302, the resource management unit confirms the connection relationship between the adjacent two sub-resource pools corresponding to the resource based on the order of executing the to-be-executed task.
[0091] In some embodiments, the resource management unit confirms the connection relationship between the adjacent two sub-resource pools corresponding to the resource based on the order of executing the sub-tasks included in the to-be-executed task. Wherein, the to-be-executed task can include at least one sub-task, taking the branch prediction, instruction fetching, decoding, renaming and execution required by the to-be-executed task as an example, the branch prediction, instruction fetching, decoding, renaming and execution are all sub-tasks of the to-be-executed task.
[0092] In some embodiments, the resource management unit sorts the at least one resource pool according to the order of executing the sub-tasks, confirms that the resource pool corresponding to the sub-task executed in advance is located before the resource pool corresponding to the sub-task executed in the rear, and connects the two resource pools of different types through a connection network (such as the connection network shown in the figure). Figure 5 Or Figure 6 The connection network shown in the figure) is provided with a plurality of command switches on each connection network, which is used to control the connection between the two resource pools of different types.
[0093] For example, as shown in FIG. 1, the execution sequence of each subtask in the to-be-executed task is branch prediction, instruction fetching, decoding, renaming, and execution; and the resource pool corresponding to the subtask of score prediction is arranged at the frontmost position, and the resource pool corresponding to the subtask of instruction fetching, the resource pool corresponding to the subtask of decoding, the resource pool corresponding to the subtask of renaming, and the resource pool corresponding to the subtask of execution are sequentially connected in the subsequent position. Figure 6
[0094] In step S303, the resource management unit confirms the switching strategy of all the sub-resource pools based on the connection relationship between the two adjacent sub-resource pools.
[0095] In some embodiments, the resource management unit confirms the switching strategy of all the sub-resource pools based on the resource required by the to-be-executed task and / or the connection relationship between the two adjacent sub-resource pools.
[0096] In specific implementation, the resource management unit confirms that the switch of each sub-resource pool included in the resource pool required by the to-be-executed task is in the open state, and the switch of other sub-resource pools in the resource pool is in the closed state, so that the input of the previous resource pool can be input into the sub-resource pool with the switch in the open state.
[0097] For example, taking the to-be-executed task requiring branch prediction, instruction fetching, decoding, renaming, and execution as an example, in step S301, the first branch prediction sub-resource pool, the second instruction fetching sub-resource pool, the second decoding sub-resource pool, the third renaming sub-resource pool, and the first execution sub-resource pool are allocated for the to-be-executed task; further, in step S302, the resource pools are connected in the order of branch prediction resource pool, instruction fetching resource pool, decoding resource pool, renaming resource pool, and execution resource pool. The resource management unit confirms the switching strategy of all the sub-resource pools based on the resource required by the to-be-executed task and / or the connection relationship between the two adjacent sub-resource pools, that is, the switches of the first branch prediction sub-resource pool, the second instruction fetching sub-resource pool, the second decoding sub-resource pool, the third renaming sub-resource pool, and the first execution sub-resource pool are in the open state, and the switches of other sub-resource pools are in the closed state.
[0098] In step S304, the resource management unit controls the switch of the connection network between the first sub-resource pool and the second sub-resource pool to be open based on the switching strategy of all the sub-resource pools.
[0099] In some embodiments, the resource management unit controls the switch of the connection network between the first sub-resource pool and the second sub-resource pool to be open based on the switching strategy of all the sub-resource pools; so that when the client executes the to-be-executed task, the data output by the first sub-resource pool is input into the second sub-resource pool.
[0100] In implementation, the on-off states of each sub-resource pool can be realized through the connection network, each connection network including a plurality of command switches; the resource management unit determines the switch strategy and / or sends the switch instruction corresponding to the switch strategy to each connection network, and each connection network triggers the opening and closing of the command switches in the connection network between two different types of resource pools based on the switch instruction, thereby realizing the connection between two different types of sub-resource pools.
[0101] For example, taking the first sub-resource pool as the first branch prediction sub-resource pool and the second sub-resource pool as the second instruction fetching sub-resource pool, the connection network between the branch prediction resource pool and the instruction fetching resource pool triggers the command switch corresponding to the second instruction fetching sub-resource pool to open based on the switch instruction, thereby connecting the first branch prediction sub-resource pool and the second instruction fetching sub-resource pool, so that the output of the first branch prediction sub-resource pool can be input to the second instruction fetching sub-resource pool.
[0102] For another example, taking the connection network as a crossbar switch, the resource management unit configures the selection signal of the crossbar switch according to the resource division scheme, so that the instruction block information output by the M branch prediction resources allocated to the processor X is sent to the N instruction fetching resources allocated to the processor X in the instruction fetching resource pool through the crossbar switch. When M is equal to N, each prediction resource corresponds to one instruction fetching resource. When M is less than N, a part of the instruction blocks can be sent to two instruction fetching resources for parallel instruction fetching. When M is greater than N, multiple instruction blocks can be sent to the same instruction fetching resource. When M is not equal to N, the correspondence between the branch prediction resources and the instruction fetching resources can be static and unchangeable, or can be dynamically adjusted.
[0103] In step S305, the resource management unit allocates the resources to the client in the electronic device, so that the client executes the to-be-executed task according to the connection relationship of each sub-resource pool in the resources.
[0104] In some embodiments, the resource management unit allocates the resources to the client in the electronic device, so that the client executes the to-be-executed task according to the connection relationship of each sub-resource pool in the resources.
[0105] For example, the client can execute the branch prediction subtask, the instruction fetching subtask, the decoding subtask, the renaming subtask and the execution subtask in the to-be-executed task in turn according to the first branch prediction sub-resource pool, the second instruction fetching sub-resource pool, the second decoding sub-resource pool, the third renaming sub-resource pool and the first execution sub-resource pool.
[0106] Therefore, by the task processing method provided in the embodiments of the present application, the resources required for executing the task are integrated into a pipeline through the integration of each sub-resource pool in the resources according to the connection relationship, thereby improving the efficiency of the client in executing the to-be-executed task by using the resources.
[0107] Figure 8 Another optional flowchart of the task processing method provided in the embodiments of the present application is shown, which will be described according to each step.
[0108] In step S401, the resource management unit in the electronic device determines the resources required for the to-be-executed task.
[0109] The specific process of step S401 is consistent with that of step S101 or steps S201 to S202, which will not be repeated here.
[0110] In step S402, the client confirms the connection relationship between the adjacent two sub-resource pools corresponding to the resources based on the order of executing the to-be-executed task.
[0111] In some embodiments, the client confirms the connection relationship between the adjacent two sub-resource pools corresponding to the resources based on the order of executing the sub-tasks included in the to-be-executed task. The to-be-executed task can include at least one sub-task. Taking the branch prediction, instruction fetching, decoding, renaming and execution required for the to-be-executed task as an example, the branch prediction, instruction fetching, decoding, renaming and execution are all sub-tasks of the to-be-executed task.
[0112] In some embodiments, the client sorts the at least one resource pool according to the order of executing the sub-tasks, confirms that the resource pool corresponding to the sub-task executed in advance is located before the resource pool corresponding to the sub-task executed in the rear, and connects the resource pools of two different types through a connection network (such as the connection network shown in Figure 5 or Figure 6 Each connection network is provided with a plurality of command switches for controlling the connection between the resource pools of two different types.
[0113] For example, as shown in Figure 6 the execution order of each sub-task in the to-be-executed task is branch prediction, instruction fetching, decoding, renaming and execution; the resource pool corresponding to the branch prediction sub-task is arranged in the frontmost position, and the resource pools corresponding to the instruction fetching sub-task, the decoding sub-task, the renaming sub-task and the execution sub-task are sequentially connected in the rear.
[0114] In step S403, the client confirms the switch strategy of all the sub-resource pools based on the connection relationship between the adjacent two sub-resource pools.
[0115] In some embodiments, the client determines the switch strategy of all the sub-resource pools based on the required resources of the task to be executed and / or the connection relationship between the two adjacent sub-resource pools.
[0116] In specific implementation, the client determines that the switch of each sub-resource pool included in the resource pool required by the task to be executed is in an open state, and the switch of other sub-resource pools in the resource pool is in a closed state, so that the input of the previous resource pool can be input into the sub-resource pool with the switch in the open state.
[0117] For example, taking the task to be executed as an example that branch prediction, instruction fetching, decoding, renaming and execution are required, in step S401, the first branch prediction sub-resource pool, the second instruction fetching sub-resource pool, the second decoding sub-resource pool, the third renaming sub-resource pool and the first execution sub-resource pool are allocated for the task to be executed; further, in step S402, the resource pools are connected in the order of branch prediction resource pool, instruction fetching resource pool, decoding resource pool, renaming resource pool and execution resource pool. The client determines the switch strategy of all the sub-resource pools based on the required resources of the task to be executed and / or the connection relationship between the two adjacent sub-resource pools, that is, the switch of the first branch prediction sub-resource pool, the second instruction fetching sub-resource pool, the second decoding sub-resource pool, the third renaming sub-resource pool and the first execution sub-resource pool is in an open state, and the switch of other sub-resource pools is in a closed state.
[0118] In step S404, the client controls the switch of the connection network between the adjacent first sub-resource pool and the second sub-resource pool to be open based on the switch strategy of all the sub-resource pools.
[0119] In some embodiments, the client controls the switch of the connection network between the adjacent first sub-resource pool and the second sub-resource pool to be open based on the switch strategy of all the sub-resource pools; so that when the client executes the task to be executed, the data output by the first sub-resource pool is input into the second sub-resource pool.
[0120] In specific implementation, the switch state of each sub-resource pool can be realized through the connection network, and each connection network includes a plurality of command switches; the client determines the switch strategy and / or sends the switch instruction corresponding to the switch strategy to each connection network, and each connection network triggers the opening and closing of the command switch in the connection network between two different types of resource pools based on the switch instruction, to realize the connection between two different types of sub-resource pools.
[0121] For example, taking the first sub-resource pool as the first branch prediction sub-resource pool and the second sub-resource pool as the second instruction fetching sub-resource pool as an example, the connection network between the branch prediction resource pool and the instruction fetching resource pool triggers the command switch corresponding to the second instruction fetching sub-resource pool to open based on the switch instruction, and connects the first branch prediction sub-resource pool and the second instruction fetching sub-resource pool, so that the output of the first branch prediction sub-resource pool can be input to the second instruction fetching sub-resource pool.
[0122] For another example, taking the connection network as a crossbar as an example, the resource management unit configures the selection signal of the crossbar according to the resource division scheme, so that the instruction block information output by the M branch prediction resources allocated to the processor X is sent to the N instruction fetching resources allocated to the processor X in the instruction fetching resource pool through the crossbar. When M is equal to N, each prediction resource corresponds to one instruction fetching resource. When M is less than N, a part of the instruction blocks can be sent to two instruction fetching resources for parallel instruction fetching. When M is greater than N, multiple instruction blocks can be sent to the same instruction fetching resource. When M is not equal to N, the correspondence between the branch prediction resources and the instruction fetching resources can be static and unchangeable, or can be dynamically adjusted.
[0123] In step S405, the client allocates the resources to the client in the electronic device, so that the client executes the to-be-executed task according to the connection relationship of each sub-resource pool in the resources.
[0124] In some embodiments, the client allocates the resources to the client in the electronic device, so that the client executes the to-be-executed task according to the connection relationship of each sub-resource pool in the resources.
[0125] For example, the client can execute, in sequence, a branch prediction subtask, an instruction fetching subtask, a decoding subtask, a renaming subtask and an execution subtask in the to-be-executed task according to the first branch prediction sub-resource pool, the second instruction fetching sub-resource pool, the second decoding sub-resource pool, the third renaming sub-resource pool and the first execution sub-resource pool.
[0126] In this way, by the task processing method provided in the embodiments of the present application, each sub-resource pool in the resources is integrated through the connection relationship, the resources required for executing the task are integrated into a pipeline, and the efficiency of the client in executing the to-be-executed task by using the resources is improved.
[0127] In the embodiments of the present application, the resource management unit can be a program installed on the electronic device, or the resource management unit can be a hardware component in the electronic device, or the resource management unit includes a program installed on the electronic device and a hardware component in the electronic device.
[0128] In some embodiments, if the resource management unit is a program installed on the electronic device, the task processing method or the resource allocation method provided by the embodiments of the present application is implemented in the form of software; wherein the program installed on the electronic device can be an application installed on the electronic device, or a small program loaded by the application installed on the electronic device.
[0129] In the implementation, the program installed on the electronic device determines the resources required by the to-be-executed task; and the resources are allocated to the corresponding hardware components in the electronic device, so that the hardware components execute the to-be-executed task according to the connection relationship of each sub-resource pool in the resources.
[0130] In some other embodiments, if the resource management unit is a hardware component in the electronic device, the task processing method provided by the embodiments of the present application is implemented in the form of hardware.
[0131] In the implementation, the hardware component in the electronic device determines the resources required by the to-be-executed task; and the resources are allocated to the corresponding hardware components in the electronic device, so that the hardware components execute the to-be-executed task according to the connection relationship of each sub-resource pool in the resources.
[0132] In some other embodiments, if the resource management unit includes a program installed on the electronic device and a hardware component in the electronic device, the task processing method provided by the embodiments of the present application is implemented in the form of software and hardware combination.
[0133] In the implementation, the hardware component in the electronic device sends information of the to-be-executed task to the program installed on the electronic device; the program installed on the electronic device determines a resource allocation strategy according to the information of the to-be-executed task, allocates target resources for the to-be-executed task based on the resource allocation strategy, and sends the target resources to the corresponding hardware components in the electronic device, so that the hardware components execute the to-be-executed task based on the target resources.
[0134] Alternatively, in the implementation, the program installed on the electronic device determines the resources required by the to-be-executed task; and sends information corresponding to the resources required by the to-be-executed task to the corresponding hardware components in the electronic device, so that the hardware components in the electronic device allocate the resources to the clients in the electronic device, so that the clients execute the to-be-executed task according to the connection relationship of each sub-resource pool in the resources.
[0135] Or, in a specific implementation, a hardware component in the electronic device sends information of a task to be executed to a program installed on the electronic device; the program installed on the electronic device determines a resource allocation strategy according to the information of the task to be executed, and sends the resource allocation strategy to a corresponding hardware component in the electronic device, and the hardware component allocates target resources for the task to be executed based on the resource allocation strategy, and executes the task to be executed based on the target resources.
[0136] It should be noted that since the first general-purpose electronic computer was invented, computer technology has developed rapidly in the past few decades. The rapid development of computer technology is due to the improvement of computer architecture and the development of computer production technology. The contribution of computer production technology to the development of computer technology has been stable; however, due to decades of improvement in computer architecture, the improvement space of computer architecture is becoming smaller and smaller, so any small improvement in computer architecture will have a relatively obvious impact on the performance of the processor and the development of computer technology.
[0137] The embodiments of the present application also provide an electronic device for implementing the above-mentioned Figure 2 task processing method and the above-mentioned Figure 3 resource allocation method. The schematic diagram of the composition structure of the electronic device is shown in Figure 9 , which at least includes a resource management unit 701 and a client 702.
[0138] In some embodiments, the resource management unit 701 in the electronic device determines resources required by a task to be executed;
[0139] The resource management unit 701 allocates the resources to the client 702 in the electronic device, so that the client 702 executes the task to be executed according to the connection relationship of each sub-resource pool in the resources.
[0140] In some embodiments, before the resource management unit 701 allocates the resources to the client 702, the resource management unit 701 confirms the connection relationship of the adjacent two sub-resource pools corresponding to the resources based on the order of executing the task to be executed;
[0141] Or, after the resource management unit 701 allocates the resources to the client 702, the client 702 confirms the connection relationship of the adjacent two sub-resource pools corresponding to the resources based on the order of executing the task to be executed.
[0142] In some embodiments, after the connection relationship of the adjacent two sub-resource pools corresponding to the resource is confirmed, the method further comprises: in response to the resource management unit 701 confirming the connection relationship of the adjacent two sub-resource pools corresponding to the resource, the resource management unit 701 confirms the switching strategy of all sub-resource pools based on the connection relationship of the adjacent two sub-resource pools.
[0143] In some embodiments, after the switching strategy of all sub-resource pools is confirmed, the method further comprises: the resource management unit 701 controls the switch of the connection network between the adjacent first sub-resource pool and the second sub-resource pool to be turned on based on the switching strategy of all sub-resource pools, so that when the client 702 executes the to-be-executed task, the data output by the first sub-resource pool is input to the second sub-resource pool.
[0144] In some embodiments, after the connection relationship of the adjacent two sub-resource pools corresponding to the resource is confirmed, the method further comprises: in response to the client 702 confirming the connection relationship of the adjacent two sub-resource pools corresponding to the resource, the client 702 confirms the switching strategy of all sub-resource pools based on the connection relationship of the adjacent two sub-resource pools.
[0145] In some embodiments, after the switching strategy of all sub-resource pools is confirmed, the method further comprises: the client 702 controls the switch of the connection network between the adjacent first sub-resource pool and the second sub-resource pool to be turned on based on the switching strategy of all sub-resource pools, so that when the client 702 executes the to-be-executed task, the data output by the first sub-resource pool is input to the second sub-resource pool.
[0146] In some embodiments, the resource management unit 701 receives the to-be-executed task sent by the client 702; based on the information of the to-be-executed task, the resource required by the to-be-executed task corresponding to at least one sub-resource pool is confirmed.
[0147] In some embodiments, the resource management unit 701 allocates the sub-resource in the at least one sub-resource pool corresponding to the resource required by the to-be-executed task in the at least one resource pool to the client 702.
[0148] In another aspect, the resource management unit 701 is configured to determine information of a to-be-processed task.
[0149] Based on the information of the to-be-processed task, a target resource is allocated to the to-be-processed task; the target resource is used for the processor core 702 to execute the to-be-processed task.
[0150] In some embodiments, the resource management unit 701 is configured to determine a resource allocation strategy based on the information of the to-be-processed task.
[0151] The target resource is allocated to the to-be-processed task based on the resource allocation strategy.
[0152] In some embodiments, the resource management unit 701 is configured to determine the intensity of the resource required by the to-be-processed task based on the information of the to-be-processed task.
[0153] The resource allocation strategy is determined based on the intensity of the resource required by the to-be-processed task.
[0154] In some embodiments, the resource management unit 701 is configured to determine the resource allocation strategy as a first resource allocation strategy in response to the intensity of the resource required by the to-be-processed task satisfying a first condition.
[0155] The resource allocation strategy is determined as a second resource allocation strategy in response to the intensity of the resource required by the to-be-processed task satisfying a second condition.
[0156] For the same type of resource, the size of the resource allocated based on the first resource allocation strategy is smaller than the size of the resource allocated based on the second resource allocation strategy.
[0157] In some embodiments, the resource management unit 701 is configured to, for each type of resource in the electronic device, divide the each type of resource into at least one sub-resource pool based on the resource allocation strategy.
[0158] The resource in one of the at least one sub-resource pool is determined as the target resource.
[0159] In some embodiments, the resource management unit 701 is a program installed on the electronic device, or the resource management unit 701 is a hardware component in the electronic device.
[0160] In some embodiments, the resource management unit 701 includes a program installed on the electronic device and a hardware component in the electronic device.
[0161] In some embodiments, the hardware component determines the information of the to-be-processed task and sends the information of the to-be-processed task to the program.
[0162] The program determines the resource allocation strategy based on the information of the to-be-processed task and sends the resource allocation strategy to the hardware component.
[0163] It should be noted that the description of the electronic device in the embodiments of the present application is similar to the description of the above task processing method or resource management method embodiments, has similar beneficial effects as the method embodiments, and therefore will not be described in detail. For technical details not described in the electronic device provided in the embodiments of the present application, they can be understood according to Figure 2 to Figure 8 the description of any figure.
[0164] The following describes an exemplary application of the electronic device provided in the embodiments of the present application. The electronic device provided in the embodiments of the present application can be implemented as an electronic device, which can be a server or a terminal device.
[0165] The server can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected through wired or wireless communication, and the embodiments of the present application do not limit this.
[0166] Referring to Figure 10 , Figure 10 is a structural schematic diagram of the electronic device 400 provided in the embodiments of the present application, Figure 10 The electronic device 400 shown in the figure includes at least one processor 410, a memory 450, and a bus 440. Each component in the electronic device 400 is coupled together through the bus 440. It can be understood that the bus 440 is used to realize the connection and communication between the components. The bus 440 includes not only a data bus, but also a power bus, a control bus, and a status signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the bus 440 in the figure. Figure 10
[0167] The processor 410 can be an integrated circuit chip with signal processing capability, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0168] The memory 450 stores executable instructions for implementing the resource management method provided in the embodiments of the present application. The resource management method can be executed by the processor 410. Figure 9 The resource management unit 701 in the illustrated electronic device is implemented by the processor 410. The memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 optionally includes one or more storage devices physically located in proximity to the processor 410.
[0169] In some embodiments, the memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or a subset or superset thereof.
[0170] In some embodiments, the electronic device 400 can further include:
[0171] an operating system 451 including a system program for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0172] a network communication module 452 for reaching other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including Bluetooth, wireless fidelity (WiFi), and universal serial bus (USB), etc.
[0173] The embodiments of the present application provide a computer readable storage medium storing executable instructions, wherein the executable instructions, when executed by a processor, will cause the processor to perform the task processing method and resource allocation method provided by the embodiments of the present application, for example, as shown in Figure 2 to Figure 7 the task processing method and resource allocation method.
[0174] In some embodiments, the computer readable storage medium can be a FRAM, a ROM, a PROM, an EPROM, an EEPROM, a flash memory, a magnetic surface memory, an optical disc, or a CD-ROM, etc. memory; or various devices including one or any combination of the above memories.
[0175] In some embodiments, the executable instructions can be in the form of programs, software, software modules, scripts or codes, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and can be deployed in any form, including being deployed as standalone programs or as modules, components, subroutines or other units suitable for use in computing environments.
[0176] As an example, the executable instructions can be deployed to execute on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed at multiple sites and interconnected through a communication network.
[0177] The embodiment of the present application provides a computer program product, which comprises computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the task processing method and the resource allocation method.
[0178] The above is only an embodiment of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement and improvement made within the spirit and scope of the present application shall be included in the protection scope of the present application.
Claims
1. A task processing method, characterized in that, The method is applied to a resource management unit of an electronic device. The resource management unit includes a branch prediction resource sub-management unit, an instruction fetch resource sub-management unit, a decoding resource sub-management unit, a renaming resource sub-management unit, and an execution resource sub-management unit. Resources allocated to the processor core include resources for each pipeline stage of the execution pipeline, including at least one of branch prediction resources, instruction fetch resources, decoding resources, renaming resources, and execution resources. The method includes: For each type of resource within the electronic device, the resource management unit divides each type of resource into at least one sub-resource pool based on the resource allocation strategy. Specifically, this includes: dividing each resource pool into sub-resource pools based on the resource allocation strategy using a minimum resource organization method, wherein the resources included in each sub-resource pool are the smallest units of that type of resource; or, dividing each resource pool into sub-resource pools using different sizes of organization methods based on the resource allocation strategy; wherein, the resource allocation strategy is determined based on the intensity of resources required by the task to be executed. The resource management unit within the electronic device determines the resources required for a task to be executed; specifically, this includes determining information about the task to be executed based on the task to be executed, and allocating target resources to the task to be executed based on the information about the task to be executed; the target resources are used by the processor core within the electronic device to execute the task to be executed; the task to be executed corresponds to a pipeline, which includes at least branch prediction, instruction fetch, decoding, renaming, and execution; The resource management unit or client confirms the connection relationship between two adjacent sub-resource pools corresponding to the resource based on the order in which the tasks to be executed are performed; In response to the resource management unit or client confirming the connection relationship between two adjacent sub-resource pools corresponding to the resource, the resource management unit or client confirms the on / off policy of all sub-resource pools based on the connection relationship between the two adjacent sub-resource pools. The resource management unit allocates the resources to the client within the electronic device, so that the client executes the task to be executed according to the connection relationship of each sub-resource pool in the resources; Based on the switching strategy of all sub-resource pools, the resource management unit or client controls the opening and closing of the connection network between adjacent first and second sub-resource pools, so that when the resource management unit or client executes the task to be executed, the data output by the first sub-resource pool is input to the second sub-resource pool. The resources include at least one sub-resource pool corresponding to at least one resource pool.
2. The method according to claim 1, characterized in that, The resource management unit within the electronic device determines the resources required for the task to be executed, including: The resource management unit receives the tasks to be executed sent by the client; Based on the information of the task to be executed, at least one sub-resource pool corresponding to the resources required by the task to be executed is identified.
3. The method according to claim 2, characterized in that, The resource management unit allocates the resources to clients within the electronic device, including: The resource management unit allocates sub-resources from at least one sub-resource pool corresponding to the resources required by the task to be executed from the at least one resource pool to the client.
4. An electronic device, characterized in that, The electronic device includes a resource management unit and a client. The resource management unit includes a branch prediction resource management unit, an instruction fetch resource management unit, a decoding resource management unit, a renaming resource management unit, and an execution resource management unit. The resources allocated to the processor core include resources for each pipeline stage of the execution pipeline, including at least one of branch prediction resources, instruction fetch resources, decoding resources, renaming resources, and execution resources. The resource management unit is configured to, for each type of resource within the electronic device, divide each type of resource into at least one sub-resource pool based on the resource allocation strategy; specifically, this includes: dividing each resource pool into sub-resource pools based on the resource allocation strategy using a minimum resource organization method, wherein the resources included in each sub-resource pool are the smallest units of that type of resource; or, dividing each resource pool into sub-resource pools using different sizes of organization methods based on the resource allocation strategy; wherein, the resource allocation strategy is determined based on the intensity of resources required by the task to be executed; The system determines the resources required for the task to be executed; based on the order in which the task to be executed is performed, it confirms the connection relationship between two adjacent sub-resource pools corresponding to the resources; in response to confirming the connection relationship between the two adjacent sub-resource pools corresponding to the resources, it confirms the switching strategy of all sub-resource pools based on the connection relationship between the two adjacent sub-resource pools; it allocates the resources to a client in the electronic device so that the client executes the task to be executed according to the connection relationship of each sub-resource pool in the resources; based on the switching strategy of all sub-resource pools, it controls the switching on of the connection network between adjacent first and second sub-resource pools so that when the task to be executed is performed, the data output from the first sub-resource pool is input to the second sub-resource pool; The resource management unit is specifically used to determine the information of the task to be executed based on the task to be executed, and to allocate target resources to the task to be executed based on the information of the task to be executed; the target resources are used by the processor core in the electronic device to execute the task to be executed; the task to be executed corresponds to a pipeline, which includes at least branch prediction, instruction fetch, decoding, renaming and execution; The resources include at least one sub-resource pool corresponding to at least one resource pool.
5. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-3.
6. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-3.
7. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-3.
Citation Information
Patent Citations
A data processing method and device suitable for a heterogeneous system
CN109885388A
Dynamic allocation of resources within network devices
US20180295060A1