Buffering method and device based on dynamic linked list structure, computer device and medium

By using a dynamic linked list structure for buffering, and leveraging a global shared buffer pool and dynamic address allocation, the problem of insufficient capacity in fixed partition ROBs is solved, achieving more efficient hardware resource utilization and data processing throughput.

CN122332334APending Publication Date: 2026-07-03BEIJING INSTITUTE OF OPEN SOURCE CHIP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-31
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing reordering buffer schemes, the capacity of fixed partition ROBs cannot be fully utilized when partition loads are uneven, resulting in wasted hardware resources and limited concurrent processing capabilities, as well as hotspot blocking issues.

Method used

A buffering method based on a dynamic linked list structure is adopted. Through a globally shared buffer pool and dynamic address allocation, the linked list is dynamically constructed and managed. Buffer resources are dynamically allocated according to transaction identifiers, breaking the limitation of fixed partitions and realizing flexible management of the linked list.

Benefits of technology

It effectively solves the blocking problem of hot transaction identifiers and improves the overall data processing throughput and hardware resource utilization in scenarios with multiple transaction identifiers, unbalanced load, and hot request scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122332334A_ABST
    Figure CN122332334A_ABST
Patent Text Reader

Abstract

This application discloses a buffering method, apparatus, computer device, and medium based on a dynamic linked list structure. The method includes: upon receiving a new request carrying a transaction identifier, obtaining the address of a free buffer item from the global buffer pool's available address management queue, allocating the free buffer item address to the new request, updating the information of the queue information table corresponding to the transaction identifier, recording the state information of the dynamic linked list in the queue information table, and recording the linking relationships of the dynamic linked list in the global buffer pool storage; upon receiving return data carrying a buffer item address and a transaction identifier, accessing the corresponding buffer item according to the buffer item address and storing the return data; querying the queue information table according to the transaction identifier, determining the submission order of the returned data based on the dynamic linked list state in the queue information table and the linking relationships in the buffer items, and performing a submission operation, while simultaneously reclaiming the addresses of submitted buffer items to the global buffer pool's available address management queue.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to, but is not limited to, the field of computer technology, and in particular to a buffering method, apparatus, computer device, and medium based on a dynamic linked list structure. Background Technology

[0002] The Reorder Buffer (ROB) is a core mechanism in modern high-performance computing architectures that resolves the conflict between out-of-order execution and sequential commit. It is widely used in scenarios such as superscalar out-of-order processors, on-chip networks, and high-speed communication protocol stacks.

[0003] With the development of high-performance computing systems, reordering responses have expanded to a certain degree of parallel submission for different application scenarios, thereby further improving system performance. To this end, ROBs (Redirect Execution Blocks) have gradually evolved into various partitioned designs. For example, the AMD Zen architecture uses a distributed ROB (Partitioned ROB), where instructions with the same ID can be submitted strictly in order within a partition, but instructions with different IDs can be submitted independently and in parallel, without global order constraints. Another example is the GPU's Warp Scheduler, which uses thread-level parallelism to divide instructions into independent instruction streams based on different Warp, similar to stream-based ROB management. Instructions in different Warp can be submitted out of order, while those within the same Warp are submitted sequentially. Furthermore, to support the out-of-order transmission mechanism of the industry-standard AMBA AXI bus protocol, transactions with the same ID must be ordered, while transactions with different IDs can be submitted out of order to improve bus utilization. The traditional solution is to introduce technologies such as virtual channels, pre-allocating a fixed-size virtual channel ROB for each transaction ID. When data is returned, it is placed into the corresponding virtual channel for sorting according to its ID.

[0004] Existing solutions such as virtual channels / thread bundles statically allocate ROB capacity, limiting the maximum capacity of a single partition. Under uneven partition load, this fails to fully utilize limited storage space, resulting in a large number of pre-allocated ROBs remaining idle and wasting hardware resources. Simultaneously, the number of partitions limits concurrent processing capabilities. When requests are being processed on every partition's ROBs, transactions with new IDs must wait, even if the total buffer capacity is still available. Furthermore, there is a hotspot blocking problem: when a particular ID becomes a "hotspot," its corresponding fixed-size ROB may be quickly filled, blocking new requests for that ID and thus blocking ROB responses across the entire bus. Summary of the Invention

[0005] In view of this, embodiments of this application provide at least one buffering method, apparatus, computer device, and medium based on a dynamic linked list structure.

[0006] The technical solution of this application embodiment is implemented as follows: On one hand, embodiments of this application provide a buffering method based on a dynamic linked list structure, the method comprising: Upon receiving a new request carrying a transaction identifier, the system retrieves the address of a free buffer item from the global buffer pool available address management queue, allocates the free buffer item address to the new request, updates the information of the queue information table corresponding to the transaction identifier, records the status information of the dynamic linked list in the queue information table, and records the link relationship of the dynamic linked list in the global buffer pool storage. This enables the system to dynamically link the free buffer item to the linked list queue corresponding to the existing transaction identifier or create a new linked list queue. The queue information table is used to manage the status of the dynamic linked list for different transaction identifiers, and the global buffer pool available address management queue is used to manage and allocate the address of a free buffer item in the buffer pool storage. Upon receiving return data carrying the buffer entry address and transaction identifier, access the corresponding buffer entry based on the buffer entry address and store the return data; The queue information table is queried based on the transaction identifier. The submission order of the returned data is determined and the submission operation is performed based on the dynamic linked list status in the queue information table and the link relationship in the buffer item. At the same time, the addresses of the submitted buffer items are reclaimed to the global buffer pool available address management queue.

[0007] On the other hand, embodiments of this application provide a buffer device based on a dynamic linked list structure, the device comprising: The receiving module is used to, upon receiving a new request carrying a transaction identifier, obtain the address of a free buffer item from the global buffer pool available address management queue, allocate the free buffer item address to the new request, update the information of the queue information table corresponding to the transaction identifier, record the status information of the dynamic linked list in the table entry, and record the link relationship of the dynamic linked list in the global buffer pool storage, thereby realizing the dynamic linking of the free buffer item to the existing linked list queue corresponding to the transaction identifier or the creation of a new linked list queue. The queue information table is used to manage the status of the dynamic linked list of different transaction identifiers, and the global buffer pool available address management queue is used to manage and allocate the address of a free buffer item in the buffer pool storage. Upon receiving return data carrying the buffer entry address and transaction identifier, access the corresponding buffer entry based on the buffer entry address and store the return data; The buffer module is used to query the queue information table according to the transaction identifier, determine the submission order of the returned data and perform the submission operation based on the dynamic linked list status in the queue information table and the link relationship in the buffer item, and at the same time reclaim the address of the submitted buffer item to the global buffer pool available address management queue.

[0008] In another aspect, embodiments of this application provide a computer device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements some or all of the steps in the buffering method based on the dynamic linked list structure described above.

[0009] In another aspect, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the buffering method based on the dynamic linked list structure described above.

[0010] In another aspect, embodiments of this application provide a computer program including computer-readable code. When the computer-readable code is run in a computer device, the processor in the computer device executes some or all of the steps in the buffering method based on the dynamic linked list structure described above.

[0011] In another aspect, embodiments of this application provide a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the buffering method based on the dynamic linked list structure described above.

[0012] This application embodiment breaks through the limitations of fixed partitions on concurrent processing capabilities and resource utilization in traditional schemes by using a globally shared buffer pool and dynamic address allocation. It can dynamically build and manage linked lists based on the transaction identifier of the request, so that the buffer resources that a single transaction identifier can use are only limited by the total capacity of the buffer pool, thereby effectively solving the blocking problem of hot transaction identifiers. At the same time, the processing between different transaction identifiers is completely independent, and the head node data can be committed immediately, avoiding mutual blocking. This significantly improves the overall data processing throughput and hardware resource utilization in scenarios with multiple transaction identifiers, unbalanced load, and hot requests.

[0013] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of this application. Attached Figure Description

[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.

[0015] Figure 1 A schematic diagram illustrating the implementation process of a buffering method based on a dynamic linked list structure provided in this application embodiment; Figure 2 A schematic diagram of the architecture of a buffering method based on a dynamic linked list structure provided in an embodiment of this application; Figure 3 A schematic diagram illustrating the processing logic for allocating new requests upon arrival, provided as an embodiment of this application; Figure 4 A schematic diagram illustrating the data return submission logic provided in an embodiment of this application; Figure 5 A schematic diagram of the composition structure of a buffer device based on a dynamic linked list structure provided in this application embodiment; Figure 6 This is a schematic diagram of the hardware entity of a computer device provided in an embodiment of this application. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application are further described in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0017] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0018] The terms “first / second / third” are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first / second / third” may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used herein is for descriptive purposes only and is not intended to limit the scope of this application.

[0020] This application provides a buffering method based on a dynamic linked list structure. Figure 1 This application provides a schematic diagram of the implementation process of a buffering method based on a dynamic linked list structure, as shown in the embodiments below. Figure 1 As shown, the method includes: Step 101: Upon receiving a new request carrying a transaction identifier, obtain the address of a free buffer item from the global buffer pool available address management queue, allocate the free buffer item address to the new request, and update the information of the queue information table corresponding to the transaction identifier. Record the status information of the dynamic linked list in the queue information table, and record the link relationship of the dynamic linked list in the global buffer pool storage. The queue information table is used to manage the status of dynamic linked lists with different transaction identifiers, and the global buffer pool available address management queue is used to manage and allocate the address of a free buffer item in the buffer pool storage.

[0021] In this embodiment, a transaction identifier is an identifier used to uniquely identify an independent transaction stream. In bus protocols such as AXI, transactions with the same transaction identifier must maintain their order. The global buffer pool is a shared storage entity composed of multiple buffer items, used to temporarily store out-of-order returned data. The available address management queue is a data structure used to quickly manage and allocate the addresses of free buffer items in the global buffer pool. The queue information table is a table indexed by transaction identifiers, used to record the dynamic linked list status corresponding to each active transaction identifier, including information such as the count of pending requests, the count of completed requests, and the pointer to the tail node of the linked list.

[0022] Upon receiving a new request carrying a transaction identifier, the system first accesses the global buffer pool's available address management queue. This queue maintains the addresses of all currently free buffer entries in the global buffer pool. A free buffer entry address is retrieved from the head of the queue and assigned to the new request. Next, the queue information table is queried based on the new request's transaction identifier. If the pending request count is zero, this transaction identifier is appearing for the first time; a new entry is created in the queue information table, and the retrieved free buffer entry address is recorded as the head and tail nodes of a new linked list, while the relevant counters are initialized. If the pending request count is greater than zero, this transaction identifier already exists; the retrieved free buffer entry address is linked to the tail of the linked list corresponding to this transaction identifier, and the tail node pointer and pending request counter for this transaction identifier in the queue information table are updated. Finally, within the corresponding buffer entry in the global buffer pool, the head node identifier and a pointer to the next node are set according to its position in the linked list.

[0023] Step 102: Upon receiving return data carrying the buffer item address and transaction identifier, access the corresponding buffer item according to the buffer item address and store the return data.

[0024] In this embodiment, the returned data refers to the data packet returned in response to a previously issued request, which carries the address of the corresponding buffer entry and the transaction identifier to which it belongs. The buffer entry address points to a specific storage location in the global buffer pool. A buffer entry is a basic storage unit in the global buffer pool, containing fields such as a data field, a valid bit, a header node identifier, and a pointer to the next node.

[0025] Upon receiving a return data packet carrying a buffer entry address and a transaction identifier, the system first locates the corresponding buffer entry in the global buffer pool based on the buffer entry address carried in the data packet. Then, the returned data content is written into the data field of that buffer entry. Simultaneously, the validity bit of the buffer entry is set to a valid state, indicating that valid data has been stored in this buffer entry. This process completes the temporary storage of out-of-order returned data in its pre-allocated buffer location.

[0026] Step 103: Query the queue information table according to the transaction identifier, determine the submission order of the returned data and perform the submission operation based on the dynamic linked list status in the queue information table and the link relationship in the buffer item, and at the same time reclaim the address of the submitted buffer item to the global buffer pool available address management queue.

[0027] In this embodiment, the submission order refers to the process of submitting data temporarily stored in the buffer pool to the higher-level module in the order of their original requests. The submission operation refers to the action of retrieving data from the buffer pool and passing it to the processing unit that returns data to the next higher level. Reclaiming refers to marking buffer items that have completed the submission operation as idle and returning their addresses to the available address management queue for allocation by subsequent new requests.

[0028] After storing the returned data, the queue information table is queried based on the transaction identifier of the data. The completed request count is incremented by a first value, and the status information of the dynamic linked list corresponding to the transaction identifier is obtained. First, the head node identifier of the current buffer item is checked. If the buffer item is the head node of the linked list, the data in the buffer item is immediately submitted to the upper-level module. After submission, the address of the buffer item is reclaimed to the global buffer pool available address management queue. Furthermore, the values ​​of the pending counter field and the completed counter field of the corresponding entry in the queue information table are each decremented by a first value. Next, the pointer in the buffer item is used to find the next buffer item in the linked list, and it is set as the new head node. If the data in the next buffer item is also valid, the data is submitted again, and this process is repeated until a buffer item whose data has not yet been returned is encountered or the end of the linked list is reached. If the current buffer item is not the head node, the completed request counter for the transaction identifier in the queue information table is updated. The queue information table is continuously checked. When the pending request count and the completed request count of a certain transaction identifier are equal, it indicates that all request data corresponding to that transaction identifier has been returned and stored in the buffer pool. At this point, starting from the head node of the linked list, all valid data is submitted sequentially, and the addresses of all submitted buffer items are reclaimed to the available address management queue. At the same time, the corresponding entries in the queue information table are cleaned up.

[0029] This application embodiment breaks through the limitations of fixed partitions on concurrent processing capabilities and resource utilization in traditional schemes by using a globally shared buffer pool and dynamic address allocation. It can dynamically build and manage linked lists based on the transaction identifier of the request, so that the buffer resources that a single transaction identifier can use are only limited by the total capacity of the buffer pool, thereby effectively solving the blocking problem of hot transaction identifiers. At the same time, the processing between different transaction identifiers is completely independent, and the head node data can be committed immediately, avoiding mutual blocking. This significantly improves the overall data processing throughput and hardware resource utilization in scenarios with multiple transaction identifiers, unbalanced load, and hot requests.

[0030] Optionally, step 101 includes: Step 1011: Access the corresponding entry in the queue information table based on the transaction identifier carried by the new request.

[0031] In this embodiment, a new data request is received. This request carries a specific transaction identifier. Using this transaction identifier as an index, the system directly addresses the entry in the queue information table corresponding to that transaction identifier. This process is implemented through hardware logic address mapping, the purpose of which is to obtain the state information required to manage the linked list of transaction identifiers.

[0032] Step 1012: Determine whether the value of the pending counter for the corresponding entry in the queue information table is zero.

[0033] In this embodiment of the application, the pending counter is a field in the queue information table entry, used to record the number of requests whose corresponding transaction identifier has been issued but have not yet returned data, i.e., the count of requests for which a reordering buffer has been allocated but the data has not yet been valid.

[0034] After accessing the corresponding entry in the queue information table, the value of the pending counter field in that entry is read. The internal comparison logic checks whether this value is equal to zero. This judgment is a key decision point in determining whether the current transaction identifier is a new identifier appearing for the first time or an old identifier that already exists in the active list.

[0035] Step 1013: If the value of the pending counter is zero, then the transaction identifier is determined to be a new transaction identifier. A free buffer item address is taken from the head of the available address management queue of the global buffer pool, the taken free buffer item address is assigned to the new request, the head node identifier field of the corresponding address in the buffer pool storage is set to a valid state, the pending counter value of the corresponding entry in the queue information table is increased by a first value, and the tail pointer field of the corresponding entry in the queue information table is updated to the free buffer item address.

[0036] In this embodiment, the global buffer pool available address management queue is a hardware queue structure for quickly allocating and reclaiming reordered buffer item addresses. It is typically implemented as a first-in-first-out queue and internally stores all currently available buffer item addresses. The buffer pool storage is a globally shared storage area composed of multiple buffer items. Each buffer item contains fields such as a head node identifier, data, valid bits, and a pointer. The head node identifier field indicates whether the buffer item is the first node in a transaction identifier linked list. The tail pointer field is a field in the queue information table entry, used to point to the address of the last node in the transaction identifier linked list within the buffer pool. The first value is a fixed increment, typically 1.

[0037] When the pending counter value is zero, it is determined that the current transaction identifier is a newly appeared identifier. A free reordering buffer address is retrieved from the head of the global buffer pool's available address management queue. This address is assigned to the current new request as its storage location in the buffer pool. The corresponding buffer item in the buffer pool is accessed based on this address, and its head node identifier field is set to a valid state, marking this buffer item as the starting node of the transaction identifier's linked list. Simultaneously, the pending counter value of the corresponding entry in the queue information table is incremented by one value, indicating that a buffer item has been allocated for this transaction identifier but data has not yet been returned. The tail pointer field of this entry is also updated to the previously allocated free buffer item address, because for a newly created linked list, the head node is also the tail node.

[0038] Step 1014: If the value of the pending counter is not zero, then the transaction identifier is determined to be an existing transaction identifier. A free buffer item address is taken from the head of the global buffer pool available address management queue, and the taken free buffer item address is assigned to the new request. The pointer field of the buffer item pointed to by the tail pointer field in the buffer pool storage is updated to the free buffer item address. The pending counter value of the corresponding entry in the queue information table is increased by a first value, and the tail pointer field of the corresponding entry in the queue information table is updated to the free buffer item address.

[0039] In this embodiment, the pointer field is a field of each buffer item in the buffer pool storage, used to store the address of the next node in the same transaction identifier linked list.

[0040] When the pending counter value is not zero, it is determined that the current transaction identifier already exists in an active linked list. A free reordering buffer address is retrieved from the head of the global buffer pool's available address management queue. This address is assigned to the current new request. Based on the address recorded in the tail pointer field of the corresponding entry in the queue information table, the tail node buffer entry of the current linked list in the buffer pool storage is located. The pointer field of this tail node buffer entry is updated to point to the newly allocated free buffer address, thus linking the new node to the tail of the existing linked list. The pending counter value of the corresponding entry in the queue information table is incremented by a first value. The tail pointer field of this entry is also updated to the newly allocated free buffer address to reflect the new tail node position of the linked list.

[0041] This application embodiment intelligently distinguishes between new transaction identifiers and existing transaction identifiers by checking the queue information table and updates the linked list structure accordingly. For new identifiers, a new linked list is created starting with the head node; for existing identifiers, the new node is appended to the tail of the linked list. This allows for dynamic address allocation based on a globally shared buffer pool, so that the number of buffer items that a single transaction identifier can use is no longer limited by the fixed partition capacity, but only by the total capacity of the buffer pool. This solves the problems of limited concurrent processing capacity, low resource utilization, and hotspot identifiers that are prone to blocking caused by the limited number of partitions and unbalanced load in traditional static partitioning schemes, thus improving overall performance and resource utilization efficiency.

[0042] Optionally, step 1011 includes: Step 10111: If the total number of transaction identifiers is less than or equal to the quantity threshold, allocate a queue information table for each transaction identifier, and then the corresponding table entry in the queue information table can be accessed directly through the transaction identifier.

[0043] In this embodiment, the transaction identifier is an identifier used to uniquely identify an independent transaction stream. For example, in the AXI4 protocol, it is used to distinguish different transaction streams, and transactions with the same identifier must be kept in order. The quantity threshold is a pre-set value used to distinguish whether the scale of the transaction identifier is small or large. The queue information table is a hardware data structure used to record the dynamic linked list state information corresponding to each active transaction identifier, including the count of pending requests, the count of completed requests, and the pointer to the tail node of the linked list.

[0044] First, determine the total number of active transaction identifiers in the current system. Compare this total number of transaction identifiers with a preset threshold. If the total number of transaction identifiers is less than or equal to the threshold, pre-allocate a queue information table entry for each possible transaction identifier. With this configuration, when a new request is received, the transaction identifier carried by the request can be directly used as an address index. Using this transaction identifier, the queue information table can be accessed directly, locating the corresponding entry that manages the dynamic linked list status information of that transaction identifier without complex lookup operations.

[0045] Step 10112: If the total number of transaction identifiers exceeds the quantity threshold, configure fewer queue information table entries to save hardware storage resources. Add an index address information table to record the address of the queue information table entry allocated to each transaction identifier, and manage the idle entries in the queue information table using a new available address queue. Access the queue information table by secondary addressing according to the transaction identifier to avoid full associative lookup. Specifically, this includes: directly accessing the index address information table based on the transaction identifier carried by the new request, obtaining the index address of the corresponding entry in the queue information table. If no entry has been allocated, obtain an entry directly from the available address queue and update the index address information table; if an entry has been allocated, access the corresponding entry in the queue information table using the index address for the second time.

[0046] In this embodiment, the index address information table is an auxiliary hardware data structure. The number of its entries corresponds to the total number of possible transaction identifiers. Each entry records the physical address of the queue information table entry currently allocated to the corresponding transaction identifier. The available address queue is a data structure used to manage the addresses of queue information table entries that are currently idle. It is typically implemented as a first-in-first-out queue, from which the system allocates and reclaims entry addresses.

[0047] If the total number of transaction identifiers exceeds a preset threshold, a queue information table entry with a number far less than the total number of possible transaction identifiers is configured. An index address information table and an available address queue are added. The index address information table retains one entry for each possible transaction identifier. The available address queue manages the addresses of all currently free queue information table entries. When a new request is received, the transaction identifier carried in the request is first used as the address to directly access the index address information table. The address information recorded in that entry is read. If the address information indicates that a queue information table entry has not yet been allocated for that transaction identifier, the address of a free entry is obtained from the head of the available address queue. This newly allocated address is written into the corresponding transaction identifier entry in the index address information table. If the address information returned by the index address information table is valid, indicating that a queue information table entry has been allocated for that transaction identifier, this address is used as an index for a second addressing operation to directly access the corresponding specific entry in the queue information table to obtain or update the dynamic linked list state of that transaction identifier.

[0048] For small-scale transaction identification scenarios, this application's embodiments achieve zero-latency access to table entries through direct addressing, resulting in simple and efficient control logic. For large-scale transaction identification scenarios, by introducing a secondary index and dynamic address allocation mechanism, only a small number of actual queue information table entries need to be maintained, greatly saving hardware storage resources and avoiding the complexity and performance bottlenecks caused by full-association lookups. Both strategies ensure that the corresponding state management unit can be quickly and accurately located based on the transaction identifier, providing a solid foundation for subsequent reordering buffer management based on dynamic linked lists.

[0049] Optionally, step 103 includes: Step 1031: Based on the transaction identifier carried by the returned data, access the corresponding entry in the queue information table and increment the value of the completed counter field by a first value.

[0050] In this embodiment, the transaction identifier carried in the returned data packet is used as an index address to directly access the corresponding entry in the queue information table. The current value of the completed counter field in that entry is read, and then an addition operation is performed to increment the value by a first value. The updated value is then written back to the completed counter field. This operation records that another request under this transaction identifier has been returned and stored in the global reordering buffer pool, but has not yet been committed in order.

[0051] Step 1032: Directly access the corresponding buffer item in the global buffer pool storage based on the buffer item address, write the returned data into the data storage field, set the data preparation completion flag field to valid, and check whether the header node flag field of the buffer item is valid.

[0052] In this embodiment, the buffer entry address is an index or pointer used to locate a specific buffer entry in the global buffer pool storage. The global buffer pool storage is a shared hardware storage structure composed of multiple buffer entries. Each buffer entry includes fields such as a data storage field, a head node identifier field, and a data preparation completion identifier field. The data preparation completion identifier field is a status bit used to indicate whether the data stored in the buffer entry is ready to be committed. The head node identifier field is a status bit used to indicate whether the buffer entry is the first node of the dynamic linked list corresponding to a specific transaction identifier.

[0053] The system directly accesses the corresponding buffer item in the global buffer pool storage based on the received buffer item address. The data returned along with the request is written to the data storage field of that buffer item. Then, the data preparation completion flag field of the buffer item is set to a valid state to indicate that the data is ready. Next, the head node flag field of the buffer item is checked to determine its validity, thus identifying the buffer item's position in its dynamic linked list.

[0054] Step 1033: If the head node identifier field is in a valid state, then the buffer item is the head node of the dynamic linked list. Submit the returned data stored in the data field of the buffer item to the next higher level, reclaim the address of the current buffer item to the tail of the global buffer pool available address management queue, and reduce the values ​​of the pending counter field and the completed counter field of the corresponding entry in the queue information table by a first value.

[0055] In this embodiment, if the head node identifier field is determined to be valid in step 1032, the current buffer item is confirmed as the head node of its dynamic linked list. The returned data stored in the buffer item's data field is submitted to the next higher-level processing module. After submission, the address of the buffer item is recycled to the tail of the global buffer pool's available address management queue, making it available for allocation by subsequent new requests. Simultaneously, based on the transaction identifier corresponding to the returned data, the corresponding entry in the queue information table is searched, and the values ​​of the pending counter field and the completed counter field are each reduced by a preset first value to reflect that a request has been processed and submitted.

[0056] Step 1034: Submit each item in the dynamic linked list sequentially according to the link relationship and status information. If the data preparation completion flag field is valid, return the data until the last item of the dynamic linked list is submitted or a buffer item with an invalid data preparation completion flag field is encountered. Then, end the current sequential submission process of the dynamic linked list. At this time, set the head node flag field of the buffer item with the invalid data preparation completion flag field to a valid state.

[0057] In this embodiment, after the head node data is submitted in step 1033, the system sequentially checks subsequent buffer items based on the linking relationships of the dynamic linked list, for example, by finding the next item through the Next pointer of the current buffer item. For each subsequent buffer item, its data preparation completion flag field is checked. If the flag is valid, the system submits the data stored in the buffer item. This process continues until one of the following two situations is encountered, at which point it stops: first, the tail item of the dynamic linked list is submitted; second, a buffer item with an invalid data preparation completion flag field is encountered during the submission process, indicating that the data has not yet returned and needs to be waited for. When the sequential submission process stops, if it stops because a buffer item with incomplete data is encountered, the head node flag field of that buffer item is set to a valid state, making it the new head node of the linked list, so that it can be identified and a new submission process can be started after its data is returned.

[0058] Step 1035: During the sequential submission process, for each piece of returned data submitted, the buffer item storing the returned data is set to an idle item in the global buffer pool storage, the address of the current buffer item is reclaimed and moved to the tail of the global buffer pool available address management queue, and the pending counter value and the completed counter value of the corresponding item in the queue information table are each reduced by a first value.

[0059] In this embodiment, during the sequential data submission process described in step 1034, resource reclamation and status update operations are performed after each successfully submitted piece of data. The buffer item storing the submitted data is marked as a free item in the global buffer pool storage. The address of the buffer item is reclaimed and moved to the tail of the global buffer pool available address management queue. Simultaneously, the system updates the counter of the corresponding transaction identifier entry in the queue information table, reducing both the pending counter value and the completed counter value by the first value.

[0060] Step 1036: If the head node identifier field is invalid, the commit operation is not performed, and the data of the head node buffer item in the dynamic linked list of the transaction identifier is returned.

[0061] In this embodiment, if it is determined in step 1032 that the head node identifier field is invalid, it is confirmed that the buffer item containing the currently returned data is not the head node of its dynamic linked list. According to the principle of sequential commit, no commit operation is performed on this data. The system enters a waiting state until the data of a buffer item in the dynamic linked list corresponding to the transaction identifier, located before the current buffer item and with a valid head node identifier field, is returned and committed. Only then can the current buffer item potentially be processed in subsequent sequential commit processes.

[0062] This application embodiment ensures that only data located at the head of the linked list can be committed by checking the head node identifier, maintaining the request order under the same transaction identifier. By dynamically updating the linked list head node and reclaiming the addresses of used buffer items, the recycling of hardware resources is achieved. By decrementing the pending counter and the completed counter, the number of incomplete requests and the number of requests that have not returned data for each transaction identifier are accurately tracked. This enables the reordering buffer device to efficiently and correctly process out-of-order returned data and commit it in order, while maximizing the use of the limited buffer pool capacity and avoiding resource waste and hot spot blocking problems caused by static partitioning.

[0063] Optionally, step 1034 includes: The linking relationship of the dynamic linked list refers to the pointer field in the buffer item where the head node of the dynamic linked list is located pointing to the address of another buffer item corresponding to the next node. After the buffer item, which is the head node, is submitted to the next level, the head node identifier field of the other buffer item is set to a valid state, and the other buffer item is used as the new head node of the dynamic linked list, thereby realizing the update of the head node.

[0064] The status information item refers to the values ​​of the pending counter field and the completed counter field in the queue information table corresponding to the transaction identifier.

[0065] The process of submitting items sequentially is as follows: Step 10341: Compare the values ​​of the pending counter field and the completed counter field; if the values ​​of the pending counter field and the completed counter field are not equal, it indicates that some entries in the current dynamic linked list have not returned data, and check whether the data preparation completion flag field of the other buffer item is valid; if the data preparation completion flag field of the other buffer item is invalid, end the current sequential submission process of the dynamic linked list; if the data preparation completion flag field of the other buffer item is valid, use the other buffer item as the new head node, and repeat the head node processing and recycling process of the dynamic linked list.

[0066] In this embodiment, the pending counter field is a hardware register that records the number of requests for a specific transaction ID that have been issued but have not yet returned data. The completed counter field is a hardware register that records the number of requests for the same transaction ID that have returned data but have not yet been committed. A dynamic linked list is a linear data structure consisting of multiple buffer entries linked by pointers, used to manage data for the same transaction ID in sequence. An entry is a basic storage unit in a dynamic linked list. The data preparation complete flag field is a hardware status bit indicating whether the data stored in the corresponding buffer entry has been effectively returned.

[0067] First, compare the values ​​of the pending counter field and the completed counter field. If these two values ​​are not equal, it is determined that some buffered items in the current dynamic linked list have not yet been returned. Next, check the data preparation completion flag field of the other buffered item pointed to by the Next pointer of the current head node. If this flag field indicates invalidity, the sequential commit process of the current dynamic linked list is terminated. If this flag field indicates validness, the other buffered item is set as the new head node, and the head node processing and resource reclamation process of the dynamic linked list is re-executed.

[0068] Step 10342: If the values ​​of the pending counter field and the completed counter field are equal and not zero, it means that all entries of the current dynamic linked list have been returned and have not yet been submitted to the next level. At this time, the other buffer item is used as the new head node, and the process of processing and recycling the head node of the dynamic linked list is repeated.

[0069] In this embodiment, the values ​​of the counter field to be processed and the counter field that has been completed are compared. If these two values ​​are equal and not zero, it is determined that all buffer items in the current dynamic linked list have been returned, but not all have been submitted to the previous level. In this case, the other buffer item pointed to by the Next pointer of the current head node is set as the new head node, and the head node processing and resource reclamation process of the dynamic linked list is re-executed.

[0070] Step 10343: If the values ​​of the pending counter field and the completed counter field are equal and zero, it means that all entries of the current dynamic linked list have been returned and submitted to the next level. At this time, the entire submission process of the current dynamic linked list ends.

[0071] In this embodiment, the completed counter field is a hardware register that records the number of requests for the same transaction ID that have returned data but have not yet been committed. A dynamic linked list is a linear data structure consisting of multiple buffer entries linked by pointers, used to manage data for the same transaction ID in sequence. An entry is a basic storage unit in the dynamic linked list. The commit process is the sequence of operations by which the system commits sorted data from the reordering buffer to the next higher-level processing unit.

[0072] The system compares the values ​​of the pending counter field and the completed counter field. If these two values ​​are equal and both are zero, it determines that all buffered items in the current dynamic linked list have not only been returned but also successfully committed to the parent level. At this point, the entire data commit process for the dynamic linked list for that specific transaction ID is terminated.

[0073] This application embodiment can intelligently determine the state of the dynamic linked list by accurately comparing the number of requests to be processed and the number of completed requests, and decide whether to continue to submit subsequent valid data in the linked list, advance the head node of the linked list to process the ready subsequent items, or completely end the processing flow of the transaction ID. This ensures that the data within the same transaction ID is submitted strictly in order, and at the same time realizes dynamic and efficient management of buffer pool resources.

[0074] Optionally, the global buffer pool available address management queue is obtained through the following steps: Step 301: Initialize a first-in-first-out queue structure as the global buffer pool available address management queue.

[0075] In this embodiment, the First-In-First-Out (FIFO) queue structure is a data structure in which data items are stored in the order they enter the queue, and when data items are retrieved, they follow the rule that the data item that entered first is retrieved first. The global buffer pool available address management queue is a queue used to manage the addresses of all free buffer items in the reordering buffer pool.

[0076] Upon startup or reset, an initialization process is performed. A first-in-first-out (FIFO) queue structure is created and designated as the queue for managing available addresses in the global buffer pool. This queue is initially empty and its function is to subsequently store and provide the addresses of all free buffer items in the reordering buffer pool.

[0077] Step 302: During the initialization phase, the addresses of all buffer items in the buffer pool storage are sequentially filled into the first-in-first-out queue structure, and an available address count value is set, which is equal to the total capacity of the buffer pool storage.

[0078] In this embodiment, during the initialization phase, the entire buffer pool memory is traversed. For each buffer item in the memory, its corresponding address is generated, and this address is added sequentially to the tail of the initialized first-in-first-out queue structure according to the physical order of the buffer items in the memory. Simultaneously, an available address count is set, and the initial value of this count is set to the total number of buffer items in the buffer pool memory, i.e., the total capacity.

[0079] Step 303: When it is necessary to allocate a buffer item for a new request, take an address from the head of the first-in-first-out queue structure and decrement the available address count by a first value.

[0080] In this embodiment, when a new request is received and a free buffer item needs to be allocated to it, the global buffer pool available address management queue is accessed. An address is retrieved from the head of this first-in-first-out queue structure; this address points to a currently free buffer item in the buffer pool memory. This address is allocated to the new request. Simultaneously, the available address count is subtracted from a first value to reflect that a free address has been removed from the available address queue.

[0081] Step 304: When reclaiming the address of a submitted buffer item, the address is placed at the tail of the first-in-first-out queue structure, and the available address count is increased by a first value.

[0082] In this embodiment, after the data submission process in a buffer item is completed, the buffer item becomes idle. The address of the buffer item is placed at the tail of the global buffer pool's available address management queue. Simultaneously, the available address count is incremented by a first value to reflect the addition of a free address to the available address queue.

[0083] This application embodiment dynamically tracks the addresses of all free buffer items using a first-in-first-out queue, and quickly performs operations and count updates during request allocation and address reclamation. This ensures that buffer items can be dynamically allocated for new requests based on the actual free capacity of the buffer pool, and that used buffer items can be efficiently reclaimed. This supports the core function of the adaptive reordering buffer device based on a dynamic linked list structure, namely, breaking through the limitations of static partitioning, dynamically allocating resources according to the global buffer pool capacity, and improving resource utilization and concurrent processing capabilities.

[0084] In some embodiments, an adaptive reordering response device based on a dynamic linked list structure, such as Figure 2 As shown, it includes: a globally shared, dynamically allocated ROB pool storage 20; a queue information table 10 managing the state of dynamic linked lists with the same ID; and a global ROB available address management queue 30. Specifically: The global ROB storage body 20, acting as a buffer pool, consists of multiple entries, including four fields: Head, Data, Valid, and Next. Head indicates whether the entry is the head node of a certain ID linked list. Data is used to temporarily store the returned data. Valid indicates whether the data in the entry is valid. Next points to a pointer to the next node in the same ID linked list, i.e., the address of the next ROB entry. If it is the tail node, Next is null or a specific value.

[0085] Queue information table 10 is indexed by transaction ID. Each entry records the linked list status of an active ID, including three fields: Pcounter, Fcounter, and Tail. Pcounter (Pending Counter) records the count of requests with the same ID that have been submitted but have not yet returned data, i.e., an allocated ROB item but Valid=0. Fcounter (FinishedCounter) records the count of requests with the same ID that have returned data but have not yet been committed, i.e., Valid=1 but not committed. Tail points to the address of the tail node of the linked list with the same ID in the ROB.

[0086] Available address management queue 30 is used to quickly find empty items in the global ROB storage and assign available ROB item addresses to the current ID request. When returning data is committed upwards, the ROB item addresses of the current ID request are reclaimed.

[0087] Reference Figure 3 There are multiple methods for determining whether an ID is new, which will be described in detail in specific embodiments. Furthermore, when searching the queue information table, it is necessary to avoid full associative lookups that could limit the number of available IDs; multiple solutions are also available for this.

[0088] Optionally, refer to Figure 3 Schemes for determining whether an ID is new can include: Using a bitmap to record how many IDs have been stored in the ROB pool has the advantage of saving hardware storage space, but the bitmap needs to be updated when all IDs are returned and submitted, which may cause conflicts and blockages. The queue information table is searched by ID to avoid full associative lookups. If the record's Pcounter in the information table is 0, then the request for the current ID is a new request. This design requires the queue information table to allocate one entry for each ID.

[0089] Optionally, refer to Figure 3 Schemes for looking up queue information tables may include: Step S1, wait for ROB items to be assigned; Step S2: Determine if there are any free items in the available address management queue. If not, return to step S1; otherwise, proceed to step S3. Step S3: The control logic assigns a ROB item to the new request; Step S4: Determine if it is a new ID. If yes, proceed to step S5; otherwise, proceed to step S6. Step S5: Fill in the value of the Head field of the newly allocated ROB item as 1, create an entry for this ID in the queue information table, and fill in the values ​​of each field as: Pcounter=1, Fcounter=0, Tail=address of the newly allocated ROB item; Step S6: Fill the Head field of the newly allocated ROB item with a value of 0, search for the entry of this ID in the queue information table, obtain the value of the Tail field, use it to index the tail of the ROB item in the ROB storage, update its Next field to the address of the newly allocated ROB item, and update the values ​​of each field of this item in the queue information table: Pcounter is incremented by 1, Tail = the address of the newly allocated ROB item.

[0090] Addressing the queue information table by ID avoids full associative lookups. This design requires the queue information table to be assigned an entry for each ID.

[0091] The queue information table is addressed by ID, meaning a separate index address table is set up. After addressing this table by ID, the contents of the queue information table are retrieved using the obtained address information. The advantage of this design is that, when the number of IDs is extremely large and the probability of them repeating within a certain period is extremely low, it can significantly reduce the number of entries in the queue information table, avoiding full associative lookups and saving hardware resources.

[0092] Reference Figure 4 The embodiments of this application may include: Step P1: When a piece of data with a ROB address and ID is returned, access the corresponding item according to the ROB address, write the data to the corresponding field, set Valid to 1, index the queue information table with ID, and increment the Fcounter of the corresponding item by 1. Step P2: Determine if the Head field of the corresponding ROB item is 1. If the Head field of the ROB item is 1, it means it is the head node of the linked list, proceed to step P3; otherwise, proceed to step P4. Step P3: The ROB item is the head node of the linked list. The data is returned and submitted. The Head field of the ROB item pointed to by the next node pointer is set to 1, and the current node is recycled. The queue information table is indexed by ID. The Pcounter and Fcounter of the corresponding item are decremented by 1. Tail is obtained, and then the process proceeds to step P4. Step P4: Determine whether Fcounter == Pcounter is true in the queue information table. If Fcounter == Pcounter is true in the queue information table, it means that all data of the current ID dynamic linked list structure has been returned and stored in the ROB pool. Proceed to step P5; otherwise, proceed to step P6. Step P5: Determine if the address of the Tail record is equal to the ROB address (Pcounter==0). If the address of the Tail record is equal to the ROB address (Pcounter==0), it means that the head node of the linked list that has been processed is the tail node of the linked list queue, and the process ends; otherwise, proceed to step P7. Step P6: When it is detected that Fcounter == Pcounter in the queue information table is not true, determine whether the Valid field of the ROB item pointed to by the next node pointer is set to 1. If it is set to 1, return to step P3; otherwise, return to step P1. Step P7: Using the Next pointer, address each item in the ROB pool one by one, return the Data of the entire data linked list for that ID to the previous level, and delete the corresponding ROB items one by one until the Tail position recorded in the queue information table ends. Each time data is submitted upwards, decrement the Pcounter and Fcounter of the corresponding ID item in the queue information table by 1, until the head node of the currently processed linked list is the tail node of the linked list queue, and end the data return processing flow for that ID.

[0093] By using the dynamic linked list design described above to manage identical IDs, the number of ROB items that can be allocated to each ID is not limited by the number of partitions, but only depends on whether there are free items in the ROB pool. For scenarios with fewer ID types, this solves the problems of low resource utilization and resource constraints on hot IDs blocking other requests when partitions are unbalanced. For scenarios with more ID types, adaptive dynamic allocation of ROB items can fully utilize the ROB capacity and prevent partitions from being filled by different IDs, thus avoiding blocking requests for other IDs.

[0094] Optionally, the implementation method of the available address management queue may include: maintaining a first-in, first-out available address management queue, automatically populating it with the index numbers of all available items in the ROB pool during initialization, and loading a count value for the available index numbers. When a request with an ID arrives, the index number at the head of the address management queue is assigned, and the count value is decremented by 1. When data is returned and submitted, the index number of the corresponding item in the ROB pool is recorded, added to the available address management queue, and the count value is incremented by 1. The above method can enable the control logic to quickly find empty ROB items.

[0095] Optionally, a multi-ID mixed request scenario may include: Assume the ROB address carried in the returned data is defined as a Token.

[0096] Step 1: Read requests are received sequentially for ID=1, ID=2, ID=1, ID=3, ID=1, ID=1, and ID=1.

[0097] The control logic dynamically assigns ROB items to them and updates the queue information table. The final result is: The linked list with ID=1 is: ROB[0](head)->ROB[2]->ROB[4]->ROB[5]->ROB[6](tail). Queue information table: Pcounter=5, Fcounter=0, Tail=6.

[0098] The linked list with ID=2: ROB[1](head / tail). Queue information table: Pcounter=1, Fcounter=0, Tail=1.

[0099] The linked list with ID=3: ROB[3](head / tail). Queue information table: Pcounter=1, Fcounter=0, Tail=3.

[0100] Step 2: Data is returned out of order, in the following order: (Token=2, ID=1), (Token=5, ID=1), (Token=6, ID=1), (Token=1, ID=2), (Token=3, ID=3), (Token=0, ID=1), (Token=4, ID=1).

[0101] Returns (Token=2, ID=1): ROB[2].Valid=1. Checking that ROB[2].Head is not 1, it is not the head node of the linked list. Update the Fcounter of ID=1 in the queue information table to make Fcounter=1.

[0102] Returns (Token=5, ID=1): ROB[5].Valid=1. Checking that ROB[5].Head is not 1, it is not the head node of the linked list. Update Fcounter of ID=1 in the queue information table to make Fcounter=2.

[0103] Returns (Token=6, ID=1): ROB[6].Valid=1. Checking that ROB[6].Head is not 1, it is not the head node of the linked list. Update Fcounter of ID=1 in the queue information table to make Fcounter=3.

[0104] Return (Token=1, ID=2): ROB[1].Valid=1. Check ROB[1].Head is 1, confirming it as the head node of the linked list, submit the returned data to the next level, do not process the ROB item pointed to by Next if it is empty, release ROB[1], update the queue information table ID=2, Pcounter-1=0, which meets the condition Pcounter==Fcounter, and Tail is equal to the ROB address, and end the data return process for this ID.

[0105] Returns (Token=3, ID=3): ROB[3].Valid=1. Check that ROB[3].Head is 1, confirming it as the head node of the linked list. Subsequent steps are the same as for ROB[1].

[0106] Return (Token=0, ID=1): ROB[0].Valid=1. Check ROB[0].Head is 1, confirming it as the head node of the chain, return the data and submit it to the next level, Next points to ROB[2], set ROB[2].Head to 1, release ROB[0], update the Pcounter of ID=1 in the queue information table, Pcounter-1=4, which does not meet the condition Pcounter==Fcounter, ROB[2].Valid=1, return ROB[2].Data and submit it to the next level, Next points to ROB[4], set ROB[4].Head to 1, release ROB[2], update the Pcounter and Fcounter of ID=1 in the queue information table, Pcounter-1=3, Fcounter-1=2, which does not meet the condition Pcounter==Fcounter, and ROB[4].Valid is not 1, wait for the next data to be returned.

[0107] Return (Token=4, ID=1): ROB[4].Valid=1. Check that ROB[4].Head is 1, confirming it as the head node of the linked list, submit the returned data to the next level, Next points to ROB[5], set ROB[5].Head to 1, release ROB[4], update the Pcounter of ID=1 in the queue information table, Pcounter-1=2, which meets the condition Pcounter==Fcounter, and Tail=6, ROB address is 5, the two are not equal, address by ROB[5].Next, return the Data on the entire data linked list of ID=1, that is, ROB[5].Data and ROB[6].Data to the next level, and release ROB[5], Pcounter and Fcounter, each decremented by 1 to equal 1, at this time Tai equals the ROB address, release ROB[6], update the Pcounter and Fcounter of ID=1 in the queue information table, each decremented by 1 to equal 0. End the data return process for this ID.

[0108] Based on the foregoing embodiments, this application provides a buffer device based on a dynamic linked list structure. The device includes various units and modules included in each unit, which can be implemented by a processor in a computer device; of course, it can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.

[0109] Figure 5 A schematic diagram of the composition structure of a buffer device based on a dynamic linked list structure provided in this application embodiment is shown below. Figure 5 As shown, the device includes: The receiving module 401 is configured to, upon receiving a new request carrying a transaction identifier, obtain the address of a free buffer item from the global buffer pool available address management queue, allocate the free buffer item address to the new request, update the information of the queue information table corresponding to the transaction identifier, record the status information of the dynamic linked list in the table entry, and record the link relationship of the dynamic linked list in the global buffer pool storage, thereby realizing the dynamic linking of the free buffer item to the existing linked list queue corresponding to the transaction identifier or the creation of a new linked list queue. The queue information table is used to manage the status of the dynamic linked list of different transaction identifiers, and the global buffer pool available address management queue is used to manage and allocate the address of a free buffer item in the buffer pool storage. Upon receiving return data carrying the buffer entry address and transaction identifier, access the corresponding buffer entry based on the buffer entry address and store the return data; The buffer module 402 is used to query the queue information table according to the transaction identifier, determine the submission order of the returned data and perform the submission operation based on the dynamic linked list status in the queue information table and the link relationship in the buffer item, and at the same time reclaim the address of the submitted buffer item to the global buffer pool available address management queue.

[0110] Optionally, the receiving module 401 is further configured to: Access the corresponding entry in the queue information table based on the transaction identifier carried in the new request; Determine whether the value of the pending counter for the corresponding entry in the queue information table is zero; If the value of the pending counter is zero, the transaction identifier is determined to be a new transaction identifier. A free buffer item address is taken from the head of the global buffer pool available address management queue, the taken free buffer item address is assigned to the new request, the head node identifier field of the corresponding address in the buffer pool storage is set to a valid state, the pending counter value of the corresponding entry in the queue information table is increased by a first value, and the tail pointer field of the corresponding entry in the queue information table is updated to the free buffer item address. If the pending counter value is not zero, the transaction identifier is determined to be an existing transaction identifier. A free buffer item address is retrieved from the head of the global buffer pool available address management queue, and the retrieved free buffer item address is assigned to the new request. The pointer field of the buffer item pointed to by the tail pointer field of the queue information table in the buffer pool storage is updated to the free buffer item address, thereby realizing the recording of the link relationship of the dynamic linked list in the global buffer pool storage. The pending counter value of the corresponding entry in the queue information table is increased by a first value, and the tail pointer field of the corresponding entry in the queue information table is updated to the free buffer item address.

[0111] Optionally, the receiving module 401 is further configured to: If the total number of transaction identifiers is less than or equal to the quantity threshold, a queue information table is allocated to each transaction identifier, and the corresponding table entry in the queue information table can be directly accessed through the transaction identifier. If the total number of transaction identifiers exceeds the threshold, fewer queue information table entries are configured to save hardware storage resources. An index address information table is added to record the address of each queue information table entry allocated to each transaction identifier. Idle entries in the queue information table are managed using a new available address queue, accessed via secondary addressing based on the transaction identifier to avoid full associative lookups. Specifically, this includes: Based on the transaction identifier carried in the new request, the index address information table is accessed directly by addressing to obtain the index address of the corresponding entry in the queue information table. If no entry has been allocated, an entry is directly obtained from the available address queue and the index address information table is updated. If an entry has been allocated, the corresponding entry in the queue information table is accessed a second time based on the index address.

[0112] Optionally, the buffer module 402 is further configured to: Based on the transaction identifier carried in the returned data, access the corresponding entry in the queue information table and increment the value of the completed counter field by a first value; The corresponding buffer item in the global buffer pool is accessed directly based on the buffer item address, the returned data is written to the data storage field, the data preparation completion flag field is set to valid, and the head node flag field of the buffer item is checked to see if it is valid. If the head node identifier field is in a valid state, then the buffer item is the head node of the dynamic linked list. The returned data stored in the data field of the buffer item is submitted to the next level, the address of the current buffer item is recycled to the tail of the global buffer pool available address management queue, and the values ​​of the pending counter field and the completed counter field of the corresponding entry in the queue information table are each reduced by a first value. According to the link relationship and status information of the dynamic linked list, each item with a valid data preparation completion flag field is submitted sequentially and returned until the last item of the dynamic linked list is submitted or a buffer item with an invalid data preparation completion flag field is encountered. At this time, the head node flag field of the buffer item with an invalid data preparation completion flag field is set to a valid state. During the sequential submission process, for each piece of returned data submitted, the buffer item storing the returned data is set to an idle item in the global buffer pool storage, the address of the current buffer item is reclaimed and moved to the tail of the global buffer pool available address management queue, and the pending counter value and the completed counter value of the corresponding item in the queue information table are each reduced by a first value. If the head node identifier field is invalid, the commit operation will not be performed, and the data of the head node buffer item in the dynamic linked list of the transaction identifier will be returned.

[0113] Optionally, the buffer module 402 is further configured to: The linking relationship of the dynamic linked list refers to the pointer field in the buffer item where the head node of the dynamic linked list is located pointing to the address of another buffer item corresponding to the next node. After the buffer item, which is the head node, is submitted to the next level, the head node identifier field of the other buffer item is set to a valid state, and the other buffer item is used as the new head node of the dynamic linked list, thereby realizing the update of the head node. The status information item refers to the values ​​of the pending counter field and the completed counter field in the queue information table corresponding to the transaction identifier; The sequential submission process is as follows: compare the values ​​of the pending counter field and the completed counter field; if the values ​​of the pending counter field and the completed counter field are not equal, it indicates that some entries in the current dynamic linked list have not returned data, and check whether the data preparation completion flag field of the other buffer item is valid; if the data preparation completion flag field of the other buffer item is invalid, end the current sequential submission process of the dynamic linked list; if the data preparation completion flag field of the other buffer item is valid, use the other buffer item as the new head node, and repeat the head node processing and recycling process of the dynamic linked list. If the values ​​of the pending counter field and the completed counter field are equal and not zero, it means that all entries of the current dynamic linked list have been returned and have not yet been submitted to the next level. At this time, the other buffer item is used as the new head node, and the process of processing and recycling the head node of the dynamic linked list is repeated. If the values ​​of the pending counter field and the completed counter field are equal and zero, it means that all entries in the current dynamic linked list have been returned and submitted to the next level. At this point, the entire submission process of the current dynamic linked list ends.

[0114] Optionally, the queue information table is obtained through the following steps: Each possible transaction identifier is pre-allocated an independent queue information table entry; wherein each queue information table entry includes a pending counter field, a completed counter field, and a tail pointer field; the pending counter field is used to record the number of requests that the corresponding transaction identifier has issued but has not yet returned data; the completed counter field is used to record the number of requests that the corresponding transaction identifier has returned data but has not yet committed; the tail pointer field is used to point to the address of the last buffer entry of the dynamic linked list of the corresponding transaction identifier in the buffer pool storage.

[0115] Optionally, the global buffer pool available address management queue is obtained through the following steps: Initialize a first-in-first-out queue structure as the queue for managing available addresses in the global buffer pool; During the initialization phase, the addresses of all buffer items in the buffer pool storage are sequentially filled into the first-in-first-out queue structure, and an available address count value is set, which is equal to the total capacity of the buffer pool storage. When it is necessary to allocate a buffer item for a new request, an address is taken from the head of the first-in-first-out queue structure, and the available address count is reduced by a first value. When reclaiming the address of a submitted buffer item, the address is placed at the tail of the first-in-first-out queue structure, and the available address count is incremented by a first value.

[0116] This application embodiment breaks through the limitations of fixed partitions on concurrent processing capabilities and resource utilization in traditional schemes by using a globally shared buffer pool and dynamic address allocation. It can dynamically build and manage linked lists based on the transaction identifier of the request, so that the buffer resources that a single transaction identifier can use are only limited by the total capacity of the buffer pool, thereby effectively solving the blocking problem of hot transaction identifiers. At the same time, the processing between different transaction identifiers is completely independent, and the head node data can be committed immediately, avoiding mutual blocking. This significantly improves the overall data processing throughput and hardware resource utilization in scenarios with multiple transaction identifiers, unbalanced load, and hot requests.

[0117] The descriptions of the apparatus embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. In some embodiments, the functions or modules included in the apparatus provided in this application can be used to perform the methods described in the method embodiments above. For technical details not disclosed in the apparatus embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0118] It should be noted that, in the embodiments of this application, if the above-described buffering method based on a dynamic linked list structure is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to related technologies, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware, software, or firmware, or any combination of hardware, software, and firmware.

[0119] This application provides a computer device including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements some or all of the steps in the above-described method.

[0120] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the above-described method. The computer-readable storage medium can be transient or non-transient.

[0121] This application provides a computer program including computer-readable code, wherein when the computer-readable code is executed in a computer device, a processor in the computer device performs some or all of the steps in the above-described method.

[0122] This application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0123] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between them, while their similarities or commonalities can be referred to interchangeably. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above method embodiments and have similar beneficial effects. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0124] It should be noted that, Figure 6 This is a schematic diagram of a hardware entity of a computer device in an embodiment of this application, such as... Figure 6 As shown, the hardware entity of the computer device 700 includes: one or more processors 701, a communication interface 702, and a memory 703, wherein: Processor 701 typically controls the overall operation of computer device 700.

[0125] Communication interface 702 enables computer devices to communicate with other terminals or servers over a network.

[0126] The memory 703 is configured to store instructions and applications executable by the processor 701, and can also cache data to be processed or already processed (e.g., image data, audio data, voice communication data, and video communication data) in the processor 701 and various modules in the computer device 700. It can be implemented using flash memory or random access memory (RAM). Data transfer between the processor 701, the communication interface 702, and the memory 703 can be performed via bus 704. Only one processor is shown in the figure; each processor 700 includes one or more cores.

[0127] It should be noted that the computer device may include multiple processors 701, and each processor 701 can interact with each other through aggregated communication methods such as all-to-all, all-gather, or all-reduce. The processors 701 may be central processing units (CPUs), graphics processing units (GPUs), embedded neural network processing units (NPUs), tensor processing units (TPUs), data processing units (DPUs), accelerated processing units (APUs), floating-point processing units (FPUs), or application-specific integrated circuits (ASICs). The processors may also be single-core or multi-core processors. The processor may consist of a CPU and hardware chips. The hardware chips may be ASICs, PLDs, or combinations thereof. The PLDs may be complex programmable logic devices (CPLDs), FPGAs, generic array logic (GALs), or any combination thereof. The processor can also be implemented using logic devices with built-in processing logic, such as FPGAs or digital signal processors (DSPs).

[0128] The communication interface 702 can be a wired interface or a wireless interface, used to communicate with other modules or devices. The wired interface can be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface can be a cellular network interface or a wireless LAN interface, etc.

[0129] Memory 703 can be non-volatile memory, such as read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Memory 703 can also be volatile memory, which can be random access memory (RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synclink dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM), direct rambus DRAM (DRDRAM), and rambus DRAM.

[0130] The 704 bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc.

[0131] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0132] It should be noted that, in this document, 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. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0133] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0134] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0135] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0136] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0137] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.

[0138] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A buffer method based on a dynamic linked list structure, characterized by, The method includes: Upon receiving a new request carrying a transaction identifier, the system retrieves the address of a free buffer item from the global buffer pool available address management queue, allocates the free buffer item address to the new request, updates the information of the queue information table corresponding to the transaction identifier, records the status information of the dynamic linked list in the queue information table, and records the link relationship of the dynamic linked list in the global buffer pool storage. This enables the system to dynamically link the free buffer item to the linked list queue corresponding to the existing transaction identifier or create a new linked list queue. The queue information table is used to manage the status of the dynamic linked list for different transaction identifiers, and the global buffer pool available address management queue is used to manage and allocate the address of a free buffer item in the buffer pool storage. Upon receiving return data carrying the buffer entry address and transaction identifier, access the corresponding buffer entry based on the buffer entry address and store the return data; The queue information table is queried based on the transaction identifier. The submission order of the returned data is determined and the submission operation is performed based on the dynamic linked list status in the queue information table and the link relationship in the buffer item. At the same time, the addresses of the submitted buffer items are reclaimed to the global buffer pool available address management queue.

2. The method of claim 1, wherein, Upon receiving a new request carrying a transaction identifier, the process involves obtaining a free buffer item address from the global buffer pool's available address management queue, allocating the free buffer item address to the new request, updating the information in the queue information table corresponding to the transaction identifier, recording the state information of the dynamic linked list in the entry, and recording the linking relationships of the dynamic linked list in the global buffer pool storage, including: Based on the transaction identifier carried by the new request, access the corresponding entry in the queue information table; determine whether the pending counter value of the corresponding entry in the queue information table is zero; If the value of the pending counter is zero, the transaction identifier is determined to be a new transaction identifier. A free buffer item address is taken from the head of the global buffer pool available address management queue, the taken free buffer item address is assigned to the new request, the head node identifier field of the corresponding address in the buffer pool storage is set to a valid state, the pending counter value of the corresponding entry in the queue information table is increased by a first value, and the tail pointer field of the corresponding entry in the queue information table is updated to the free buffer item address. If the pending counter value is not zero, the transaction identifier is determined to be an existing transaction identifier. A free buffer item address is retrieved from the head of the global buffer pool available address management queue, and the retrieved free buffer item address is assigned to the new request. The pointer field of the buffer item pointed to by the tail pointer field of the queue information table in the buffer pool storage is updated to the free buffer item address, thereby realizing the recording of the link relationship of the dynamic linked list in the global buffer pool storage. The pending counter value of the corresponding entry in the queue information table is increased by a first value, and the tail pointer field of the corresponding entry in the queue information table is updated to the free buffer item address.

3. The method of claim 2, wherein, The step of accessing the corresponding entry in the queue information table based on the transaction identifier carried in the new request includes: If the total number of transaction identifiers is less than or equal to the quantity threshold, a queue information table is allocated to each transaction identifier, and the corresponding table entry in the queue information table can be directly accessed through the transaction identifier. If the total number of transaction identifiers exceeds the threshold, fewer queue information table entries are configured to save hardware storage resources. An index address information table is added to record the address of each queue information table entry allocated to each transaction identifier. Idle entries in the queue information table are managed using a new available address queue, accessed via secondary addressing based on the transaction identifier to avoid full associative lookups. Specifically, this includes: Based on the transaction identifier carried in the new request, the index address information table is accessed directly by addressing to obtain the index address of the corresponding entry in the queue information table. If no entry has been allocated, an entry is directly obtained from the available address queue and the index address information table is updated. If an entry has been allocated, the corresponding entry in the queue information table is accessed a second time based on the index address.

4. The method of claim 1, wherein, The step of querying the queue information table based on the transaction identifier, determining the submission order of the returned data and performing a submission operation based on the dynamic linked list status in the queue information table and the link relationships in the buffer items, and simultaneously reclaiming the addresses of the submitted buffer items to the global buffer pool available address management queue, includes: Based on the transaction identifier carried in the returned data, access the corresponding entry in the queue information table and increment the value of the completed counter field by a first value; The corresponding buffer item in the global buffer pool is accessed directly based on the buffer item address, the returned data is written to the data storage field, the data preparation completion flag field is set to valid, and the head node flag field of the buffer item is checked to see if it is valid. If the head node identifier field is in a valid state, then the buffer item is the head node of the dynamic linked list. The returned data stored in the data field of the buffer item is submitted to the next level, the address of the current buffer item is recycled to the tail of the global buffer pool available address management queue, and the values ​​of the pending counter field and the completed counter field of the corresponding entry in the queue information table are each reduced by a first value. According to the link relationship and status information of the dynamic linked list, each item with a valid data preparation completion flag field is submitted sequentially and returned until the last item of the dynamic linked list is submitted or a buffer item with an invalid data preparation completion flag field is encountered. At this time, the head node flag field of the buffer item with an invalid data preparation completion flag field is set to a valid state. During the sequential submission process, for each piece of returned data submitted, the buffer item storing the returned data is set to an idle item in the global buffer pool storage, the address of the current buffer item is reclaimed and moved to the tail of the global buffer pool available address management queue, and the pending counter value and the completed counter value of the corresponding item in the queue information table are each reduced by a first value. If the head node identifier field is invalid, the commit operation will not be performed, and the data of the head node buffer item in the dynamic linked list of the transaction identifier will be returned.

5. The method of claim 4, wherein, The process of sequentially submitting data according to the link relationships and state information of the dynamic linked list, returning data for each item whose data preparation completion flag is valid, until the last item of the dynamic linked list is submitted or a buffer item with an invalid data preparation completion flag is encountered, ends the current sequential submission process of the dynamic linked list, including: The linking relationship of the dynamic linked list refers to the pointer field in the buffer item where the head node of the dynamic linked list is located pointing to the address of another buffer item corresponding to the next node. After the buffer item, which is the head node, is submitted to the next level, the head node identifier field of the other buffer item is set to a valid state, and the other buffer item is used as the new head node of the dynamic linked list, thereby realizing the update of the head node. The status information item refers to the values ​​of the pending counter field and the completed counter field in the queue information table corresponding to the transaction identifier; The sequential submission process is as follows: compare the values ​​of the pending counter field and the completed counter field; if the values ​​of the pending counter field and the completed counter field are not equal, it indicates that some entries in the current dynamic linked list have not returned data, and check whether the data preparation completion flag field of the other buffer item is valid; if the data preparation completion flag field of the other buffer item is invalid, end the current sequential submission process of the dynamic linked list; if the data preparation completion flag field of the other buffer item is valid, use the other buffer item as the new head node, and repeat the head node processing and recycling process of the dynamic linked list. If the values ​​of the pending counter field and the completed counter field are equal and not zero, it means that all entries of the current dynamic linked list have been returned and have not yet been submitted to the next level. At this time, the other buffer item is used as the new head node, and the process of processing and recycling the head node of the dynamic linked list is repeated. If the values ​​of the pending counter field and the completed counter field are equal and zero, it means that all entries in the current dynamic linked list have been returned and submitted to the next level. At this point, the entire submission process of the current dynamic linked list ends.

6. The method of claim 1, wherein, The queue information table is obtained through the following steps: Each possible transaction identifier is pre-allocated an independent queue information table entry; wherein each queue information table entry includes a pending counter field, a completed counter field, and a tail pointer field; the pending counter field is used to record the number of requests that the corresponding transaction identifier has issued but has not yet returned data; the completed counter field is used to record the number of requests that the corresponding transaction identifier has returned data but has not yet committed; the tail pointer field is used to point to the address of the last buffer entry of the dynamic linked list of the corresponding transaction identifier in the buffer pool storage.

7. The method of claim 1, wherein, The global buffer pool available address management queue is obtained through the following steps: Initialize a first-in-first-out queue structure as the queue for managing available addresses in the global buffer pool; During the initialization phase, the addresses of all buffer items in the buffer pool storage are sequentially filled into the first-in-first-out queue structure, and an available address count value is set, which is equal to the total capacity of the buffer pool storage. When it is necessary to allocate a buffer item for a new request, an address is taken from the head of the first-in-first-out queue structure, and the available address count is reduced by a first value. When reclaiming the address of a submitted buffer item, the address is placed at the tail of the first-in-first-out queue structure, and the available address count is incremented by a first value.

8. A buffer device based on a dynamic linked list structure, characterized in that, The device includes: The receiving module is used to, upon receiving a new request carrying a transaction identifier, obtain the address of a free buffer item from the global buffer pool available address management queue, allocate the free buffer item address to the new request, update the information of the queue information table corresponding to the transaction identifier, record the status information of the dynamic linked list in the table entry, and record the link relationship of the dynamic linked list in the global buffer pool storage, thereby realizing the dynamic linking of the free buffer item to the existing linked list queue corresponding to the transaction identifier or the creation of a new linked list queue. The queue information table is used to manage the status of the dynamic linked list of different transaction identifiers, and the global buffer pool available address management queue is used to manage and allocate the address of a free buffer item in the buffer pool storage. Upon receiving return data carrying the buffer entry address and transaction identifier, access the corresponding buffer entry based on the buffer entry address and store the return data; The buffer module is used to query the queue information table according to the transaction identifier, determine the submission order of the returned data and perform the submission operation based on the dynamic linked list status in the queue information table and the link relationship in the buffer item, and at the same time reclaim the address of the submitted buffer item to the global buffer pool available address management queue.

9. A computer device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the buffering method based on a dynamic linked list structure as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the buffering method based on a dynamic linked list structure as described in any one of claims 1 to 7.