Resource allocation method and device, electronic equipment and storage medium

By obtaining and analyzing resource requirements information for task type, the balanced allocation of resources is achieved, the resource deadlock problem is solved, and the efficiency of memory page creation is improved.

CN120276853APending Publication Date: 2025-07-08SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510386281.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

In the prior art, the resource deadlock problem caused by unbalanced resource allocation, especially when the number of requests is large, the first task type allocates resources faster, while the subsequent task type resources are insufficient and the processing cannot be completed, resulting in the resource pool falling into a deadlock.

Method used

By obtaining resource requirements information for multiple task types, and after completing the memory page creation operation corresponding to resource requirements information for all task types, the control blocks of the next requested resource allocation stage are processed to achieve balanced resource allocation.

Benefits of technology

Avoid resource deadlock problems and improve the efficiency of memory page creation, ensuring that resources can be allocated balancedly to different task types, and avoiding insufficient resources caused by the use of too many resources in a specific task type.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276853A_ABST
    Figure CN120276853A_ABST
Patent Text Reader

Abstract

The invention discloses a resource allocation method and device, electronic equipment and a storage medium, and relates to the technical field of storage, and the method comprises the steps that a control block in a resource allocation stage comprises resource demand information of multiple task types corresponding to the same request instead of the resource demand information of one task type. And correspondingly, applying resources to a resource management engine according to the resource demand information of each task type to obtain resource allocation information of each task type, creating a memory page corresponding to each task type based on the resource allocation information, and after the memory pages corresponding to all the task types are completed, storing the memory pages corresponding to all the task types in the resource management engine. And processing the next control block of the resource allocation stage. Under the processing, resources occupied by different task types are balanced, the problem that a specific task type occupies more resources can be avoided, and then the problem of resource deadlock can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage technology, and in particular, to a resource allocation method, apparatus, electronic device, and storage medium. Background Art

[0002] In the field of storage technology, after receiving a request, a resource management system will create a control page (Control Page) for the request. Among them, the control page includes multiple control blocks (Control Block), and through these control blocks, a series of operation steps required for a request can be completed.

[0003] Generally, in the resource allocation stage of a task chain corresponding to a request, each task type corresponds to a control block. The memory management engine must execute the resource allocation operations corresponding to each control block in the order of task types in sequence before it can start executing subsequent task operations. After completing all task operations, the memory resources are released in sequence. Since the processing of resource allocation for the first task type is relatively fast, in the case of a large number of requests, most resources will be allocated to the first task type, and a small part of the resources will be allocated to the last task type. In such a mechanism, the following situation will occur: currently, resources need to be allocated to the last task type of the earliest request, but the resource pool is full. At this time, it is necessary to release the resources occupied by the first few task types in this request to allocate resources. In this way, since releasing resources requires ending the task chain corresponding to this request, and this task chain cannot proceed with subsequent stage processing due to the unfinished operations in the resource allocation stage, it falls into an infinite loop, that is, the problem of resource deadlock is caused. Summary of the Invention

[0004] This application provides a resource allocation method, apparatus, electronic device, storage medium, and program product to solve the problem of resource deadlock.

[0005] This application provides a resource allocation method, including:

[0006] When it is determined that the resource allocation operation corresponding to the first control block is completed, obtain the second control block, where the first control block is the control block in the resource allocation stage corresponding to the first request, the second control block is the control block in the resource allocation stage corresponding to the second request, and the second request is the next request after the first request;

[0007] Parse the first control block to obtain the resource requirement information corresponding to various task types;

[0008] Apply for resources from the resource management engine according to the resource requirement information corresponding to each task type;

[0009] When receiving the resource allocation information sent by the resource management engine, create memory pages corresponding to the task types based on the resource allocation information;

[0010] After creating memory pages corresponding to each of the task types, determine that the resource allocation operation corresponding to the second control block is completed.

[0011] This application also provides a memory page creation device, including:

[0012] An acquisition module, configured to acquire a second control block when it is determined that the resource allocation operation corresponding to the first control block is completed, where the first control block is the control block in the resource allocation stage corresponding to the first request, the second control block is the control block in the resource allocation stage corresponding to the second request, and the second request is the next request after the first request;

[0013] An analysis module, configured to analyze the first control block to obtain resource requirement information corresponding to various task types;

[0014] A claiming module, configured to claim resources from the resource management engine according to the resource requirement information corresponding to each of the task types;

[0015] A creation module, configured to create memory pages corresponding to the task types based on the resource allocation information when receiving the resource allocation information sent by the resource management engine;

[0016] The determination module is further configured to determine that the resource allocation operation corresponding to the second control block is completed after creating memory pages corresponding to each of the task types.

[0017] This application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above resource allocation methods when executing the computer program.

[0018] This application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above resource allocation methods are implemented.

[0019] This application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any of the above resource allocation methods are implemented.

[0020] Through the present application, the resource requirement information of multiple task types corresponding to one request is added to a control block. One control block corresponds to a first-level pipeline. Only after the memory page creation operations corresponding to all the resource requirement information of the task types in the control block are completed, the control block in the resource allocation phase corresponding to the next request will be processed. In this way, resources can be allocated to different task types in a balanced manner, avoiding the resource deadlock problem caused by some specific task types occupying more resources, where some requests are earlier but due to insufficient resources, resources cannot be allocated to the task types with a later order in the request. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0022] Figure 1 Schematic diagram of a task chain provided by an embodiment of the present application;

[0023] Figure 2 Schematic diagram of the resource allocation situation of a resource pool provided by an embodiment of the present application;

[0024] Figure 3 Another schematic diagram of the resource allocation situation of a resource pool provided by an embodiment of the present application;

[0025] Figure 4 Another schematic diagram of the resource allocation situation of a resource pool provided by an embodiment of the present application;

[0026] Figure 5 Another schematic diagram of the resource allocation situation of a resource pool provided by an embodiment of the present application;

[0027] Figure 6 Schematic diagram of the data flow of a task chain provided by an embodiment of the present application;

[0028] Figure 7 Schematic diagram of the flow of a resource allocation method provided by an embodiment of the present application;

[0029] Figure 8 Another schematic diagram of the data flow of a task chain provided by an embodiment of the present application;

[0030] Figure 9 Another schematic diagram of the resource allocation situation of a resource pool provided by an embodiment of the present application;

[0031] Figure 10 Schematic diagram of the flow of creating a memory page provided by an embodiment of the present application;

[0032] Figure 11 Another flowchart for creating memory pages provided by the embodiments of the present application;

[0033] Figure 12 A schematic diagram of the efficiency of serial creation of memory pages provided by the embodiments of the present application;

[0034] Figure 13 A schematic diagram of the efficiency of parallel creation of memory pages provided by the embodiments of the present application;

[0035] Figure 14 A flowchart of a memory page creation device provided by the embodiments of the present application;

[0036] Figure 15 A schematic diagram of the structure of an electronic device provided by the embodiments of the present application. Detailed implementation manners

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

[0038] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements includes not only those elements but also other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0039] In order to enable those skilled in the art of this technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0040] Next, the professional terms involved in the embodiments of the present application will be explained.

[0041] Control Page (CP): A set of commands required to execute a complete task chain corresponding to a request. A control block (CB) corresponds to a command in the control page.

[0042] Head pointer: Used to indicate the address information corresponding to the latest allocated resource in the resource pool.

[0043] Tail pointer: Used to indicate the address information corresponding to the resource that was first allocated in the resource pool.

[0044] Resource pool: Includes the address information corresponding to the unoccupied resources.

[0045] In the field of storage technology, after receiving a request sent by the central processing unit, the resource management system can process the request and execute relevant business operations. These business operations require resources. Therefore, a resource allocation operation needs to be performed first so that the hard disk can perform subsequent data processing based on the relevant data stored in the allocated resources and operate on the data stored in its own storage medium based on the processing results.

[0046] Such as Figure 1 shown, the task chain can include multiple task stages. These task stages are arranged in the order of execution as follows: the resource allocation (Allocation, Alloc) stage corresponding to task type A (corresponding to Figure 1 Alloc CP1-A in it), the resource allocation stage corresponding to task type H (corresponding to Figure 1 Alloc CP1-H in it), the resource allocation stage corresponding to task type V (corresponding to Figure 1 Alloc CP1-V in it), the working stage, and the resource release (Deallocation, Dealloc) stage. Taking a task chain as an example, the resources allocated for different task types are used to store data with different functions. These data with different functions can be used to construct a complete data corresponding to the request.

[0047] Next, taking the resource allocation process of multiple task chains as an example, the changes in the resource allocation situation in the resource pool and the reasons for finally evolving into a deadlock situation will be described. In Figures 2 to 5 where A i represents the resource allocated to task type A in task chain i, H i represents the resource allocated to task type H in task chain i, and V i represents the resource allocated to task type V in task chain i.

[0048] After ending the resource allocation stages corresponding to task type A, task type H, and task type V in task chain 1 respectively, the resource allocation situation in the resource pool can be as Figure 2 shown.

[0049] As time goes by, the resource allocation engine sequentially allocates resources to task type A, task type H, and task type V corresponding to task chain 2 and task chain 3 respectively. And the resource allocation stage and the working stage of task chain 1 are both completed and enter the resource release stage. At this time, the resource release engine drives the tail pointer to sequentially recycle A1, H1, and V1. The resource allocation situation in the resource pool can be asFigure 3 as shown

[0050] Since there is a sequence in the resource allocation phases of the three task types, that is, first is the resource allocation phase of task type A, then that of task type H, and finally that of task type V. Since the resource allocation speed of task type A is faster, that of task type H is the second, and that of task type V is the slowest. Therefore, as time goes by, most of the resources in the resource pool are allocated to task type A, a small amount of resources are allocated to task type H, and even fewer resources are allocated to task type V. The resource allocation situation of the resource pool can be as Figure 4 shown. Among them, the resource allocation of task type A has reached task chain 10( Figure 4 A in 10 ), the resource allocation of task type H has only reached task chain 7( Figure 4 H7 in Figure 4 ), and the resource allocation of task type V has reached task chain 5(

[0051] V5 in Figure 4 ).

[0051] When task chains 3 to 5 are completed, the resources they occupy are released. As Figure 5 shown, the resources occupied by some task types corresponding to task chains 6 to 14 have been allocated resources. Among them, the A task type and H task type of task chain 6 are allocated resources. Next, resources need to be allocated to the V task type of task chain 6. However, the current resource pool is in a full-load state, and the tail pointer points to A6, that is, to allocate resources to the V task type of task chain 6, A6 needs to be recycled first. But since the V task type of task chain 6 has not been allocated resources, the subsequent working phases of task chain 6 cannot be executed, resulting in a situation of resource pool deadlock.

[0052] As Figure 6 shown, the resource management system may include a CP creation engine, a work queue management engine, a resource allocation engine, a work engine, a resource release engine, a resource management engine, and a resource pool. Among them, the work queue management engine is used to manage the task execution process of task chains, including a task resource allocation queue, a work engine processing queue, and a task resource release queue. Each element in the queue can include the address information of a CB. For example, Figure 6 CP1, CPi-A, CPi-H, CPi-V in , where i is 1, 2, 3, 4, 5, CP1. The work engine can include one or more. Here, one is taken as an example for illustration.

[0053] Under the above resource allocation mechanism and the architecture of the resource management system, taking the execution process of a complete task chain as an example, the complete execution process of the task chain will be described in detail below.

[0054] Every time the CP creation engine receives a request, it can create a CP for the request, and the CP can include multiple CBs. The CP creation engine sequentially sends the address information of the CBs corresponding to the resource allocation phase to the work queue management engine, and the work queue management engine adds the address information of the CBs to the task resource allocation queue ( Figure 6 in process ① in Figure 6 ). The work queue management engine, according to the first-in, first-out rule, first sends CP1-A to the resource allocation management engine (

[0055] in process ② in Figure 6 ). The resource allocation engine reads the corresponding CB1 from the address information included in CP1-A, extracts the resource requirement information corresponding to task type A from it, and sends it to the resource management engine. The resource management engine determines whether to perform a resource allocation operation according to the resource requirement information of task type A and the remaining resource amount in the resource pool. If so, the resource management engine allocates resources for task type A and feeds back the resource allocation information to the resource allocation engine (

[0056] in process ③ in Figure 6 ), and the resource allocation engine creates a memory page corresponding to task type A according to the resource allocation information.

[0057] When the resource allocation engine determines that the memory page corresponding to task type A has been created, it can extract the address information of CB2 from the specified field of CB1 and feed it back to the work queue management engine. The work queue management engine can add the address information of CB2 (CP1-H) to the work engine processing queue ( Figure 6 in process ④ in

[0058] ). It can be seen from such a processing method that allocating resources for task types H and V requires passing through the resource allocation operation of the previous task type, that is, it requires passing through more data transfer buses, and the resource allocation speed is slower. Figure 6 In the process of creating the memory page corresponding to task type A, the work queue management engine will receive the address information of the CBs in the resource allocation phase of the next request and add it to the task resource allocation queue. Therefore, it can be seen from Figure 6CP11) in is added to the processing queue of the working engine ( Figure 6 Process ⑩) in. When it's its turn to be processed, it is sent to the working engine ( Figure 6 Process in ). The working engine can, based on the address information of CB4, read CB4 and execute corresponding tasks based on the information contained in CB4. After completing the tasks, it extracts CB5 from CB4 (corresponding to Figure 6 CP12) in and feedbacks the address information to the working queue management engine. The working queue management engine can add the address information of CB5 to the resource release queue ( Figure 6 Process in ). The resource release queue extracts the memory page information corresponding to the request from CB5 based on the address information of CB5 and feedbacks it to the resource management engine ( Figure 6 Process in ). The resource management engine performs corresponding resource release operations ( Figure 6 Process in ).

[0059] To solve the above resource deadlock problem, the present application provides a resource allocation method, which can be executed by the above resource allocation engine. As Figure 7 shown, the resource allocation method may include the following specific steps:

[0060] Step S701, when it is determined that the resource allocation operation corresponding to the first control block is completed, obtain the second control block.

[0061] Among them, the first control block may be the control block in the resource allocation stage corresponding to the first request, the second control block may be the control block in the resource allocation stage corresponding to the second request, and the second request may be the next request after the first request.

[0062] Specifically, after the resource allocation engine completes the resource allocation operation corresponding to each control block, it can, according to the address information included in the control block, obtain the next control block after the control block. Correspondingly, it may specifically include the following steps:

[0063] Step 1, receive the target address information sent by the task queue management engine.

[0064] Step 2, read the second control block from the storage location corresponding to the target address information.

[0065] Specifically, according to the principle of first in first out, the task queue management engine extracts the address information of the control block from the task resource allocation queue it manages and sends it to the resource allocation engine. The resource allocation engine can receive the address information of the control block, store it in its own queue, and also based on the first in first out rule, when it is the turn to process the address information of the control block, it extracts the address information of the control block from it. For example, when the first control block includes resource requirement information corresponding to multiple task types, after the resource allocation engine receives the notification that the memory page creation corresponding to each task type is completed, it can determine that the resource allocation operation corresponding to the first control block is completed. The resource allocation engine can extract the earliest target address information from its own queue, and according to the target address information, read the second control block from the storage location corresponding to the target address information.

[0066] Step S702, parse the first control block to obtain the resource requirement information corresponding to multiple task types.

[0067] Specifically, the resource allocation engine can parse the first control block and extract the resource requirement information corresponding to each task type among multiple task types from the target field of the first control block.

[0068] Step S703, apply for resources from the resource management engine according to the resource requirement information corresponding to each task type.

[0069] Among them, the resource requirement information corresponding to each task type may include the resource requirement quantity corresponding to this task type.

[0070] Specifically, the resource allocation engine can obtain the resource allocation information by interacting with the resource management engine. Among them, the resource allocation information may be the resource allocation information corresponding to the total resource requirement quantity, including multiple address information allocated to all task types, or it may also be the resource allocation information corresponding to one task type, including multiple address information corresponding to this task type.

[0071] The resource allocation engine can interact with the resource management engine in the following two ways:

[0072] Method 1, determine the total resource requirement quantity according to the resource requirement quantity included in the resource requirement information corresponding to each task type. Generate a resource application request according to the total resource requirement quantity and send it to the resource management engine.

[0073] Specifically, the resource allocation engine can determine the total resource demand corresponding to the second control block according to the resource demands corresponding to each task type. In this way, the resource allocation engine can add the total resource demand to the first preset field of the resource application request according to the pre-configured request generation rule and send it to the resource management engine. When receiving the resource application request, the resource management engine can extract the total resource demand from the first preset field of the resource application request. Information such as a head pointer and a tail pointer is stored in the resource management engine. Accordingly, the remaining resource amount can be calculated based on the address information pointed to by the head pointer and the tail pointer, and it can be determined whether the total resource demand is less than or equal to the remaining resource amount. If so, the resource allocation engine can select multiple address information that matches the total resource demand from the address information corresponding to all unoccupied resources included in the resource pool as the resource allocation information and send it to the resource allocation engine. Thus, the resource allocation engine completes the resource application.

[0074] Through the resource application operation of Method 1, the resource allocation operation is only executed when the remaining resource amount can meet the resource demands corresponding to all task types respectively, which can avoid the resource deadlock problem.

[0075] Method 2: Generate resource application requests corresponding to each task type according to the resource demands included in the resource demand information corresponding to each task type. According to the pre-configured resource allocation order corresponding to each task type, sequentially send the resource application requests corresponding to each task type to the resource management engine.

[0076] Specifically, for each task type, the resource allocation engine can add the resource demand corresponding to the task type to the second preset field of the resource application request according to the pre-configured request generation rule to generate a resource application request corresponding to the task type. The resource allocation engine can sequentially send the resource application requests corresponding to each task type to the resource management engine according to the resource allocation order corresponding to each task type and the arbitration rule of the data transmission bus. Whenever receiving a resource application request, the resource management engine can extract the resource demand corresponding to a task type from the second preset field of the resource application request.

[0077] The resource management engine stores information such as a head pointer and a tail pointer. Accordingly, the remaining resource amount can be calculated based on the address information pointed to by the head pointer and the tail pointer, and it can be determined whether the required resource amount extracted is less than or equal to the remaining resource amount. If so, the resource allocation engine can, according to the required resource amount extracted, select multiple address information items that match the required resource amount extracted from the address information corresponding to all unoccupied resources included in the resource pool as resource allocation information and send it to the resource allocation engine. In this way, the resource allocation engine can obtain the resource allocation information corresponding to a task type.

[0078] After the resource management engine completes the resource allocation operation corresponding to a task type, it can update the head pointer, and after completing the operation of releasing resources, it can update the tail pointer. When the resource management engine receives a resource application request again, it can perform a resource allocation operation again according to a similar process.

[0079] When the resource allocation engine receives the resource allocation information corresponding to all task types of the second control block respectively, it determines that the operation of applying for resources corresponding to the second control block is completed.

[0080] Through the operation of applying for resources in Method 2, as long as the remaining resource amount meets the resource requirements of a task type, resources will be allocated immediately, which can improve the efficiency of resource application and further improve the efficiency of memory page creation. And subsequently, it is only after completing the memory page creation operations corresponding to all task types that the next control block in the resource allocation stage will be processed. That is, combining the processing in Method 2 in this step can avoid resource deadlock problems and improve processing efficiency.

[0081] Step S704, when receiving the resource allocation information sent by the resource management engine, create a memory page corresponding to the task type based on the resource allocation information.

[0082] Specifically, due to the different ways in which the resource allocation engine applies for resources in step S703, accordingly, the resource allocation information received by the resource allocation engine is different. Corresponding to the two methods in step S703, this step also provides two processing methods as follows:

[0083] Method 1 (corresponding to Method 1 in step S703)

[0084] Step 1, construct a physical area page list corresponding to each task type according to the required resource amount corresponding to each task type and the multiple address information items included in the resource allocation information.

[0085] Step 2: Parallelly write the physical region page list corresponding to each task type to a preset storage location in the memory via a data transmission bus to create memory pages corresponding to each task type.

[0086] For example, the data transmission bus can be an AXI (Advanced eXtensible Interface) bus.

[0087] Specifically, upon receiving the resource allocation information, the resource allocation engine can extract multiple address information therefrom. Furthermore, according to the resource demand corresponding to each task type, the multiple address information can be divided to obtain multiple groups of address information with the same number of groups as the number of task type categories. The resource allocation engine can construct a physical region page list (Physical Region PageList) corresponding to the second task type based on the target group address information corresponding to the second task type. For example, the physical region page list corresponding to task type A can be called an absolute list (Absolute List, A-List), the physical region page list corresponding to task type H can be called a horizontal list (Horizontal List, H-List), and the physical region page list corresponding to task type V can be called a vertical list (Vertical List, V-List).

[0088] Finally, after constructing the physical region page list corresponding to each task type, when the data transmission bus is in a preset mode, the resource allocation engine can parallelly write the physical region page list corresponding to each task type to a preset storage location in the memory via the data transmission bus. Thus, the resource allocation engine creates memory pages corresponding to each task type. In this way, when the hard disk controller processes data, it can perform data transfer operations based on the address information recorded in the memory pages corresponding to each task type. Here, the preset mode means that the data transmission bus can transmit the next write request without receiving a response notification for the completion of the previous write data.

[0089] By processing in Method 1 and creating memory pages in parallel, the efficiency of creating memory pages can be improved.

[0090] Method 2 (corresponding to Method 2 in step S703)

[0091] Step 1: Upon receiving each resource allocation information, construct a physical region page list of the target task type corresponding to the received resource allocation information according to the multiple address information included in the received resource allocation information.

[0092] Here, the target task type is one of multiple task types.

[0093] Step 2, write the physical area page list of the target task type to a preset storage location in the memory via the data transfer bus to create a memory page corresponding to the target task type.

[0094] Specifically, each time the resource allocation engine receives a resource allocation information, it can extract multiple address information from the received resource allocation information and construct a physical area page list corresponding to the target task type based on this. Further, the resource allocation engine can write the physical area page list corresponding to the target task type to a preset storage location in the memory. In a similar manner, the resource allocation engine can complete the memory page creation operations for all task types corresponding to the second control block.

[0095] Step S705, after creating the memory pages corresponding to each task type, determine that the resource allocation operation corresponding to the second control block is completed.

[0096] Specifically, each time a memory page creation operation for a task type is completed, the resource allocation engine can receive a memory page creation completion notification corresponding to the task type. After receiving the memory page creation completion notifications corresponding to all task types respectively, the resource allocation engine can determine that the resource allocation operation corresponding to the second control block is completed, and obtain the fourth control block, and execute the resource allocation operation corresponding to the fourth control block according to the processing from step S701 to step S705.

[0097] In some alternative embodiments, after determining that the resource allocation operation corresponding to the second control block is completed, the resource allocation engine can also extract the address information corresponding to the third control block from the second control block, where the third control block is the control block corresponding to the working stage after the resource allocation stage of the second request; send the address information corresponding to the third control block to the task queue management engine for executing the tasks in the working stage.

[0098] Specifically, after the resource allocation engine receives the memory page creation completion notifications corresponding to each task type, it can determine that the resource allocation operation corresponding to the second control block is completed. At this time, the resource allocation engine can extract the address information corresponding to the third control block from the second control block and send the address information corresponding to the third control block to the work queue management engine as the memory page creation completion notification corresponding to the first control block. In this way, the work queue management engine distributes the address information of the third control block to the work engine, and the work engine reads the third control block based on the address information of the third control block and executes the subsequent work tasks.

[0099] In the resource allocation method of the embodiments of the present application, the resource requirement information of multiple task types corresponding to one request is added to a control block. One control block corresponds to one-level pipelining. Only after the memory page creation operations corresponding to the resource requirement information of all task types in the control block are completed, the control block in the resource allocation stage corresponding to the next request will be processed. In this way, resources can be allocated to different task types in a balanced manner, avoiding the problem of resource deadlock caused by some specific task types occupying more resources, and some requests being in the front but unable to allocate resources to the task types with lower rankings in the request due to insufficient resources.

[0100] In some optional embodiments, resource counters corresponding to each task type can be preset in the resource allocation engine. Taking the third task type as an example, after each resource allocation operation for the third task type is completed, the count value of the resource counter corresponding to the third task type can be updated (it can be increased by a first preset value). When it is determined that the count value of the resource counter corresponding to the third task type is equal to the target value, the resource requirement information corresponding to the third task type will no longer be sent. In addition, after each operation of releasing resources is monitored, the resource allocation engine can update the resource counters corresponding to all task types (decrease the first preset value respectively). In this way, by restricting the resources that different task types can occupy and updating the count values in real time, it is possible to avoid some task types from occupying too many resources, and thus, the problem of resource deadlock can be avoided. The following is a detailed description of this design.

[0101] Step 1, when it is determined that the resource allocation operation corresponding to the first control block is completed, obtain the second control block.

[0102] Among them, under this design, the first control block can be the control block in the resource allocation stage that matches both the first request and the fourth task type, and the second control block can be the control block in the resource allocation stage that matches both the second request and the fifth task type. And the first request and the second request can be the same request, or the second request can be a request after the first request. The fourth task type and the fifth task type can both be any one of multiple task types.

[0103] The specific processing of Step 1 is similar to the specific processing of Step S701, and will not be elaborated here.

[0104] Step 2, parse the second control block to obtain the resource requirement information corresponding to the fifth task type.

[0105] Step 3, when it is determined that the count value of the resource counter corresponding to the fifth task type is less than the target value, send the resource requirement information corresponding to the fifth task type to the resource management engine.

[0106] Step 4: After receiving the resource allocation information corresponding to the fifth task type sent by the resource management engine, create a memory page corresponding to the fifth task type based on the resource allocation information corresponding to the fifth task type, that is, create a memory page corresponding to the second control block.

[0107] For the specific processing of Step 4, reference can be made to the specific processing of Method 2 in Step S703 above, which will not be elaborated here.

[0108] Step 5: Send a notification indicating that the creation of the memory page corresponding to the second control block is completed to the task queue management engine, so as to notify the task queue management engine to issue the next control block in the resource allocation phase.

[0109] Or,

[0110] Step 6: When it is determined that the count value of the resource counter corresponding to the fifth task type is equal to the target value, send a preset notification to the task queue management engine, so as to notify the task queue management engine to issue the next control block in the resource allocation phase.

[0111] Through Step 6, when resource allocation operations for the fifth task type cannot be performed, resource allocation operations for other task types can also be executed, improving the task processing efficiency.

[0112] Next, a specific example is used to elaborate in detail the task chain process including the improved resource allocation method described above. The architecture of the resource management system is similar to Figure 6 and there are differences in data flow processing, as Figure 8 shown.

[0113] Each time the CP creation engine receives a request, it can create a CP for the request. The CP can include multiple CBs. Among them, there is only one CB corresponding to the resource allocation phase of one request, and it includes the resource requirement information corresponding to task types A, H, and V respectively. The CP creation engine sequentially issues the address information of the CB corresponding to the resource allocation phase to the work queue management engine, and the work queue management engine adds the address information of the CB in the resource allocation phase to the task resource allocation queue ( Figure 8 Process ① in). The work queue management engine, according to the first-in, first-out rule, first issues CP1-AHV to the resource allocation management engine ( Figure 8 Process ② in).

[0114] The resource allocation management engine reads the corresponding CB6 from the address information included in CP1-AHV, extracts the resource requirement information corresponding to the A task type, H task type, and V task type from CB6, and sends it to the resource management engine. The resource management engine determines whether to perform a resource allocation operation based on the resource requirement information of these three task types and the remaining resource amount in the resource pool. If so, the resource management engine allocates resources for these three task types respectively, and feeds back the resource allocation information corresponding to these three task types to the resource allocation engine( Figure 8 in process ③), and the resource allocation engine creates memory pages corresponding to each task type according to the resource allocation information corresponding to each task type.

[0115] When the resource allocation engine determines that the memory pages corresponding to each task type are created, it can extract the address information of CB7 from the specified field of CB6 and feed it back to the work queue management engine. The work queue management engine can add the address information of CB7 (corresponding Figure 8 to CP13) to the work engine processing queue( Figure 8 in process ④), and when it is its turn to be processed, it is sent down to the work engine( Figure 8 in process ⑤). The work engine can read CB7 according to the address information of CB7 and execute the corresponding task based on the information contained in CB7. After completing the task, it extracts the address information of CB8 (corresponding Figure 8 to CP14) from CB7 and feeds it back to the work queue management engine. The work queue management engine can add the address information of CB8 to the resource release queue( Figure 8 in process ⑥), and the resource release queue extracts the memory page information corresponding to each task type from CB8 according to the address information of CB8 and feeds it back to the resource management engine( Figure 8 in process ⑦), and the resource management engine performs the corresponding resource release operation( Figure 8 in process ⑧).

[0116] Under such a mechanism, as Figure 8 shown by CP1-AHV, CP2-AHV, CP3-AHV, CP4-AHV in the task resource allocation queue, after the resource allocation engine completes the resource allocation operations for all task types corresponding to CP1, it will execute the resource allocation operations for the next CP. Correspondingly, the resource allocation situation in the resource pool can be as Figure 9 shown, with the resources of the three task types evenly allocated. Therefore, by modifying the resource operations of the three task types to the same-level pipeline, the problem of resource deadlock can be avoided.

[0117] As Figure 10As shown, the resource allocation engine can first claim the resources corresponding to task types A, H, and V respectively, and create memory pages corresponding to each task type in parallel. Or, as Figure 11 As shown, the resource allocation engine can claim the resources corresponding to task types A, H, and V respectively in parallel and create memory pages corresponding to each task type. During the process of creating memory pages, when the AXI bus is in the Outstanding mode, the resource allocation engine can write the physical area page list of a task type to a preset storage location in the memory to complete the corresponding memory page creation operation. It determines that the resource allocation operation corresponding to CB6 is completed until it receives the memory page response notification corresponding to each task type. Among them, the Outstanding mode allows the initiator to transmit the next request without waiting for the previous request to complete.

[0118] As Figure 12 shown, the resource allocation engine first initiates an A write request. After the AXI bus responds to the A write request, the resource allocation engine writes data (the physical area page list corresponding to task type A) through the AXI bus. After receiving the AXI write response Bresp (a response signal, which can be the above-mentioned memory page creation completion notification), it then initiates an H write request. After the AXI bus responds to the H write request, the resource allocation engine writes data (the physical area page list corresponding to task type B) through the AXI bus. After receiving the AXI write response Bresp, it then initiates a V write request. After the AXI bus responds to the V write request, the resource allocation engine writes data (the physical area page list corresponding to task type B) through the AXI bus. After receiving the AXI write response Bresp, it determines that the memory page creation operation corresponding to CB6 is completed. In the serial mode of creating memory pages, the time occupied is longer and the efficiency is lower. As Figure 13 shown, the resource allocation engine sequentially initiates an A write request, an H write request, and a V write request at extremely short intervals. After the AXI bus responds to the corresponding request, it starts to write data without waiting to receive the write response Bresp corresponding to the previous write request before initiating the next request, which can improve the memory page creation efficiency.

[0119] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0120] An embodiment of the present application also provides a resource allocation device, as Figure 14 shown, including:

[0121] An acquisition module 1410, configured to acquire a second control block when it is determined that the resource allocation operation corresponding to the first control block is completed, where the first control block is the control block in the resource allocation phase corresponding to the first request, the second control block is the control block in the resource allocation phase corresponding to the second request, and the second request is the next request after the first request;

[0122] An analysis module 1420, configured to analyze the first control block to obtain resource requirement information corresponding to multiple task types;

[0123] A claim module 1430, configured to claim resources from a resource management engine according to the resource requirement information corresponding to each task type;

[0124] A creation module 1440, configured to create memory pages corresponding to task types based on the resource allocation information when receiving the resource allocation information sent by the resource management engine;

[0125] A determination module 1450, configured to determine that the resource allocation operation corresponding to the second control block is completed after the memory pages corresponding to each task type are created.

[0126] In some alternative embodiments, the acquisition module 1410 is specifically configured to:

[0127] Receive target address information sent by a task queue management engine;

[0128] Read the second control block from a storage location corresponding to the target address information.

[0129] In some alternative embodiments, the claim module 1430 is specifically configured to:

[0130] Determine the total resource requirement according to the resource requirements included in the resource requirement information corresponding to each task type;

[0131] Generate a resource claim request according to the total resource requirement and send it to the resource management engine.

[0132] In some alternative embodiments, the creation module 1440 is specifically configured to:

[0133] Construct a physical area page list corresponding to each task type according to the resource requirements corresponding to each task type and the multiple address information included in the resource allocation information;

[0134] Parallelly write the physical area page list corresponding to each task type to a preset storage location in the memory through a data transmission bus to create the memory pages corresponding to each task type.

[0135] In some alternative embodiments, the application module 1430 is specifically configured to:

[0136] Generate a resource application request corresponding to each task type according to the resource demand quantity included in the resource demand information corresponding to each task type;

[0137] According to the pre-configured resource allocation order corresponding to each task type, sequentially send the resource application requests corresponding to each task type to the resource management engine.

[0138] In some alternative embodiments, the creation module 1440 is specifically configured to:

[0139] For each received resource allocation information, construct a physical area page list of the target task type corresponding to the received resource allocation information according to the multiple address information included in the received resource allocation information, where the target task type is one of the multiple task types;

[0140] Write the physical area page list of the target task type into a preset storage location in the memory through the data transmission bus to create a memory page corresponding to the target task type.

[0141] In some alternative embodiments, the acquisition module 1410 is further configured to:

[0142] Extract the address information corresponding to the third control block from the second control block, where the third control block is the control block corresponding to the working stage after the resource allocation stage of the second request;

[0143] Send the address information corresponding to the third control block to the task queue management engine for executing the tasks of the working stage.

[0144] For the description of the features in the embodiments corresponding to the resource allocation device, reference can be made to the relevant description of the embodiments corresponding to the resource allocation method, which will not be elaborated here one by one.

[0145] An embodiment of the present application further provides an electronic device, as Figure 15 shown, including a memory 10 and a processor 20. A computer program is stored in the memory 10, and the processor 20 is configured to run the computer program to execute the steps in any of the above embodiments of the resource allocation method.

[0146] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the steps in any of the above embodiments of the resource allocation method when running.

[0147] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memory (ROM), random access memory (RAM), external hard drives, magnetic disks, or optical discs that can store computer programs.

[0148] The embodiments of the present application also provide a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the resource allocation method.

[0149] The embodiments of the present application also provide another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the resource allocation method.

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

[0151] The above has provided a detailed introduction to a resource allocation method, device, electronic device, storage medium, and program product provided by the present application. Specific examples have been used herein to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A resource allocation method, characterized in that, Including: When it is determined that the resource allocation operation corresponding to the first control block is completed, obtain the second control block, where the first control block is the control block in the resource allocation phase corresponding to the first request, the second control block is the control block in the resource allocation phase corresponding to the second request, and the second request is the next request after the first request; Parse the first control block to obtain the resource requirement information corresponding to various task types; Apply for resources from the resource management engine according to the resource requirement information corresponding to each task type; When receiving the resource allocation information sent by the resource management engine, create memory pages corresponding to the task types based on the resource allocation information; When the memory pages corresponding to each task type are created, determine that the resource allocation operation corresponding to the second control block is completed.

2. The resource allocation method according to claim 1, wherein The step of "When it is determined that the resource allocation operation corresponding to the first control block is completed, obtain the second control block" includes: Receive the target address information sent by the task queue management engine; Read the second control block from the storage location corresponding to the target address information.

3. The resource allocation method according to claim 1 or 2, characterized in that The step of "Apply for resources from the resource management engine according to the resource requirement information corresponding to each task type" includes: Determine the total resource requirement according to the resource requirements included in the resource requirement information corresponding to each task type; Generate a resource application request according to the total resource requirement and send it to the resource management engine.

4. The resource allocation method according to claim 3, wherein The step of "When receiving the resource allocation information sent by the resource management engine, create memory pages corresponding to the task types based on the resource allocation information" includes: According to the resource requirements corresponding to each task type and the multiple address information included in the resource allocation information, construct a physical area page list corresponding to each task type; Parallelly write the physical area page list corresponding to each task type into a preset storage location in the memory through the data transmission bus to create the memory pages corresponding to each task type.

5. The resource allocation method according to claim 1 or 2, characterized in that The step of "Apply for resources from the resource management engine according to the resource requirement information corresponding to each task type" includes: Generate a resource application request corresponding to each task type according to the resource requirements included in the resource requirement information corresponding to each task type; According to the pre-configured resource allocation order corresponding to each task type, sequentially send the resource application requests corresponding to each task type to the resource management engine respectively.

6. The resource allocation method according to claim 5, wherein The step of "When receiving the resource allocation information sent by the resource management engine, create memory pages corresponding to the task types based on the resource allocation information" includes: For each received resource allocation information, construct a physical area page list of the target task type corresponding to the received resource allocation information according to the multiple address information included in the received resource allocation information, where the target task type is one of the multiple task types; Write the physical area page list of the target task type to a preset storage location in the memory via a data transmission bus to create a memory page corresponding to the target task type.

7. The resource allocation method according to claim 2, wherein After creating the memory pages corresponding to each of the task types and determining that the resource allocation operation corresponding to the second control block is completed, the method further includes: Extract the address information corresponding to the third control block from the second control block, where the third control block is the control block corresponding to the working stage of the second request after the resource allocation stage; Send the address information corresponding to the third control block to the task queue management engine for executing the tasks of the working stage.

8. A resource allocation device, characterized in that, Includes: An acquisition module, configured to acquire a second control block when it is determined that the resource allocation operation corresponding to the first control block is completed, where the first control block is the control block of the resource allocation stage corresponding to the first request, the second control block is the control block of the resource allocation stage corresponding to the second request, and the second request is the next request after the first request; An analysis module, configured to analyze the first control block to obtain the resource requirement information corresponding to various task types; A claiming module, configured to claim resources from the resource management engine according to the resource requirement information corresponding to each of the task types; A creation module, configured to create a memory page corresponding to the task type based on the resource allocation information when receiving the resource allocation information sent by the resource management engine; A determination module, further configured to determine that the resource allocation operation corresponding to the second control block is completed after creating the memory pages corresponding to each of the task types.

9. An electronic device, characterized in that, Includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the resource allocation method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where the computer program implements the steps of the resource allocation method according to any one of claims 1 to 7 when executed by a processor.