A resource tag allocation system, method, electronic device and storage medium
By optimizing resource tag allocation through a two-round search mechanism, the problem of low search efficiency in existing technologies is solved, achieving efficient resource tag allocation and low-latency operation, thereby improving system performance and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
- Filing Date
- 2026-03-25
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, resource tag allocation and lookup are inefficient, especially when the number of Buffer IDs increases or a large number of concurrent requests are processed, leading to system performance bottlenecks and increased power consumption.
A two-round search mechanism is adopted. First, the target resource data of the storage device is obtained through the address call module, the target cache array is constructed, and the resource status value of each row is traversed in turn to determine the target label row. Then, the resource status values in the target label row are traversed to determine the target label bit and device number, thereby reducing the search depth.
It improves the efficiency of resource tag allocation, reduces system power consumption, ensures low-latency operation under high load, and enhances the system's concurrency performance and stability.
Smart Images

Figure CN122173292A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically to a resource tag allocation system, method, electronic device, and storage medium. Background Technology
[0002] In a System on Chip (SoC), dynamic management of physical storage resources is one of the core technologies to ensure efficient system operation. Since there is a mapping relationship between buffer identifiers (Buffer IDs) and physical storage resources, dynamic management of physical storage resources is achieved by managing and allocating buffer identifiers.
[0003] In related technologies, Buffer IDs are usually stored in the form of bitmaps. When allocating and looking up resource tags, it is necessary to traverse from the beginning of the bitmap. When the number of Buffer IDs increases, or when dealing with a large number of concurrent requests, the lookup efficiency becomes low, which in turn reduces the efficiency of resource tag allocation. Summary of the Invention
[0004] This application provides a resource tag allocation system, method, electronic device, and storage medium to at least solve the problem of low efficiency in resource tag allocation and searching in related technologies.
[0005] This application provides a resource tag allocation system, including: an address calling module, a first search module, and a second search module; The address call module is used to obtain resource tag application requests. In response to the resource tag application requests, it sequentially obtains the target resource data of at least one storage device and sends the target resource data of at least one storage device to the first search module. The first search module is used to receive target resource data of at least one storage device sent by the address call module, construct a target cache array using the target resource data of at least one storage device as array row data, traverse each row of the target cache array in turn, determine the target label row based on at least one resource status value of each row of the target cache array, and send the target label row to the second search module; wherein, the target label row includes at least one resource status value; The second search module is used to receive the target tag line sent by the first search module, traverse each resource status value of the target tag line, and if any resource status value is valid, determine the bit number corresponding to the resource status value as the target tag bit, and determine the target resource tag according to the target tag bit and its corresponding row number and device number.
[0006] This application also provides a resource tag allocation method, the method comprising: Request a resource tag application; In response to a resource tag request, target resource data for at least one storage device is sequentially acquired; Construct a target cache array by using the target resource data of at least one storage device as array row data; Iterate through each row of the target cache array in sequence, and determine the target label row based on at least one resource status value of each row of the target cache array; wherein the target label row includes at least one resource status value; Iterate through each resource status value in the target label row. If any resource status value is valid, determine the bit number corresponding to the resource status value as the target label bit. Determine the target resource label based on the target label bit and its corresponding row number and device number.
[0007] This application also provides a resource tag allocation device, the device comprising: The first acquisition module is used to acquire resource tag application requests; The second acquisition module is used to sequentially acquire target resource data of at least one storage device in response to a resource tag application request; The building module is used to construct a target cache array by using target resource data from at least one storage device as array row data; The first determining module is used to sequentially traverse each row of the target cache array and determine the target label row based on at least one resource status value of each row of the target cache array; wherein the target label row includes at least one resource status value; The second determining module is used to traverse each resource status value of the target label row, and if any resource status value is valid, determine the bit number corresponding to the resource status value as the target label bit. The third determination module is used to determine the target resource label based on the target label bit and its corresponding row number and device number.
[0008] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described resource tag allocation methods when executing the computer program.
[0009] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described resource tag allocation methods.
[0010] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described resource tag allocation methods.
[0011] This application achieves a two-round search mechanism: first, determining the target resource data in at least one storage device by obtaining a resource tag request; second, using the target resource data as array row data to construct a target cache array; and third, sequentially traversing each row of the target cache array, determining the target tag row based on at least one resource status value in each row, and then traversing each resource status value in the target tag row. If any resource status value is valid, the bit corresponding to the resource status value is determined as the target tag bit. Finally, the target resource tag is determined based on the target tag bit and the corresponding row number and device number. This mechanism reduces the search depth and improves the efficiency of resource tag allocation. Attached Figure Description
[0012] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a schematic diagram of the interaction process of the resource tag allocation system provided in the embodiments of this application; Figure 2 A schematic diagram illustrating an exemplary resource tag allocation structure provided for embodiments of this application; Figure 3 A flowchart illustrating an exemplary resource tag allocation method provided in this application embodiment; Figure 4 A schematic diagram illustrating an exemplary two-round search structure provided in this application embodiment; Figure 5 A flowchart illustrating a resource tag allocation method provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a resource tag allocation device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0015] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0016] In a system-on-a-chip (SoC), dynamic management of cache resources is one of the core technologies for ensuring efficient system operation. SoCs typically integrate multiple functional modules, such as SSD controller chips, network processors, image processors, and AI chips. These modules need to frequently exchange data; therefore, an efficient cache management mechanism plays a crucial role in improving system throughput, reducing latency, and controlling power consumption.
[0017] Currently, common methods for buffer ID management in SoC systems include linear allocation, FIFO queues, linked list management, and bitmap lookup. However, existing solutions often fail to meet the demands of high-concurrency, low-latency environments. Allocation / release latency is a significant issue, as traditional ID allocation methods struggle to achieve low latency during high-speed processing. Especially in scenarios with a large number of concurrent ID allocations, allocation latency and release lag become bottlenecks for system performance. Resource conflicts also contribute to instability in cache resource allocation and release when multiple tasks execute concurrently, impacting overall system throughput. Furthermore, existing management methods suffer from excessive search depth when handling large-scale cache pools, leading to low ID lookup efficiency, particularly when efficient traversal of the ID pool is required, significantly impacting both performance and power consumption.
[0018] In related technologies, Buffer IDs are usually stored in the form of bitmaps. When allocating and looking up resource tags, it is necessary to traverse from the beginning of the bitmap. When the number of Buffer IDs increases, or when dealing with a large number of concurrent requests, the lookup efficiency becomes low, which in turn reduces the efficiency of resource tag allocation.
[0019] To address the aforementioned technical problems, this application provides a resource tag allocation system, method, electronic device, and storage medium. In this resource tag allocation system, by acquiring a resource tag application request, target resource data is obtained from at least one storage device. This target resource data is then used as array row data to construct a target cache array. Each row of the target cache array is traversed sequentially, and a target tag row is determined based on at least one resource status value for each row. Then, each resource status value of the target tag row is traversed again, and if any resource status value is valid, the bit corresponding to that resource status value is determined as the target tag bit. The target resource tag is determined based on the target tag bit and the corresponding row number and device number. This two-round search mechanism—first determining the target cache array, then judging row status values on a row-by-row basis, and finally traversing within the row—reduces the search depth and improves the efficiency of resource tag allocation.
[0020] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0021] This application provides a resource tag allocation system for responding to a user's resource tag application request, identifying available resource tags from multiple resource tags, and allocating them.
[0022] like Figure 1 The diagram shown is an interactive flow diagram of the resource tag allocation system provided in an embodiment of this application. The system includes: an address call module, a first search module, and a second search module. The address call module is used to obtain resource tag application requests. In response to the resource tag application requests, it sequentially obtains the target resource data of at least one storage device and sends the target resource data of at least one storage device to the first search module. The first search module is used to receive target resource data of at least one storage device sent by the address call module, construct a target cache array using the target resource data of at least one storage device as array row data, traverse each row of the target cache array in turn, determine the target label row based on at least one resource status value of each row of the target cache array, and send the target label row to the second search module; wherein, the target label row includes at least one resource status value; The second search module is used to receive the target tag line sent by the first search module, traverse each resource status value of the target tag line, and if any resource status value is valid, determine the bit number corresponding to the resource status value as the target tag bit, and determine the target resource tag according to the target tag bit and its corresponding row number and device number.
[0023] Specifically, the storage device can be a dual-port Static Random-Access Memory (SRAM), with each SRAM configured to be 64 bits wide and 32 rows deep, used to store the resource status values of resource tags. A resource status value of 1 indicates that the resource tag is in an unallocated state (idle), while 0 indicates that the resource tag is in an allocated state (occupied). During initialization, all resource status values are 1. For example, a grouped SRAM structure containing 32 SRAMs, each containing 32 rows, with each row containing 64 bits (64 resource status values), allows the entire storage device to map up to 64K target resource tags.
[0024] Correspondingly, by using a grouped SRAM structure, all resource tags are stored in 32 groups of dual-port SRAMs in bitmap form. The 64-bit width and 32-bit depth configuration of each SRAM can efficiently manage up to 65,536 IDs, greatly reducing hardware overhead. The bitmap compression structure makes the hardware overhead of each ID extremely low, ensuring the management of the ultra-large-scale ID pool.
[0025] The address invocation module (GetID_addr_gen) is responsible for generating read addresses for storage devices in a loop. For any storage device, the address invocation module points to the current row to be accessed on the storage device. Initially, it points to the first row of the storage device. It supports wraparound and rollback mechanisms. After each request is triggered, the address will increment between 0 and 31 and automatically wrap around. If valid data is hit in the cache, the address increment will be paused and the target label row will be locked. The resource status value corresponding to the current row to be accessed pointed to by the address invocation module is the target resource data. The GetID_addr_gen address is initially 0.
[0026] The first search module (First_round_search) maintains a target cache array. The address call module points to the first row of data in each SRAM, and then calls the first row of data in each SRAM to the first search module to form a 32×64-bit target cache array. The priority encoder is used to traverse and search to find the first row that is not all zeros, which is used as the target label row.
[0027] The second search module (Second_round_search) traverses each bit of the target label row determined by the first search module using a priority encoder. In the 64-bit data of the target label row, it finds the first bit that is 1 and uses it as the target label bit.
[0028] The target resource tag is determined by combining the SRAM device number, the target tag bit number, and the target tag row number. For example, if there are 32 storage devices, each with 32 rows and 64 bits of data per row, the target resource tag is 16 bits long. The high 5 bits determine the device number (Addr) of the corresponding storage device, i.e., Buffer_ID[15:11]; the middle 5 bits determine the row number of the target tag row (SRAM_ID), i.e., Buffer_ID[10:6]; and the low 6 bits determine the bit number of the target tag bit (Bit_Index), i.e., Buffer_ID[5:0]. Buffer ID = {Addr (5-bit), SRAM_ID (5-bit), Bit_Index (6-bit)}.
[0029] Accordingly, by determining the target cache array based on resource status values and performing searches based on the target cache array in the first and second search modules, frequent access to SRAM is reduced. The use of a cache machine reduces memory read / write operations and lowers system power consumption. Furthermore, the look-ahead-bit-later two-round search mechanism reduces the search depth, improves ID allocation efficiency, reduces system response time, and ensures low-latency operation even under high load.
[0030] Based on the above embodiments, as an implementable approach, in one embodiment, the first search module is specifically used to: for any row of the target cache array, determine a row status value based on at least one resource status value of the row; and if the row status value is valid, determine that the row is the target label row.
[0031] Specifically, when the row status value is 1, it indicates that the row status value is valid, that is, there is at least one allocatable valid resource status value in the row.
[0032] For any row in the target cache array, its row status value is obtained by performing a logical OR operation on all 64-bit resource status values of that row, and is used to characterize the validity of the row. If the result is 1, it means that the row is valid, that is, there is at least one resource status bit with a value of "1", corresponding to an allocable resource tag; if the result is 0, it means that the row is invalid, that is, all bits are "0", the corresponding resource tags have all been allocated, and there are no free resources.
[0033] For example, any row can be simplified to include a 4-bit resource status value. When the resource status value of the row is 0000, the row status value is 0, indicating that there are no assignable resource tags. When the resource status value of the row is 0010, 1010, 1011 or 1111, the row status value is 1, indicating that the row has at least one assignable resource tag.
[0034] If the row status value is valid, the row is determined to be the target label row, which is used to further retrieve the target label bit in the target label row.
[0035] Correspondingly, the row status value represents the resource tag allocation of the row, avoiding the need to traverse each bit of each row sequentially, thus improving the retrieval efficiency of effective resource tags.
[0036] Based on the above embodiments, as an implementable approach, in one embodiment, the second search module is further configured to: After determining the target resource tag, updating the resource status value corresponding to the target tag bit is invalid; After updating the resource status value, update the row status value of the target tag row to which the target resource tag belongs; Accumulate target resource tags, and use the accumulated value as the assigned tag value; If the allocated tag value is less than the tag requirement value represented by the resource tag application request, and the row status value of the updated target tag row is valid, then re-traverse each resource status value of the target tag row. If any resource status value is valid, determine the bit number corresponding to the resource status value as the new target tag bit, and determine the new target resource tag based on the new target tag bit and its corresponding row number and device number.
[0037] Specifically, after determining the target resource label, the corresponding resource status value is updated to invalid, that is, the resource status value is updated from 1 to 0. Then, the row status value of the corresponding target label row is updated. That is, based on all the resource status values of the updated target label row, a logical "OR" operation is performed again to obtain the updated row status value.
[0038] A resource tag request typically includes at least one tag requirement. If the allocated tag value is less than the tag requirement value, a new target resource tag is determined. The row status value of the target tag row is reassessed. If the row status value is valid, it indicates that there are still allocable resource tags in that row. Then, each resource tag value in the target tag row is re-traversed, and the first resource tag value with a value of 1 is found. The corresponding bit number is determined as the new target tag bit. Based on the row number of the target tag row, the device number of the storage device to which it belongs, and the bit number, the corresponding target resource tag is determined, and the corresponding resource status value and row status value are updated until the allocated tag value equals the tag requirement value represented by the resource tag request.
[0039] Accordingly, by continuing to traverse the target tag row to determine the new target resource tag, the traversal and retrieval from the beginning of the target cache array are avoided, thus improving the efficiency of resource tag allocation.
[0040] Based on the above embodiments, as one possible implementation, in one embodiment, the second search module is specifically used for: If the allocated tag value is less than the tag requirement value represented by the resource tag application request, and the row status value of the updated target tag row is invalid, a first signal is fed back to the first search module so that the first search module responds to the first signal and redetermines the target tag row to obtain a new target tag row.
[0041] Specifically, if the updated target label row status value is invalid, indicating that there are no allocatable resource labels in the target label row, a first signal is sent back to the first search module. The first signal indicates that the current row is invalid, triggering the traversal of new rows in the target cache array to find a new target label row. Based on the row status value, the new target label row is determined. After determining the new target label row, each resource label value is traversed, and the first resource label value that is 1 is found. The corresponding bit number is determined as the new target label bit. Based on the row number of the corresponding target label row, the device number of the storage device to which it belongs, and the bit number, the corresponding target resource label is determined, and the corresponding resource status value and row status value are updated until the allocated label value is equal to the label demand value represented by the resource label application request.
[0042] Accordingly, by continuing to traverse the target cache array to determine the new target tag row, the traversal and retrieval from the beginning position of all resource tags is avoided, thus improving the efficiency of resource tag allocation.
[0043] Based on the above embodiments, as one possible implementation, in one embodiment, the second search module is specifically used for: If the allocated tag value is less than the tag requirement value represented by the resource tag application request, and all row status values of the updated target cache array are invalid, a second signal is fed back to the address call module so that the address call module responds to the second signal, re-acquires the new target resource data of at least one storage device, and sends the new target resource data of at least one storage device to the first search module; In this module, after obtaining new target resource data, the first search module redetermines the new target cache array.
[0044] Specifically, if all row status values of the target cache array are traversed and found to be invalid, indicating that there are no allocatable resource tags in the target cache array, a second signal is fed back to the address invocation module. The second signal indicates that all resource status values in the current target cache array are invalid, triggering the address invocation module to update the row addresses pointing to each storage device, re-acquire new target resource data, send the new target resource data to the first search module, use the new target resource data as new array row data, construct a new target cache array, and continue to determine target resource tags in the new target cache array until the allocated tag value is equal to the tag demand value represented by the resource tag application request.
[0045] Based on the above embodiments, as an implementable approach, in one embodiment, the second search module is further configured to: The allocation of resource tags is completed when the allocated tag value equals the tag requirement value represented by the resource tag application request.
[0046] Based on the above embodiments, as an implementable approach, in one embodiment, the first search module is further configured to: If all row status values of the target cache array are invalid, obtain the current target resource data corresponding to the target cache array in at least one storage device; Determine the current cache array based on at least one current target resource data obtained; Determine the latest cache array based on the target cache array and the current cache array; The latest cache array is sent to at least one storage device so that the storage device updates the corresponding current target resource data based on the latest cache array.
[0047] Specifically, in one embodiment, the latest cache array is determined based on the following formula:
[0048] in, Indicates the latest cache array, Indicates the current cache array, Indicates the target cache array. This indicates that the target cache array is bitwise inverted. This indicates that the current cache array and the inverted initial target cache array are subjected to a logical AND operation bit by bit.
[0049] For example, suppose the initial target cache array is Storage devices also provide When the resource tag corresponding to the first bit of SRAM0 is released, the current cache array corresponding to the storage device is... The latest cache array is obtained by performing calculations with the initial target cache array. The target resource data is updated according to the latest cache array, so that the storage device contains... .
[0050]
[0051] Accordingly, a masked write-back mechanism is used to achieve data synchronization, ensuring the consistency of cached data. When the Buffer IDs in the target cache array are exhausted, the SRAM is updated according to the latest cached data, ensuring that the state of each ID is accurately synchronized and avoiding errors caused by resource conflicts or data inconsistencies.
[0052] Specifically, in one embodiment, when releasing a resource tag, the resource tag is parsed, the device number of the corresponding storage device is determined based on the high 5 bits, the row number is determined based on the middle 5 bits, and the bit number is determined based on the low 6 bits. Then, the corresponding tag bit is determined in the storage device, and the resource status value corresponding to the tag bit is modified from 0 to 1, thus completing the release and recycling of the resource tag.
[0053] Specifically, during the resource tag allocation process, resource tags are reclaimed, causing changes in the current resource status value in the storage device. The corresponding resource status value is updated from 0 to 1. Since the initial target cache array also has resource tag allocation, its corresponding resource status value also changes. Therefore, the current target resource data in the storage device and the target resource data in the target cache array are different. To maintain data consistency, the current target resource data corresponding to the target cache array is obtained, the current cache array is generated, and it is calculated with the initial target cache array to obtain the latest cache array. This allows the storage device to update the corresponding current target resource data according to the latest cache array.
[0054] Specifically, in one embodiment, the release operation requires an SRAM "read-modify-write" process. This process checks whether the released ID is an incorrect ID. It does not block the ongoing ID allocation process, but release cannot be performed while the SRAM is being updated. During release, a Buffer ID is input. Based on the mapping rules, the SRAM_ID, Address, and Bit_Index are directly obtained. First, the corresponding SRAM is read according to the SRAM_ID and Address. Then, the corresponding resource status value is modified to 1 according to the Bit_Index and rewritten to the SRAM. If the resource tag value corresponding to the released Buffer ID in the SRAM is already 1, it indicates that the Buffer ID has been released repeatedly, and this ID is considered an incorrect ID.
[0055] For example, such as Figure 2The diagram illustrates an exemplary resource tag allocation structure provided in this application embodiment, including an address invocation module, a grouped SRAM structure, a tag release module, a first search module, and a second search module. The address invocation module obtains a resource tag request, acquires target resource data from at least one SRAM, and sends it to the first search module. The first search module uses the target resource data as array row data to construct a target cache array, sequentially traversing each row of the target cache array. Based on at least one resource status value of each row of the target cache array, it determines the target tag row and sends the target tag row to the second search module. The second search module traverses each resource status value of the target tag row. If any resource status value is valid, it determines the bit corresponding to the resource status value as the target tag bit, and determines the target resource tag based on the target tag bit and its corresponding row number and device number, updating the corresponding resource status value. If the allocated tag value is less than the tag requirement value represented by the resource tag request, and the updated row status value of the target tag row is valid, then... The system re-traverses each resource status value of the target label row. If any resource status value is valid, the bit corresponding to the resource status value is determined as the new target label bit. Based on the new target label bit and its corresponding row number and device number, a new target resource label is determined. If the allocated label value is less than the label requirement value represented by the resource label request, and the row status value of the updated target label row is invalid, a first signal is fed back to the first search module. The first search module responds to the first signal and re-determines the target label row to obtain a new target label row. If the allocated label value is less than the label requirement value represented by the resource label request, and all row status values of the updated target cache array are invalid, a second signal is fed back to the address invocation module. The address invocation module responds to the second signal, re-acquires new target resource data from at least one storage device, sends the new target resource data from at least one storage device to the first search module, constructs a new target cache array, and determines the target resource label based on the new target cache array. When resource labels are reclaimed, they are sent to the grouped SRAM structure through the label release module.
[0056] For example, such as Figure 3The diagram illustrates an exemplary resource tag allocation method provided in this application. First, a resource tag request is obtained. Then, target resource data is acquired from the storage device. A target cache array is constructed based on the target resource data. Each row in the target cache array is traversed sequentially, and the target tag row is determined based on the row status value. Each resource status value in the target tag row is traversed to determine the target tag bit, and the corresponding resource status value and row status value are updated. After updating the resource status value and row status value, if the row status value is still valid, the target tag row is traversed again to determine a new target resource tag. If no allocable resource tag exists in the target tag row, the target cache array is traversed further to determine a new target tag row. If no allocable target resource tag exists in the target cache array, a second signal is sent to the address invocation module to re-acquire new target resource data from the storage device, construct a new target cache array, and determine a new target resource tag. This process continues until the allocated tag value is less than the tag requirement value represented by the resource tag request. Simultaneously, the corresponding resource status value in the storage device is updated based on the current cache array and the target cache array.
[0057] For example, such as Figure 4 The diagram shows an exemplary two-round search structure provided in an embodiment of this application. The first search module performs a first-round search, traversing each row sequentially to find the first row with a status value of 1, which is then identified as the target tag row. The target tag row is sent to the second search module, where a second-round search is performed. The second search module traverses the 64 resource tag values of the target tag row sequentially, finding the first resource tag value with a value of 1, and identifying the corresponding bit number as the new target tag bit. The corresponding target resource tag is determined based on the row number of the target tag row, the device number of the storage device to which it belongs, and the bit number. The total number of target tag rows is N, and the number of bits in the resource status value of the target tag row is M.
[0058] Specifically, the amount of SRAM can be increased as needed, thereby increasing the number of resource tags. It has good scalability and supports efficient cache management in different application scenarios.
[0059] Specifically, in one embodiment, initialization is performed first. The SRAM is initialized to all 1s, indicating that all Buffer IDs are available, and the GetID_addr_gen address is initially set to 0. Upon receiving a resource tag request to obtain Z Buffer IDs, 32 SRAMs are read according to the addresses in the current GetID_addr_gen and written into the 32x64 cache array in the first search module, where 32 corresponds to 32 SRAMs. The cache array is searched in the first round in groups of 32. If a group of non-all-zero 64-bit data is found, the device number of the storage device at this time, i.e., SRAM_ID, is recorded, and the 64-bit data is output and entered into the second search module for the second round of search. If all bits in the cache array are 0, the address in GetID_addr_gen is incremented by 1, and the target cache array is redefined. A second round of searching is performed on the 64 bits output from the target label line. A priority encoder is used to find the first 1 bit in the 64-bit data, denoted as Bit_Index. A 16-bit Buffer ID is output: {Addr (5 bits), SRAM_ID (5 bits), Bit_Index (6 bits)}. Simultaneously, the corresponding bit in the cache is updated to 0. After the second round of searching, the search is repeated in the target label line. When the cache array is exhausted, the target cache array is updated. If all Buffer IDs in the cache array have already been allocated, the SRAM at the current address needs to be updated. Then, the target resource label is re-determined until the required number of Buffer IDs are met, at which point the acquisition process ends.
[0060] Specifically, in one embodiment, for any target tag row, at least one target resource tag is determined in the target tag row through a sliding window mechanism. The size of the sliding window is equal to the tag demand value Z of the resource tag application request. By sliding the sliding window across the target tag row, it is detected in real time whether all Z consecutive bits covered by the window are valid resource status values. If the detection is successful, it indicates that Z consecutive target resource tags have been hit. If the hit fails, each bit of the target tag row is traversed in turn, and the first bit that is 1 is selected as the target tag bit. By using the sliding window method, multiple target resource tags can be hit at once, which improves the efficiency of resource tag allocation.
[0061] The resource tag allocation system provided in this application includes an address invocation module, a first search module, and a second search module. The address invocation module is used to obtain resource tag application requests, and in response to these requests, sequentially obtains target resource data from at least one storage device and sends this data to the first search module. The first search module receives the target resource data from the address invocation module, uses this data as array row data to construct a target cache array, sequentially traverses each row of the target cache array, determines a target tag row based on at least one resource status value from each row, and sends the target tag row to the second search module. The target tag row includes at least one resource status value. The second search module receives the target tag row from the first search module, traverses each resource status value in the target tag row, and, if any resource status value is valid, determines the bit corresponding to the resource status value as the target tag bit, and determines the target resource tag based on the target tag bit and its corresponding row number and device number.
[0062] The method provided by the above scheme reduces the search depth and improves the efficiency of resource tag allocation by obtaining target resource data from at least one storage device through obtaining resource tag application requests, using the target resource data as array row data to construct a target cache array, sequentially traversing each row of the target cache array, determining the target tag row based on at least one resource status value of each row, and then traversing each resource status value of the target tag row. If any resource status value is valid, the bit number corresponding to the resource status value is determined as the target tag bit. The target resource tag is determined based on the target tag bit and the corresponding row number and device number. By first determining the target cache array, then judging the row status value on a row-by-row basis, and then traversing within the row, the efficiency of resource tag allocation is improved.
[0063] Furthermore, by using a grouped SRAM structure, all resource tags are stored in bitmap form in 32 groups of dual-port SRAMs. The 64-bit width and 32-bit depth configuration of each SRAM can efficiently manage up to 65,536 IDs, significantly reducing hardware overhead. The bitmap compression structure makes the hardware overhead per ID extremely low, ensuring the management of a very large ID pool. By determining the target cache array based on resource status values and performing searches based on the target cache array in the first and second search modules, frequent access to SRAM is reduced. The use of a cache machine reduces memory read / write operations, lowering system power consumption. Moreover, the row-first, bit-latent two-round search mechanism reduces the search depth, improves ID allocation efficiency, reduces system response time, and ensures low-latency operation even under high load. Row status values characterize the resource tag allocation status of a row, avoiding sequential traversal of every bit in each row, improving the retrieval efficiency of effective resource tags. By continuing to traverse within the target tag row to determine new target resource tags, the traversal and retrieval from the beginning of the target cache array is avoided, further improving the efficiency of resource tag allocation. By continuing to traverse the target cache array to determine the new target tag row, the traversal and retrieval from the beginning of all resource tags is avoided, improving the efficiency of resource tag allocation. A masked write-back mechanism is used to achieve data synchronization, ensuring the consistency of cached data. When the Buffer ID in the target cache array is exhausted, the SRAM is updated according to the latest cached data, ensuring that the state of each ID is accurately synchronized, avoiding errors caused by resource conflicts or data inconsistencies. Through a dual-port SRAM structure, allocation and release are parallelized, avoiding resource contention and operation blocking. Each SRAM port can independently perform allocation and release operations without mutual interference, thereby effectively improving the system's concurrency performance and ensuring the stability of the resource allocation process.
[0064] Through the above description of the embodiments, those skilled in the art can clearly understand that the system according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0065] This application provides a resource tag allocation method, applied to the host side of the resource tag allocation system (provided in the above embodiments). The execution subject of this application is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, and other electronic devices that can perform heterogeneous computing.
[0066] like Figure 5 The diagram shown is a flowchart illustrating a resource tag allocation method provided in an embodiment of this application. The method includes: Step 501: Obtain the resource tag application request; Step 502: In response to the resource tag application request, sequentially obtain target resource data for at least one storage device; Step 503: Use the target resource data of at least one storage device as array row data to construct a target cache array; Step 504: Iterate through each row of the target cache array in sequence, and determine the target label row based on at least one resource status value of each row of the target cache array; wherein, the target label row includes at least one resource status value; Step 505: Traverse each resource status value in the target label row. If any resource status value is valid, determine the bit number corresponding to the resource status value as the target label bit. Step 506: Determine the target resource label based on the target label bit and its corresponding row number and device number.
[0067] For a description of the features in the corresponding embodiments of the resource tag allocation method, please refer to the relevant descriptions in the corresponding embodiments of the resource tag allocation system, which will not be repeated here.
[0068] The embodiments of this application also provide a resource tag allocation device, which is applied to the resource tag allocation method provided in the above embodiments.
[0069] like Figure 6 The diagram shown is a structural schematic of a resource tag allocation device provided in an embodiment of this application. The resource tag allocation device 60 includes: a first acquisition module 601, a second acquisition module 602, a construction module 603, a first determination module 604, a second determination module 605, and a third determination module 606.
[0070] The system comprises: a first acquisition module for acquiring resource tag application requests; a second acquisition module for sequentially acquiring target resource data from at least one storage device in response to the resource tag application request; a construction module for constructing a target cache array using the target resource data from at least one storage device as array row data; a first determination module for sequentially traversing each row of the target cache array and determining a target tag row based on at least one resource status value of each row of the target cache array, wherein the target tag row includes at least one resource status value; a second determination module for traversing each resource status value of the target tag row and, if any resource status value is valid, determining the bit corresponding to the resource status value as the target tag bit; and a third determination module for determining the target resource tag based on the target tag bit and its corresponding row number and device number.
[0071] For a description of the features in the embodiment corresponding to the resource tag allocation device, please refer to the relevant description in the embodiment corresponding to the resource tag allocation method, which will not be repeated here.
[0072] Embodiments of this application also provide an electronic device, such as... Figure 7 The diagram shown is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, including a processor 10 and a memory 20. The memory 20 stores a computer program, and the processor 10 is configured to run the computer program to execute the steps in any of the above-described resource tag allocation method embodiments.
[0073] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described resource tag allocation method embodiments at runtime.
[0074] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0075] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described resource tag allocation method embodiments.
[0076] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described resource tag allocation method embodiments.
[0077] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0078] The resource tag allocation system, method, electronic device, and storage medium provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A resource tag allocation system, characterized in that, include: Address call module, first search module, and second search module; The address call module is used to obtain resource tag application requests, and in response to the resource tag application requests, sequentially obtains target resource data of at least one storage device, and sends the target resource data of the at least one storage device to the first search module; The first search module is used to receive target resource data of at least one storage device sent by the address call module, construct a target cache array using the target resource data of the at least one storage device as array row data, sequentially traverse each row of the target cache array, determine a target tag row based on at least one resource status value of each row of the target cache array, and send the target tag row to the second search module; wherein, the target tag row includes at least one resource status value; The second search module is used to receive the target tag line sent by the first search module, traverse each resource status value of the target tag line, and if any of the resource status values is valid, determine the bit number corresponding to the resource status value as the target tag bit, and determine the target resource tag according to the target tag bit and its corresponding row number and device number.
2. The resource tag allocation system according to claim 1, characterized in that, The first search module is specifically used for: For any row of the target cache array, determine the row status value based on at least one resource status value of the row; If the row status value is valid, the row is determined to be the target label row.
3. The resource tag allocation system according to claim 2, characterized in that, The second search module is also used for: After determining the target resource tag, updating the resource status value corresponding to the target tag bit is invalid; After updating the resource status value, update the row status value of the target tag row to which the target resource tag belongs; Accumulate the target resource tags and use the accumulated value as the assigned tag value; If the allocated tag value is less than the tag requirement value represented by the resource tag application request, and the row status value of the updated target tag row is valid, then each resource status value of the target tag row is re-traversed. If any of the resource status values is valid, the bit number corresponding to the resource status value is determined as the new target tag bit, and a new target resource tag is determined based on the new target tag bit and its corresponding row number and device number.
4. The resource tag allocation system according to claim 3, characterized in that, The second search module is specifically used for: If the allocated tag value is less than the tag requirement value represented by the resource tag application request, and the row status value of the updated target tag row is invalid, a first signal is fed back to the first search module so that the first search module responds to the first signal and redetermines the target tag row to obtain a new target tag row.
5. The resource tag allocation system according to claim 3, characterized in that, The second search module is specifically used for: If the allocated tag value is less than the tag requirement value represented by the resource tag application request, and all row status values of the updated target cache array are invalid, a second signal is fed back to the address call module so that the address call module responds to the second signal, re-acquires new target resource data of at least one storage device, and sends the new target resource data of the at least one storage device to the first search module; In this process, after obtaining the new target resource data, the first search module redetermines the new target cache array.
6. The resource tag allocation system according to claim 3, characterized in that, The second search module is also used for: The allocation of the resource tag is completed when the allocated tag value is equal to the tag requirement value represented by the resource tag application request.
7. The resource tag allocation system according to claim 2, characterized in that, The first search module is also used for: If all row status values of the target cache array are invalid, obtain at least one current target resource data corresponding to the target cache array in the storage device; Determine the current cache array based on at least one current target resource data obtained; Based on the target cache array and the current cache array, determine the latest cache array; The latest cache array is sent to the at least one storage device so that the storage device updates the corresponding current target resource data according to the latest cache array.
8. A resource tag allocation method, applied to the resource tag allocation system as described in any one of claims 1 to 7, characterized in that, The method includes: Request a resource tag application; In response to the resource tag request, target resource data of at least one storage device is sequentially obtained; The target resource data of the at least one storage device is used as array row data to construct a target cache array; The target label row is determined by sequentially traversing each row of the target cache array and based on at least one resource status value of each row of the target cache array; wherein the target label row includes at least one resource status value. Traverse each resource status value of the target label row, and if any of the resource status values is valid, determine the bit number corresponding to the resource status value as the target label bit; The target resource label is determined based on the target label bit and its corresponding row number and device number.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the resource tag allocation method as described in claim 8 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the resource tag allocation method as described in claim 8.