Queue pair context access method and apparatus for send / receive queue pair, and computer device

By splitting queue access requests into sub-access requests and utilizing scheduling queues and access lock mechanisms, the atomicity and cache consistency issues of queue access under high concurrency in RDMA networks are resolved, achieving efficient and reliable access operations.

WO2026114040A1PCT designated stage Publication Date: 2026-06-04CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2025-11-19
Publication Date
2026-06-04

AI Technical Summary

Technical Problem

In RDMA networks, under high-concurrency access scenarios, it is difficult to guarantee the atomicity of information in the queue and the consistency of the cache.

Method used

The queue is split into multiple sub-access requests, each corresponding to a target information table. These sub-access requests are managed through a scheduling queue and access lock mechanism to ensure that each sub-access request is accessed after the access lock is successfully allocated, and to generate comprehensive access response information.

Benefits of technology

This achieves ordered access to information and cache consistency for queues, improving access efficiency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025135961_04062026_PF_FP_ABST
    Figure CN2025135961_04062026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to a queue pair context access method and apparatus for a send / receive queue pair, and a computer device. The method comprises: receiving a queue pair context access request for a send / receive queue pair; determining a plurality of target queue pair contexts targeted by the queue pair context access request, and on the basis of the plurality of target queue pair contexts, splitting the queue pair context access request into at least one sub-access request, and writing same into scheduling queues; and allocating an access lock to each sub-access request on the basis of scheduling of the plurality of scheduling queues, and sending each sub-access request to a corresponding target information table on the basis of the corresponding access lock, so as to access the target queue pair context in each target information table.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, apparatus and computer equipment for accessing queue pair information of send and receive queue pairs

[0001] Related applications

[0002] This application claims priority to Chinese patent application filed on November 28, 2024, application number 2024117232368, entitled “Method, apparatus and computer device for accessing queue information of sending and receiving queue pairs”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of communication technology, and in particular to a method, apparatus, computer device, computer storage medium, and computer-readable instruction product for accessing queue information of a transmit / receive queue pair. Background Technology

[0004] In RDMA (Remote Direct Memory Access) networks, communication between the sender and receiver is achieved through send and receive queue pairs (QPs). During the sending and receiving of packets in a QP, access to queue pair information (QPCs) is usually involved, such as read or write operations.

[0005] Currently, the scale of QPCs in RDMA networks can reach hundreds of thousands or even millions, so access to QPCs is often high-concurrency access; and in high-concurrency access scenarios, ensuring the atomicity of QPCs and cache consistency is a great challenge. Summary of the Invention

[0006] According to various embodiments disclosed in this application, a method, apparatus, computer device, computer storage medium, and computer-readable instruction product for accessing queue pair information of send and receive queue pairs that can guarantee the atomicity and cache consistency of queue pair information are provided.

[0007] Firstly, this application provides a method for accessing queue pair information of send and receive queue pairs, including:

[0008] Receive queue pair information access requests for send / receive queue pairs;

[0009] The multiple target queue pairs for which the queue pair information access request is directed are determined. Based on the multiple target queue pairs, the queue pair information access request is split into at least one sub-access request. Each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair.

[0010] Write each sub-access request into its corresponding scheduling queue;

[0011] Based on the scheduling of multiple scheduling queues, a corresponding access lock is assigned to each sub-access request. Based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and access response information for each sub-access request is generated; and

[0012] The comprehensive access response information of the queue access request is returned to the sender of the queue access request; the comprehensive access response information includes the access response information of each sub-access request.

[0013] In one embodiment, each target information table corresponds to multiple scheduling queues, and the scheduling queue to which each sub-access request is written is the target scheduling queue of the sub-access request in the multiple scheduling queues of the corresponding target information table.

[0014] The process of allocating a corresponding access lock to each sub-access request based on the scheduling of multiple scheduling queues, and sending each sub-access request to the corresponding target information table based on the access lock of each sub-access request, includes:

[0015] Concurrent queue scheduling is performed on each target information table. For each target information table, a queue to be scheduled is determined from multiple scheduling queues of the target information table, and a corresponding access lock is allocated to the target sub-access request in the queue to be scheduled. The target sub-access request is the sub-access request located at the head of the queue to be scheduled.

[0016] If the access lock corresponding to the target sub-access request is successfully allocated, the target sub-access request is sent to the corresponding target information table; and

[0017] If the allocation of the access lock corresponding to the target sub-access request fails, the target sub-access request will be written back into the scheduling queue.

[0018] In one embodiment, allocating a corresponding access lock for the target sub-access request in the scheduling queue includes:

[0019] Based on the request type of the information access request in the queue, determine the target lock type corresponding to the target sub-access request;

[0020] Determine the number of transmit / receive queues already allocated under the target lock type;

[0021] If the number of allocated locks is less than the corresponding threshold, an access lock of the target lock type is allocated to the target sub-access request, and the number of allocated locks is incremented. It is then determined that the access lock allocation for the target sub-access request was successful.

[0022] If the number of allocated locks is equal to the corresponding number threshold, it is determined that the allocation of the access lock corresponding to the target sub-access request has failed.

[0023] In one embodiment, the method further includes:

[0024] After generating the access response information for the target sub-access request, the number of allocated locks in the send / receive queue under the lock type of the access lock for the target sub-access request is reduced.

[0025] In one embodiment, each information table corresponds to multiple scheduling queues;

[0026] The step of writing each sub-access request into the corresponding scheduling queue includes:

[0027] For each sub-access request, based on the hash value of the queue pair identifier of the send / receive queue pair, the target scheduling queue for the sub-access request is determined from multiple scheduling queues in the target information table corresponding to the sub-access request; and

[0028] Write the sub-access request into the target scheduling queue.

[0029] In one embodiment, determining the multiple target queue pairs for which the queue pair information access request is directed, and splitting the queue pair information access request into at least one sub-access request based on the multiple target queue pairs, includes:

[0030] The request type of the queue access request and the interface identifier of the interface that sent the queue access request are used as the request information of the queue access request.

[0031] Based on the request information, query the pre-built mapping relationship between request information and queue pair information to determine the multiple target queue pairs information targeted by the queue pair information access request;

[0032] Based on the multiple target queue pair information, the mapping relationship between the pre-built queue pair information and the information table is queried. Among the pre-built multiple information tables, at least one target information table is determined for storing the information of each target queue pair; the pre-built multiple information tables are used to store the queue pair information of each send / receive queue pair; and

[0033] The queue information access request is split into sub-access requests for each target information table.

[0034] In one embodiment, there are multiple queue pairs for information access requests, and each queue pair for information access requests corresponds to a send / receive queue pair;

[0035] The method further includes:

[0036] For each queue pair of information access requests, determine the number of requests for each sub-access request of the information access request for that queue pair; and

[0037] When the number of information messages corresponding to each access response message of the queue reaches the number of requests, the access response messages corresponding to each access request of the queue are combined to obtain the comprehensive access response message of the queue for the information access request.

[0038] Secondly, this application also provides an access device for receiving and sending queue pair information, comprising:

[0039] The request receiving module is used to receive queue pair information access requests for send and receive queue pairs;

[0040] The request splitting module is used to determine the multiple target queue pairs information targeted by the queue pair information access request, and based on the multiple target queue pairs information, split the queue pair information access request into at least one sub-access request; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information.

[0041] The request writing module is used to write each sub-access request into the corresponding scheduling queue;

[0042] The information access module is used to allocate a corresponding access lock to each sub-access request based on the scheduling of multiple scheduling queues, send each sub-access request to the corresponding target information table based on the access lock of each sub-access request, access the target queue pair information in the target information table corresponding to each sub-access request, and generate access response information for each sub-access request; and

[0043] The information return module is used to return the comprehensive access response information of the queue to the sender of the information access request; the comprehensive access response information includes the access response information of each sub-access request.

[0044] In one embodiment, each target information table corresponds to multiple scheduling queues, and the scheduling queue to which each sub-access request is written is the target scheduling queue of the sub-access request in the multiple scheduling queues of the corresponding target information table.

[0045] The information access module is also used for:

[0046] Concurrent queue scheduling is performed on each target information table. For each target information table, a queue to be scheduled is determined from multiple scheduling queues of the target information table, and a corresponding access lock is allocated to the target sub-access request in the queue to be scheduled. The target sub-access request is the sub-access request located at the head of the queue to be scheduled.

[0047] If the access lock corresponding to the target sub-access request is successfully allocated, the target sub-access request is sent to the corresponding target information table; and

[0048] If the allocation of the access lock corresponding to the target sub-access request fails, the target sub-access request will be written back into the scheduling queue.

[0049] In one embodiment, the information access module is further configured to:

[0050] Based on the request type of the information access request in the queue, determine the target lock type corresponding to the target sub-access request;

[0051] Determine the number of transmit / receive queues already allocated under the target lock type;

[0052] If the number of allocated locks is less than the corresponding threshold, an access lock of the target lock type is allocated to the target sub-access request, and the number of allocated locks is incremented. It is then determined that the access lock allocation for the target sub-access request was successful.

[0053] If the number of allocated locks is equal to the corresponding number threshold, it is determined that the allocation of the access lock corresponding to the target sub-access request has failed.

[0054] In one embodiment, the information access module is further configured to:

[0055] After generating the access response information for the target sub-access request, the number of allocated locks in the send / receive queue under the lock type of the access lock for the target sub-access request is reduced.

[0056] In one embodiment, each information table corresponds to multiple scheduling queues;

[0057] The information writing module is also used for:

[0058] For each sub-access request, based on the hash value of the queue pair identifier of the send / receive queue pair, the target scheduling queue for the sub-access request is determined from multiple scheduling queues in the target information table corresponding to the sub-access request; and

[0059] Write the sub-access request into the target scheduling queue.

[0060] In one embodiment, the request splitting module is further configured to:

[0061] The request type of the queue access request and the interface identifier of the interface that sent the queue access request are used as the request information of the queue access request.

[0062] Based on the request information, query the pre-built mapping relationship between request information and queue pair information to determine the multiple target queue pairs information targeted by the queue pair information access request;

[0063] Based on the multiple target queue pair information, the mapping relationship between the pre-built queue pair information and the information table is queried. Among the pre-built multiple information tables, at least one target information table is determined for storing the information of each target queue pair; the pre-built multiple information tables are used to store the queue pair information of each send / receive queue pair; and

[0064] The queue information access request is split into sub-access requests for each target information table.

[0065] In one embodiment, there are multiple queue pairs for information access requests, and each queue pair for information access requests corresponds to a send / receive queue pair;

[0066] The information return module is also used for:

[0067] For each queue pair of information access requests, determine the number of requests for each sub-access request of the information access request for that queue pair; and

[0068] When the number of information messages corresponding to each access response message of the queue reaches the number of requests, the access response messages corresponding to each access request of the queue are combined to obtain the comprehensive access response message of the queue for the information access request.

[0069] Thirdly, this application also provides a computer device, including a memory and one or more processors, wherein the memory stores computer-readable instructions, and the one or more processors execute the computer-readable instructions to perform the following steps:

[0070] Receive queue pair information access requests for send / receive queue pairs;

[0071] The multiple target queue pairs for which the queue pair information access request is directed are determined. Based on the multiple target queue pairs, the queue pair information access request is split into at least one sub-access request. Each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair.

[0072] Write each sub-access request into its corresponding scheduling queue;

[0073] Based on the scheduling of multiple scheduling queues, a corresponding access lock is assigned to each sub-access request. Based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and access response information for each sub-access request is generated; and

[0074] The comprehensive access response information of the queue access request is returned to the sender of the queue access request; the comprehensive access response information includes the access response information of each sub-access request.

[0075] Fourthly, this application also provides a computer storage medium storing computer-readable instructions thereon, which, when executed by one or more processors, perform the following steps:

[0076] Receive queue pair information access requests for send / receive queue pairs;

[0077] The multiple target queue pairs for which the queue pair information access request is directed are determined. Based on the multiple target queue pairs, the queue pair information access request is split into at least one sub-access request. Each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair.

[0078] Write each sub-access request into its corresponding scheduling queue;

[0079] Based on the scheduling of multiple scheduling queues, a corresponding access lock is assigned to each sub-access request. Based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and access response information for each sub-access request is generated; and

[0080] The comprehensive access response information of the queue access request is returned to the sender of the queue access request; the comprehensive access response information includes the access response information of each sub-access request.

[0081] Fifthly, this application also provides a computer-readable instruction product, including computer-readable instructions that, when executed by one or more processors, perform the following steps:

[0082] Receive queue pair information access requests for send / receive queue pairs;

[0083] The multiple target queue pairs for which the queue pair information access request is directed are determined. Based on the multiple target queue pairs, the queue pair information access request is split into at least one sub-access request. Each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair.

[0084] Write each sub-access request into its corresponding scheduling queue;

[0085] Based on the scheduling of multiple scheduling queues, a corresponding access lock is assigned to each sub-access request. Based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and access response information for each sub-access request is generated; and

[0086] The comprehensive access response information of the queue access request is returned to the sender of the queue access request; the comprehensive access response information includes the access response information of each sub-access request.

[0087] Details of one or more embodiments of this application are set forth in the following drawings and description. Other features and advantages of this application will become apparent from the specification, drawings, and claims. Attached Figure Description

[0088] To more clearly illustrate the technical solutions in the embodiments of this application or the conventional technology, the drawings used in the description of the embodiments or the conventional technology will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the disclosed drawings without creative effort.

[0089] Figure 1 is a schematic diagram of a queue-based information management system according to one or more embodiments;

[0090] Figure 2 is a flowchart illustrating one of the methods for accessing queue pair information according to one or more embodiments;

[0091] Figure 3 is a flowchart illustrating the steps of allocating a corresponding access lock to each sub-access request based on scheduling of multiple scheduling queues according to one or more embodiments, and sending each sub-access request to the corresponding target information table based on the access lock of each sub-access request.

[0092] Figure 4 is a flowchart illustrating the steps of allocating a corresponding access lock to a target sub-access request in a queue to be scheduled, according to one or more embodiments.

[0093] Figure 5 is a flowchart illustrating the steps of determining multiple target queue pairs for which a queue pair information access request is targeted, and splitting the queue pair information access request into at least one sub-access request based on the multiple target queue pairs.

[0094] Figure 6 is a second flowchart illustrating a method for accessing queue pair information according to one or more embodiments of the method for sending and receiving queue pairs.

[0095] Figure 7 is a structural block diagram of an access device for sending and receiving queue pair information according to one or more embodiments;

[0096] Figure 8 is an internal structural diagram of a computer device according to one or more embodiments. Detailed Implementation

[0097] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0098] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0099] The method for accessing queue pair information of send / receive queues provided in this application embodiment can be applied to the queue pair information management system shown in Figure 1. This queue pair information management system is hosted on a server, but it can also be hosted on a terminal, or on a system including both a server and a terminal, and is implemented through interaction between the server and the terminal. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services; the terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, etc.

[0100] Referring to Figure 1, the queue information management system includes a request parsing module, an information table management module, an information table module, and a response generation module.

[0101] It should be noted that the sender and receiver in the RDMA network communicate through transmit and receive queues (QPs). During the communication process, the sender and receiver need to obtain the corresponding queue pair information (QPC) from the queue pair information management system.

[0102] Referring to Figure 1, the sending end sends a queue pair information access request (QPC) to the queue pair information management system via a sending interface, and receives the response information returned by the queue pair information management system via the sending interface. Similarly, the receiving end sends a queue pair information access request (QPC) to the queue pair information management system via a receiving interface, and receives the response information returned by the queue pair information management system via the receiving interface. Both the sending and receiving interfaces serve as communication interfaces between the sending and receiving ends.

[0103] In this embodiment, the request parsing module is used to parse the received queue pair information access request, determine the multiple target queue pair information targeted by the queue pair information access request, split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information, and send each sub-access request to the information table management module.

[0104] The information table management module is used to write each sub-access request into the corresponding scheduling queue. Based on the scheduling of multiple scheduling queues, it allocates a corresponding access lock to each sub-access request. Based on the access lock of each sub-access request, it sends each sub-access request to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request.

[0105] The information table module includes multiple pre-built information tables, which are used to store queue pair information for each send and receive queue pair. The information table module is used to generate access response information for each sub-access request after the access is completed, and send the access response information for each sub-access request to the response generation module.

[0106] The response generation module is used to generate comprehensive access response information for the queue-to-information access request based on the access response information of each sub-access request, and return the comprehensive access response information for the queue-to-information access request to the sender of the queue-to-information access request.

[0107] In some embodiments, as shown in FIG2, a method for accessing queue pair information of send and receive queue pairs is provided. Taking the application of this method to the queue pair information management system shown in FIG1 as an example, the method includes the following steps:

[0108] Step S202: Receive a queue pair information access request for the send / receive queue pair.

[0109] Among them, the transmit / receive queue pair refers to the QP (Queue Pair). In the RDMA network, the transmit / receive queue pair QP enables communication between the sender and receiver.

[0110] The queue pair information access request is used to request access to queue pair information; queue pair information refers to QPC (Queue Pair Context). During the process of sending and receiving packets in QP, access to the queue pair information QPC is usually involved, such as when reading or writing to the queue pair information QPC is required.

[0111] Referring to Figure 1, both the sending interface and the receiving interface are communication interfaces between the sending end and the receiving end. The queue information management system receives queue information access requests based on the sending interface and the receiving interface.

[0112] In practical applications, multiple queue pair information access requests can exist simultaneously in a queue pair information management system to improve the efficiency of queue pair information access; multiple queue pair information access requests can be for different send and receive queue pairs or for the same send and receive queue pair.

[0113] Step S204: Determine the multiple target queue pairs for which the queue pair information access request is directed, and based on the multiple target queue pairs, split the queue pair information access request into at least one sub-access request.

[0114] The queue pair information management system contains multiple pre-built information tables, which are used to store the queue pair information QPC of each send and receive queue pair (QP). Referring to Figure 1, the queue pair information management system stores multiple pre-built information tables in the information table module.

[0115] Each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information.

[0116] In this embodiment, referring to Figure 1, the request parsing module of the queue pair information management system first parses the queue pair information access request to determine the multiple target queue pair information that the queue pair information access request needs to access; then, based on the multiple target queue pair information, the request parsing module determines at least one information table that the queue pair information access request needs to access from multiple pre-built information tables, as the target information table of the queue pair information access request; next, based on the target information table, the request parsing module splits the queue pair information access request into at least one sub-access request, each sub-access request corresponding to a target information table, used to request access to the target queue pair information in the corresponding target information table.

[0117] For example, suppose the request parsing module parses the queue pair information QPCs that queue pair information access request 1 needs to access as QPC1, QPC2, and QPC3. Then, the target queue pair information for queue pair information access request 1 is QPC1, QPC2, and QPC3. Among them, QPC1 and QPC2 are stored in information table 1, and QPC3 is stored in information table 2. Therefore, the target information tables for queue pair information access request 1 are information table 1 and information table 2. Thus, the request parsing module splits queue pair information access request 1 into sub-access request 1-1 for information table 1 and sub-access request 1-2 for information table 2, in order to request access to QPC1 and QPC2 in information table 1, and in order to request access to QPC3 in information table 2.

[0118] Step S206: Write each sub-access request into the corresponding scheduling queue.

[0119] Referring to Figure 1, the queue-based information management system has multiple scheduling queues in the information table management module. Furthermore, each target information table corresponds to multiple scheduling queues.

[0120] The scheduling queue corresponding to each sub-access request is one of multiple scheduling queues in the target information table corresponding to that sub-access request.

[0121] In this embodiment, referring to Figure 1, after the request parsing module splits the queue pair information access request into multiple sub-access requests, it sends the multiple sub-access requests to the information table management module of the queue pair information management system; the information table management module writes each sub-access request into the corresponding scheduling queue, and each sub-access request waits for scheduling in the scheduling queue.

[0122] Step S208: Based on the scheduling of multiple scheduling queues, allocate a corresponding access lock for each sub-access request. Based on the access lock of each sub-access request, send each sub-access request to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and generate access response information for each sub-access request.

[0123] The information table management module is equipped with scheduling algorithms for scheduling multiple scheduling queues. These scheduling algorithms include, but are not limited to, the RR (Round-Robin) polling scheduling algorithm and the WRR (Weighted Round Robin) weighted round-robin scheduling algorithm.

[0124] In this embodiment, referring to Figure 1, the information table management module schedules multiple scheduling queues. Each time, it takes out a sub-access request from the scheduling queue and assigns a corresponding access lock to the sub-access request. When the sub-access request is assigned a corresponding access lock, it sends the sub-access request to the corresponding target information table stored in the information table module of the queue information management system, so as to access the target queue information in the target information table.

[0125] After the sub-access request is completed, the information table module generates the access response information for the sub-access request and sends it to the response generation module of the queue information management system.

[0126] Step S210: Return the comprehensive access response information of the queue access request to the sender of the queue access request.

[0127] The comprehensive access response information includes the access response information for each sub-access request.

[0128] Referring to Figure 1, both the sending interface and the receiving interface are communication interfaces between the sending end and the receiving end. The queue information management system returns queue access requests based on the sending interface and the receiving interface.

[0129] In this embodiment, referring to Figure 1, the response generation module combines the access response information of each sub-access request received to obtain the comprehensive access response information of the queue-to-information access request corresponding to each sub-access request, and returns the comprehensive access response information to the sender of the queue-to-information access request through the interface for receiving queue-to-information access requests.

[0130] In the above-mentioned method for accessing queue pair information of send / receive queue pairs, firstly, the queue pair information management system receives a queue pair information access request for the send / receive queue pair; then, the queue pair information management system determines multiple target queue pairs information for which the queue pair information access request is directed, and based on the multiple target queue pairs information, splits the queue pair information access request into at least one sub-access request; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information; next, the queue pair information management system writes each sub-access request into its corresponding scheduling queue; then, based on the scheduling of multiple scheduling queues, the queue pair information management system allocates a corresponding access lock to each sub-access request, and based on the access lock of each sub-access request, sends each sub-access request to its corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and generates access response information for each sub-access request; finally, the queue pair information management system returns the comprehensive access response information of the queue pair information access request to the sender of the queue pair information access request; the comprehensive access response information includes the access response information of each sub-access request. In this way, by assigning a corresponding access lock to each sub-access request of the queue access request, and sending each sub-access request to the corresponding target information table based on the access lock of each sub-access request, the queue information management system can ensure the orderliness of the access operation of the queue information based on the access lock, thereby ensuring the atomicity and cache consistency of the queue information.

[0131] In some embodiments, each target information table corresponds to multiple scheduling queues, and the scheduling queue to which each sub-access request is written is the target scheduling queue in the multiple scheduling queues of the corresponding target information table for the sub-access request.

[0132] For example, suppose queue access request 1 is split into sub-access request 1-1 for information table 1 and sub-access request 1-2 for information table 2; queue access request 2 is split into sub-access request 2-1 for information table 1 and sub-access request 2-2 for information table 2; and queue access request 3 is split into sub-access request 3-1 for information table 1 and sub-access request 3-2 for information table 2. Also suppose information table 1 has scheduling queues 1-1 and 1-2. If the target scheduling queue for sub-access request 1-1 and sub-access request 3-1 in information table 1 is scheduling queue 1-1, and the target scheduling queue for sub-access request 2-1 in information table 1 is scheduling queue 1-2, the information table management module will write sub-access request 1-1 and sub-access request 3-1 to scheduling queue 1-1 and write sub-access request 2-1 to scheduling queue 1-2.

[0133] As shown in Figure 3, step S208 above, based on the scheduling of multiple scheduling queues, allocates a corresponding access lock to each sub-access request, and sends each sub-access request to the corresponding target information table based on the access lock of each sub-access request, including the following steps:

[0134] Step S302: Perform concurrent queue scheduling processing on each target information table. For each target information table, determine the queue to be scheduled from the multiple scheduling queues of the target information table, and allocate the corresponding access lock to the target sub-access request in the queue to be scheduled.

[0135] Step S304: If the access lock corresponding to the target sub-access request is successfully allocated, the target sub-access request is sent to the corresponding target information table.

[0136] Step S306: If the allocation of the access lock corresponding to the target sub-access request fails, the target sub-access request is written back into the scheduling queue.

[0137] The target sub-access request is the sub-access request located at the head of the queue to be scheduled.

[0138] In this embodiment, referring to Figure 1, the information table management module can perform queue scheduling processing on each target information table concurrently, that is, perform queue scheduling processing on multiple target information tables at the same time.

[0139] The queue scheduling process for each target information table is as follows:

[0140] Referring to Figure 1, the information table management module also includes a scheduler. The scheduler is equipped with a scheduling algorithm. First, based on the scheduling algorithm, the scheduler determines the queue to be scheduled from multiple scheduling queues in the target information table. The sub-access request at the head of the queue to be scheduled is identified as the target sub-access request in the scheduling queue, and the target sub-access request is retrieved. Then, the scheduler allocates the corresponding access lock to the target sub-access request in the queue to be scheduled. If the corresponding access lock is successfully allocated to the target sub-access request, the target sub-access request is sent to the corresponding target information table to access the information in the target queue. Alternatively, if the allocation of the access lock to the target sub-access request fails, the target sub-access request is rewritten into the queue to be scheduled, waiting for the next scheduling.

[0141] For example, suppose that for information table 1, there are corresponding scheduling queues 1-1 and 1-2, and scheduling queue 1-1 contains sub-access request 1-1 and sub-access request 3-1 in sequence, and scheduling queue 1-2 contains sub-access request 1-2.

[0142] In the first scheduling, if the scheduler determines that the queue to be scheduled is scheduling queue 1-1, the information table management module retrieves the sub-access request 1-1 currently at the head of the queue from scheduling queue 1-1 and assigns it the corresponding access lock. If the assignment fails, the scheduler writes the sub-access request 1-1 back into scheduling queue 1-1.

[0143] In the second scheduling, if the scheduler determines that the queue to be scheduled is scheduling queue 1-2, the scheduler takes the sub-access request 2-1 that is currently at the head of the queue from scheduling queue 1-2 and assigns it the corresponding access lock. If the assignment is successful, the scheduler sends the sub-access request 2-1 to information table 1.

[0144] In the third scheduling, if the scheduler determines that the queue to be scheduled is scheduling queue 1-1, the scheduler takes the sub-access request 3-1 that is currently at the head of the queue from scheduling queue 1-1 and assigns it the corresponding access lock. If the assignment is successful, the scheduler sends the sub-access request 3-1 to information table 1.

[0145] In the fourth scheduling, if the scheduler determines that the queue to be scheduled is scheduling queue 1-1, the scheduler takes the sub-access request 1-1 that is currently at the head of the queue from scheduling queue 1-1 and assigns it the corresponding access lock. If the assignment is successful, the scheduler sends the sub-access request 1-1 to information table 1.

[0146] In this embodiment, firstly, by scheduling the concurrent queues of each target information table through the scheduler, concurrent access to different target information tables can be achieved, thereby improving access efficiency; secondly, by allocating access locks for target sub-access requests through the scheduler, and by handling different situations of successful and unsuccessful allocation, it can be ensured that each sub-access request accesses the queue information sequentially with access locks, thereby guaranteeing the orderliness of access operations to queue information, that is, guaranteeing the atomicity and cache consistency of queue information.

[0147] In some embodiments, as shown in FIG4, step S302 above, allocating a corresponding access lock for a target sub-access request in the queue to be scheduled includes the following steps:

[0148] Step S402: Based on the request type of the information access request in the queue, determine the target lock type corresponding to the target sub-access request.

[0149] Step S404: Determine the number of send / receive queue pairs already allocated under the target lock type.

[0150] Step S406: If the number of allocated locks is less than the corresponding number threshold, allocate an access lock of the target lock type to the target sub-access request, increment the number of allocated locks, and confirm that the access lock corresponding to the target sub-access request has been successfully allocated.

[0151] Step S408: If the number of allocated locks is equal to the corresponding number threshold, determine that the allocation of the access lock corresponding to the target sub-access request has failed.

[0152] The request type of the queue access request is used to characterize the type of access operation of the queue access request. The access operation includes, but is not limited to, read operation and write operation. The request type includes, but is not limited to, read request corresponding to read operation and write request corresponding to write operation. In practical applications, the queue access request carries the corresponding request type. In the process of splitting the queue access request, the sub-access request will also carry the request type carried by the queue access request to which it belongs.

[0153] For different request types, different access locks of different lock types need to be assigned to the queues for information access requests. The lock types include, but are not limited to, read locks corresponding to read requests and write locks corresponding to write requests.

[0154] The target lock type is the lock type of the access lock to be assigned to the target sub-access request.

[0155] In this embodiment, the queue information management system configures a number threshold for each send / receive queue pair under different lock types to constrain the number of locks that the send / receive queue pair can be allocated under different lock types.

[0156] Furthermore, in practical applications, the queue information management system also records the number of queues allocated under different lock types for each send and receive queue pair.

[0157] In this embodiment, the process of allocating a corresponding access lock for each target sub-access request is as follows:

[0158] First, the scheduler determines the request type of the information access request in the queue to which the target sub-access request belongs, and determines the lock type of the access lock to be allocated to the target sub-access request based on the request type, thus obtaining the target lock type corresponding to the target sub-access request.

[0159] Referring to Figure 1, the request scheduling queue also includes a lock allocation controller. The number thresholds and the number of allocated locks for each send and receive queue under different lock types are recorded in the lock allocation controller.

[0160] After determining the target lock type for the target sub-access request, the lock allocation controller first determines the number of allocated locks for the send / receive queue pairs corresponding to the target sub-access request under that target lock type. If the number of allocated locks is less than the threshold for the number of send / receive queue pairs corresponding to the target sub-access request under that target lock type, the controller allocates an access lock of the target lock type to the target sub-access request and increments the number of allocated locks, thus confirming that the access lock allocation for the target sub-access request is successful. If the number of allocated locks is equal to the threshold for the number of send / receive queue pairs corresponding to the target sub-access request under that target lock type, the controller determines that the access lock allocation for the target sub-access request has failed.

[0161] For example, suppose the queue corresponding to the target sub-access request is a write request. The scheduler determines that a write lock needs to be allocated for the target sub-access request, and therefore determines that the target lock type corresponding to the target sub-access request is a write lock. Further assume that the threshold number of send and receive queues corresponding to the target sub-access request under the write lock is 99.

[0162] If the number of send / receive queue pairs corresponding to the current target sub-access request that have been allocated under the write lock is 80, which is less than the number threshold of 99, then the lock allocation controller allocates a write lock to the target sub-access request, increments the number of allocated queue pairs by 1, and releases the allocated write lock after the target sub-access request successfully accesses the corresponding target information table, and decrements the number of allocated queue pairs by 1.

[0163] If the number of transmit / receive queue pairs corresponding to the current target sub-access request that have been allocated under the write lock is 99, which is equal to the number threshold of 99, then the lock allocation controller determines that the access lock allocation corresponding to the target sub-access request has failed and informs the scheduler of the allocation failure information. The scheduler then writes the target sub-access request back into the scheduling queue to which the target sub-access request originally belonged.

[0164] In this embodiment, by configuring the number threshold for each send / receive queue pair under different lock types through the lock allocation controller, and recording the number of allocated locks for each send / receive queue pair under different lock types, it is possible to determine whether a corresponding access lock can be allocated to the target sub-access request. Based on the access lock, the orderliness of access operations on queue pairs can be guaranteed, thereby ensuring the atomicity of queue pairs and cache consistency.

[0165] In some embodiments, the method for accessing queue pair information of send / receive queue pairs provided in this application further includes the following steps:

[0166] After generating the access response information for the target sub-access request, reduce the number of allocated locks in the send / receive queues for the lock type of the access lock for the target sub-access request.

[0167] In some embodiments, each information table corresponds to multiple scheduling queues.

[0168] Step S206 above, writing each sub-access request into the corresponding scheduling queue, includes the following: for each sub-access request, determining the target scheduling queue of the sub-access request from multiple scheduling queues in the target information table corresponding to the sub-access request based on the hash value of the queue pair identifier of the send and receive queue pair; and writing the sub-access request into the target scheduling queue.

[0169] Among them, the queue pair identifier refers to the information that can uniquely identify the send and receive queue pair; in practical applications, the queue pair information access request carries the queue pair identifier of the specific send and receive queue pair. In the process of splitting the queue pair information access request, the sub-access request will also carry the request type carried by the queue pair information access request to which it belongs.

[0170] In this embodiment, for each sub-access request, the information table management module calculates the hash value of the queue pair identifier based on the queue pair identifier and hash function of the send / receive queue pair corresponding to the sub-access request, and uses the hash value to determine the target scheduling queue of the sub-access request from among the multiple scheduling queues of the target information table corresponding to the sub-access request, and then writes the sub-access request into the target scheduling queue.

[0171] In this embodiment, the information table management module can determine the target scheduling queue from multiple scheduling queues in the target information table corresponding to the sub-access request based on the hash value of the queue pair identifier of the send / receive queue pair corresponding to the sub-access request, thereby realizing the writing of the sub-access request.

[0172] In some embodiments, as shown in FIG5, step S204 above, which determines multiple target queue pairs for which the queue pair information access request is directed, and splits the queue pair information access request into at least one sub-access request based on the multiple target queue pairs, includes the following steps:

[0173] Step S502: The request type of the queue access request and the interface identifier of the interface that sent the queue access request are used as the request information of the queue access request.

[0174] Step S504: Based on the request information, query the pre-built mapping relationship between the request information and the queue pair information to determine the multiple target queue pairs information targeted by the queue pair information access request.

[0175] Step S506: Based on multiple target queue pair information, query the mapping relationship between the pre-built queue pair information and the information table, and determine at least one target information table for storing the target queue pair information in the pre-built multiple information tables.

[0176] Step S508: The queue information access request is split into sub-access requests for each target information table.

[0177] Among them, multiple pre-built information tables are used to store queue pair information for each send and receive queue pair.

[0178] Among them, the interface identifier is information that can uniquely identify the interface.

[0179] The mapping relationship between request information and queue pair information is used to characterize the mapping relationship between the request information of each queue pair information access request and the queue pair information requested by the queue pair information access request.

[0180] The mapping relationship between queue pair information and information table is used to characterize the mapping relationship between each queue pair information and the information table that stores the queue pair information.

[0181] In this embodiment, the request parsing module uses the request type of the queue pair information access request and the interface identifier of the interface sending the queue pair information access request as the request information for the queue pair information access request. Then, based on the request information, the request parsing module queries the pre-built mapping relationship between request information and queue pair information. Among the queue pair information, it determines the queue pair information that the queue pair information access request with the request information needs to access, thus obtaining multiple target queue pair information targeted by the queue pair information access request. Next, based on the multiple target queue pair information, the request parsing module queries the pre-built mapping relationship between queue pair information and information tables. Among the multiple information tables, it determines the information table storing each target queue pair information, thereby obtaining at least one target information table. Finally, based on at least one target information table, the request parsing module splits the queue pair information access request into at least one sub-access request. Each sub-access request corresponds to a target information table and is used to request access to the target queue pair information in the corresponding target information table.

[0182] In this embodiment, firstly, the request parsing module, based on the pre-built mapping relationship between request information and queue pair information, can determine which queue pair information the queue pair information access request needs to obtain, thereby obtaining multiple target queue pair information targeted by the queue pair information access request; secondly, based on the pre-built mapping relationship between queue pair information and information table, the request parsing module can determine which information table each target queue pair information is stored in, thereby obtaining at least one target information table, and then can split the queue pair information access request into at least one sub-access request.

[0183] In some embodiments, there are multiple queue pairs for information access requests, and each queue pair for information access requests corresponds to a send / receive queue pair.

[0184] The method for accessing queue pair information of the send and receive queue pairs provided in this application further includes the following: for each queue pair information access request, determining the number of requests for each sub-access request of the queue pair information access request; when the number of information for each access response information corresponding to the queue pair information access request reaches the number of requests, combining the access response information corresponding to the queue pair information access request to obtain the comprehensive access response information of the queue pair information access request.

[0185] Each queue access request carries a corresponding request identifier; the request identifier is information that uniquely identifies the queue access request. In practical applications, during the splitting of a queue access request, each sub-access request also carries the request identifier of its respective queue access request.

[0186] Among them, the access response information corresponding to each information access request in the queue refers to the access response information of each sub-access information of the information access request in the queue.

[0187] In this embodiment, multiple queue pair information access requests can exist simultaneously in the queue pair information management system. For each queue pair information access request, after the request parsing module splits the queue pair information access request into at least one sub-access request, it determines the number of requests for each sub-access request, and then binds the request identifier of the queue pair information access request and the number of requests to the response generation module.

[0188] After generating the access response information for each sub-access request, the information table module sends the access response information to the response generation module; the access response information carries the request identifier carried by the corresponding sub-access request.

[0189] Then, for each request identifier (to which the queue access request belongs), the response generation module counts the number of access response messages received corresponding to that request identifier (to which the queue access request belongs). If the number of messages corresponding to that request identifier (to which the queue access request belongs) reaches the number of requests corresponding to that request identifier (to which the queue access request belongs), it means that all sub-access requests of the queue access request to which that request identifier belongs have completed the access operation. Therefore, the access response messages corresponding to that request identifier (to which the queue access request belongs) are combined to obtain the comprehensive access response message of the queue access request corresponding to that request identifier.

[0190] In this embodiment, the response generation module can determine whether each sub-access request of each queue has completed the access operation based on the number of requests and the number of information corresponding to the information access request of each queue. If all access operations have been completed, the module generates comprehensive access response information, thereby realizing access response in high-concurrency access scenarios.

[0191] In one embodiment, the information table management module is divided into multiple sub-management modules, each corresponding to an information table, and is used to schedule multiple scheduling queues of an information table. Sub-access requests corresponding to each information table are scheduled through the sub-management module corresponding to that information table.

[0192] In one embodiment, as shown in Figure 6, another method for accessing queue pair information is provided. Taking the application of this method to the queue pair information management system shown in Figure 1 as an example, the method includes the following steps:

[0193] Step S602: Receive multiple queue requests for information access.

[0194] Step S604: Determine the target queue pair information for each queue pair information access request, based on the target queue pair information for each queue pair information access request.

[0195] Step S606: The request type of each queue's information access request and the interface identifier of the interface that sent the information access request to each queue are used as the request information for each queue's information access request.

[0196] Step S608: Based on the request information of each queue pair information access request, query the pre-built mapping relationship between request information and queue pair information to determine the target queue pair information for each queue pair information access request.

[0197] Step S610: Based on the target queue pair information for each queue pair information access request, query the pre-built mapping relationship between queue pair information and information table to determine the target information table corresponding to each queue pair information access request.

[0198] Step S612: Based on the target information table corresponding to each queue's information access request, split each queue's information access request into multiple sub-access requests.

[0199] Step S614: Write each sub-access request into the target scheduling queue of the multiple scheduling queues in the corresponding target information table.

[0200] Step S616: Perform concurrent queue scheduling processing on multiple target information tables. For each target information table, determine the queue to be scheduled from the multiple scheduling queues of the target information table, and allocate the corresponding access lock to the target sub-access request in the queue to be scheduled.

[0201] Step S618: For each target sub-access request, if the access lock corresponding to the target sub-access request is successfully allocated, the target sub-access request is sent to the corresponding target information table to access the target queue information in the target information table and generate the access response information of the sub-access request.

[0202] Step S620: For each target sub-access request, if the allocation of the access lock corresponding to the target sub-access request fails, the target sub-access request is written back into the scheduling queue.

[0203] Step S622: For each queue access request, if the number of information in each access response information corresponding to the queue access request reaches the number of requests in each sub-access request of the queue access request, combine the access response information corresponding to the queue access request to obtain the comprehensive access response information of the queue access request.

[0204] Step S624: Return the comprehensive access response information of each queue to the sender of each queue's information access request.

[0205] In this embodiment, by assigning a corresponding access lock to each sub-access request of the queue access request, and sending each sub-access request to the corresponding target information table based on the access lock of each sub-access request, the target queue accesses the information corresponding to each sub-access request. This ensures the orderliness of the access operation to the queue based on the access lock, thereby ensuring the atomicity of the queue access to the information and the consistency of the cache.

[0206] To more clearly illustrate the method for accessing queue pair information of send / receive queues provided in the embodiments of this application, the following description uses an embodiment to illustrate the method for accessing queue pair information of send / receive queues. However, it should be understood that the embodiments of this application are not limited thereto. In one exemplary embodiment, this application also provides a high-concurrency access control method for RDMA based on distributed locks. This method is applied to the queue pair information management system shown in Figure 1, and includes the following:

[0207] The queue information management system mainly consists of four sub-modules, as shown in Figure 1: request parsing module, information table management module, information table module, and response generation module.

[0208] The request parsing module is primarily used to receive and parse QPC read / write requests. It handles QPC read / write requests sent from interfaces in both the sending and receiving directions of data packets. These interfaces include, but are not limited to, sending and receiving interfaces. The request parsing module determines the required QPC parameters for each request based on the input interface and request type. It then breaks down a single read / write request into several concurrent sub-requests and sends them to the information table management module, which contains the required QPC parameters, for further processing.

[0209] The Information Table Management Module is primarily responsible for caching, scheduling, and concurrent access control of read and write requests for QPC tables. It consists of a scheduling input queue, a scheduling output queue, a scheduler, and a lock allocation controller for concurrent access control. The lock allocation controller is responsible for allocating and releasing read and write locks for each QP; each QPC table has its own lock allocation controller. For each sub-request, a lock must be acquired before it can be forwarded to the corresponding QPC table for parameter reading and writing, ensuring atomicity and cache consistency. If a sub-request fails to acquire a read and write lock, the scheduler will add the sub-request back to the tail of the corresponding scheduling input queue, waiting for the next scheduling cycle.

[0210] The Information Table module is primarily used to cache QPC parameters and handle read and write operations on these parameters. This module contains multiple QPC tables, each caching different QPC parameters.

[0211] Response generation module: mainly responsible for integrating the read and write responses returned by various QPC tables and generating a comprehensive response to be returned to the sender of the read and write request.

[0212] In this embodiment, the RDMA high-concurrency access control method based on distributed locks includes the following steps:

[0213] Step 1: The request parsing module receives the QPC request and stores it in the request cache queue.

[0214] Step 2: The request parsing module retrieves a QPC request from the request cache queue, determines the QPC parameters to be processed based on the interface ID (Module ID) of the interface that sent the QPC request and the request type (Req type) of the QPC request, decomposes it into QPC sub-requests for several QPC tables, and sends them to the information table management module of the corresponding QPC table.

[0215] Step 3: The request parsing module sends the request information of the currently processed QPC request to the response generation module. This request information includes, but is not limited to, the Module ID, Req ID (QPC request ID), Req_type, and QPN (the ID of the QP corresponding to the QPC request). The response generation module caches the request information using the Req ID and records how many QPC table read / write responses the currently processed QPC request needs to wait for based on the Req_type. Once the response generation module receives all the read / write responses for the QPC request, it generates a merged, comprehensive response and returns it based on the Module ID.

[0216] In addition to step 3 above, the following steps are also included:

[0217] Step 4: The information table management module obtains the Queue ID of the scheduling queue based on the QPN of the QPC request using a hash function, where Queue ID = Hash(QPN), and then writes the QPC request and its request information into the corresponding scheduling queue.

[0218] Step 5: The scheduler of the information table management module reads the head request of the queue to be processed according to the scheduling algorithm, sends the request information of the head request to the lock allocation controller to obtain the read-write lock of the QPC sub-request, and determines whether the current QPC sub-request can be scheduled out. Furthermore, the scheduler's scheduling algorithm is configurable, including but not limited to RR round-robin scheduling, WRR weighted round-robin scheduling, etc.

[0219] Step 6: After receiving a lock acquisition request, the lock allocation controller queries the corresponding lock table based on the QPN to see if a lock can be allocated for the QPC sub-request. In the lock table, each QPN contains the RD_Lock_Num and WR_Lock_Num parameters, representing the number of read locks and write locks already allocated to that QPN, respectively, with an initial value of 0. The lock table also contains the MAX_RD_LOCK and MAX_WR_LOCK parameters, representing the maximum number of read locks and write locks that can be allocated to that QPN, respectively.

[0220] The basic steps to determine whether each QPN is lock-assignable are as follows:

[0221] Step 6.1: Determine whether the QPC sub-request is a read request or a write request based on Req_type. If it is a read request, proceed to step 6.2; if it is a write request, proceed to step 6.3.

[0222] Step 6.2: Read the WR_Lock_Num parameter of the QPN. If WR_Lock_Num is less than MAX_WR_LOCK, determine that a write lock can be allocated to the QPN, increment WR_Lock_Num by 1, and send a successful lock acquisition response to the scheduler. If WR_Lock_Num is equal to MAX_WR_LOCK, determine that the QPN has enough write locks to allocate, and return a lock acquisition failure response to the scheduler.

[0223] Step 6.3: Read the RD_Lock_Num parameter of the QPN. If RD_Lock_Num is less than MAX_RD_LOCK, determine that a read lock can be allocated to the QPN, increment RD_Lock_Num by 1, and send a successful lock acquisition response to the scheduler. If RD_Lock_Num is equal to MAX_RD_LOCK, determine that the QPN has enough available read locks, return a lock acquisition failure response to the scheduler.

[0224] Step 7: The scheduler receives the lock request response from the lock allocation controller. If the lock is successfully acquired, the currently processed QPC sub-request is forwarded to the corresponding QPC table for processing, and the process proceeds to Step 8; if the lock acquisition fails, the QPC sub-request and its request information are re-added to the scheduling queue corresponding to its QPN, waiting for the next scheduling, and the process proceeds to Step 5.

[0225] Step 8: The QPC table determines the request type of the QPC sub-request based on the Req type. If it's a write request, update the relevant QPC parameters of the corresponding QP based on the QPN; if it's a read request, read the relevant QPC parameters of the corresponding QP based on the QPN. After the QPC sub-request is processed, the QPC table generates a read / write response and sends it to the response generation module, proceeding to step 10; simultaneously, it sends a read / write lock release request for the QPN to the information table management module, carrying the QPN and Req Type, proceeding to step 9.

[0226] Step 9: The lock allocation controller receives a read-write lock release request from the QPC table, updates the lock table based on the QPN and Req type carried in the read-write lock release request, and releases the allocated read-write lock. The basic steps for releasing a read-write lock are as follows:

[0227] Step 9.1: The lock allocation controller reads the lock table based on the QPN and determines whether the currently released lock is a read lock or a write lock based on the Req type.

[0228] Step 9.2: If it is a read lock, decrement the RD_Lock_Num parameter corresponding to QPN by 1, and the process ends.

[0229] Step 9.3: If a write lock is not present, decrement the WR_Lock_Num parameter corresponding to QPN by 1, and the process ends.

[0230] Step 10: After receiving the read / write responses from the QPC tables, the response generation module uses the Req ID to determine whether read / write responses for the QPC request have been received from all the QPC tables. If all have been received, the response generation module generates a merged comprehensive response and returns it based on the Module ID, then deletes the cached request information for that Req ID. If not, Step 10 is repeated to continue waiting for read / write responses from all QPC tables to be received.

[0231] In this embodiment, firstly, QPC parameters are maintained in separate tables based on the QPC read / write scenario. An information table management module is designed based on each QPC table to maintain read / write lock allocation for each QPC table. This ensures both the consistency requirements of concurrent read / write operations with different parameters and good scalability. Secondly, read / write lock allocation is maintained based on QPN, ensuring that the QPC parameters of sent and received data packets within the same QP are updated in a global order, guaranteeing the atomicity of reads and writes for the same QPC parameter. Furthermore, for the same QPN, the number of read / write locks allocated to the same QPN is controlled by the RD_Lock_Num and WR_Lock_Num parameters, which can effectively improve the read / write concurrency of the same QPN. At the same time, the allocation of read / write locks between different QPNs does not affect each other, greatly improving the concurrency between different QPNs. Furthermore, the request parsing module decomposes the QPC request into several QPC sub-requests for QPC tables, and the response generation module merges the read and write response requests of different QPC tables into a comprehensive response for return. This method allows different QPC requests to access different QPC tables concurrently, improving the read and write efficiency of QPC and shortening the processing latency of QPC requests.

[0232] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0233] Based on the same inventive concept, this application also provides an apparatus for accessing queue information of transmit / receive queue pairs to implement the above-described method for accessing queue information of transmit / receive queue pairs. The solution provided by this apparatus is similar to the implementation described in the above-described method. Therefore, the specific limitations in one or more embodiments of the apparatus for accessing queue information of transmit / receive queue pairs provided below can be found in the limitations of the method for accessing queue information of transmit / receive queue pairs described above, and will not be repeated here.

[0234] In some embodiments, as shown in FIG7, an access device for queue pair information of send and receive queue pairs is provided, including: a request receiving module 702, a request splitting module 704, a request writing module 706, an information access module 708, and an information return module 710, wherein:

[0235] The request receiving module 702 is used to receive queue pair information access requests for the send and receive queue pairs.

[0236] The request splitting module 704 is used to determine the multiple target queue pairs for which the queue pair information access request is directed, and based on the multiple target queue pairs, split the queue pair information access request into at least one sub-access request; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair.

[0237] The request writing module 706 is used to write each sub-access request into the corresponding scheduling queue.

[0238] The information access module 708 is used to allocate a corresponding access lock to each sub-access request based on the scheduling of multiple scheduling queues, send each sub-access request to the corresponding target information table based on the access lock of each sub-access request, access the target queue pair information in the target information table corresponding to each sub-access request, and generate access response information for each sub-access request.

[0239] The information return module 710 is used to return the comprehensive access response information of the queue to the sender of the queue to access the information; the comprehensive access response information includes the access response information of each sub-access request.

[0240] In one embodiment, each target information table corresponds to multiple scheduling queues, and the scheduling queue to which each sub-access request is written is the target scheduling queue in the multiple scheduling queues of the corresponding target information table for the sub-access request.

[0241] The information access module 708 is also used to perform concurrent queue scheduling processing on each target information table. For each target information table, it determines the queue to be scheduled from multiple scheduling queues of the target information table and allocates the corresponding access lock to the target sub-access request in the queue to be scheduled. The target sub-access request is the sub-access request located at the head of the queue to be scheduled. If the access lock corresponding to the target sub-access request is successfully allocated, the target sub-access request is sent to the corresponding target information table. If the access lock corresponding to the target sub-access request fails to be allocated, the target sub-access request is written back into the queue to be scheduled.

[0242] In one embodiment, the information access module 708 is further configured to: determine the target lock type corresponding to the target sub-access request based on the request type of the information access request in the queue; determine the number of allocated locks in the send / receive queues under the target lock type; if the number of allocated locks is less than the corresponding number threshold, allocate an access lock of the target lock type to the target sub-access request, and increment the number of allocated locks, and determine that the access lock allocation corresponding to the target sub-access request is successful; if the number of allocated locks is equal to the corresponding number threshold, determine that the access lock allocation corresponding to the target sub-access request fails.

[0243] In one embodiment, the information access module 708 is further configured to reduce the number of allocated locks under the lock type of the access lock for the target sub-access request after generating access response information for the target sub-access request.

[0244] In one embodiment, each information table corresponds to multiple scheduling queues.

[0245] The request writing module 706 is also used to determine the target scheduling queue of the sub-access request from multiple scheduling queues in the target information table corresponding to the sub-access request, based on the hash value of the queue pair identifier of the send and receive queue pair; and write the sub-access request to the target scheduling queue.

[0246] In one embodiment, the request splitting module 704 is further configured to use the request type of the queue pair information access request and the interface identifier of the interface sending the queue pair information access request as the request information of the queue pair information access request; based on the request information, query the mapping relationship between the pre-built request information and the queue pair information to determine the multiple target queue pair information targeted by the queue pair information access request; based on the multiple target queue pair information, query the mapping relationship between the pre-built queue pair information and the information table, and determine at least one target information table for storing the information of each target queue pair in the multiple pre-built information tables; the multiple pre-built information tables are used to store the queue pair information of each send and receive queue pair; and split the queue pair information access request into sub-access requests for each target information table.

[0247] In one embodiment, there are multiple queue pairs for information access requests, and each queue pair for information access requests corresponds to a send / receive queue pair.

[0248] The information return module 710 is also used to determine the number of requests for each sub-access request of the information access request for each queue; and when the number of information in each access response information corresponding to the information access request of the queue reaches the number of requests, it combines the access response information corresponding to the information access request of the queue to obtain the comprehensive access response information of the information access request of the queue.

[0249] Each module in the aforementioned device for accessing queue pair information can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of one or more processors in a computer device, or stored in software in the memory of the computer device, so that one or more processors can invoke and execute the operations corresponding to each module.

[0250] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in Figure 8. The computer device includes one or more processors, memory, input / output interfaces (I / O), and a communication interface. The one or more processors, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The one or more processors of the computer device provide computing and control capabilities. The memory of the computer device includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer-readable instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage media. The database of the computer device stores queue pair information for each transmit / receive queue pair. The I / O interfaces of the computer device are used for exchanging information between the one or more processors and external devices. The communication interface of the computer device is used for communicating with external terminals via a network connection. When the computer-readable instructions are executed by the one or more processors, a method for accessing queue pair information for transmit / receive queue pairs is implemented.

[0251] Those skilled in the art will understand that the structure shown in Figure 8 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. The computer device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0252] In some embodiments, a computer device is also provided, including a memory and one or more processors, the memory storing computer-readable instructions, the one or more processors executing the computer-readable instructions to implement the steps in the above method embodiments.

[0253] In some embodiments, a computer storage medium is provided that stores computer-readable instructions that, when executed by one or more processors, implement the steps in the above method embodiments.

[0254] In some embodiments, a computer-readable instruction product is provided, including computer-readable instructions that, when executed by one or more processors, implement the steps in the above method embodiments.

[0255] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a non-volatile computer-readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0256] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0257] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for accessing queue pair information of send and receive queue pairs, wherein, The method includes: Receive queue pair information access requests for send / receive queue pairs; The multiple target queue pairs for which the queue pair information access request is directed are determined. Based on the multiple target queue pairs, the queue pair information access request is split into at least one sub-access request. Each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair. Write each sub-access request into its corresponding scheduling queue; Based on the scheduling of multiple scheduling queues, a corresponding access lock is assigned to each sub-access request. Based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and access response information for each sub-access request is generated; and The comprehensive access response information of the queue access request is returned to the sender of the queue access request; the comprehensive access response information includes the access response information of each sub-access request.

2. The method according to claim 1, wherein, Each target information table corresponds to multiple scheduling queues, and the scheduling queue to which each sub-access request is written is the target scheduling queue of the sub-access request in the multiple scheduling queues of the corresponding target information table. The process of allocating a corresponding access lock to each sub-access request based on the scheduling of multiple scheduling queues, and sending each sub-access request to the corresponding target information table based on the access lock of each sub-access request, includes: Concurrent queue scheduling is performed on each target information table. For each target information table, a queue to be scheduled is determined from multiple scheduling queues of the target information table, and a corresponding access lock is allocated to the target sub-access request in the queue to be scheduled. The target sub-access request is the sub-access request located at the head of the queue to be scheduled. If the access lock corresponding to the target sub-access request is successfully allocated, the target sub-access request is sent to the corresponding target information table; and If the allocation of the access lock corresponding to the target sub-access request fails, the target sub-access request will be written back into the scheduling queue.

3. The method according to claim 2, wherein, The step of allocating a corresponding access lock for the target sub-access request in the queue to be scheduled includes: Based on the request type of the information access request in the queue, determine the target lock type corresponding to the target sub-access request; Determine the number of transmit / receive queues already allocated under the target lock type; If the number of allocated locks is less than the corresponding threshold, an access lock of the target lock type is allocated to the target sub-access request, and the number of allocated locks is incremented. It is then determined that the access lock allocation for the target sub-access request was successful. If the number of allocated locks is equal to the corresponding number threshold, it is determined that the allocation of the access lock corresponding to the target sub-access request has failed.

4. The method according to claim 3, wherein, The method further includes: After generating the access response information for the target sub-access request, the number of allocated locks in the send / receive queue under the lock type of the access lock for the target sub-access request is reduced.

5. The method according to claim 1, wherein, Each information table corresponds to multiple scheduling queues; The step of writing each sub-access request into the corresponding scheduling queue includes: For each sub-access request, based on the hash value of the queue pair identifier of the send / receive queue pair, the target scheduling queue for the sub-access request is determined from multiple scheduling queues in the target information table corresponding to the sub-access request; and Write the sub-access request into the target scheduling queue.

6. The method according to any one of claims 1 to 5, wherein, The step of determining the multiple target queue pairs for which the queue pair information access request is directed, and splitting the queue pair information access request into at least one sub-access request based on the multiple target queue pairs, includes: The request type of the queue access request and the interface identifier of the interface that sent the queue access request are used as the request information of the queue access request. Based on the request information, query the pre-built mapping relationship between request information and queue pair information to determine the multiple target queue pairs information targeted by the queue pair information access request; Based on the multiple target queue pair information, the mapping relationship between the pre-built queue pair information and the information table is queried. Among the pre-built multiple information tables, at least one target information table is determined for storing the information of each target queue pair; the pre-built multiple information tables are used to store the queue pair information of each send / receive queue pair; and The queue information access request is split into sub-access requests for each target information table.

7. The method according to any one of claims 1 to 5, wherein, The queue pairs may have multiple information access requests, and each queue pair information access request corresponds to a send / receive queue pair. The method further includes: For each queue pair of information access requests, determine the number of requests for each sub-access request of the information access request for that queue pair; and When the number of information messages corresponding to each access response message of the queue reaches the number of requests, the access response messages corresponding to each access request of the queue are combined to obtain the comprehensive access response message of the queue for the information access request.

8. An access device for receiving and sending queue pair information, wherein, The device includes: The request receiving module is used to receive queue pair information access requests for send and receive queue pairs; The request splitting module is used to determine the multiple target queue pairs information targeted by the queue pair information access request, and based on the multiple target queue pairs information, split the queue pair information access request into at least one sub-access request; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information. The request writing module is used to write each sub-access request into the corresponding scheduling queue; The information access module is used to allocate a corresponding access lock to each sub-access request based on the scheduling of multiple scheduling queues, send each sub-access request to the corresponding target information table based on the access lock of each sub-access request, access the target queue pair information in the target information table corresponding to each sub-access request, and generate access response information for each sub-access request; and The information return module is used to return the comprehensive access response information of the queue to the sender of the information access request; the comprehensive access response information includes the access response information of each sub-access request.

9. The apparatus according to claim 8, wherein, Each target information table corresponds to multiple scheduling queues, and the scheduling queue to which each sub-access request is written is the target scheduling queue of the sub-access request in the multiple scheduling queues of the corresponding target information table. The information access module is also used for: Concurrent queue scheduling is performed on each target information table. For each target information table, a queue to be scheduled is determined from multiple scheduling queues of the target information table, and a corresponding access lock is allocated to the target sub-access request in the queue to be scheduled. The target sub-access request is the sub-access request located at the head of the queue to be scheduled; If the access lock corresponding to the target sub-access request is successfully allocated, the target sub-access request will be sent to the corresponding target information table. and If the allocation of the access lock corresponding to the target sub-access request fails, the target sub-access request will be written back into the scheduling queue.

10. The apparatus according to claim 9, wherein, The information access module is also used for: Based on the request type of the information access request in the queue, determine the target lock type corresponding to the target sub-access request; Determine the number of transmit / receive queues already allocated under the target lock type; If the number of allocated locks is less than the corresponding number threshold, an access lock of the target lock type is allocated to the target sub-access request, and the number of allocated locks is incremented. It is then determined that the access lock for the target sub-access request has been successfully allocated. and If the number of allocated locks is equal to the corresponding number threshold, it is determined that the allocation of the access lock corresponding to the target sub-access request has failed.

11. The apparatus according to claim 10, wherein, The information access module is also used for: After generating the access response information for the target sub-access request, the number of allocated locks in the send / receive queue under the lock type of the access lock for the target sub-access request is reduced.

12. The apparatus according to claim 8, wherein, Each information table corresponds to multiple scheduling queues; The information writing module is also used for: For each sub-access request, based on the hash value of the queue pair identifier of the send / receive queue pair, the target scheduling queue for the sub-access request is determined from multiple scheduling queues in the target information table corresponding to the sub-access request; and Write the sub-access request into the target scheduling queue.

13. The apparatus according to any one of claims 8 to 12, wherein, The request splitting module is also used for: The request type of the queue access request and the interface identifier of the interface that sent the queue access request are used as the request information of the queue access request. Based on the request information, query the pre-built mapping relationship between request information and queue pair information to determine the multiple target queue pairs information targeted by the queue pair information access request; Based on the multiple target queue pair information, the mapping relationship between the pre-built queue pair information and the information table is queried. Among the multiple pre-built information tables, at least one target information table is determined to store the queue pair information of each target queue pair. The multiple pre-built information tables are used to store the queue pair information of each send and receive queue pair. and The queue information access request is split into sub-access requests for each target information table.

14. The apparatus according to any one of claims 8 to 12, wherein, The queue pairs may have multiple information access requests, and each queue pair information access request corresponds to a send / receive queue pair. The information return module is also used for: For each queue pair of information access requests, determine the number of requests for each sub-access request of the information access request for that queue pair; and When the number of information messages corresponding to each access response message of the queue reaches the number of requests, the access response messages corresponding to each access request of the queue are combined to obtain the comprehensive access response message of the queue for the information access request.

15. A computer device comprising a memory and one or more processors, the memory storing computer-readable instructions, wherein... When the one or more processors execute the computer-readable instructions, they implement the steps of the method according to any one of claims 1 to 7.

16. A computer storage medium having computer-readable instructions stored thereon, wherein, When the computer-readable instructions are executed by one or more processors, they implement the steps of the method according to any one of claims 1 to 7.

17. A computer-readable instruction product comprising computer-readable instructions, wherein, When the computer-readable instructions are executed by one or more processors, they implement the steps of the method according to any one of claims 1 to 7.