Access control method and device, chip, network interface card, equipment, storage medium and program product

Direct access to the server hash table through the client's RDMA engine and perform data modification locally on the server, solving the problems of low data access performance and consistency in distributed memory hash index, and achieving efficient data access and processing.

CN119003438APending Publication Date: 2024-11-22SHENZHEN JAGUAR MICROSYSTEMS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411090742.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In high-performance data centers, the data access method of distributed memory hash indexes leads to an increase in the CPU burden on the server, the data transmission delay is large and the concurrency is low, so data consistency cannot be guaranteed.

Method used

The RDMA engine of the client directly accesses the data in the hash table of the server through one-side operation of the client. During the modification operation, the RDMA engine of the server and the client operates bilaterally, and performs data modification locally on the server, and uses concurrent control information to realize mutex locks. mechanism to ensure data consistency.

Benefits of technology

It significantly improves data access speed, reduces the burden on server processors, improves data query and processing efficiency in high concurrency environments, and ensures data security and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003438A_ABST
    Figure CN119003438A_ABST
Patent Text Reader

Abstract

The invention relates to an access control method and device, a chip, a network interface card, equipment, a storage medium and a program product. The method comprises the steps that an access request of a hash table is received and sent to an RDMA engine, and the access request is used for requesting target access operation on the hash table; if the target access operation is query operation, the RDMA engine locates a node where target query data corresponding to the query operation is located in a hash table in the server through a hash mapper in the client, and reads the target query data from the node where the target query data is located to a client memory. If the target access operation is a modification operation, the RDMA engine sends a write operation request to the server, the write operation request is used for requesting a coordinator in the server to modify target modification data corresponding to the modification operation in a hash table, and the target modification data is in a locked state during modification. By adopting the method, the data access performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip technology, and in particular to an access control method, apparatus, chip, network interface card, device, storage medium and program product. Background Art

[0002] Distributed memory hash index is an index structure used to manage data in a distributed memory system. It stores data in the memory of multiple servers and uses hash functions to disperse the data on different nodes. Distributed memory hash index often shows certain limitations when applied in high-performance data centers.

[0003] In the related art, the client accesses data (such as querying and modifying data) through the distributed memory hash index. On the one hand, the query of data needs to go through the server central processing unit (CPU) to access the server memory. In the query-intensive application scenario of high-performance data centers, it will increase the burden of the server CPU and the delay of data transmission will be large. On the other hand, even if the server CPU can be bypassed to access the data in the server memory, when a large number of read and write operations are performed concurrently in the high-performance data center, the current method of accessing data cannot guarantee the consistency of the data due to bypassing the operating system kernel, and the concurrency capability is low. Therefore, the data access method in the related art has low performance. Summary of the invention

[0004] Based on this, it is necessary to provide an access control method, device, chip, network interface card, equipment, storage medium and program product that can improve data access performance in response to the above technical problems.

[0005] In a first aspect, the present application provides an access control method, applied to a client, the method comprising:

[0006] Receive an access request for a hash table and send it to a remote direct memory access (RDMA) engine, wherein the access request is used to request a target access operation on the hash table;

[0007] If the target access operation is a query operation, the RDMA engine locates the node where the target query data corresponding to the query operation is located in the hash table in the server through the hash mapper in the client, and reads the target query data from the node where the target query data is located to the client memory;

[0008] If the target access operation is a modification operation, the RDMA engine sends a write operation request to the server, and the write operation request is used to request the coordinator in the server to modify the target modification data corresponding to the modification operation in the hash table, and the target modification data is in a locked state during modification.

[0009] In one of the embodiments, the hash table includes a bucket array, and each bucket element in the bucket array stores a pointer to a head node of a different linked list.

[0010] In one embodiment, each node in the linked list includes a control information field and a data storage field; the data storage field is used to store data, and the control information field is used to store access control information;

[0011] The access control information includes at least one of the following information: bitmap information, concurrency control information, pointer information of the next node, and fingerprint information.

[0012] In one of the embodiments, locating the node where the target query data corresponding to the query operation is located in the hash table in the server includes:

[0013] Calculate the hash value corresponding to the target query data;

[0014] Determine the target bucket element corresponding to the target query data in the hash table according to the key corresponding to the hash value;

[0015] Matching the fingerprint information of the target query data with the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element to determine a matching result;

[0016] According to the matching result, the node where the target query data corresponding to the query operation is located is located.

[0017] In one embodiment, matching the fingerprint information of the target query data with the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element includes:

[0018] Get the pointer to the head node of the linked list stored in the target bucket element;

[0019] Starting from the head node of the linked list, the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is matched with the fingerprint information of the target query data in turn.

[0020] In one of the embodiments, after reading the target query data from the node where the target query data is located to the client memory, the method further includes:

[0021] Detecting the concurrency control information of the node where the target query data is located;

[0022] If the concurrency control information indicates that the target query data is in a locked state, determining that the read target query data is unavailable;

[0023] If the concurrency control information indicates that the target query data is not in a locked state, it is determined that the read target query data is available.

[0024] In one of the embodiments, the linked list is a circular linked list including multiple nodes, the head node of the linked list is a hot node of the linked list, and the hot node is the node previously visited by the client; the modification operation includes an insert operation, a delete operation, and an update operation.

[0025] In one of the embodiments, before receiving the access request to the hash table, the method further includes:

[0026] Apply to establish a connection with the server;

[0027] Memory registration information sent by the server is received and sent to the RDMA engine, wherein the memory registration information is used to indicate a hash table, and the hash table is created and managed by a memory range allocated from the server memory by the server during initialization.

[0028] In a second aspect, the present application provides an access control method, applied to a server, the method comprising:

[0029] Receiving a write operation request sent by a client, wherein the write operation request is issued by an RDMA engine of the client when receiving an access request for performing a modification operation on a hash table of the server;

[0030] According to the write operation request, controlling the coordinator of the server to set the target modification data corresponding to the modification operation in the hash table to a locked state;

[0031] Control the coordinator to perform the modification operation on the target modification data in the hash table;

[0032] After the modification operation is completed, the coordinator is controlled to release the locking state of the target modification data.

[0033] In one of the embodiments, the hash table includes a bucket array, and each bucket element in the bucket array stores a pointer to a head node of a different linked list.

[0034] In one embodiment, each node in the linked list includes a control information field and a data storage field; the data storage field is used to store data, and the control information field is used to store access control information;

[0035] The access control information includes at least one of the following information: bitmap information, concurrency control information, pointer information of the next node, and fingerprint information.

[0036] In one of the embodiments, the coordinator controlling the server sets the target modification data corresponding to the modification operation in the hash table to a locked state, including:

[0037] The value of the concurrency control information of the node where the target modified data is located is adjusted so that the concurrency control information indicates that the target modified data is in a locked state.

[0038] In one of the embodiments, the linked list is a circular linked list including multiple nodes, the head node of the linked list is a hot node of the linked list, and the hot node is the node previously visited by the client; the modification operation includes an insert operation, a delete operation, and an update operation.

[0039] In one embodiment, if the modification operation is an update operation, controlling the coordinator to perform the modification operation on the target modification data in the hash table includes:

[0040] Control the coordinator to obtain the key, fingerprint information and data modification information of the target modification data;

[0041] According to the key and fingerprint information of the target modified data, control the coordinator to locate the target node where the target modified data is located in the hash table;

[0042] In the target node, the coordinator is controlled to update the target modification data according to the data modification information.

[0043] In one embodiment, if the modification operation is a deletion operation, controlling the coordinator to perform the modification operation on the target modification data in the hash table includes:

[0044] Controlling the coordinator to obtain the key and fingerprint information of the target modification data;

[0045] According to the key and fingerprint information of the target modified data, control the coordinator to locate the target node where the target modified data is located in the hash table;

[0046] In the target node, the coordinator is controlled to delete the target modification data.

[0047] In one of the embodiments, after controlling the coordinator to delete the target modification data, the method further includes:

[0048] If the target bitmap information indicates that the data stored in the target node are all invalid, the memory allocator of the server is controlled to reclaim the memory of the target node.

[0049] In one of the embodiments, controlling the coordinator to locate the target node where the target modified data is located in the hash table according to the key and fingerprint information of the target modified data includes:

[0050] Control the coordinator to determine the target bucket element corresponding to the target modified data in the hash table according to the key of the target modified data;

[0051] Control the coordinator to match the fingerprint information of the target modified data with the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element, and determine a matching result;

[0052] The coordinator is controlled to locate the target node where the target modification data is located according to the matching result.

[0053] In one embodiment, if the modification operation is an insert operation, controlling the coordinator to perform the modification operation on the target modification data in the hash table includes:

[0054] Controlling the coordinator to obtain the key and fingerprint information of the target modification data;

[0055] Control the coordinator to determine the target bucket element corresponding to the target modified data in the hash table according to the key of the target modified data;

[0056] If the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is inconsistent with the fingerprint information of the target modified data, according to each bitmap information in the linked list corresponding to the target bucket element, control the coordinator to determine the free node in the linked list corresponding to the target bucket element or control the memory allocator to add the free node in the linked list corresponding to the target bucket element;

[0057] The coordinator is controlled to insert the target modification data in the idle node.

[0058] In one of the embodiments, after determining the target bucket element corresponding to the target modification data in the hash table, the method further includes:

[0059] If the fingerprint information of the data stored in any node in the linked list corresponding to the target bucket element is consistent with the fingerprint information of the target modified data, the coordinator is controlled to generate insertion failure indication information of the insertion operation.

[0060] In one embodiment, the method further comprises:

[0061] During initialization, a memory range is allocated from the server memory to create and manage the hash table and form memory registration information;

[0062] When a connection request from a client is monitored, the client responds to the connection request and establishes a connection with the client;

[0063] Send memory registration information to the client.

[0064] In a third aspect, the present application provides an access control device, which is applied to a client and includes:

[0065] A first receiving module, used for receiving an access request of a hash table and sending it to the RDMA engine, wherein the access request is used for requesting a target access operation to the hash table;

[0066] A query module, for locating the node where the target query data corresponding to the query operation is located in the hash table in the server through the hash mapper in the client if the target access operation is a query operation, and reading the target query data from the node where the target query data is located to the client memory;

[0067] A modification module is used for, if the target access operation is a modification operation, the RDMA engine sends a write operation request to the server, the write operation request is used to request the coordinator in the server to modify the target modification data corresponding to the modification operation in the hash table, and the target modification data is in a locked state during modification.

[0068] In a fourth aspect, the present application provides an access control device, which is applied to a server, and includes:

[0069] A second receiving module is used to receive a write operation request sent by the client, wherein the write operation request is issued by the RDMA engine of the client when receiving an access request for modifying the hash table of the server;

[0070] A processing module is used to control the coordinator of the server to set the target modification data corresponding to the modification operation in the hash table to a locked state according to the write operation request; control the coordinator to perform the modification operation on the target modification data in the hash table; and control the coordinator to release the locked state of the target modification data after the modification operation is completed.

[0071] In a fifth aspect, the present application further provides a chip, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the access control method described in the first aspect or the second aspect when executing the computer program.

[0072] In a sixth aspect, the present application further provides a network interface card, which includes the chip described in the fifth aspect and a plurality of interfaces, and the chip communicates externally through the interfaces.

[0073] In the seventh aspect, the present application also provides an electronic device, comprising a processor and the network interface card described in the sixth aspect, wherein the network interface card is used to dispatch messages to the processor or the network interface card itself for processing, and the processor is used to process the messages dispatched by the network interface card.

[0074] In an eighth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the access control method described in the first aspect or the second aspect when executed by a processor.

[0075] In a ninth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the access control method described in the first aspect or the second aspect is implemented.

[0076] The access control method, device, chip, equipment, storage medium and program product described above, the client receives an access request for a hash table and sends it to a remote direct memory access storage RDMA engine, the access request is used to request a target access operation on the hash table. If the target access operation is a query operation, the RDMA engine locates the node where the target query data corresponding to the query operation is located in the hash table in the server through the hash mapper in the client, and reads the target query data from the node where the target query data is located to the client memory. If the target access operation is a modification operation, the RDMA engine sends a write operation request to the server, the write operation request is used to request the coordinator in the server to modify the target modification data corresponding to the modification operation in the hash table, and the target modification data is in a locked state during the modification. Since during the query operation, the RDMA engine of the client directly accesses the data in the hash table of the server by unilateral operation, during the modification operation, the RDMA engines of the server and the client operate bilaterally, and the data is modified locally on the server, which can significantly improve the speed of data access, reduce the burden on the processor of the server, make data query and processing in a high concurrency environment more efficient, and greatly improve data access performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] FIG1 is an application scenario diagram of an access control method provided by an embodiment of the present application;

[0078] Figure 2 A schematic diagram of a hash table access control system provided in an embodiment of the present application;

[0079] Figure 3 A flowchart of another access control method provided in an embodiment of the present application;

[0080] Figure 4 A memory allocation diagram provided for an embodiment of the present application;

[0081] Figure 5 A schematic diagram of a hash table structure provided in an embodiment of the present application

[0082] FIG6 is a signaling interaction diagram of access control provided in an embodiment of the present application;

[0083] Figure 7 A structural block diagram of an access control device provided in an embodiment of the present application;

[0084] Figure 8 A structural block diagram of another access control device provided in an embodiment of the present application;

[0085] FIG. 9 is an internal structure diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0086] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0087] The embodiments of the present application provide an access control method, apparatus, chip, network interface card, device, storage medium and program product. During a query operation, the RDMA engine of the client directly accesses the data in the hash table of the server through unilateral operation. During a modification operation, the RDMA engines of the server and the client operate bilaterally to modify the data locally on the server, thereby significantly improving the speed of data access, reducing the burden on the processor of the server, making data query and processing more efficient in a high-concurrency environment, and greatly improving data access performance.

[0088] The following describes the application scenarios of the access control method involved in this application.

[0089] The message transmission method provided in the embodiment of the present application can be applied in the application environment as shown in Figure 1. Figure 1 is an application environment diagram of an access control method provided in the embodiment of the present application. As shown in Figure 1, when it is necessary to access the hash table, the client 101 can receive an access request for the hash table and send it to the Remote Direct Memory Access (RDMA) engine, and the access request is used to request a target access operation on the hash table. Subsequently, if the target access operation is a query operation, the RDMA engine locates the node where the target query data corresponding to the query operation is located in the hash table in the server 102 through the hash mapper in the client 101, and reads the target query data from the node where the target query data is located to the client memory. If the target access operation is a modification operation, the RDMA engine sends a write operation request to the server 102, and the write operation request is used to request the coordinator in the server 102 to modify the target modification data corresponding to the modification operation in the hash table, and the target modification data is in a locked state when modified.

[0090] Among them, the client 101 can be an application or a terminal device where the application is located. The terminal device can be, but is not limited to, various servers, personal computers, smart phones, tablet computers, Internet of Things devices, portable wearable devices and network devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. A node can be a storage space in a memory, or it can be the memory of different servers.

[0091] Figure 2 A schematic diagram of a hash table access control system provided in an embodiment of the present application. Figure 2 As shown in FIG. 1 , the client and the server can form an access control system for a hash table. The client includes a user interface, an RDMA engine, a hash mapper, and a memory. The user interface is used to receive access requests to the hash table directly or indirectly input by the user, and the RDMA engine is used to call the hash mapper to query the hash table in the server, and is also used to send write operation requests to the server. The memory in the client is used to store data read from the hash table.

[0092] The server includes a hash table, a coordinator, memory, and a memory allocator. The coordinator is used to modify data in the hash table after receiving a write operation request sent by the RDMA engine. The memory allocator is used to allocate memory to nodes in the hash table, or to reclaim the memory of empty nodes in the hash table.

[0093] In one embodiment, Figure 3 As shown, an access control method is provided, and the method is applied to the client in FIG. 1 as an example for explanation. The access control method includes S201-S203:

[0094] S201, receiving an access request for a hash table, and sending the request to a remote direct memory access (RDMA) engine, where the access request is used to request a target access operation on the hash table.

[0095] The access request may include a write request and a read request. Accordingly, if the access request is a write request, the target access operation on the hash table requested by the access request is a modification operation, and if the access request is a read request, the target access operation on the hash table requested by the access request is a query operation.

[0096] For example, the query operation is used to query data from the hash table. The modification operation includes the insert operation, the delete operation, and the update operation. The insert operation is used to insert data into the hash table, the delete operation is used to delete data from the hash table, and the update operation is used to update data in the hash table.

[0097] It should be understood that the embodiments of the present application do not limit how to send a hash table access request to the client. In some embodiments, the user can directly or indirectly send a hash table access request to the client by calling the client's user interface. Subsequently, the client sends the hash table access request to the RDMA engine in the client.

[0098] In some embodiments, before the client receives a request to access the hash table, the server may also perform initialization. During initialization, a continuous memory range may be allocated from the server memory for managing and creating the hash table, and forming memory registration information. After completing the initialization, the client may send a connection establishment request to the server to apply for a connection with the server. When the server listens to the client's connection establishment request, it responds to the connection request and establishes a connection with the client. Subsequently, the server sends the memory registration information to the client, and the client sends the memory registration information to the RDMA engine so that the client's RDMA engine can perform a target access operation on the hash table. Among them, the memory registration information is used to indicate the hash table.

[0099] Figure 4 A memory allocation diagram provided in an embodiment of the present application is as follows: Figure 4 As shown, the usage of a continuous memory range allocated by the server for the hash table is initialized. The memory can be allocated to multiple nodes and node bitmaps (node_bitmap). Multiple nodes can be a storage space in the memory for storing data. The node bitmap can represent the usage of part of the memory of multiple nodes.

[0100] The structure of the hash table involved in this application is explained below.

[0101] In some embodiments, the hash table includes a bucket array, each bucket element in the bucket array stores a pointer to a head node of a linked list. Preferably, each bucket element stores a pointer to a head node of a different linked list.

[0102] For example, Figure 5 A schematic diagram of the structure of a hash table provided in an embodiment of the present application is shown in FIG. Figure 5As shown in the figure, the hash table includes a bucket array. Each bucket element in the bucket array stores a pointer to the head node of a different linked list. The linked list corresponding to the bucket array is indicated by indicating the head node of the linked list. If the hash table includes several bucket elements, it can contain several linked lists. Each linked list contains multiple nodes. The number of nodes in different linked lists can be the same or different. The nodes in the same linked list are connected head to tail to form a circular linked list.

[0103] In some embodiments, each node in the linked list includes a control information field and a data storage field. The data storage field is used to store data, and the control information field is used to store access control information. The access control information includes at least one of the following information: bitmap information, concurrency control information, pointer information of the next node, and fingerprint information.

[0104] Continue to refer Figure 5 Each node in the linked list contains a control information field and a data storage field. The control information field includes an 8-bit bitmap information field, an 8-bit concurrent control information field (lock), a 48-bit next node pointer field, and 6 8-bit fingerprint information (fp) fields. In addition, the control information field can also include a 16-bit reserved bit (rsv) field.

[0105] For example, in the x64 architecture, a pointer is 64 bits, but only the last 48 bits of the pointer are valid, and the first 16 bits of the pointer are 0 by default. Therefore, in the node structure, the first 8 bits of the pointer can be used to store the bitmap, and the following 8 bits are used to store the lock. The remaining 32 bits are data storage space, which is used to store the key and value, that is, to store data.

[0106] Exemplarily, the description information of the control information field and the data storage field may be as shown in Table 1.

[0107] Table 1

[0108]

[0109] As shown in Table 1, the 6 valid bits of the bitmap information (bitmap) field are used to indicate the usage of the 6 data storage spaces in the node. For example, if the first bit of the bitmap is 0, it means that the first block of the data storage part is empty and data can be inserted. If the first bit of the bitmap is 1, it means that the first block of the data storage part is not empty and data has been stored.

[0110] The 6 valid bits of the concurrency control information (lock) field are used for concurrency control of data. Each valid bit corresponds to a key-value pair in the data storage space and is managed by the coordinator.

[0111] The fingerprint information (fp) field size is 8 bits. Since each node contains multiple data (key-value pairs), when searching for data, you can quickly determine whether the searched data is in the node by comparing the fp value, thereby determining whether it is necessary to further check the actual key-value pairs in the node.

[0112] In this application, each node of the hash table can store multiple data (key-value pairs), and the storage status of the data in the node can be quickly determined through the bitmap information in the control information field of the node. In this way, not only the storage density is improved, but also the overall search speed and efficiency are further improved by reducing the number of nodes.

[0113] S202. If the target access operation is a query operation, the RDMA engine locates the node where the target query data corresponding to the query operation is located in the hash table in the server through the hash mapper in the client, and reads the target query data from the node where the target query data is located to the client memory.

[0114] In this step, after the client receives the access request of the hash table and sends it to the RDMA engine, it can determine the type of the target access operation corresponding to the access request. If the target access operation is a query operation, the RDMA engine locates the node where the target query data corresponding to the query operation is located in the hash table in the server through the hash mapper in the client, and reads the target query data from the node where the target query data is located to the client memory.

[0115] It should be understood that the embodiments of the present application do not limit how to locate the node where the target query data corresponding to the query operation is located in the hash table in the server. In some embodiments, the hash value corresponding to the target query data can be calculated first. Secondly, according to the key corresponding to the hash value, the target bucket element corresponding to the target query data in the hash table is determined. Thirdly, the fingerprint information of the target query data is matched with the fingerprint information of the data stored in each node in the storage linked list corresponding to the target bucket element to determine the matching result. Finally, according to the matching result, the node where the target query data corresponding to the query operation is located is located.

[0116] The calculation of the hash value may be performed by a set hash function, and the hash function may include MD5, SHA-1, SHA-256, etc., which is not limited in the embodiments of the present application.

[0117] It should be noted that, according to the principle of locality, the client tends to access the most recently accessed data when querying the data in the server. Therefore, the above linked list can be a circular linked list including multiple nodes, and the entire linked list can be traversed from any node in the linked list. Accordingly, the head node of the linked list can be set as a hot node of the linked list, and the hot node is the node that the client visited last time. When performing a search operation, data can be searched from the hot node first.

[0118] Exemplarily, the RDMA engine can obtain the pointer to the head node of the linked list stored by the target bucket element through the hash mapper in the client. Then, starting from the head node (i.e., hot node) of the linked list, the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is matched with the fingerprint information of the target query data in turn.

[0119] Exemplarily, if no matching node is found after traversing the linked list, it is determined that the query operation fails. If a matching node exists when traversing the linked list, it can be determined that the target query data is stored in the matching node, and the RDMA engine can read the matching node locally through an RDMA read operation, thereby reading the target query data into the client memory.

[0120] In this application, the linked list in the hash table adopts a circular linked list, and the entire linked list can be traversed from any node. Since the head node (i.e., hot node) of the linked list is the node that the client visited last time, the client can traverse the linked list from the head node of the linked list when searching for data, which increases the hit rate of the data. Each node contains multiple data. By comparing the fingerprint information, it can be quickly determined whether the data in the node needs to be further checked, thereby reducing the need to traverse the entire linked list, greatly improving the search efficiency, and maintaining the simplicity of the data structure.

[0121] In some embodiments, after the target query data is read from the node where the target query data is located, the concurrency control information of the node where the target query data is located may also be detected. If the concurrency control information indicates that the target query data is in a locked state, it is determined that the read target query data is unavailable. If the concurrency control information indicates that the target query data is not in a locked state, it is determined that the read target query data is available.

[0122] For example, if the coordinator in the server is modifying the target query data, the concurrency control information (lock bit) can be set to 1, thereby indicating that the target query data is in a locked state. After the client's RDMA engine reads the node where the target query data is located locally, it will check the lock bit corresponding to the target query data. If the corresponding lock bit is 0, it means that the target query data is not being modified, and the target query data is available. If the corresponding lock bit is 1, it means that the target query data is being modified, and the target query data is unavailable.

[0123] In some embodiments, after the target query data is read, the hot node address may also be updated in the target bucket element to the address of the node where the target query data is located.

[0124] In this application, since data query operations account for the absolute majority of access requests in data center scenarios, when the target access operation is a query operation, RDMA unilateral access operation is adopted, allowing the client's RDMA engine to directly access the server's memory to query data, which greatly reduces the burden on the server's central processing unit (CPU), improves the performance of the server, and reduces the delay of data transmission.

[0125] S203. If the target access operation is a modification operation, the RDMA engine sends a write operation request to the server. The write operation request is used to request the coordinator in the server to modify the target modification data corresponding to the modification operation in the hash table. The target modification data is in a locked state during modification.

[0126] In this step, when the client receives the access request of the hash table, it can determine the type of the target access operation corresponding to the access request. If the target access operation is a modification operation, a write operation request is sent to the server to make the coordinator in the server modify the target modification data corresponding to the modification operation in the hash table.

[0127] For example, in a distributed system, if multiple clients simultaneously access the target modification data on the server or perform a series of operations on the target modification data, data consistency issues will arise. For example, client 1 issues a modification operation to the server, and when the server is modifying but not completed, client 2 issues a query operation to the server, which will cause the data stored in the hash table on the server to be inconsistent with the data read by client 2. The coordinator on the server can ensure that data remains consistent during concurrent operations.

[0128] In some embodiments, according to the write operation request, the coordinator of the control service end can set the target modification data corresponding to the modification operation to a locked state in the hash table. Subsequently, the control coordinator performs the modification operation on the target modification data in the hash table. Finally, after the modification operation is completed, the control coordinator releases the locked state of the target modification data.

[0129] Exemplarily, setting the target modification data corresponding to the modification operation to a locked state can be achieved by adjusting the value of the concurrent control information of the node where the target modification data is located. Before performing the modification operation, the coordinator can first check the current lock value to determine whether other users are performing modification operations on the target modification data. If not, the modification operation can be performed. At this time, the coordinator can set the corresponding position of the lock field to 1, thereby setting the target modification data to a locked state. After completing the modification operation of the target modification data, the corresponding position of the lock field can be set to 0, thereby releasing the locked state of the target modification data.

[0130] In the present application, a mutual exclusion lock mechanism is implemented through concurrent control information, and the coordinator modifies the concurrent control information in the node to lock or unlock the data, thereby solving the problem of data consistency that cannot be guaranteed due to RDMA unilateral operation accessing data bypassing the operating system kernel. In addition, since the field of the concurrent control information includes multiple bits, each bit corresponds to the state of a data (key-value pair), so that each bit in the concurrent control information only locks a single data (key-value pair), and other data that is not locked can still be accessed and modified in parallel. Since the mutual exclusion lock mechanism implemented by the concurrent control information in the present application is fine-grained with a single data (key-value pair), the concurrency capability of the system is greatly increased, and the security and accuracy of the data are also guaranteed.

[0131] In some embodiments, the modification operation includes an insert operation, a delete operation, and an update operation. Different execution modes may be used for different modification operations.

[0132] In some embodiments, if the modification operation is an update operation, the server may first control the coordinator to obtain the key, fingerprint information, and data modification information of the target modification data. Subsequently, the server may control the coordinator to locate the target node where the target modification data is located in the hash table according to the key and fingerprint information of the target modification data. Finally, in the target node, the server controls the coordinator to update the target modification data according to the data modification information.

[0133] In some embodiments, if the modification operation is a delete operation, the server may first control the coordinator to obtain the key and fingerprint information of the target modification data. Subsequently, the server controls the coordinator to locate the node where the target modification data is located in the hash table according to the key and fingerprint information of the target modification data. Finally, in the target node, the server controls the coordinator to delete the target modification data.

[0134] In some embodiments, after the server-side control coordinator deletes the target modified data, if the target bitmap information indicates that all data stored in the target node are invalid, the server-side memory allocator may also be controlled to reclaim memory from the target node.

[0135] Exemplarily, if the target bitmap information is all 0, it means that all the data stored in the node is invalid, and the memory allocator can reclaim the memory.

[0136] It should be understood that the embodiments of the present application do not limit the manner in which the node where the target modified data is located is located during the deletion operation and the update operation. Exemplarily, the server may first control the coordinator to determine the target bucket element corresponding to the target modified data in the hash table according to the key of the target modified data. Subsequently, the control coordinator matches the fingerprint information of the target modified data with the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element to determine the matching result. Finally, the control coordinator locates the target node where the target modified data is located according to the matching result.

[0137] In some embodiments, if the modification operation is an insert operation, the server may first control the coordinator to obtain the key and fingerprint information of the target modification data. Subsequently, the server may control the coordinator to determine the target bucket element corresponding to the target modification data in the hash table according to the key of the target modification data.

[0138] If the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is inconsistent with the fingerprint information of the target modified data, the server controls the coordinator to determine the free nodes in the linked list corresponding to the target bucket element or controls the memory allocator to add free nodes in the linked list corresponding to the target bucket element based on each bit map information in the linked list corresponding to the target bucket element.

[0139] If the fingerprint information of the data stored in any node in the linked list corresponding to the target bucket element is consistent with the fingerprint information of the target modified data, the server controls the coordinator to generate insertion failure indication information of the insertion operation.

[0140] Exemplarily, the fingerprint information can be used to detect whether the fingerprint information (key fingerprint) of the data currently to be inserted is unique in each node of the entire linked list. If the fingerprint information of the data stored in any node in the linked list corresponding to the target bucket element is consistent with the fingerprint information of the target modified data, the key is not unique, the insertion fails, and corresponding insertion failure indication information can be generated. If the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is inconsistent with the fingerprint information of the target modified data, the key is unique, and accordingly, the free node can be found according to the bitmap to insert the data and update the control information of the node. If there is no free node, the memory allocator allocates a new node to insert the data.

[0141] In this application, the memory allocator can dynamically allocate and recycle memory by controlling the nodes in the linked list, thereby ensuring efficient use of memory. The memory allocator maintains the stability and performance of the hash table by flexibly utilizing free memory. The memory recycling mechanism ensures the timely release of empty nodes, maximizing the efficiency of memory use.

[0142] In some embodiments, after completing the modification operation, the server may feed back the execution result of the modification operation to the client.

[0143] The access control method provided by the embodiment of the present application, the client receives an access request of a hash table and sends it to the RDMA engine, and the access request is used to request a target access operation on the hash table. If the target access operation is a query operation, the RDMA engine locates the node where the target query data corresponding to the query operation is located in the hash table in the server through the hash mapper in the client, and reads the target query data from the node where the target query data is located to the client memory. If the target access operation is a modification operation, the RDMA engine sends a write operation request to the server, and the write operation request is used to request the coordinator in the server to modify the target modification data corresponding to the modification operation in the hash table, and the target modification data is in a locked state when modified. Since during the query operation, the RDMA engine of the client directly accesses the data in the hash table of the server unilaterally, during the modification operation, the RDMA engine of the server and the client bilaterally operates to modify the data locally on the server, thereby significantly improving the speed of data access, reducing the burden on the processor of the server, making data query and processing in a high concurrency environment more efficient, and greatly improving data access performance.

[0144] The following describes the interaction between the client and the server. FIG6 is a signaling interaction diagram of an access control method provided by an embodiment of the present application. As shown in FIG6 , the access control method includes S301 to S307:

[0145] S301: The client receives an access request for a hash table and sends it to an RDMA engine. The access request is used to request a target access operation on the hash table.

[0146] In some embodiments, the hash table includes a bucket array, and each bucket element in the bucket array stores a pointer to a head node of the linked list.

[0147] In some embodiments, each node in the linked list includes a control information field and a data storage field; the data storage field is used to store data, and the control information field is used to store access control information.

[0148] The access control information includes at least one of the following information: bitmap information, concurrency control information, pointer information of the next node, and fingerprint information.

[0149] S302: The client determines whether the target access operation is a query operation.

[0150] If yes, execute S303, if no, execute S305.

[0151] S303: The RDMA engine uses a hash mapper to locate the node where the target query data corresponding to the query operation is located in the hash table in the server.

[0152] In some embodiments, the hash value corresponding to the target query data may be calculated first. Secondly, the target bucket element corresponding to the target query data in the hash table may be determined according to the key corresponding to the hash value. Thirdly, the fingerprint information of the target query data may be matched with the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element to determine the matching result. Finally, according to the matching result, the node where the target query data corresponding to the query operation is located may be located.

[0153] S304. The RDMA engine reads the target query data from the node where the target query data is located to the client memory through the hash mapper.

[0154] In some embodiments, after the RDMA engine reads the target query data from the node where the target query data is located to the client memory, it can detect the concurrency control information of the node where the target query data is located. If the concurrency control information indicates that the target query data is in a locked state, it is determined that the read target query data is unavailable. If the concurrency control information indicates that the target query data is not in a locked state, it is determined that the read target query data is available.

[0155] S305: The server controls the coordinator to set the target modification data corresponding to the modification operation to a locked state in the hash table according to the write operation request.

[0156] In some embodiments, the value of the concurrency control information of the node where the target modified data is located may be adjusted so that the concurrency control information indicates that the target modified data is in a locked state.

[0157] S306: The server-side control coordinator performs a modification operation on the target modification data in the hash table.

[0158] In some embodiments, the modification operation includes an insert operation, a delete operation, and an update operation.

[0159] In some embodiments, if the modification operation is an update operation, the server may first control the coordinator to obtain the key, fingerprint information, and data modification information of the target modification data. Subsequently, the server may control the coordinator to locate the target node where the target modification data is located in the hash table according to the key and fingerprint information of the target modification data. Finally, in the target node, the server controls the coordinator to update the target modification data according to the data modification information.

[0160] In some embodiments, if the modification operation is a delete operation, the server may first control the coordinator to obtain the key and fingerprint information of the target modification data. Subsequently, the server controls the coordinator to locate the target node where the target modification data is located in the hash table according to the key and fingerprint information of the target modification data. Finally, in the target node, the server controls the coordinator to delete the target modification data.

[0161] In some embodiments, if the modification operation is an insert operation, the server may first control the coordinator to obtain the key and fingerprint information of the target modified data. Subsequently, the server may control the coordinator to determine the target bucket element corresponding to the target modified data in the hash table based on the key of the target modified data. If the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is inconsistent with the fingerprint information of the target modified data, the server controls the coordinator to determine the free nodes in the linked list corresponding to the target bucket element or controls the memory allocator to add free nodes to the linked list corresponding to the target bucket element based on each bitmap information in the linked list corresponding to the target bucket element. If the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is consistent with the fingerprint information of the target modified data, the server controls the coordinator to generate insertion failure indication information of the insert operation.

[0162] S307: After the modification operation is completed, the server-side control coordinator releases the lock state of the target modification data.

[0163] The access control method provided by the embodiment of the present application, the client receives an access request of a hash table and sends it to the RDMA engine, and the access request is used to request a target access operation on the hash table. If the target access operation is a query operation, the RDMA engine locates the node where the target query data corresponding to the query operation is located in the hash table in the server through the hash mapper in the client, and reads the target query data from the node where the target query data is located. If the target access operation is a modification operation, the RDMA engine sends a write operation request to the server, and the write operation request is used to request the coordinator in the server to modify the target modification data corresponding to the modification operation in the hash table, and the target modification data is in a locked state when modified. Because during the query operation, the RDMA engine of the client directly accesses the data in the hash table of the server unilaterally, and during the modification operation, the RDMA engines of the server and the client bilaterally operate to modify the data locally on the server, thereby significantly improving the speed of data access, reducing the burden on the processor of the server, making data query and processing in a high concurrency environment more efficient, and greatly improving data access performance.

[0164] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0165] Based on the same inventive concept, the embodiment of the present application also provides a message transmission device for implementing the message transmission method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more message transmission device embodiments provided below can refer to the limitations on the message transmission method above, and will not be repeated here.

[0166] In one embodiment, Figure 7 As shown, an access control device 400 is provided. The access control device 400 is applied to a client. The access control device 400 includes: a first receiving module 401 , a query module 402 and a modification module 403 .

[0167] The first receiving module 401 is used to receive an access request of a hash table and send it to the RDMA engine. The access request is used to request a target access operation to the hash table.

[0168] The query module 402 is used for locating the node where the target query data corresponding to the query operation is located in the hash table in the server through the hash mapper in the client if the target access operation is a query operation, and reading the target query data from the node where the target query data is located to the client memory.

[0169] The modification module 403 is used for, if the target access operation is a modification operation, the RDMA engine sends a write operation request to the server, the write operation request is used to request the coordinator in the server to modify the target modification data corresponding to the modification operation in the hash table, and the target modification data is in a locked state during modification.

[0170] In one of the embodiments, the hash table includes a bucket array, and each bucket element in the bucket array stores a pointer to a head node of a different linked list.

[0171] In one embodiment, each node in the linked list includes a control information field and a data storage field; the data storage field is used to store data, and the control information field is used to store access control information;

[0172] The access control information includes at least one of the following information: bitmap information, concurrency control information, pointer information of the next node, and fingerprint information.

[0173] In one of the embodiments, the query module 402 is also used to calculate the hash value corresponding to the target query data; determine the target bucket element corresponding to the target query data in the hash table according to the key corresponding to the hash value; match the fingerprint information of the target query data with the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element to determine the matching result; and locate the node where the target query data corresponding to the query operation is located according to the matching result.

[0174] In one embodiment, the query module 402 is also used to obtain a pointer to the head node of the linked list stored in the target bucket element; starting from the head node of the linked list, the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is matched with the fingerprint information of the target query data in turn.

[0175] In one embodiment, the query module 402 is also used to detect the concurrency control information of the node where the target query data is located; if the concurrency control information indicates that the target query data is in a locked state, it is determined that the read target query data is unavailable; if the concurrency control information indicates that the target query data is not in a locked state, it is determined that the read target query data is available.

[0176] In one embodiment, the linked list is a circular linked list including multiple nodes, the head node of the linked list is a hot node of the linked list, and the hot node is a node previously accessed by the client; the modification operation includes an insert operation, a delete operation, and an update operation.

[0177] In one embodiment, the access control device 400 further includes:

[0178] The connection module is used to apply for establishing a connection with the server.

[0179] The first receiving module 401 is also used to receive memory registration information sent by the server and send it to the RDMA engine. The memory registration information is used to indicate a hash table. The hash table is created and managed by a memory range allocated from the server memory during initialization.

[0180] In one embodiment, Figure 8 As shown, an access control device 500 is provided. The access control device 500 is applied to a server. The access control device 500 includes: a second receiving module 501 and a processing module 502 .

[0181] The second receiving module 501 is used to receive a write operation request sent by the client, and the write operation request is issued by the RDMA engine of the client when receiving an access request for modifying the hash table of the server;

[0182] Processing module 502 is used to control the server coordinator to set the target modification data corresponding to the modification operation to a locked state in the hash table according to the write operation request; control the coordinator to perform the modification operation on the target modification data in the hash table; after the modification operation is completed, control the coordinator to release the lock state of the target modification data.

[0183] In one of the embodiments, the hash table includes a bucket array, and each bucket element in the bucket array stores a pointer to a head node of a different linked list.

[0184] In one embodiment, each node in the linked list includes a control information field and a data storage field; the data storage field is used to store data, and the control information field is used to store access control information;

[0185] The access control information includes at least one of the following information: bitmap information, concurrency control information, pointer information of the next node, and fingerprint information.

[0186] In one embodiment, the processing module 502 is further used to adjust the value of the concurrency control information of the node where the target modified data is located, so that the concurrency control information indicates that the target modified data is in a locked state.

[0187] In one embodiment, the linked list is a circular linked list including multiple nodes, the head node of the linked list is a hot node of the linked list, and the hot node is a node previously accessed by the client; the modification operation includes an insert operation, a delete operation, and an update operation.

[0188] In one of the embodiments, if the modification operation is an update operation, the processing module 502 is also used to control the coordinator to obtain the key, fingerprint information and data modification information of the target modification data; based on the key and fingerprint information of the target modification data, the control coordinator locates the target node where the target modification data is located in the hash table; in the target node, the control coordinator updates the target modification data according to the data modification information.

[0189] In one of the embodiments, if the modification operation is a deletion operation, the processing module 502 is also used to control the coordinator to obtain the key and fingerprint information of the target modification data; based on the key and fingerprint information of the target modification data, the control coordinator locates the target node where the target modification data is located in the hash table; in the target node, the control coordinator deletes the target modification data.

[0190] In one embodiment, the processing module 502 is further configured to control the memory allocator of the server to reclaim memory of the target node if the target bitmap information indicates that the data stored in the target node are all invalid.

[0191] In one of the embodiments, the processing module 502 is also used to control the coordinator to determine the target bucket element corresponding to the target modified data in the hash table according to the key of the target modified data; the control coordinator matches the fingerprint information of the target modified data with the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element to determine the matching result; the control coordinator locates the target node where the target modified data is located according to the matching result.

[0192] In one of the embodiments, if the modification operation is an insert operation, the processing module 502 is also used to control the coordinator to obtain the key and fingerprint information of the target modified data; the control coordinator determines the target bucket element corresponding to the target modified data in the hash table according to the key of the target modified data; if the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is inconsistent with the fingerprint information of the target modified data, the control coordinator determines the free node in the linked list corresponding to the target bucket element or controls the memory allocator to add a new free node in the linked list corresponding to the target bucket element according to each bit map information in the linked list corresponding to the target bucket element; the control coordinator inserts the target modified data in the free node.

[0193] In one of the embodiments, the processing module 502 is further used to control the coordinator to generate insertion failure indication information of the insertion operation if the fingerprint information of the data stored in any node in the linked list corresponding to the target bucket element is consistent with the fingerprint information of the target modified data.

[0194] In one of the embodiments, the processing module 502 is also used to allocate a memory range from the server memory during initialization to create and manage a hash table and form memory registration information; when monitoring a connection request from the client, respond to the connection request and establish a connection with the client; and send the memory registration information to the client.

[0195] Each module in the access control device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0196] In one embodiment, a computer device is provided, which may be a client or a server, and includes a chip thereon, and the computer device may implement the access control method on the client or server side. The internal structure diagram of the computer device may be shown in FIG9. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a message reordering method is implemented. Those skilled in the art will understand that the structure shown in FIG. 9 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0197] In one embodiment, a chip is provided. The chip includes a memory and a processor, and the memory stores a computer program. When the processor executes the computer program, the above access control method is implemented. The chip may be a data processing unit (DPU) chip.

[0198] In one embodiment, a network interface card is provided, the network interface card includes the above chip and multiple interfaces, and the chip communicates with the outside through the interface. The interface includes a PCI / PCIE interface, a network interface, and the like.

[0199] In one embodiment, an electronic device is provided. The electronic device includes a processor and the above-mentioned network interface card. The network interface card is used to dispatch messages to the processor or the network interface card itself for processing, and the processor is used to process the messages dispatched by the network interface card.

[0200] In one embodiment, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the access control method described above is implemented.

[0201] In one embodiment, a computer program product is provided, including a computer program, which implements the above access control method when executed by a processor.

[0202] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0203] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.

[0204] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An access control method, It is characterized in that Applied to a client, the method comprises: Receive an access request for a hash table and send it to a remote direct memory access (RDMA) engine, wherein the access request is used to request a target access operation on the hash table; If the target access operation is a query operation, the RDMA engine locates the node where the target query data corresponding to the query operation is located in the hash table in the server through the hash mapper in the client, and reads the target query data from the node where the target query data is located to the client memory; If the target access operation is a modification operation, the RDMA engine sends a write operation request to the server, and the write operation request is used to request the coordinator in the server to modify the target modification data corresponding to the modification operation in the hash table, and the target modification data is in a locked state during modification.

2. The method according to claim 1, It is characterized in that The hash table includes a bucket array, and each bucket element in the bucket array stores a pointer to a head node of a linked list.

3. The method according to claim 2, It is characterized in that Each node in the linked list includes a control information field and a data storage field; the data storage field is used to store data, and the control information field is used to store access control information; The access control information includes at least one of the following information: bitmap information, concurrency control information, pointer information of the next node, and fingerprint information.

4. The method according to claim 3, It is characterized in that The locating the node where the target query data corresponding to the query operation is located in the hash table in the server includes: Calculate the hash value corresponding to the target query data; Determine the target bucket element corresponding to the target query data in the hash table according to the key corresponding to the hash value; Matching the fingerprint information of the target query data with the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element to determine a matching result; According to the matching result, the node where the target query data corresponding to the query operation is located is located.

5. The method according to claim 4, It is characterized in that The matching of the fingerprint information of the target query data with the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element includes: Get the pointer to the head node of the linked list stored in the target bucket element; Starting from the head node of the linked list, the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is matched with the fingerprint information of the target query data in turn.

6. The method according to claim 3, It is characterized in that After reading the target query data from the node where the target query data is located to the client memory, the method further includes: Detecting the concurrency control information of the node where the target query data is located; If the concurrency control information indicates that the target query data is in a locked state, determining that the read target query data is unavailable; If the concurrency control information indicates that the target query data is not in a locked state, it is determined that the read target query data is available.

7. The method according to any one of claims 2 to 6, It is characterized in that The linked list is a circular linked list including a plurality of nodes, the head node of the linked list is a hot node of the linked list, and the hot node is a node accessed by the client last time; the modification operation includes an insert operation, a delete operation and an update operation.

8. The method according to claim 1, It is characterized in that Before receiving the access request to the hash table, the method further includes: Apply to establish a connection with the server; Memory registration information sent by the server is received and sent to the RDMA engine, wherein the memory registration information is used to indicate a hash table, and the hash table is created and managed by a memory range allocated from the server memory by the server during initialization.

9. An access control method, It is characterized in that Applied to the server, the method includes: Receiving a write operation request sent by a client, wherein the write operation request is issued by an RDMA engine of the client when receiving an access request for performing a modification operation on a hash table of the server; According to the write operation request, controlling the coordinator of the server to set the target modification data corresponding to the modification operation in the hash table to a locked state; Control the coordinator to perform the modification operation on the target modification data in the hash table; After the modification operation is completed, the coordinator is controlled to release the locking state of the target modification data.

10. The method according to claim 9, It is characterized in that The hash table includes a bucket array, and each bucket element in the bucket array stores a pointer to a head node of a linked list.

11. The method according to claim 10, It is characterized in that Each node in the linked list includes a control information field and a data storage field; the data storage field is used to store data, and the control information field is used to store access control information; The access control information includes at least one of the following information: bitmap information, concurrency control information, pointer information of the next node, and fingerprint information.

12. The method according to claim 11, It is characterized in that The coordinator controlling the server sets the target modification data corresponding to the modification operation in the hash table to a locked state, including: The value of the concurrency control information of the node where the target modified data is located is adjusted so that the concurrency control information indicates that the target modified data is in a locked state.

13. The method according to claim 10 or 11, It is characterized in that The linked list is a circular linked list including a plurality of nodes, the head node of the linked list is a hot node of the linked list, and the hot node is a node accessed by the client last time; the modification operation includes an insert operation, a delete operation and an update operation.

14. The method according to claim 13, It is characterized in that If the modification operation is an update operation, controlling the coordinator to perform the modification operation on the target modification data in the hash table includes: Control the coordinator to obtain the key, fingerprint information and data modification information of the target modification data; According to the key and fingerprint information of the target modified data, control the coordinator to locate the target node where the target modified data is located in the hash table; In the target node, the coordinator is controlled to update the target modification data according to the data modification information.

15. The method according to claim 13, It is characterized in that If the modification operation is a deletion operation, controlling the coordinator to perform the modification operation on the target modification data in the hash table includes: Controlling the coordinator to obtain the key and fingerprint information of the target modification data; According to the key and fingerprint information of the target modified data, control the coordinator to locate the target node where the target modified data is located in the hash table; In the target node, the coordinator is controlled to delete the target modification data.

16. The method according to claim 15, It is characterized in that After controlling the coordinator to delete the target modification data, the method further includes: If the target bitmap information indicates that the data stored in the target node are all invalid, the memory allocator of the server is controlled to reclaim the memory of the target node.

17. The method according to any one of claims 14 to 16, It is characterized in that The controlling the coordinator to locate the target node where the target modified data is located in the hash table according to the key and fingerprint information of the target modified data comprises: Control the coordinator to determine the target bucket element corresponding to the target modified data in the hash table according to the key of the target modified data; Control the coordinator to match the fingerprint information of the target modified data with the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element, and determine a matching result; The coordinator is controlled to locate the target node where the target modification data is located according to the matching result.

18. The method according to claim 13, It is characterized in that If the modification operation is an insert operation, controlling the coordinator to perform the modification operation on the target modification data in the hash table includes: Controlling the coordinator to obtain the key and fingerprint information of the target modification data; Control the coordinator to determine the target bucket element corresponding to the target modified data in the hash table according to the key of the target modified data; If the fingerprint information of the data stored in each node in the linked list corresponding to the target bucket element is inconsistent with the fingerprint information of the target modified data, according to each bitmap information in the linked list corresponding to the target bucket element, control the coordinator to determine the free node in the linked list corresponding to the target bucket element or control the memory allocator to add the free node in the linked list corresponding to the target bucket element; The coordinator is controlled to insert the target modification data in the idle node.

19. The method according to claim 18, It is characterized in that After determining the target bucket element corresponding to the target modification data in the hash table, the method further includes: If the fingerprint information of the data stored in any node in the linked list corresponding to the target bucket element is consistent with the fingerprint information of the target modified data, the coordinator is controlled to generate insertion failure indication information of the insertion operation.

20. The method according to claim 9, It is characterized in that The method further comprises: During initialization, a memory range is allocated from the server memory to create and manage the hash table and form memory registration information; When a connection request from a client is monitored, the client responds to the connection request and establishes a connection with the client; Send memory registration information to the client.

21. An access control device, It is characterized in that The access control device is applied to a client, and the access control device comprises: A first receiving module, used for receiving an access request of a hash table and sending it to the RDMA engine, wherein the access request is used for requesting a target access operation to the hash table; A query module, for locating the node where the target query data corresponding to the query operation is located in the hash table in the server through the hash mapper in the client if the target access operation is a query operation, and reading the target query data from the node where the target query data is located to the client memory; A modification module is used for, if the target access operation is a modification operation, the RDMA engine sends a write operation request to the server, the write operation request is used to request the coordinator in the server to modify the target modification data corresponding to the modification operation in the hash table, and the target modification data is in a locked state during modification.

22. An access control device, It is characterized in that The access control device is applied to the server, and the access control device includes: A second receiving module is used to receive a write operation request sent by the client, wherein the write operation request is issued by the RDMA engine of the client when receiving an access request for modifying the hash table of the server; A processing module is used to control the coordinator of the server to set the target modification data corresponding to the modification operation in the hash table to a locked state according to the write operation request; control the coordinator to perform the modification operation on the target modification data in the hash table; and control the coordinator to release the locked state of the target modification data after the modification operation is completed.

23. A chip comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 20 are implemented.

24. A network interface card, It is characterized in that The network interface card comprises the chip as claimed in claim 23 and a plurality of interfaces, and the chip communicates externally through the interfaces.

25. An electronic device, It is characterized in that The electronic device comprises a processor and a network interface card as claimed in claim 24, wherein the network interface card is used to dispatch messages to the processor or the network interface card itself for processing, and the processor is used to process the messages dispatched by the network interface card.

26. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 20 are implemented.

27. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 20 are implemented.