Resource management method and device, equipment, medium and product
By releasing the earliest requested resource when there is insufficient primitive block index resources, the problem of random allocation and forced release of primitive block index resources is solved, thus improving the efficiency and performance of resource management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, the allocation and forced release of primitive block index resources tend to be random, which leads to newly allocated resources being forcibly released and needing to be re-applied for, resulting in performance degradation.
When there are insufficient resources for the primitive block index, the earliest requested resource is identified and released. After its release is completed, resources are allocated to the target primitive block to avoid the forced release of newly requested resources.
This reduces the performance degradation caused by repeatedly re-applying for primitive block index resources, and improves the efficiency and stability of resource management.
Smart Images

Figure CN121858285A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a resource management method, apparatus, equipment, medium and product. Background Technology
[0002] In primitive processing, multiple primitives are typically assembled into primitive blocks for batch processing. To effectively manage and schedule these primitive blocks, an identifier (ID) resource needs to be allocated to each primitive block.
[0003] In related technologies, when allocating ID resources, it is usually considered to select the first unallocated ID resource in sequence for allocation; when there are no available ID resources, it is necessary to forcibly release the ID resources.
[0004] However, using the resource management method described above, the allocation and forced release of ID resources tend to be random after a long period of operation. This may result in newly allocated ID resources being forcibly released, requiring the re-application of ID resources. Multiple re-applications of resources can lead to performance degradation. Summary of the Invention
[0005] This application provides a resource management method, apparatus, device, medium, and product that can prevent newly requested primitive block index resources from being forcibly released, thus avoiding the need to re-request primitive block index resources and reducing performance degradation caused by multiple re-requests of primitive block index resources. The technical solution provided by this application includes the following aspects.
[0006] In one aspect, embodiments of this application provide a resource management method, the method comprising: Receive a resource request; wherein the resource request is used to request the allocation of primitive block index resources for the target primitive block; In the absence of any available primitive block index resources, a first primitive block index resource is determined from a first state list; wherein, the first state list records the allocated primitive block index resources, and the primitive block index resources recorded in the first state list are sorted according to the order of application time, and the first primitive block index resource is the earliest applied primitive block index resource in the first state list. Release the index resource of the first primitive block; Once the first primitive block index resource has been released, primitive block index resources are allocated to the target primitive block.
[0007] On the other hand, embodiments of this application provide a resource management device, which includes a resource status maintenance module, a resource request module, and a resource release module; The resource release module is configured to send a first request to the resource status maintenance module, the first request being used to request the resource status maintenance module to indicate the primitive block index resource to be forcibly released; The resource status maintenance module is configured to, upon receiving the first request, determine a first primitive block index resource from a first status list, wherein the first status list records allocated primitive block index resources, and the primitive block index resources recorded in the first status list are sorted according to the order of application time, and the first primitive block index resource is the earliest applied primitive block index resource in the first status list; and send a first response to the resource release module, wherein the first response is used to instruct the resource release module to release the first primitive block index resource. The resource release module is further configured to release the first primitive block index resource upon receiving the first response; and to send a re-request instruction to the resource request module after the release of the first primitive block index resource is completed, wherein the re-request instruction is used to instruct the resource request module to re-request primitive block index resources for the primitive block.
[0008] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-described resource management method.
[0009] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the above-described resource management method.
[0010] On the other hand, a computer program product is provided, the computer program product including a computer program stored in a computer-readable storage medium, wherein a processor reads from the computer-readable storage medium and executes the computer program to implement the above-described resource management method.
[0011] The technical solution provided in this application can bring the following beneficial effects: Upon receiving a resource request, if no available primitive block index resource is available for allocation, a first primitive block index resource is determined from a first state list. This first state list records allocated primitive block index resources, ordered by request time. The first primitive block index resource is the earliest requested primitive block index resource in the first state list. This first primitive block index resource is then released. Once the first primitive block index resource is released, primitive block index resources are allocated to the primitive block based on the resource request. Releasing the earliest requested primitive block index resource when there are insufficient primitive block index resources avoids the need to re-request primitive block index resources due to the forced release of newly requested primitive block index resources, thus reducing performance degradation caused by multiple re-requests. Attached Figure Description
[0012] Figure 1 This is a flowchart illustrating the execution process of a resource management method according to an illustrative embodiment of this application; Figure 2 This is a flowchart illustrating the execution process of a resource management method provided in another illustrative embodiment of this application; Figure 3 This is a schematic diagram illustrating the determination of primitive block index resources provided in an exemplary embodiment of this application; Figure 4 This is a flowchart illustrating the execution process of a resource management method provided in another illustrative embodiment of this application; Figure 5 This is a schematic diagram of the second primitive block index resource selection process provided in an illustrative embodiment of this application; Figure 6 This is a flowchart illustrating the execution process of a resource management method provided in another illustrative embodiment of this application; Figure 7 This is a schematic diagram of the structure of a resource management device provided in an exemplary embodiment of this application; Figure 8 This is a schematic diagram of the structure of a resource management device provided in another exemplary embodiment of this application; Figure 9 This is a schematic diagram of the structure of a resource management device provided in another illustrative embodiment of this application; Figure 10 This is a flowchart illustrating the execution process of a resource management method provided in another illustrative embodiment of this application; Figure 11 This is a structural block diagram of a computer device provided in an exemplary embodiment of this application. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0014] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0015] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0016] It should be understood that although the terms “first,” “second,” etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, a first parameter may also be referred to as a second parameter, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word “if” as used herein may be interpreted as “when…” or “in response to determination.”
[0017] It should be noted that this application may display a prompt interface, pop-up window, or output voice prompt information before collecting user, processor, computer device, and other related data, and during the process of collecting user-related data. This prompt interface, pop-up window, or voice prompt information is used to inform the user that their related data is being collected. This ensures that the application only begins executing the steps related to collecting user-related data after receiving confirmation from the user regarding the prompt interface or pop-up window; otherwise (i.e., without receiving confirmation from the user), the steps related to collecting user-related data end, meaning no user-related data is collected. In other words, all user data collected in this application is collected with the user's consent and authorization, and the collection, use, and processing of related user data must comply with the laws, regulations, and standards of relevant countries and regions.
[0018] First, the terms used in the embodiments of this application will be introduced.
[0019] A primitive is a fundamental, indivisible geometric unit that constitutes a 3D model. It is the direct object that graphics hardware renders and processes. A primitive can be a vertex, a line segment, a triangle, a polygon, a circle, a quadratic curve, a surface, etc. In the graphics pipeline, vertex data submitted by the application is assembled according to the specified primitive type. Subsequently, these primitives undergo a series of stages such as vertex shading, rasterization, and pixel shading before finally being drawn onto the screen.
[0020] A primitive block is a collection of primitives assembled together. Processing a single primitive requires memory allocation and read / write instructions, resulting in significant overhead. Assembling multiple primitives into primitive blocks makes them easier to manage, enabling efficient batch operations and management. Primitive blocks are typically assembled according to certain rules. For example, primitives with a common vertex are placed in the same primitive block, or primitives that are points, lines, or triangles are placed in their respective primitive blocks for quick identification of similar primitives. There is an upper limit to the number of primitives a primitive block can contain. For example, a primitive block can store ten primitives. In other embodiments, there is an upper limit to the number of vertices a primitive block can contain. When the upper limit set in this application is reached, the primitive block is considered full and cannot accept new primitives, requiring it to be sent to the downstream processing pipeline for further processing.
[0021] Primitive block index resources are critical logical resources used to identify and manage primitive blocks in the assembly process. Essentially, it's an internal tagging system that provides a unique identifier for each active primitive block, enabling upstream circuitry to accurately direct input primitives to the correct storage location for accumulation. The total number of primitive block index resources is hardware-preset and finite, its size determining the maximum number of primitive blocks the entire assembly circuit can process in parallel at any given time. Illustratively, primitive block index resources can be implemented as a set of identifier (ID) resources, where each ID is a unique integer value or register address. When a primitive block begins assembly, a free ID resource is allocated to it from the available ID resources; subsequent write operations to this primitive block are addressed through this ID resource. Once a primitive block is assembled and sent downstream, the ID resource it occupied is marked as free and reclaimed for allocation to the next newly created primitive block. When primitive block index resources are insufficient, releasing an allocated primitive block index resource is typically considered to avoid delays caused by waiting for the normal release of primitive block index resources.
[0022] When processing primitive blocks in a Graphics Processing Unit (GPU), multiple primitives are typically packaged into primitive blocks, and batch processing is performed on a block-by-block basis. To effectively manage and schedule these primitive blocks, an ID resource needs to be allocated to each primitive block. Existing resource management methods typically consider allocating the first unallocated ID resource in sequence, and when no ID resources are available and forced release is required, they typically consider forcibly releasing the first allocated ID resource in sequence.
[0023] However, the above resource management method has the following problem: after running for a long time, the allocation and forced release of ID resources tend to be random, which may cause newly allocated ID resources to be forcibly released, requiring the re-application of ID resources, and multiple re-applications of ID resources will cause performance degradation.
[0024] To address the aforementioned issues, this application provides a resource management method. By identifying and releasing the earliest requested primitive block index resource when primitive block index resources are insufficient, the method avoids the need to re-request primitive block index resources due to the forced release of newly requested primitive block index resources, thereby reducing performance degradation caused by multiple re-requests of primitive block index resources.
[0025] Figure 1 This is a flowchart of a resource management method provided in an exemplary embodiment of this application, which is executed by a resource management device. Figure 1 As shown, the method includes at least one of the following steps.
[0026] Step 110: Receive a resource request; wherein the resource request is used to request the allocation of primitive block index resources for the target primitive block.
[0027] When a new primitive is not suitable for an existing primitive block being assembled, or when the new primitive requires a new primitive block to be requested according to the primitive block assembly rules, a new primitive block index resource needs to be allocated. In other words, when a new primitive cannot be placed into an existing primitive block, a new primitive block needs to be requested and a new primitive block index resource allocated to it, so that the new primitive can be successfully assembled into a primitive block.
[0028] When it is necessary to allocate primitive block index resources for primitive blocks, the resource management device receives a resource request request to allocate primitive block index resources for the target primitive block.
[0029] Step 120: In the absence of any available primitive block index resources, determine the first primitive block index resource from the first state list; wherein, the first state list records the allocated primitive block index resources, and the primitive block index resources recorded in the first state list are sorted according to the order of application time, and the first primitive block index resource is the earliest applied primitive block index resource in the first state list.
[0030] In some embodiments, when there are no available primitive block index resources, the primitive block index resources are insufficient, making it impossible to allocate primitive block index resources to primitive blocks. When a primitive block is not allocated a primitive block index resource, it will wait indefinitely for allocation, causing program lag. To avoid this situation, when primitive block index resources are insufficient, one primitive block index resource needs to be forcibly released, allowing new primitive blocks to be allocated primitive block index resources, and primitives of the same type as the newly allocated primitive block can also be normally assembled into primitive blocks.
[0031] The first state list records the allocated primitive block index resources, and these resources are ordered according to their application time. In other words, the order in which the allocated primitive block index resources were applied can be determined based on the first state list.
[0032] The first primitive block index resource is the earliest requested primitive block index resource in the first state list.
[0033] Step 130: Release the first primitive block index resource.
[0034] After determining the first primitive block index resource to be released, release the first primitive block index resource.
[0035] Step 140: After the first primitive block index resource has been released, allocate primitive block index resources to the target primitive block.
[0036] Once the first primitive block index resource has been released, there are primitive block index resources available for allocation. The resource management device reallocates primitive block index resources to the target primitive block based on the resource request.
[0037] In summary, by receiving resource request requests, and when no available primitive block index resources are available for allocation, a first primitive block index resource is determined from a first state list. This first state list records allocated primitive block index resources, ordered by request time. The first primitive block index resource is the earliest requested primitive block index resource in the first state list. This first primitive block index resource is then released. Once the first primitive block index resource is released, primitive block index resources are allocated to primitive blocks based on the resource request. Releasing the earliest requested primitive block index resource when primitive block index resources are insufficient avoids the need to re-request primitive block index resources due to the forced release of newly requested primitive block index resources, thus reducing performance degradation caused by multiple re-requests of primitive block index resources.
[0038] The resource management methods for managing primitive block index resources mainly include: forcibly releasing primitive block index resources, requesting primitive block index resources, and releasing primitive block index resources.
[0039] When applying for primitive block index resources, if there are no primitive block index resources available for allocation, the resource management device forcibly releases the primitive block index resources and reallocates them; if there are primitive block index resources available for allocation, the resource management device directly allocates the primitive block index resources.
[0040] The following section describes the situation where there are no available primitive block index resources.
[0041] like Figure 2 As shown, it illustrates a resource management method provided by another illustrative embodiment of this application, which is executed by a resource management device and includes at least one of the following steps.
[0042] Step 120: In the absence of any available primitive block index resources, determine the first primitive block index resource from the first state list; wherein, the first state list records the allocated primitive block index resources, and the primitive block index resources recorded in the first state list are sorted according to the order of application time, and the first primitive block index resource is the earliest applied primitive block index resource in the first state list.
[0043] When there are no available primitive block index resources, the primitive block index resources are insufficient, and no primitive block index resources can be allocated to primitive blocks. When a primitive block is not allocated a primitive block index resource, it will wait indefinitely for allocation, causing program lag. To avoid this situation, when primitive block index resources are insufficient, a first primitive block index resource needs to be determined and forcibly released. This allows new primitive blocks to be allocated primitive block index resources, and primitives of the same type as the first primitive block can be assembled into primitive blocks normally.
[0044] The resource management device maintains a first status list, which records the allocated primitive block index resources. The primitive block index resources recorded in the first status list are sorted according to the order of application time. In other words, the order of application time of the allocated primitive block index resources can be determined based on the first status list.
[0045] In some embodiments, the entries in the first state list are assigned serial numbers, with the serial numbers corresponding to the application time order of the primitive block index resources. The order of the primitive block index resource's application time can be determined by the serial number of the entry in the first state list. Illustratively, the primitive block index resource stored in the entry with the smallest serial number was applied for earliest, and the primitive block index resource stored in the entry with the largest serial number was applied for latest. In other embodiments, the primitive block index resource stored in the entry with the largest serial number was applied for earliest, and the primitive block index resource stored in the entry with the smallest serial number was applied for latest.
[0046] This application example uses the earliest application time of the primitive block index resource stored in the table entry with the smallest sequence number as an example, without limiting the correspondence between the sequence number and the application time of the primitive block index resource.
[0047] In some embodiments, entries storing primitive block index resources are adjacent; that is, allocated primitive block index resources are stored in entries with smaller entry numbers, and there are no unoccupied entries between entries storing primitive block index resources. In other embodiments, entries storing primitive block index resources are not adjacent; that is, there are unoccupied entries between entries storing primitive block index resources.
[0048] This application uses the example of adjacent entries storing primitive block index resources to illustrate the concept, without limiting whether the entries storing primitive block index resources are adjacent.
[0049] Not all entries in the first state list contain primitive block index resources. Only allocated primitive block index resources can be stored in the first state list. Unallocated primitive block index resources cannot be stored in the first state list. Entries in the first state list can be empty. The number of entries storing primitive block index resources represents the number of allocated primitive block index resources.
[0050] Among the allocated primitive blocks, the primitive block corresponding to the earliest requested primitive block index resource occupies the longest time in storage space. Releasing this primitive block index resource can minimize the need to re-request primitive block index resources due to the forced release of a newly requested primitive block index resource. Simultaneously, this primitive block may remain in storage space because it is missing a certain primitive and has not yet been assembled and sent to the downstream processing pipeline. Compared to other primitive blocks, releasing this primitive block is most likely to prevent it from remaining stagnant and occupying space for too long, thus improving the utilization rate of primitive blocks.
[0051] like Figure 3 The diagram illustrating the determination of primitive block index resources is used as an example. The second state list contains the status, rt_number, and mask corresponding to the primitive block index resource. status indicates the allocation status of the primitive block index resource; rt_number is the primitive block identifier used to distinguish different primitive blocks; the corresponding rt_number is updated during the allocation and release of primitive block index resources; and mask is the mask of the primitive block index resource. In the first state list, SLOT corresponds to the allocated primitive block index resource. SLOT includes the primitive block identifier rt_number corresponding to the allocated primitive block index resource. The lower the rank of the SLOT, the earlier the primitive block index resource was requested. LUT is a lookup table used to select from eligible primitive block index resources. current_ptr is the release command; upon receiving current_ptr, a suitable primitive block index resource needs to be selected from the first state list and deleted.
[0052] In the diagram, current_ptr is the release instruction. When the release instruction does not specify the primitive block index resource to be released, it is a forced release instruction. In this case, the primitive block index resource corresponding to SLOT0 in the first state list is selected as the first primitive block index resource.
[0053] In other embodiments, when storage resources are insufficient, the resource management device determines the first primitive index resource and releases the first primitive block index resource.
[0054] Insufficient storage resources refer to the need for temporary storage space during the assembly of primitive blocks before they are sent to the downstream processing pipeline. The storage space allocated to the resource management device is limited. If there is insufficient storage, even with allocated primitive block index resources, primitive block assembly cannot proceed. To avoid this, a primitive block index resource needs to be forcibly released, simultaneously releasing the storage resources occupied by the corresponding primitive block, allowing new primitive blocks to be assembled normally.
[0055] Step 122: After determining the first primitive block index resource, delete the first primitive block index resource from the first state list, and move the primitive block index resources following the first primitive block index resource forward in sequence.
[0056] The first state list records the allocated primitive block index resources. After the resource management device determines the first primitive block index resource, the first primitive block index resource will be released. In order to keep the first list recording the allocated primitive block index resources, the first primitive block index resource needs to be deleted from the first state list.
[0057] In some embodiments, after deleting the first primitive block index resource from the first state list, the resource management device needs to sequentially move the primitive block index resources following the first primitive block index resource forward. The application time of the primitive block index resources following the first primitive block index resource is after the application time of the first primitive block index resource. That is, the primitive block index resources following the first primitive block index resource in the first state list are sequentially moved forward one position, making the entries storing primitive block index resources in the first state list adjacent, and maintaining the primitive block index resources in the first list in order of application time.
[0058] like Figure 3 As shown, the rt_number stored in SLOT1 is written to SLOT0, the rt_number stored in SLOT2 is written to SLOT1, and so on, until the rt_number stored in SLOT39 is written to SLOT38. The primitive block index resources in the updated first state list are sorted by application time.
[0059] In some embodiments, after determining the first primitive block index resource, the allocation status of the first primitive block index resource in the second status list is modified to unallocated, and the status indicated by the mask corresponding to the released primitive block index resource is maintained as the first status.
[0060] The second state list contains the allocation state and mask corresponding to the primitive block index resource. The allocation state is used to indicate whether the primitive block index resource has been allocated to the primitive block, and the mask is used to indicate whether the primitive block index resource is in the first state or the second state. The primitive block index resource in the first state cannot be used for allocation, and the primitive block index resource in the second state can be used for allocation.
[0061] The resource management device maintains a second state list, which includes the allocation status of the primitive block index resource and the mask.
[0062] The allocation status of a primitive block index resource indicates whether it has been allocated to a primitive block. The mask corresponding to the primitive block index resource indicates whether it is in a first or second state. A primitive block index resource in the first state cannot be allocated, while a primitive block index resource in the second state can be allocated.
[0063] In some embodiments, the primitive block index resource in the second state list also corresponds to a primitive block identifier. The primitive block identifier is used to distinguish different primitive blocks. After the primitive block index resource allocated to a primitive block is released, the primitive block is sent to the downstream processing unit for primitive block processing. The primitive block identifier can still be used in the downstream processing unit to indicate the corresponding primitive block, facilitating primitive block management.
[0064] The second state list records the allocation status of primitive block index resources. After the first primitive block index resource is determined, it will be released. The second state list needs to be updated to change the allocation status of the first primitive block index resource in the second state list to unallocated, so as to ensure the correctness of the allocation status of the first primitive block index resource in the second state list.
[0065] In some embodiments, the resource management device maintains the state indicated by the mask corresponding to the first primitive block index resource used for forced release as a first state.
[0066] The second state list records the mask corresponding to the primitive block index resource. After the first primitive block index resource is determined, it will be forcibly released. The mask corresponding to the first primitive block index resource needs to be kept in the first state in the second state list. At this time, the primitive block index resource cannot be used for allocation.
[0067] By updating the first state list after determining the first primitive block index resource to be forcibly released, the primitive block index resources recorded in the first state list can still be sorted according to the application time, thus ensuring the correctness of the first state list.
[0068] Step 130: Release the first primitive block index resource.
[0069] After determining the first primitive block index resource to be forcibly released, release the first primitive block index resource.
[0070] In some embodiments, the resource management device maintains an allocation list. This allocation list determines the correspondence between primitive blocks and first primitive block index resources. In other words, primitive blocks allocated primitive block index resources are recorded in the allocation list. The allocation list determines whether a primitive block has been allocated primitive block index resources and the corresponding primitive block index resources. Releasing the first primitive block index resource after determining it means deleting the correspondence between the primitive block and the first primitive block index resource from the allocation list.
[0071] Step 140: After the first primitive block index resource has been released, allocate primitive block index resources to the target primitive block.
[0072] Once the first primitive block index resource has been released, there are primitive block index resources available for allocation. The resource management device can reallocate primitive block index resources to the target primitive block based on the resource request.
[0073] The following section describes the situation where there are available primitive block index resources for allocation.
[0074] like Figure 4 As shown, it illustrates a resource management method provided by another illustrative embodiment of this application, which is executed by a resource management device and includes at least one of the following steps.
[0075] Step 125: If there are available primitive block index resources for allocation, the primitive block index resource with the mask indicating the second state, the allocation state being unallocated, and the smallest index in the second state list is determined as the second primitive block index resource.
[0076] The second state list contains the allocation state and mask corresponding to the primitive block index resource. The allocation state is used to indicate whether the primitive block index resource has been allocated to the primitive block. The mask is used to indicate whether the primitive block index resource is in the first state or the second state. The primitive block index resource in the first state cannot be used for allocation, while the primitive block index resource in the second state can be used for allocation.
[0077] If there are sufficient primitive block index resources available for allocation, it is necessary to determine the primitive block index resources to be used for allocation.
[0078] The mask corresponding to the primitive block index resource recorded in the second state list is used to indicate whether the primitive block index resource is in the first state or the second state. Primitive block index resources in the first state cannot be allocated, while primitive block index resources in the second state can be allocated.
[0079] like Figure 3As shown, when determining the second primitive block index resource for allocation, primitive block index resources with status==free and mask==0 are selected from the second status list. status==free means the allocation status is unallocated, and mask==0 means the mask is the second status. Among all primitive block index resources with status==free and mask==0, the primitive block index resource with the smallest index is selected as the second primitive block index resource.
[0080] The state indicated by the mask corresponding to the primitive block index resource in the second state list is changed from the second state to the first state when requesting primitive block index resources; it remains in the first state when releasing primitive block index resources; and it is changed from the first state to the second state when the state indicated by the mask corresponding to all primitive block index resources in the second state list is the first state.
[0081] When determining the second primitive block index resource for allocation, the resource management device selects the primitive block index resource with the mask indicating the second state, the allocation state being unallocated, and the smallest index. Selecting this resource ensures that each request for primitive block index resources is allocated according to index order, and reallocation only occurs after all primitive block index resources have been allocated or allocated once. In other words, when requesting primitive block index resources, before modifying the mask indicating the unallocated primitive block index resource in the second state list to the second state, the primitive block index resource with the smallest index is selected for allocation from the unallocated primitive block index resources.
[0082] like Figure 5 The selection process of the second primitive block index resource is illustrated using the table shown as an example. The table records the allocation status and mask for each primitive block index resource. During allocation, the resource management device selects primitive block index resource 4 as the second primitive block index resource. At this time, primitive block index resource 3, with a smaller sequence number, is also in an unallocated state, but its mask is in the first state, indicating that it has already been allocated once and cannot be used for allocation. Only after primitive block index resource 6 is also allocated, and the mask indicating the state for all primitive block index resources in the second state list is in the first state, can primitive block index resource 3 be used for allocation after the mask indicating the unallocated primitive block index resource is changed to the second state.
[0083] In other embodiments, when allocating primitive block index resources, the resource management device randomly selects a primitive block index resource as the second primitive block index resource from those whose mask indicates the second state and whose allocation state is unallocated. That is, when requesting primitive block index resources, before modifying the state indicated by the mask corresponding to the unallocated primitive block index resource in the second state list to the second state, a primitive block index resource is randomly selected from the unallocated primitive block index resources for allocation, without needing to meet the minimum index requirement.
[0084] by Figure 5 The process of selecting the second primitive block index resource is illustrated in the table below. The table records the allocation status and mask of each primitive block index resource. During allocation, primitive block index resource 4 or primitive block index resource 6 can be randomly selected as the second primitive block index resource; both can be used for allocation.
[0085] The resource management device maintains a first state list and a second state list. After determining the second primitive block index resource, it is necessary to update the first state list that records the allocated primitive block index resources and the second state list that records the allocation status of the corresponding primitive block index resources, so that the first state list correctly records the allocated primitive block index resources and the second state list correctly records the allocation status and mask of the primitive block index resources.
[0086] In some embodiments, after the second primitive block index resource is determined, it is written after the last primitive block index resource in the first state list.
[0087] By updating the first state list after determining the second primitive block index resource for allocation, the primitive block index resources recorded in the first state list can still be sorted according to the application time, thus ensuring the correctness of the first state list.
[0088] The first state list records the allocated primitive block index resources. After the second primitive block index resource is determined for allocation, it will be allocated to the primitive block. At this time, the second primitive block index resource will be used to allocate to the primitive block. The second primitive block index resource needs to be added to the first state list so that the first state list contains all the allocated primitive block index resources.
[0089] In some embodiments, to sort the primitive block index resources in the first state list according to their application time, the second primitive block index resource is written after the last primitive block index resource in the first state list. At this point, the second primitive block index resource is at the end of the first state list, meaning it is the most recently applied primitive block index resource.
[0090] In some embodiments, after determining the second primitive block index resource, the allocation status corresponding to the second primitive block index resource in the second status list is updated to allocated, and the status indicated by the mask corresponding to the second primitive block index resource is modified to the first status.
[0091] The second state list records the allocation status of the primitive block index resource. After the second primitive block index resource is determined for allocation, it will be used to allocate the primitive block. The allocation status of the second primitive block index resource needs to be changed to "allocated" in the second state list.
[0092] By updating the second state list after determining the second primitive block index resource to be allocated, the allocation status corresponding to the primitive block index resource recorded in the second state list is modified to allocated, thus ensuring the correctness of the second state list.
[0093] The second state list records the mask corresponding to the primitive block index resource. After the second primitive block index resource for allocation is determined, it will be used to allocate the primitive block. The mask corresponding to the second primitive block index resource needs to be modified to the first state in the second state list, indicating that the second primitive block index resource cannot be used for allocation.
[0094] In some embodiments, the state indicated by the mask corresponding to the released primitive block index resource is maintained as the first state.
[0095] The second state list records the mask corresponding to the primitive block index resource. After the primitive block index resource is released, the primitive block index resource will have been released. The mask corresponding to the primitive block index resource needs to be kept in the first state in the second state list, indicating that the primitive block index resource cannot be used for allocation.
[0096] In some embodiments, when the mask indicating the state of all primitive block index resources in the second state list is in the first state, the state indicated by the mask corresponding to the primitive block index resource whose allocation state is unallocated is modified to the second state.
[0097] The second state list records the masks corresponding to primitive block index resources. When the mask indicating the state of all primitive block index resources in the second state list is the first state, all primitive block index resources cannot be allocated. However, some primitive block index resources have been released and can be allocated. It is necessary to modify the mask corresponding to the released primitive block index resources in the second state list to the second state, indicating that the primitive block index resources whose state indicated by the corresponding mask is the second state can be allocated.
[0098] By modifying the state indicated by the mask corresponding to the primitive block index resources recorded in the second state list when the state of all primitive block index resources is the first state, the correctness of the second state list is ensured.
[0099] Step 126: Allocate the second primitive block index resource for the target primitive block.
[0100] In some embodiments, the resource management device maintains an allocation list. This allocation list determines the correspondence between target primitive blocks and second primitive block index resources. In other words, primitive blocks allocated primitive block index resources are recorded in the allocation list. The allocation list determines whether a primitive block has been allocated primitive block index resources and the corresponding primitive block index resource. After determining the second primitive block index resource, the correspondence between the target primitive block and the second primitive block index resource is added to the allocation list.
[0101] By allocating primitive block index resources with the second state list that are masked as second state, have an allocation state of unallocated, and have the smallest index, the possibility of repeatedly requesting the same primitive block index resource within a certain period of time is reduced, thereby improving the utilization rate of primitive block index resources and improving the operating efficiency of the resource management device.
[0102] The following describes the execution process of releasing primitive block index resources by the resource management device.
[0103] like Figure 6 As shown, it illustrates a resource management method provided by another illustrative embodiment of this application, which is executed by a resource management device and includes at least one of the following steps.
[0104] Step 610: Receive a resource release request; wherein, the resource release request is used to request the release of the third primitive block index resource.
[0105] There is an upper limit to the number of primitives that a primitive block can hold. When the limit is reached, the primitive block needs to be sent to the downstream processing pipeline for further processing. Before the primitive block is sent downstream, the primitive block index resource corresponding to the primitive block needs to be released.
[0106] When it is necessary to release primitive block index resources, the resource management device receives a resource release request, which includes the third primitive block index resources that need to be released.
[0107] Step 620: In response to the resource release request, the third primitive block index resource is removed from the first state list, and the primitive block index resources following the third primitive block index resource are moved forward in sequence.
[0108] The resource management device maintains a first state list and a second state list. After releasing the third primitive block index resource, it is necessary to update the first state list that records the allocated primitive block index resources and the second state list that records the allocation status of the corresponding primitive block index resources, so that the first state list correctly records the allocated primitive block index resources and the second state list correctly records the allocation status and mask of the primitive block index resources.
[0109] The first state list records the allocated primitive block index resources. After the third primitive block index resource is released, it needs to be deleted from the first state list.
[0110] In some embodiments, after deleting the third primitive block index resource from the first state list, the primitive block index resources following the third primitive block index resource need to be shifted forward sequentially. That is, the primitive block index resources following the third primitive block index resource in the first state list are shifted forward one position in sequence, so that the entries storing primitive block index resources in the first state list are adjacent.
[0111] like Figure 3 As shown, when the release command current_ptr is received, current_ptr includes the primitive block identifier rt_number corresponding to the primitive block index resource to be released. By matching the rt_number in current_ptr with the rt_number stored in SLOT in the first state list, the position of the third primitive block index resource stored in the first state list is found, the primitive block index resource stored at that position is deleted, and the primitive block index resources after the third primitive block index resource are sequentially moved forward one position.
[0112] In some embodiments, in response to a resource release request, the resource management device updates the allocation status of the resource corresponding to the third primitive block index in the second status list to unallocated.
[0113] The second state list records the allocation status of primitive block index resources. When a resource release request is received, the third primitive block index resource will be released, and the second state list will be updated to ensure the correctness of the allocation status corresponding to the third primitive block index resource in the second state list.
[0114] In response to a resource release request, the resource management device updates the second state list, thereby changing the allocation status of the primitive block index resource recorded in the second state list to unallocated, thus ensuring the correctness of the second state list.
[0115] In some embodiments, the resource management device maintains the state indicated by the mask corresponding to the third primitive block index resource that is about to be released as the first state.
[0116] The second state list records the mask corresponding to the primitive block index resource. After updating the allocation state of the third primitive block index resource in the second state list, the mask corresponding to the third primitive block index resource needs to be kept in the first state. At this time, the third primitive block index resource cannot be used for allocation.
[0117] In response to a resource release request, the resource management device updates the first state list and releases the third primitive block index resource, ensuring that the primitive block index resources recorded in the first state list can still be sorted according to the application time, thus guaranteeing the correctness of the first state list.
[0118] Step 630: Release the third primitive block index resource.
[0119] In some embodiments, the resource management device maintains an allocation list, which determines the correspondence between primitive blocks and third primitive block index resources. Allocating primitive block index resources to a primitive block means associating the primitive block with a primitive block index resource. Illustratively, the allocation list records the correspondence between primitive blocks and third primitive block index resources. Releasing third primitive block index resources means releasing the correspondence between a primitive block and a third primitive block index resource. Illustratively, the entry in the allocation list representing the correspondence between the primitive block and the third primitive block index resource is deleted.
[0120] In some embodiments, after releasing the third primitive block index resource, the primitive block corresponding to the third primitive block index resource is sent to the downstream processing pipeline. Releasing the primitive block index resource means that the primitive block has been assembled and needs to be sent to the downstream processing pipeline for the next step of processing.
[0121] In summary, upon receiving a resource request, if no available primitive block index resources are available for allocation, a first primitive block index resource is determined from the first state list. This first state list records allocated primitive block index resources, ordered by request time. The first primitive block index resource is the earliest requested primitive block index resource in the first state list. This first primitive block index resource is then released. Once the first primitive block index resource is released, primitive block index resources are allocated to the primitive block based on the resource request. Releasing the earliest requested primitive block index resource when primitive block index resources are insufficient avoids the need to re-request primitive block index resources due to the forced release of newly requested primitive block index resources, thus reducing performance degradation caused by multiple re-requests of primitive block index resources.
[0122] When requesting primitive block index resources, if no primitive block index resources are available for allocation, one primitive block index resource is forcibly released for allocation; if primitive block index resources are available for allocation, they are directly allocated to the primitive block. When releasing primitive block index resources, the target primitive block index resource is released. This improves the efficiency and accuracy of the resource management device in managing primitive block index resources under different circumstances.
[0123] Please refer to Figure 7 This diagram illustrates a resource management device provided in an exemplary embodiment of this application. Functionally, the resource management device is divided into a resource status maintenance module 710, a resource request module 720, and a resource release module 730. The resource status maintenance module 710 and the resource request module 720 are connected by communication, as are the resource status maintenance module 710 and the resource release module 730.
[0124] The resource release module 730 is used to send a first request to the resource status maintenance module 710. The first request is used to request the resource status maintenance module 710 to instruct the forced release of primitive block index resources.
[0125] In some embodiments, when the resource release module 730 needs to forcibly release a primitive block index resource, it does not have the ability to determine the target primitive block index resource for forced release and needs to request an external request indicating the primitive block index resource to be forcibly released. The resource release module 730 sends a first request to the resource status maintenance module 710 to indicate the primitive block index resource to be forcibly released by the resource release module 730.
[0126] The resource status maintenance module 710 is used to determine the first primitive block index resource from the first status list when a first request is received. The first status list records the allocated primitive block index resources. The primitive block index resources recorded in the first status list are sorted according to the application time. The first primitive block index resource is the earliest applied primitive block index resource in the first status list.
[0127] Upon receiving the first request, the resource status maintenance module 710 needs to determine the primitive block index resource to be forcibly released.
[0128] The resource status maintenance module 710 maintains a first status list, which records the allocated primitive block index resources. The primitive block index resources recorded in the first status list are sorted according to the application time. In other words, the application time order of the allocated primitive block index resources can be determined based on the first status list.
[0129] The resource status maintenance module 710 sends a first response to the resource release module 730, which instructs the resource release module 730 to release the first primitive block index resource.
[0130] After determining the first primitive block index resource to be forcibly released, the resource status maintenance module 710 sends a first response to the resource release module 730, instructing the resource release module 730 to use the first primitive block index resource to be forcibly released.
[0131] The resource release module 730 is also used to release the first primitive block index resource upon receiving the first response.
[0132] The resource release module 730 receives a first response, which is used to indicate the first primitive block index resource to be forcibly released. After the first primitive block index resource is determined, the resource release module 730 can perform a forced release.
[0133] When the resource release module 730 completes the release of the first primitive block index resource, it sends a re-request instruction to the resource request module 720. The re-request instruction is used to instruct the resource request module to re-request primitive block index resources for the primitive block.
[0134] When the resource release module 730 completes the release of the first primitive block index resource, it sends a re-request instruction to the resource request module 720. The re-request instruction indicates that the resource request module 720 has now successfully forcibly released the primitive block index resource and that there is a primitive block index resource available for allocation. The resource request module 720 can then re-request the primitive block index resource and allocate it to the primitive block.
[0135] In summary, during forced release, the resource status maintenance module selects the earliest requested primitive block index resource from the first status list, and the resource release module performs the forced release. Forcibly releasing the earliest requested primitive block index resource avoids the need to re-request primitive block index resources due to the forced release of newly requested primitive block index resources, thereby reducing performance degradation caused by multiple re-requests of primitive block index resources.
[0136] Please refer to Figure 8 The diagram illustrates the structure of a resource management device provided in an exemplary embodiment of this application. The resource management device includes a resource status maintenance module 810, a resource request module 820, and a resource release module 830, with bidirectional data transmission lines between each pair of modules.
[0137] The management of primitive block index resources by this resource management device mainly includes: forcibly releasing primitive block index resources, requesting primitive block index resources, and releasing primitive block index resources.
[0138] The following section describes how the resource management device forcibly releases primitive block index resources.
[0139] The resource release module 830 sends a first request D4 to the resource status maintenance module 810. The first request D4 is used to request the resource status maintenance module 810 to instruct the primitive block index resource to be forcibly released.
[0140] In some embodiments, the resource release module 830 does not have the ability to decide to forcibly release the target primitive block index resource. The resource release module 830 sends a first request D4 to the resource status maintenance module 810, requesting the resource status maintenance module 810 to indicate the target primitive block index resource to be forcibly released.
[0141] In other embodiments, the resource release module 830 has the capability to determine the forced release of a target primitive block index resource. After determining the target primitive block index resource to be forcibly released, the resource release module 830 forcibly releases the target primitive block index resource. At this time, the resource release module 830 sends a request to the resource status maintenance module 810 to update the first status list and the second status list, so that the status of the allocated primitive block index resource remains correct.
[0142] In some embodiments, when the resource release module 830 receives a resource forced release command from outside the device, it sends a first request D4 to the resource status maintenance module 810.
[0143] like Figure 9 The illustration shows a resource management device provided in an illustrative embodiment of this application. The resource management device includes a primitive block index resource management device 900 and a storage resource management device 950. The primitive block index resource management device 900 includes a resource status maintenance module 910, a resource request module 920, and a resource release module 930. The storage resource management module 950 includes a write control module 960 and a storage module 970. When the resource release module 930 receives a resource release instruction from outside the resource management device, and the resource release instruction does not specify a primitive block index resource to be released, the resource release module 930 needs to forcibly release a primitive block index resource. The resource release module 930 sends a first request D4 to the resource status maintenance module 910, requesting the primitive block index resource to be forcibly released.
[0144] In some embodiments, if the forced release conditions are met, the resource request module 820 sends a fourth request D5 to the resource release module 830. The fourth request D5 is used to instruct the resource release module 830 to forcibly release the primitive block index resource.
[0145] The timing for the resource release module 830 to perform a forced release is determined by the resource request module. The resource release module 830 will only initiate the forced release process after receiving the fourth request D5 from the resource request module 820.
[0146] In some embodiments, the forced release conditions include at least one of insufficient primitive block index resources and insufficient storage resources.
[0147] Insufficient primitive block index resources refer to a situation where there are no primitive block index resources available for allocation when primitive blocks need to be allocated. When a primitive block is not allocated a primitive block index resource, it will wait indefinitely for allocation, causing program lag. To avoid this, when primitive block index resources are insufficient, one primitive block index resource needs to be forcibly released, allowing new primitive blocks to be allocated primitive block index resources, and primitives of the same type as the initial primitive block can also be correctly assembled into primitive blocks.
[0148] Insufficient storage resources refer to the need for temporary storage space during the assembly of primitive blocks before they are sent to the downstream processing pipeline. The storage space allocated to the resource management device is limited. If there is insufficient storage, even with allocated primitive block index resources, primitive block assembly cannot proceed. To avoid this, a primitive block index resource needs to be forcibly released, simultaneously releasing the storage resources occupied by the corresponding primitive block, allowing new primitive blocks to be assembled normally.
[0149] In some embodiments, when there is insufficient primitive block index resources or insufficient storage resources, at least two primitive block index resources are forcibly released. This application embodiment does not limit the number of primitive block index resources released when forcibly released.
[0150] In some embodiments, when the resource request module 820 receives a resource request from outside the resource management device, it sends a second request D2 to the resource status maintenance module 810. The second request D2 requests the resource status maintenance module 810 to allocate primitive block index resources for primitive blocks. When primitive block index resources are insufficient, the resource status maintenance module 810 issues a resource insufficiency indication D1 to the resource request module 820. The resource insufficiency indication D1 indicates that primitive block index resources are insufficient. When the resource request module 820 receives the resource insufficiency indication D1, it sends a fourth request D5 to the resource release module 830.
[0151] In some embodiments, after allocating primitive block index resources for a primitive block, the resource allocation module 820 requests the storage resources required for the primitive block. If the storage resources are insufficient, it sends a fourth request D5 to the resource release module 830. At this time, the primitive block has obtained primitive block index resources, but when assembling the primitive block, the storage resources used to store the primitive are insufficient, and the primitive block cannot be assembled. The primitive block index resources need to be forcibly released. After the primitive block index resources are forcibly released, the primitive block corresponding to the primitive block index resources can be packaged and sent to the downstream processing pipeline for processing, thus freeing up some storage resources that can be allocated to newly requested primitive blocks.
[0152] In other embodiments, the resource management device includes a primitive block index resource management device and an address resource management device. After the resource application module 820 obtains primitive block index resources, the resource application module applies to the address resource management device for the storage resources required by the primitive blocks. When the storage resources are insufficient, a fourth request D5 is sent to the resource release module 830.
[0153] like Figure 9 In the resource management device shown, after requesting primitive block index resources, the resource request module 920 sends a request to the write control module 960, requesting the allocation of storage resources. The allocated storage resources are stored in the storage module 970, which allocates storage resources for each assembled primitive block. The write control module 960 can control the writing of primitives into the storage resources allocated to the primitive blocks.
[0154] In some embodiments, when the resource release module 830 receives the fourth request D5, it sends the first request D4 to the resource status maintenance module 810.
[0155] When the conditions for forced release are met, the resource request module sends a fourth request to the resource release module to request the forced release of primitive block index resources. When primitive block index resources are insufficient, they can be forcibly released for allocation, avoiding lag caused by waiting for primitive block index resource allocation and improving running efficiency.
[0156] Upon receiving the first request D4, the resource status maintenance module 810 determines the first primitive block index resource from the first status list. The first status list records the allocated primitive block index resources. The primitive block index resources recorded in the first status list are sorted according to the order of application time, and the first primitive block index resource is the earliest applied primitive block index resource in the first status list.
[0157] The resource status maintenance module 810 maintains a first status list, which records the allocated primitive block index resources. The primitive block index resources recorded in the first status list are sorted according to the application time. In other words, the application time order of the allocated primitive block index resources can be determined based on the first status list.
[0158] In some embodiments, the entries in the first state list are assigned serial numbers, with the serial numbers corresponding to the application time order of the primitive block index resources. The order of the primitive block index resource's application time can be determined by the serial number of the entry in the first state list. Illustratively, the primitive block index resource stored in the entry with the smallest serial number was applied for earliest, and the primitive block index resource stored in the entry with the largest serial number was applied for latest. In other embodiments, the primitive block index resource stored in the entry with the largest serial number was applied for earliest, and the primitive block index resource stored in the entry with the smallest serial number was applied for latest.
[0159] This application example uses the earliest application time of the primitive block index resource stored in the table entry with the smallest sequence number as an example, without limiting the correspondence between the sequence number and the application time of the primitive block index resource.
[0160] In some embodiments, entries storing primitive block index resources are adjacent; that is, allocated primitive block index resources are stored in entries with smaller entry numbers, and there are no unoccupied entries between entries storing primitive block index resources. In other embodiments, entries storing primitive block index resources are not adjacent; that is, there are unoccupied entries between entries storing primitive block index resources.
[0161] This application uses the example of adjacent entries storing primitive block index resources to illustrate the concept, without limiting whether the entries storing primitive block index resources are adjacent.
[0162] Not all entries in the first state list contain primitive block index resources. Only allocated primitive block index resources can be stored in the first state list. Unallocated primitive block index resources cannot be stored in the first state list. Entries in the first state list can be empty. The number of entries storing primitive block index resources represents the number of allocated primitive block index resources.
[0163] Among the allocated primitive blocks, the primitive block corresponding to the earliest requested primitive block index resource occupies the longest time in storage space. Releasing this primitive block index resource can minimize the need to re-request primitive block index resources due to the forced release of a newly requested primitive block index resource. Simultaneously, this primitive block may remain in storage space because it is missing a certain primitive and has not yet been assembled and sent to the downstream processing pipeline. Compared to other primitive blocks, releasing this primitive block is most likely to prevent it from remaining stagnant and occupying space for too long, thus improving the utilization rate of primitive blocks.
[0164] like Figure 3 The diagram illustrating the determination of primitive block index resources is used as an example. The second state list contains the status, rt_number, and mask corresponding to the primitive block index resource. status indicates the allocation status of the primitive block index resource; rt_number is the primitive block identifier used to distinguish different primitive blocks; the corresponding rt_number is updated during the allocation and release of primitive block index resources; and mask is the mask of the primitive block index resource. In the first state list, SLOT corresponds to the allocated primitive block index resource. SLOT includes the primitive block identifier rt_number corresponding to the allocated primitive block index resource. The lower the rank of the SLOT, the earlier the primitive block index resource was requested. LUT is a lookup table used to select from eligible primitive block index resources. current_ptr is the release command; upon receiving current_ptr, a suitable primitive block index resource needs to be selected from the first state list and deleted.
[0165] In the diagram, current_ptr is the release instruction. When the release instruction does not specify the primitive block index resource to be released, it is a forced release instruction. In this case, the primitive block index resource corresponding to SLOT0 in the first state list is selected as the first primitive block index resource.
[0166] In some embodiments, after determining the first primitive block index resource, the resource status maintenance module 810 deletes the first primitive block index resource from the first status list and moves the primitive block index resources following the first primitive block index resource forward in sequence, wherein the application time of the primitive block index resources following the first primitive block index resource is after the application time of the first primitive block index resource.
[0167] After the resource status maintenance module determines the first primitive block index resource to be forcibly released, it updates the first status list so that the primitive block index resources recorded in the first status list can still be sorted according to the application time, thus ensuring the correctness of the first status list.
[0168] The first status list records the allocated primitive block index resources. When the resource status maintenance module 810 receives the first request D4, the first primitive block index resource will be released. In order to keep the first list recording the allocated primitive block index resources, the first primitive block index resource needs to be deleted from the first status list.
[0169] In some embodiments, after the resource status maintenance module 810 deletes the first primitive block index resource from the first status list, it needs to shift the primitive block index resources following the first primitive block index resource forward sequentially. That is, the primitive block index resources following the first primitive block index resource in the first status list are shifted one position forward sequentially, so that the entries storing primitive block index resources in the first status list are adjacent, maintaining the primitive block index resources in the first list in order of application time.
[0170] like Figure 3 As shown, the rt_number stored in SLOT1 is written to SLOT0, the rt_number stored in SLOT2 is written to SLOT1, and so on, until the rt_number stored in SLOT39 is written to SLOT38. The primitive block index resources in the updated first state list are sorted by application time.
[0171] In some embodiments, after determining the first primitive block index resource, the resource status maintenance module 810 modifies the allocation status of the first primitive block index resource in the second status list to unallocated.
[0172] The resource status maintenance module 810 maintains a second status list, which includes the allocation status of the primitive block index resource and the mask.
[0173] The allocation status of a primitive block index resource indicates whether it has been allocated to a primitive block. The mask corresponding to the primitive block index resource indicates whether it is in a first or second state. A primitive block index resource in the first state cannot be allocated, while a primitive block index resource in the second state can be allocated.
[0174] In some embodiments, the primitive block index resource in the second state list also corresponds to a primitive block resource number. The primitive block resource number is used to indicate a primitive block. After the primitive block index resource allocated to the primitive block is released, the primitive block is sent to the downstream processing unit for primitive block processing. The primitive block resource number can still be used in the downstream processing unit to indicate the corresponding primitive block, which facilitates the management of the primitive block.
[0175] The second state list records the allocation status of primitive block index resources. When the resource state maintenance module 810 receives the first request D4, the first primitive block index resource will be released. The second state list needs to be updated to change the allocation status of the first primitive block index resource in the second state list to unallocated, so as to ensure the correctness of the allocation status of the first primitive block index resource in the second state list.
[0176] In some embodiments, the resource state maintenance module 810 maintains the state indicated by the mask corresponding to the first primitive block index resource used for forced release as the first state.
[0177] The second state list records the mask corresponding to the primitive block index resource. When the resource state maintenance module 810 determines the first primitive block index resource to be forcibly released, the first primitive block index resource will be forcibly released. The mask corresponding to the first primitive block index resource needs to be kept in the first state in the second state list. At this time, the primitive block index resource cannot be used for allocation.
[0178] In some embodiments, the resource status maintenance module 810 maintains an allocation list. The allocation list determines the correspondence between primitive blocks and first primitive block index resources. That is, primitive blocks allocated primitive block index resources are recorded in the allocation list. The allocation list can determine whether a primitive block has been allocated primitive block index resources and the corresponding primitive block index resources. After determining the first primitive block index resource, the resource status maintenance module 810 deletes the correspondence between primitive blocks and the first primitive block index resource from the allocation list.
[0179] The resource status maintenance module 810 sends a first response D3 to the resource release module 830. The first response D3 is used to instruct the resource release module 830 to release the first primitive block index resource.
[0180] After determining that the first primitive block index resource needs to be forcibly released, the resource status maintenance module 810 needs to inform the resource release module 830 of the primitive block index resource to be forcibly released. The resource status maintenance module 810 sends a first response D3 to the resource release module 830, informing the resource release module 830 to release the first primitive block index resource.
[0181] Upon receiving the first response D3, the resource release module 830 releases the first primitive block index resource.
[0182] The resource release module 830 receives the first response D3 from the resource status maintenance module 810. It can determine the primitive block index resource that needs to be forcibly released through the first response D3, and the resource release module 830 forcibly releases the primitive block index resource.
[0183] In some embodiments, "receiving the first response D3" by the resource release module 830 means before receiving the first response D3. In other embodiments, "receiving the first response D3" by the resource release module 830 means after receiving the first response D3. In still other embodiments, "receiving the first response D3" by the resource release module 830 means simultaneously with receiving the first response D3. This application does not limit the timing of determining that the first response D3 has been received.
[0184] In some embodiments, the resource release module 830 maintains an allocation list, which determines the correspondence between primitive blocks and first primitive block index resources. In other words, primitive blocks that have been allocated primitive block index resources are recorded in the allocation list. The allocation list can be used to determine whether a primitive block has been allocated primitive block index resources and the corresponding primitive block index resources.
[0185] Allocating a primitive block index resource to a primitive block refers to associating a primitive block with a primitive block index resource. Illustratively, an allocation list records the correspondence between a primitive block and a first primitive block index resource. The resource release module 830 forcibly releasing the first primitive block index resource means releasing the correspondence between the primitive block and the first primitive block index resource. Illustratively, this involves deleting the entry in the allocation list showing the correspondence between the primitive block and the first primitive block index resource. In some embodiments, after releasing the first primitive block index resource, the resource release module 830 sends the primitive block corresponding to the first primitive block index resource to the downstream processing pipeline. After releasing the primitive block index resource, the corresponding primitive block cannot receive new primitives and needs to be sent to the downstream processing pipeline for further processing.
[0186] like Figure 9 The resource management device shown in the diagram, after receiving a first response indicating the forced release of the first primitive block index resource, the resource release module 930 sends a release primitive block instruction to the storage module 970. The storage module 970 then releases the primitive block corresponding to the first primitive block index resource into the downstream processing pipeline for further processing.
[0187] When the resource release module 830 completes the release of the first primitive block index resource, it sends a re-request instruction D6 to the resource request module 820. The re-request instruction D6 is used to instruct the resource request module to re-request primitive block index resources for the primitive block.
[0188] In some embodiments, when the resource allocation module 820 allocates primitive block index resources for a primitive block, if there are insufficient primitive block index resources, it sends a fourth request D5 to the resource release module 830, requesting the resource release module 830 to forcibly release a primitive block index resource. After the resource release module 830 successfully forcibly releases the resource, it sends a re-allocation instruction D6 to the resource allocation module 820, informing the resource allocation module 820 that the primitive block index resource has been successfully forcibly released, there are available primitive block index resources for allocation, and the allocation of primitive block index resources can be re-established.
[0189] In some embodiments, when the resource request module 820 receives the re-request instruction D6, it resends a second request to the resource status maintenance module, requesting the allocation of primitive block index resources and allocating primitive block index resources for the primitive blocks.
[0190] The following describes the process of requesting primitive block index resources by the resource management device.
[0191] The resource application module 820 sends a second request D2 to the resource status maintenance module 810. The second request D2 is used to request the resource status maintenance module to allocate primitive block index resources for primitive blocks.
[0192] When a new primitive is not suitable for an existing primitive block being assembled, or when the new primitive requires a new primitive block to be requested according to the primitive block assembly rules, a new primitive block index resource needs to be allocated. In other words, when a new primitive cannot be placed into an existing primitive block, a new primitive block needs to be requested and a new primitive block index resource allocated to it, so that the new primitive can be successfully assembled into a primitive block.
[0193] The resource application module 820 allocates primitive block index resources to primitive blocks, which requires first determining a primitive block index resource.
[0194] In some embodiments, the resource request module 820 does not have the ability to determine the primitive block index resource to be allocated, while the resource status maintenance module 810 maintains a second status list. The second status list contains the allocation status and mask corresponding to the primitive block index resource, and the resource status maintenance module 810 can determine the primitive block index resource to be allocated based on the second status list. The resource request module 820 determines the primitive block index resource to be allocated by issuing a primitive block index resource request to the resource status maintenance module 810.
[0195] In other embodiments, the resource request module 820 has the ability to determine the primitive block index resource to be allocated. After determining the primitive block index resource to be allocated, the resource request module allocates the primitive block index resource to the primitive block. At this time, the resource request module 820 sends a request to the resource status maintenance module 810 to update the first status list and the second status list, so that the status of the allocated primitive block index resource remains correct.
[0196] In some embodiments, after receiving a resource request instruction from outside the resource management device, the resource request module 820 sends a second request D2 to the resource status maintenance module.
[0197] like Figure 9 The resource management device shown in the diagram, after receiving a resource request instruction from outside the resource management device, the resource request module 920 sends a second request to the resource status maintenance module 910, requesting the resource status maintenance module to indicate the primitive block index resource for allocation.
[0198] Upon receiving the second request D2, the resource status maintenance module 810 identifies the primitive block index resource in the second status list that has the mask indicating the second status, the allocation status of the unallocated resource, and the smallest index as the second primitive block index resource.
[0199] The mask corresponding to the primitive block index resource recorded in the second state list is used to indicate whether the primitive block index resource is in the first state or the second state. Primitive block index resources in the first state cannot be allocated, while primitive block index resources in the second state can be allocated.
[0200] like Figure 3 As shown, when determining the second primitive block index resource for allocation, primitive block index resources with status==free and mask==0 are selected from the second status list. status==free means the allocation status is unallocated, and mask==0 means the mask is the second status. Among all primitive block index resources with status==free and mask==0, the primitive block index resource with the smallest index is selected as the second primitive block index resource.
[0201] The state indicated by the mask corresponding to the primitive block index resource in the second state list is changed from the second state to the first state when requesting primitive block index resources; it remains in the first state when releasing primitive block index resources; and it is changed from the first state to the second state when the state indicated by the mask corresponding to all primitive block index resources in the second state list is the first state.
[0202] When allocating primitive block index resources, the resource status maintenance module 810 selects the primitive block index resource with the mask indicating the second state, the allocation status being unallocated, and the smallest index as the second primitive block index resource. Selecting this resource ensures that each request for primitive block index resources is allocated according to index order. Only after all primitive block index resources have been allocated or allocated once can they be reallocated. In other words, when requesting primitive block index resources, before changing the mask indicating the unallocated primitive block index resource in the second state list to the second state, the primitive block index resource with the smallest index is selected for allocation from the unallocated primitive block index resources.
[0203] like Figure 5 The selection process of the second primitive block index resource is illustrated using the table shown below. The table records the allocation status and mask of each primitive block index resource. During allocation, the resource status maintenance module 810 selects primitive block index resource 4 as the second primitive block index resource. At this time, primitive block index resource 3, with a smaller sequence number, is also in an unallocated state, but its mask is in the first state, indicating that it has already been allocated once and cannot be used for allocation. Only after primitive block index resource 6 is also allocated will the mask indicating the first state be found for all primitive block index resources in the second state list. The resource status maintenance module 810 then modifies the mask indicating the second state for primitive block index resources that were previously unallocated. Only then can primitive block index resource 3 be used for allocation.
[0204] In other embodiments, when allocating primitive block index resources, the resource status maintenance module 810 randomly selects a primitive block index resource as the second primitive block index resource from those whose mask indicates the second state and whose allocation state is unallocated. That is, when requesting primitive block index resources, before modifying the state indicated by the mask corresponding to the unallocated primitive block index resource in the second state list to the second state, a primitive block index resource is randomly selected from the unallocated primitive block index resources for allocation, without needing to meet the minimum index requirement.
[0205] by Figure 5 The process of selecting the second primitive block index resource is illustrated in the table below. The table records the allocation status and mask of each primitive block index resource. During allocation, the resource status maintenance module 810 randomly selects either primitive block index resource 4 or primitive block index resource 6 as the second primitive block index resource; both can be used for allocation.
[0206] The resource status maintenance module 810 maintains a first status list and a second status list. After determining the second primitive block index resource, it is necessary to update the first status list that records the allocated primitive block index resources and the second status list that records the allocation status of the corresponding primitive block index resources, so that the first status list correctly records the allocated primitive block index resources and the second status list correctly records the allocation status and mask of the primitive block index resources.
[0207] In some embodiments, after determining the second primitive block index resource, the resource status maintenance module 810 writes the second primitive block index resource after the last primitive block index resource in the first status list.
[0208] After the resource status maintenance module determines the second primitive block index resource to be allocated, it updates the first status list so that the primitive block index resources recorded in the first status list can still be sorted according to the application time, thus ensuring the correctness of the first status list.
[0209] The first state list records the allocated primitive block index resources. After the resource state maintenance module 810 determines the second primitive block index resource to be allocated, the second primitive block index resource will be allocated to the primitive block. At this time, the second primitive block index resource will be used to allocate the primitive block, and the second primitive block index resource needs to be added to the first state list so that the first state list contains all the allocated primitive block index resources.
[0210] In some embodiments, to sort the primitive block index resources in the first state list according to their application time, the second primitive block index resource is written after the last primitive block index resource in the first state list. At this point, the second primitive block index resource is at the end of the first state list, meaning it is the most recently applied primitive block index resource.
[0211] In some embodiments, after determining the second primitive block index resource, the resource status maintenance module 810 updates the allocation status corresponding to the second primitive block index resource in the second status list to allocated.
[0212] After the resource status maintenance module determines the second primitive block index resource to be allocated, it updates the second status list, so that the allocation status corresponding to the primitive block index resource recorded in the second status list is changed to allocated, thus ensuring the correctness of the second status list.
[0213] The second status list records the allocation status corresponding to the primitive block index resource. After the resource status maintenance module 810 determines the second primitive block index resource to be allocated, the second primitive block index resource will be used to allocate primitive blocks. The allocation status corresponding to the second primitive block index resource needs to be modified to allocated in the second status list.
[0214] In some embodiments, after determining the second primitive block index resource, the resource status maintenance module 810 modifies the status indicated by the mask corresponding to the second primitive block index resource to the first status.
[0215] The second state list records the mask corresponding to the primitive block index resource. After the resource state maintenance module 810 determines the second primitive block index resource to be allocated, the second primitive block index resource will be used to allocate primitive blocks. At this time, the mask corresponding to the second primitive block index resource needs to be modified to the first state in the second state list, indicating that the second primitive block index resource cannot be used for allocation.
[0216] In some embodiments, the resource state maintenance module 810 maintains the state indicated by the mask corresponding to the released primitive block index resource as the first state.
[0217] The second state list records the mask corresponding to the primitive block index resource. After the primitive block index resource is released, the primitive block index resource will have been released. The mask corresponding to the primitive block index resource needs to be kept in the first state in the second state list, indicating that the primitive block index resource cannot be used for allocation.
[0218] In some embodiments, when the mask indicating the status of all primitive block index resources in the second status list is in the first status, the resource status maintenance module 810 modifies the mask indicating the status of the primitive block index resources whose allocation status is unallocated to the second status.
[0219] The second state list records the masks corresponding to primitive block index resources. When the mask indicating the state of all primitive block index resources in the second state list is the first state, all primitive block index resources cannot be allocated. However, some primitive block index resources have been released and can be allocated. It is necessary to modify the mask corresponding to the released primitive block index resources in the second state list to the second state, indicating that the primitive block index resources whose state indicated by the corresponding mask is the second state can be allocated.
[0220] By modifying the mask indicating the status of the primitive block index resource to be allocated, released, or all primitive block index resources to the status of the first state, the resource status maintenance module ensures the correctness of the second state list by modifying the status indicated by the mask corresponding to the primitive block index resource recorded in the second state list.
[0221] In some embodiments, the resource status maintenance module 810 maintains an allocation list. The allocation list determines the correspondence between primitive blocks and second primitive block index resources. That is, primitive blocks allocated primitive block index resources are recorded in the allocation list. The allocation list can determine whether a primitive block has been allocated primitive block index resources and the corresponding primitive block index resources. After determining the second primitive block index resource, the resource status maintenance module 810 adds the correspondence between the primitive block and the second primitive block index resource to the allocation list.
[0222] The resource status maintenance module 810 sends a second response D1 to the resource request module 820. The second response D1 is used to indicate the allocation of a second primitive block index resource for the primitive block.
[0223] After selecting the primitive block index resource for allocation, the resource status maintenance module 810 needs to inform the resource application module of the selected primitive block index resource.
[0224] In some embodiments, the second response D1 includes an index of the second primitive block index resource, and the resource request module 820 can determine the second primitive block index resource through the index.
[0225] Upon receiving the second response D1, the resource request module 820 allocates the second primitive block index resource to the primitive block.
[0226] By allocating primitive block index resources with the second state, whose mask indicates the second state, whose allocation state is unallocated, and which have the smallest index in the second state list, the possibility of repeatedly requesting the same primitive block index resource within a period of time is reduced, thereby improving the utilization rate of primitive block index resources and improving the operating efficiency of the resource management device.
[0227] In some embodiments, "receiving the second response D1" by the resource release module 830 means before receiving the second response D1. In other embodiments, "receiving the second response D1" by the resource release module 830 means after receiving the second response D1. In still other embodiments, "receiving the second response D1" by the resource release module 830 means simultaneously with receiving the second response D1. The embodiments of this application do not limit the timing of determining that the second response D1 has been received.
[0228] In some embodiments, after receiving a second response indicating the second primitive block index resource, the resource request module 820 requests storage resources from the storage resource management module.
[0229] like Figure 9The resource management device shown has a resource request module 920 that sends a request to the write control module 960 to allocate storage resources for the primitive blocks. After allocating primitive block index resources and storage resources for the primitive blocks, the write control module 960 writes the primitives into the allocated storage resources to assemble the primitive blocks.
[0230] After determining the second primitive block index resource to be allocated, the resource request module 820 can allocate the primitive block index resource for the primitive block.
[0231] In some embodiments, the resource request module 820 maintains an allocation list. Allocating a primitive block index resource to a primitive block refers to writing the correspondence between the primitive block and the second primitive block index resource into the allocation list. The resource request module 820 can determine the correspondence between the primitive block and the second primitive block index resource through the allocation list.
[0232] After a primitive block is allocated to a primitive block index resource, the primitive block can receive primitives of the same type. Once the primitive block is full, it can be released and sent to the downstream processing pipeline for the next step of processing.
[0233] The following describes the process of releasing primitive block index resources by the resource management device.
[0234] The resource release module 830 sends a third request D4 to the resource status maintenance module 810. The third request D4 is used to request the resource status maintenance module 810 to update the allocation status corresponding to the third primitive block index resource to be released.
[0235] There is an upper limit to the number of primitives that a primitive block can hold. When the limit is reached, the primitive block needs to be sent to the downstream processing pipeline for further processing. Before the primitive block is sent downstream, the primitive block index resource corresponding to the primitive block needs to be released.
[0236] Releasing primitive block index resources requires synchronously updating the status of primitive block index resources to ensure data consistency. The resource release module 830 sends a third request to the resource status maintenance module, requesting an update to the allocation status corresponding to the third primitive block index resource.
[0237] In some embodiments, after receiving a resource release request from outside the resource management device, the resource release module 830 sends a third request D4 to the resource status maintenance module 810.
[0238] like Figure 9 The resource management device shown has a resource release module 930 that receives a resource release command from outside the device. The resource release command specifies the third primitive block index resource to be released. The resource release module 930 then sends a third request to the resource status maintenance module 910, requesting the resource status maintenance module 910 to update the allocation status corresponding to the third primitive block index resource.
[0239] The resource status maintenance module 810 maintains a first status list and a second status list. After releasing primitive block index resources, it is necessary to update the first status list that records the allocated primitive block index resources and the second status list that records the allocation status of the corresponding primitive block index resources, so that the first status list correctly records the allocated primitive block index resources and the second status list correctly records the allocation status and mask of the primitive block index resources.
[0240] Upon receiving the third request D4, the resource status maintenance module 810 removes the third primitive block index resource from the first status list and moves the primitive block index resources following the third primitive block index resource forward in sequence. The primitive block index resources following the third primitive block index resource were requested after the third primitive block index resource.
[0241] The first state list records the allocated primitive block index resources. When the resource state maintenance module 810 receives the third request D4, the third primitive block index resource will be released and needs to be deleted from the first state list.
[0242] In some embodiments, after the resource status maintenance module 810 deletes the third primitive block index resource from the first status list, it needs to shift the primitive block index resources located after the third primitive block index resource forward sequentially. That is, the primitive block index resources located after the third primitive block index resource in the first status list are shifted forward one position in sequence, so that the entries storing primitive block index resources in the first status list are adjacent.
[0243] like Figure 3 As shown, when the release command current_ptr is received, current_ptr includes the primitive block identifier rt_number corresponding to the primitive block index resource to be released. By matching the rt_number in current_ptr with the rt_number stored in SLOT in the first state list, the position of the third primitive block index resource stored in the first state list is found, the primitive block index resource stored at that position is deleted, and the primitive block index resources after the third primitive block index resource are sequentially moved forward one position.
[0244] In some embodiments, when the resource status maintenance module 810 receives the third request D4, it updates the allocation status of the resource corresponding to the third primitive block index in the second status list to unallocated.
[0245] Upon receiving a third request, the resource status maintenance module updates the second status list, changing the allocation status of the primitive block index resources recorded in the second status list to unallocated, thus ensuring the correctness of the second status list.
[0246] The second state list records the allocation status of primitive block index resources. When the resource state maintenance module 810 receives the third request D4, the third primitive block index resource will be released, and the second state list will be updated to ensure the correctness of the allocation status corresponding to the third primitive block index resource in the second state list.
[0247] In some embodiments, the resource state maintenance module 810 maintains the state indicated by the mask corresponding to the third primitive block index resource that is about to be released as the first state.
[0248] The second state list records the mask corresponding to the primitive block index resource. After updating the allocation status of the third primitive block index resource in the second state list, the resource state maintenance module 810 needs to keep the mask corresponding to the third primitive block index resource in the first state. At this time, the third primitive block index resource cannot be used for allocation.
[0249] The resource status maintenance module 810 sends a third response D3 to the resource release module 830. The third response D3 is used to indicate that the allocation status update of the resource corresponding to the third primitive block index is complete.
[0250] Upon receiving a third request, the resource status maintenance module 810 updates the first status list, ensuring that the primitive block index resources recorded in the first status list are still sorted according to the application time, thus guaranteeing the correctness of the first status list.
[0251] After updating the first status list, the resource status maintenance module 810 needs to inform the resource release module 830 that the allocation status of the third primitive block index resource has been updated to ensure the consistency of the resource status.
[0252] In some embodiments, upon receiving a third response D3, the resource release module 830 determines the consistency of the third primitive block index resource status and then releases the third primitive block index resource.
[0253] In some embodiments, "receiving the third response D3" by the resource release module 830 means before receiving the third response D3. In other embodiments, "receiving the third response D3" by the resource release module 830 means after receiving the third response D3. In still other embodiments, "receiving the third response D3" by the resource release module 830 means simultaneously with receiving the third response D3. This application does not limit the timing of determining that the first response D3 has been received.
[0254] In some embodiments, the resource release module 830 maintains an allocation list to determine the correspondence between primitive blocks and third primitive block index resources. Allocating primitive block index resources to a primitive block means associating the primitive block with its index resource. Illustratively, the allocation list records the correspondence between primitive blocks and third primitive block index resources. Releasing the third primitive block index resource by the resource release module 830 means releasing the correspondence between the primitive block and the third primitive block index resource. Illustratively, this involves deleting the entry in the allocation list representing the correspondence between the primitive block and the third primitive block index resource.
[0255] In some embodiments, after releasing the third primitive block index resource, the resource release module 830 sends the primitive block corresponding to the third primitive block index resource to the downstream processing pipeline. Releasing the primitive block index resource means that the primitive block has been assembled and needs to be sent to the downstream processing pipeline for the next step of processing.
[0256] In summary, after receiving the first request through the resource status maintenance module, the first primitive block index resource is selected from the first status list and forcibly released by the resource release module. The first status list records the allocated primitive block index resources, which are sorted according to their application time, with the first primitive block index resource being the earliest applied primitive block index resource. During forced release, the resource release module forcibly releases the earliest applied primitive block index resource, which avoids the need to re-apply for primitive block index resources due to the forced release of newly applied primitive block index resources, thereby reducing the performance degradation caused by multiple re-applications of primitive block index resources.
[0257] Figure 10 A flowchart illustrating the execution process of a resource management method according to another illustrative embodiment of this application is shown. This method is applied to any of the resource management devices described in the above embodiments, the resource management device including a resource status maintenance module, a resource request module, and a resource release module. Figure 10 As shown, the method includes: Step 1010: The resource release module sends a first request to the resource status maintenance module. The first request is used to request the resource status maintenance module to indicate the primitive block index resource to be forcibly released.
[0258] Step 1020: Upon receiving the first request, the resource status maintenance module determines the first primitive block index resource from the first status list. The first status list records the allocated primitive block index resources, and the primitive block index resources recorded in the first status list are sorted according to the order of application time.
[0259] Among them, the first primitive block index resource is the earliest applied primitive block index resource in the first state list.
[0260] Step 1030: The resource status maintenance module sends a first response to the resource release module. The first response is used to instruct the resource release module to release the first primitive block index resource.
[0261] Step 1040: Upon receiving the first response, the resource release module releases the first primitive block index resource.
[0262] Step 1050: After the release of the first primitive block index resource is completed, the resource release module sends a re-request instruction to the resource request module. The re-request instruction is used to instruct the resource request module to re-request primitive block index resources for the primitive block.
[0263] In some embodiments, after determining the first primitive block index resource, the resource status maintenance module deletes the first primitive block index resource from the first status list and sequentially moves the primitive block index resources following the first primitive block index resource forward. The primitive block index resources following the first primitive block index resource were requested after the first primitive block index resource was requested.
[0264] In some embodiments, the resource status maintenance module maintains a second status list, which includes the allocation status and mask corresponding to the primitive block index resource. The allocation status is used to indicate whether the primitive block index resource has been allocated to a primitive block, and the mask is used to indicate whether the primitive block index resource is in a first state or a second state. The primitive block index resource in the first state cannot be used for allocation, and the primitive block index resource in the second state can be used for allocation. The resource request module is used to send a second request to the resource status maintenance module. The second request is used to request the resource status maintenance module to allocate primitive block index resources for primitive blocks. The resource status maintenance module is used to, upon receiving a second request, identify the primitive block index resource in the second status list that is masked as the second status, has an allocation status of unallocated, and has the smallest index as the second primitive block index resource; and send a second response to the resource request module, the second response being used to indicate the allocation of the second primitive block index resource for the primitive block; The resource request module is used to allocate a second primitive block index resource to a primitive block upon receiving a second response.
[0265] In some embodiments, the resource status maintenance module is used to write the second primitive block index resource after the last primitive block index resource in the first status list after determining the second primitive block index resource.
[0266] In some embodiments, the resource status maintenance module is used to update the allocation status corresponding to the second primitive block index resource in the second status list to allocated after determining the second primitive block index resource; The resource status maintenance module is also used to update the allocation status of the allocation status corresponding to the first primitive block index resource in the second status list to unallocated after the first primitive block index resource is determined.
[0267] In some embodiments, the resource status maintenance module is used to modify the status indicated by the mask corresponding to the second primitive block index resource to the first status after determining the second primitive block index resource; The resource status maintenance module is also used to keep the status indicated by the mask corresponding to the released primitive block index resource as the first state; The resource status maintenance module is also used to modify the status indicated by the mask corresponding to the unallocated primitive block index resource to the second status when the status indicated by the mask corresponding to all primitive block index resources in the second status list is the first status.
[0268] In some embodiments, the resource release module is used to send a third request to the resource status maintenance module, the third request being used to request the resource status maintenance module to update the allocation status corresponding to the third primitive block index resource to be released. The resource status maintenance module is used to, upon receiving a third request, delete the third primitive block index resource from the first status list and sequentially move the primitive block index resources following the third primitive block index resource forward, wherein the application time of the primitive block index resources following the third primitive block index resource is after the application time of the third primitive block index resource; and send a third response to the resource release module, the third response being used to indicate that the allocation status update corresponding to the third primitive block index resource is complete.
[0269] In some embodiments, the resource status maintenance module is used to update the allocation status of the resource corresponding to the third primitive block index in the second status list to unallocated upon receiving a third request.
[0270] In some embodiments, the resource request module is used to send a fourth request to the resource release module when the forced release conditions are met. The fourth request is used to instruct the resource release module to forcibly release the primitive block index resource. The resource release module is used to send a first request to the resource status maintenance module upon receiving a fourth request.
[0271] In summary, after receiving the first request through the resource status maintenance module, the first primitive block index resource is selected from the first status list and forcibly released by the resource release module. The first status list records the allocated primitive block index resources, which are sorted according to their application time, with the first primitive block index resource being the earliest applied primitive block index resource. During forced release, the resource release module forcibly releases the earliest applied primitive block index resource, which avoids the need to re-apply for primitive block index resources due to the forced release of newly applied primitive block index resources, thereby reducing the performance degradation caused by multiple re-applications of primitive block index resources.
[0272] For a detailed description of the resource management process performed by the resource management device in the above-described resource management method, please refer to the embodiments of the resource management device described above. This embodiment will not be repeated here.
[0273] In some embodiments, the resource management device in this application can be integrated into a chip. This application provides a chip that includes the resource management device as provided in any of the above embodiments.
[0274] Optionally, the chip can be a processor, such as an AI processor, a CPU processor, or other processors with vector operation requirements (especially multi-issue and vector branch operation requirements), and this application embodiment does not limit this.
[0275] Please refer to Figure 11 This diagram illustrates a structural block diagram of a computer device 1100 provided in an exemplary embodiment of this application. The computer device 1100 may be a terminal or a server.
[0276] Typically, computer device 1100 includes a processor 1101 and a memory 1102.
[0277] Processor 1101 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1101 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 1101 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1101 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1101 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0278] In some embodiments, the processor 1101 may integrate the resource management device provided in the above embodiments. When there is a resource management requirement, the resource management device can be used to perform resource management tasks.
[0279] The memory 1102 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 1102 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices.
[0280] In some embodiments, the computer device 1100 may also optionally include a peripheral device interface 1103 and at least one peripheral device.
[0281] Those skilled in the art will understand that Figure 11 The structure shown does not constitute a limitation on the computer device 1100 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0282] This application provides a computer-readable storage medium storing a computer program, which is loaded and executed by a processor to implement the resource management methods provided in the above-described method embodiments.
[0283] This application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the processor of the computer device to load and execute the resource management method provided in the above-described method embodiments.
[0284] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0285] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0286] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A resource management method, characterized in that, The method includes: Receive a resource request; wherein the resource request is used to request the allocation of primitive block index resources for the target primitive block; In the absence of any available primitive block index resources, a first primitive block index resource is determined from a first state list; wherein, the first state list records the allocated primitive block index resources, and the primitive block index resources recorded in the first state list are sorted according to the order of application time, and the first primitive block index resource is the earliest applied primitive block index resource in the first state list. Release the index resource of the first primitive block; Once the first primitive block index resource has been released, primitive block index resources are allocated to the target primitive block.
2. The method according to claim 1, characterized in that, The method further includes: After the first primitive block index resource is determined, the first primitive block index resource is deleted from the first status list, and the primitive block index resources following the first primitive block index resource are moved forward sequentially.
3. The method according to claim 1, characterized in that, The method further includes: After identifying the first primitive block index resource, the allocation status corresponding to the first primitive block index resource in the second status list is updated to unallocated; and, Keep the state indicated by the mask corresponding to the released primitive block index resource as the first state; The second state list includes the allocation state and mask corresponding to the primitive block index resource. The allocation state is used to indicate whether the primitive block index resource has been allocated to a primitive block. The mask is used to indicate whether the primitive block index resource is in a first state or a second state. The primitive block index resource in the first state cannot be used for allocation, and the primitive block index resource in the second state can be used for allocation.
4. The method according to claim 3, characterized in that, The method further includes: If there are available primitive block index resources for allocation, the primitive block index resource with the mask indicating the second state, the allocation state being unallocated, and the smallest index in the second state list is identified as the second primitive block index resource. Allocate the second primitive block index resource to the target primitive block.
5. The method according to claim 4, characterized in that, The method further includes: The second primitive block index resource is written after the last primitive block index resource in the first state list.
6. The method according to claim 4, characterized in that, The method further includes: After determining the second primitive block index resource, the allocation status corresponding to the second primitive block index resource in the second status list is updated to allocated; and, Modify the state indicated by the mask corresponding to the second primitive block index resource to the first state.
7. The method according to claim 3 or 6, characterized in that, The method further includes: If the mask indicating the state of all primitive block index resources in the second state list is in the first state, then the mask indicating the state of the primitive block index resources whose allocation state is unallocated will be modified to the second state.
8. The method according to claim 3 or 4, characterized in that, The method further includes: Receive a resource release request; wherein the resource release request is used to request the release of the third primitive block index resource; In response to the resource release request, the third primitive block index resource is removed from the first status list, and the primitive block index resources following the third primitive block index resource are sequentially moved forward; Release the index resource of the third primitive block.
9. The method according to claim 8, characterized in that, The method further includes: In response to the resource release request, the allocation status of the third primitive block index resource in the second status list is updated to unallocated.
10. A resource management device, characterized in that, The device includes a resource status maintenance module, a resource request module, and a resource release module; The resource release module is configured to send a first request to the resource status maintenance module, the first request being used to request the resource status maintenance module to indicate the primitive block index resource to be forcibly released; The resource status maintenance module is configured to, upon receiving the first request, determine a first primitive block index resource from a first status list, wherein the first status list records allocated primitive block index resources, and the primitive block index resources recorded in the first status list are sorted according to the order of application time, and the first primitive block index resource is the earliest applied primitive block index resource in the first status list; and send a first response to the resource release module, wherein the first response is used to instruct the resource release module to release the first primitive block index resource. The resource release module is further configured to release the first primitive block index resource upon receiving the first response; and to send a re-request instruction to the resource request module after the release of the first primitive block index resource is completed, wherein the re-request instruction is used to instruct the resource request module to re-request primitive block index resources for the primitive block.
11. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program that is loaded and executed by the processor to implement the resource management method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the resource management method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium, and a processor reads from and executes the computer program to implement the resource management method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Page table management device and method, graphics processor and electronic equipment
CN116775512A
Resource access control method and device, computer equipment and storage medium
CN118069071A
Data caching method and device and storage medium
CN120892185A
Mileage service provision system and method based on medical information utilization
KR1020210058677A