Concurrency control method, network card, computer device, storage medium
By performing consistency checks on the network interface card, the problem of high CPU overhead is solved, more efficient concurrency control is achieved, CPU overhead and latency are reduced, and resource utilization is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2021-03-16
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, in order to perform concurrency control, the requesting end needs to perform data consistency checks, which is usually performed by the central processing unit (CPU), resulting in a large CPU overhead.
By performing consistency checks on the network interface card (NIC), the NIC obtains the object and performs consistency checks on the data based on the check information. Data is only provided to the memory of the requesting end when the check passes, reducing the CPU check and memory relocation overhead.
It effectively reduces CPU overhead and end-to-end latency, improves resource utilization and concurrency, and reduces the overhead of invalid data processing.
Smart Images

Figure CN115150472B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of concurrency control, and particularly relates to a concurrency control method, a network card, a computer device and a storage medium. BACKGROUND
[0002] Concurrency control takes a transaction as a basic unit of scheduling. The purpose of concurrency control is to reasonably arrange the concurrent scheduling of transactions to avoid conflicts and improve the correctness and utilization of the system.
[0003] In the related art, when a request end needs to read data from a destination end, in order to perform concurrency control, consistency verification needs to be performed on the data requested to be read by the request end, so as to ensure that no update operation is performed on the data requested to be read in the process of reading the data, that is, there is no concurrency conflict in the operation of reading the data.
[0004] However, the verification operation is usually performed by the central processing unit (CPU) of the request end, resulting in a large CPU overhead. SUMMARY
[0005] The present application provides a concurrency control method, a network card, a computer device and a storage medium. The present application effectively reduces the CPU overhead. The technical solutions provided by the present application are as follows:
[0006] In a first aspect, the present application provides a concurrency control method, which comprises: a network card acquiring an object, the object carrying data requested to be read by a request end from a destination end and verification information of the data; the network card performing consistency verification on the data according to the verification information; and the network card providing the data to the memory of the request end when the consistency verification passes.
[0007] By using the network card to perform consistency verification, it is not necessary to use the CPU in the server to perform consistency verification, and the CPU overhead caused by verification and memory migration can be effectively reduced on the basis of realizing concurrency control of the reading process, thereby reducing the end-to-end latency.
[0008] In an implementable manner, when the consistency verification passes, the network card provides the data to the memory of the request end, comprising: when the consistency verification passes, the network card performs a verification information stripping operation on the object to obtain the data; and the network card provides the data to the memory of the request end.
[0009] By using the network card to perform the stripping operation, it is not necessary to use the CPU in the server to perform the stripping operation, and the CPU overhead caused by verification and memory migration can be effectively reduced on the basis of realizing concurrency control of the reading process, thereby reducing the end-to-end latency.
[0010] In an implementation, when the network card is deployed in the destination, after the network card performs the consistency check on the data according to the check information, the method further includes: when the consistency check fails, the network card notifies the requestor that the consistency check fails. By notifying the requestor in time that the consistency check fails, the overhead caused by processing invalid data can be effectively reduced.
[0011] In an implementation, when the network card is deployed in the destination, after the network card performs the consistency check on the data according to the check information, the method further includes: when the consistency check fails, the network card stops performing the consistency check on the unverified part of the data, and stops sending the part of the data that has passed the check to the requestor. In this way, the resource overhead and time overhead used for performing the consistency check and transmission on invalid data can be reduced, and the utilization of resources and the concurrency of the destination can be improved.
[0012] In an implementation, when the network card is deployed in the requestor, after the network card performs the consistency check on the data according to the check information, the method further includes: when the consistency check fails, the network card stops writing the part of the data that has passed the check into the memory of the requestor. In this way, the resource overhead and time overhead used for transmission of invalid data can be reduced, and the utilization of resources and the concurrency of the destination can be improved.
[0013] In an implementation, when the network card is deployed in the requestor, after the network card performs the consistency check on the data according to the check information, the method further includes: when the consistency check fails, the network card stops performing the consistency check on the unverified part of the data. In this way, the resource overhead and time overhead used for performing the consistency check on invalid data can be reduced, and the utilization of resources and the concurrency of the destination can be improved.
[0014] Optionally, when the network card is deployed in the destination, the object can be read from the memory. As an implementation, the network card obtaining the object includes: the network card receiving a read request sent by the requestor, the read request being used to request reading data; and the network card obtaining the object from the memory of the destination according to the read request.
[0015] In addition, the network card providing the data to the memory of the requestor includes: the network card sending the data to the network card of the requestor, so that the network card of the requestor sends the data to the memory of the requestor.
[0016] Optionally, when the network card is deployed in the requestor, the object is provided by the destination. As an implementation, before the network card obtains the object, the method further includes: the network card sending a read request to the destination, the read request being used to request reading data; and correspondingly, the network card obtaining the object includes: the network card receiving the object sent by the network card of the destination based on the read request in the destination.
[0017] In an implementation, when the network card is deployed in the request end, the network card provides the data to the memory of the request end, including: the network card directly sends the data to the memory of the request end.
[0018] Optionally, when the network card provided by the present application can support read-write operations of different read-write scales, the organization forms of the check information of the data involved in different read-write scales in the object can be the same or different, and the check information in different organization forms can be described by description information. Accordingly, before the network card performs the consistency check on the data according to the check information, the method further includes: the network card acquires the description information of the object, the description information being used to indicate the organization form of the object; and the network card acquires the check information from the object based on the description information.
[0019] In order to distinguish the description information used to describe different organization forms, the description information used to describe different organization forms can also be assigned with an identifier, and accordingly, the network card acquires the description information of the object, including: the network card acquires the identifier of the description information; and the network card acquires the description information based on the identifier of the description information and a mapping relationship, the mapping relationship reflecting the correspondence between the description information and the identifier.
[0020] In an implementation, when the network card is deployed in the destination end, the network card acquires the identifier of the description information, including: the network card receives a read request sent by the request end, the read request carrying the identifier of the description information; and the network card acquires the identifier of the description information from the read request.
[0021] In another implementation, when the network card is deployed in the request end, the network card acquires the identifier of the description information, including: the network card receives a read response sent by the destination end based on the read request, the read response carrying the identifier of the description information, the identifier of the description information being sent to the destination end through the read request; and the network card acquires the identifier of the description information from the read response.
[0022] In a second aspect, the present application provides a network card, including: an acquisition unit, configured to acquire an object, the object carrying data requested by a request end to read from a destination end and check information of the data; a check unit, configured to perform a consistency check on the data according to the check information; and an interaction unit, configured to provide the data to a memory of the request end when the consistency check passes.
[0023] Optionally, the network card further includes: a stripping unit, configured to perform a check information stripping operation on the object to obtain the data when the consistency check passes; and the interaction unit, specifically configured to provide the data to the memory of the request end.
[0024] Optionally, the network card is deployed in the destination end, and the interaction unit is further configured to notify the request end that the consistency check fails when the consistency check fails.
[0025] Optionally, the network card is deployed in the destination, and the interaction unit is further configured to stop sending the part of the data that has passed the consistency check to the requestor when the consistency check fails.
[0026] Optionally, the network card is deployed in the requestor, and the interaction unit is further configured to stop writing the part of the data that has passed the consistency check into the memory of the requestor when the consistency check fails.
[0027] Optionally, the network card is deployed in the requestor, and the interaction unit is further configured to stop writing the part of the data that has passed the consistency check into the memory of the requestor when the consistency check fails.
[0028] Optionally, the interaction unit is further configured to receive a read request sent by the requestor, the read request being used to request reading of the data, and the obtaining unit is specifically configured to obtain the object from the memory of the destination according to the read request.
[0029] Optionally, the network card is deployed in the destination, and the interaction unit is specifically configured to send the data to the network card of the requestor, so that the network card of the requestor sends the data to the memory of the requestor.
[0030] Optionally, the network card is deployed in the requestor, and the interaction unit is further configured to send a read request to the destination, the read request being used to request reading of the data, and the obtaining unit is specifically configured to receive the object sent by the network card of the destination, the object being obtained in the destination by the network card of the destination based on the read request.
[0031] Optionally, the network card is deployed in the requestor, and the interaction unit is specifically configured to directly send the data to the memory of the requestor.
[0032] Optionally, the obtaining unit is further configured to obtain description information of the object, the description information being used to indicate an organization form of the object, and the checking unit is further configured to obtain the check information from the object based on the description information.
[0033] Optionally, the obtaining unit is specifically configured to: obtain an identifier of the description information, and obtain the description information based on the identifier of the description information and a mapping relationship, the mapping relationship reflecting a corresponding relationship between the description information and the identifier.
[0034] Optionally, the network card is deployed in the destination, and the interaction unit is further configured to receive a read request sent by the requestor, the read request carrying the identifier of the description information, and the obtaining unit is specifically configured to obtain the identifier of the description information from the read request.
[0035] Optionally, the network card is arranged in the request end, and the interaction unit is further configured to receive a read response sent by the target end based on the read request, the read response carrying the identifier of the description information, and the identifier of the description information being sent to the target end through the read request; and the obtaining unit is specifically configured to obtain the identifier of the description information from the read response.
[0036] In a third aspect, the present application provides a computer device, comprising: a network card and a memory, the memory storing a computer program; when the network card executes the computer program, the method provided in the first aspect of the present application and any possible implementation manner thereof is implemented.
[0037] In a fourth aspect, the present application provides a non-transitory computer readable storage medium, when the instructions in the computer readable storage medium are executed by the network card, the network card executes the method provided in the first aspect of the present application and any possible implementation manner thereof.
[0038] In a fifth aspect, the present application provides a computer program product containing instructions, when the computer program product is run on the network card, the network card executes the method provided in the first aspect of the present application and any possible implementation manner thereof. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 is a schematic diagram of an application scenario related to a concurrent control method provided by an embodiment of the present application;
[0040] Figure 2 is a structural schematic diagram of a network card provided by an embodiment of the present application;
[0041] Figure 3 is a flowchart of a concurrent control method provided by an embodiment of the present application;
[0042] Figure 4 is a schematic diagram of an object storage mode provided by an embodiment of the present application;
[0043] Figure 5 is a schematic diagram of another object storage mode provided by an embodiment of the present application;
[0044] Figure 6 is a schematic diagram of a network card of a target end executing a concurrent control method provided by an embodiment of the present application;
[0045] Figure 7 is a flowchart of another concurrent control method provided by an embodiment of the present application;
[0046] Figure 8 is a schematic diagram of a network card of a request end executing a concurrent control method provided by an embodiment of the present application;
[0047] Figure 9is another structural schematic diagram of a network card provided by an embodiment of the present application;
[0048] Figure 10 is another structural schematic diagram of a network card provided by an embodiment of the present application;
[0049] Figure 11 is a structural schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the objects, technical solutions and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0051] In order to make the objects, technical solutions and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0052] A transaction is a logical operation unit, and is an operation sequence composed of all operations executed between transaction start and transaction end. All operations in a transaction are an execution whole, and all operations in the whole transaction are executed successfully or all are failed, and the transaction failure can guarantee that the operation object of the operation in the transaction is not affected through the abort or rollback strategy.
[0053] Concurrency control (CC) is used to serialize multiple concurrent transactions operating on the same object, and is a mechanism for ensuring that errors caused by concurrent operations are discovered and corrected in time. When concurrent transactions of an object include read operation transactions and write operation transactions, the read operation transactions and the write operation transactions can be serialized through concurrency control, so as to prevent concurrent operations such as executing write operations simultaneously in the read operation process, executing read operations simultaneously in the read operation process, executing read operations simultaneously in the write operation process, or executing other write operations simultaneously in the write operation process, thereby guaranteeing the consistency of data.
[0054] Most implementation systems adopt a lock method to implement concurrency control. The principle of implementing concurrency control by using the lock method is that when a transaction operates on an object, the object is locked to prevent other transactions from operating on the object in the execution process of the transaction, and the lock on the object is released after the transaction is completed. However, the lock method increases the overhead of the implementation system and reduces the potential concurrency degree of the implementation system.
[0055] Another mechanism to achieve concurrency control is optimistic concurrency control (OCC). OCC is a lock free concurrency control mechanism, which is based on an optimistic conflict detection strategy to perform concurrency control, and can maximize parallel efficiency on the basis of achieving concurrency control. When using OCC, the execution process of a transaction includes an execution phase, a verification phase and a commit phase. In the execution phase, the object is operated according to the logic of the transaction. In the verification phase, it is judged whether the operation of the transaction on the object conflicts with the operation of other transactions on the object. If the operation of the transaction on the object does not conflict with the operation of other transactions on the object, the transaction is allowed to enter the commit phase, otherwise, a conflict resolution mechanism needs to be used for the transaction with conflict.
[0056] A distributed transaction is a transaction involving multiple servers, and the implementation of the distributed transaction needs the cooperation of the multiple servers. In the distributed transaction, each server applies local concurrency control to the object managed by itself to ensure that the transaction is serialized locally, and also needs to perform concurrency control on the entire distributed transaction to ensure global serialization.
[0057] In the distributed transaction, the process of lock-free read can be controlled by using OCC. However, the process of using OCC to achieve lock-free read will cause a large CPU (central processing unit) overhead in the server.
[0058] Embodiments of the present application provide a concurrency control method. A network card acquires an object, performs consistency check on data in the object according to check information carried by the object, and provides the data to the memory of the request end when the consistency check is passed. The object carries data requested by the request end to read from the destination end and check information of the data. In the concurrency control method, the consistency check is performed by using the network card, so that the CPU in the server is not needed to perform the consistency check, and the CPU overhead can be effectively reduced on the basis of achieving concurrency control of the reading process. The data carried by the object is a general term of the content requested by the request end to read from the destination end.
[0059] Figure 1is an implementation scenario related to a concurrent control method provided by an embodiment of the present application. The implementation scenario includes at least two service nodes. Each of the at least two service nodes is deployed with a network card, and data transmission is implemented between any two of the at least two service nodes through the network cards. In a data reading scenario, one of the at least two service nodes is used as a destination, and the destination stores data. One or more of the at least two service nodes other than the destination is used as a requestor, and the requestor is configured to request reading of the data from the destination. Wherein, Figure 1 is a schematic diagram of the application scenario including a first service node 10 and a second service node 20, one of the first service node 10 and the second service node 20 is used as a requestor, and the other is used as a destination.
[0060] Optionally, the service nodes in the implementation scenario can be implemented by a physical machine, a physical machine cluster including a plurality of physical machines, a bare metal server, or a cloud server, etc.
[0061] The process of reading data from the destination by the requestor includes that the requestor sends a read request to the destination, the destination acquires data requested to be read by the read request in the destination according to the read request, and provides the data to the requestor. In order to perform concurrent control on the data reading process, the data reading process further includes performing consistency verification on the data requested to be read by the read request. In the embodiment of the present application, the consistency verification process can be performed by the network card of the destination or the network card of the requestor.
[0062] In addition, the destination usually stores data in the memory in units of objects, wherein the object includes data and verification information for verifying the data. The data in the object is usually stored in the form of data blocks, that is, the object usually includes one or more data blocks. In addition, each data block has verification information, and the verification information of any data block can be located at the head or tail of the data block, or the verification information in the plurality of data blocks in the object can be placed in other ways. The requestor needs to acquire the data in the object, so when the data passes the verification, the network card is further used to strip the verification information of the data in the object, for example, to strip the verification information located at the head of the data block from the object to obtain the data requested to be read by the requestor, and provide the data to the memory of the requestor. By performing the stripping operation by the network card, the CPU and memory overhead caused by the CPU performing the stripping operation can be reduced.
[0063] Further, the network card provided by the embodiments of the present application can support read and write operations of multiple different read and write scales, and the data and the check information of the read and write operations of the multiple different read and write scales are organized in different forms in the object. The organization form is used to indicate the storage manner of the data and the check information in the object. The organization form can be reflected by using description information. When consistency check needs to be performed on the data, the network card needs to first acquire the description information of the object including the data, then acquire the check information of the data from the object according to the description information, and then perform consistency check on the data according to the check information.
[0064] In an implementable manner, the operations such as check and stripping performed by the network card in the embodiments of the present application can be implemented by program codes. Correspondingly, the network card used to perform consistency check can be a programmable network card. The programmable network card is also called programmable controller (Programmable NIC). When the network card is a programmable network card, the behavior of the network card can be changed by modifying the program codes such as firmware or microcode in the programmable network card, so that the network card has the above functions.
[0065] In addition, in order to further reduce the time delay of the CPU, the network card is configured with a remote direct memory access (RDMA) function. The RDMA is a fast cross-machine memory access technology commonly used in the field of distribution. The RDMA allows a machine to perform memory read and write operations on a pre-registered memory area of another target machine, and can bypass the operating system and CPU of the target machine, and therefore has the advantages of high speed, low delay and low CPU overhead.
[0066] Optionally, the above functions of the network card can be implemented by a plurality of function modules, and the plurality of function modules cooperatively implement the above functions of the service node. The following will be described by taking the network card as an example: Figure 2
[0067] As shown in Figure 2 When the service node includes the network card used to perform operations such as check and stripping, the service node includes a host system X01 and a programmable network card X02. The host system X01 runs an application program used to perform read and write operations on data, and correspondingly, the host system X01 includes an initialization module X011 serving the application program. The initialization module X011 is used to perform initialization configuration required by running the application program. In addition, the service node is configured with a memory X012 for the host system X01. The memory X012 is used to store objects required to be accessed by a distributed transaction.
[0068] AsFigure 2 As shown in FIG. 2, the programmable network card X02 includes a network card module X021, a first buffer module X022, a matching module X023, a validation module X024, a stripping module X025 and a second buffer module X026. The validation information includes version information, and the consistency check on the data is also called version check on the data. The validation module X024 is also called version validation module. The network card module X021 is hardware allowing the service node to communicate on the computer network, and is configured to receive data and the like sent by the network card of another service node through the network, and send data and the like to the network card of another service node through the network. The first buffer module X022 is configured to buffer the objects to be validated. The matching module X023 is configured to obtain the description information of the objects. The validation module X024 is configured to obtain the description information of the objects from the matching module, obtain the validation information of the data from the objects buffered by the first buffer module according to the description information, and perform consistency check on the data according to the validation information. The stripping module X025 is configured to strip the validation information from the objects when the data passes the check, and obtain the data requested to be read by the requestor. The second buffer module X026 is configured to buffer the validation information that has passed the check.
[0069] Optionally, the network card module X021, the first buffer module X022 and the second buffer module X026 can be implemented by hardware. For example, the first buffer module X022 can be a stream buffer, and the second buffer module X026 can be a context buffer. The matching module X023, the validation module X024 and the stripping module X025 can be implemented by software. It should be noted that the implementation manners of the network card module X021, the first buffer module X022, the matching module X023, the validation module X024, the stripping module X025 and the second buffer module X026 are exemplary and are not limited to the implementation manners of the corresponding modules. The implementation manners of the modules can be adjusted according to application requirements.
[0070] As described above, the concurrent control method provided by the embodiments of the present application can be executed by the destination or the requestor. The implementation process of the concurrent control method will be described below with respect to the concurrent control method executed by the destination and the concurrent control method executed by the requestor.
[0071] Figure 3 is a method flowchart of a concurrent control method provided by the embodiments of the present application and executed by the destination. As shown in FIG. 3, the concurrent control method includes the following steps. Figure 3
[0072] Step 301, the application program of the destination registers the description information of the object, and sends the identifier of the description information to the requestor through the network card of the destination.
[0073] When the application program runs in the destination, the object of the application program is stored in the memory, and the destination can provide the access function of the object to the requestor. The object includes the related data of the application program and the check information of the data. The check information is placed in the head, tail or other positions of the data. The related data of the application program includes the data read from the disk to the memory, the data generated in the process of running the application program and the data written by the other service nodes through the application program.
[0074] When the network card provided by the embodiment of the present application can support multiple read-write operations of different read-write scales, the organization forms of the check information of the data involved in different read-write scales in the object can be the same or different. For example, the organization forms of the check information of the data accessed by different threads of the application program in the object can be the same or different. At this time, in order to facilitate the network card to obtain the check information of the data, the application program needs to register the description information of the object. The description information is used to indicate the organization form of the object, such as the organization form of the data and the check information in the object. The application program registers the description information, which means that the application program determines the organization form of the data accessed by the application program and the check information in the object according to the execution logic of the application program, and obtains the description information of the object according to the organization form of the object.
[0075] In addition, in order to distinguish the description information for describing different organization forms, the description information for describing different organization forms can also be assigned with identifiers, and a mapping relationship between the description information and the identifiers is established, so that in the subsequent process of reading the data, the network card can determine the description information indicated by the identifier according to the identifier. Alternatively, the operation of assigning the description information with the identifier can be performed by the application program or the network card of the destination, as long as it can ensure that an identifier can uniquely identify a description information. The mapping relationship table is stored in the network card, and is used to describe the mapping relationship between the description information and the identifiers.
[0076] Since the memory of the destination usually stores a lot of data, and the destination cannot predict the data that the requester needs to read, the destination cannot predict the check information of the data that the requester needs to read. Therefore, in order to facilitate the destination to determine the check information of the data that the requester needs to read, the requester needs to carry the identifier or the description information of the object in the read request sent to the destination. Correspondingly, after determining the description information of the object, the destination also needs to notify the requester of the description information for describing different organizations, so that when the requester needs to read data from the destination, the requester can carry the corresponding description information in the read request. Alternatively, after the destination allocates identifiers for the description information for describing different organizations, the destination also needs to notify the requester of the identifiers of the description information for describing different organizations, so that when the requester needs to read data from the destination, the requester can carry the identifier of the corresponding description information in the read request. Alternatively, the application program of the destination can notify the application program of the requester of the description information for describing different organizations or the identifiers thereof through an in-band or out-of-band manner.
[0077] In the object, the data can be divided into multiple data blocks, and the check information of each data block is carried in the object to facilitate the check of each data block. When the memory caches data in the form of cache lines, one data block can be stored in each cache line, or multiple cache lines can jointly store one data block. The following describes the two implementation manners by taking Figure 4 and Figure 5 as examples.
[0078] As shown in Figure 4 , the data in the object is divided into three data blocks, and each cache line of the three cache lines stores one data block in the object, and the check information of the data block stored in each cache line is also stored in each cache line. When checking the data in the object, the data block stored in each cache line needs to be checked according to the check information of the data block stored in each cache line. The length of the check information in the multiple cache lines can be the same or different, and / or the content included in the check information in the multiple cache lines can be the same or different. For example, the length of each cache line is 256 bytes, according to the indication of the description information, it is known that the check information is located at the head of the data block, and the length of the check information in each cache line is 8 bytes, and the length of the data block is 248 bytes.
[0079] As shown in Figure 5 , the data in the object is divided into two data blocks, each data block is stored in two cache lines, and the check information of each data block is also stored at the head of each data block. When checking the data in the object, the corresponding data block can be checked according to the check information at the head of each data block.
[0080] The number of cache lines used to store one data block in the object can be determined according to application requirements, for example, can be determined according to the atomic read-write granularity of the network card. When the atomic read-write granularity of the network card is one cache line, each cache line is used to store one data block, and when the atomic read-write granularity of the network card is multiple cache lines, multiple cache lines are used to store one data block.
[0081] In an implementation manner, the description information of the object can be represented by a pattern descriptor of the object, and the identifier of the corresponding description information can be represented by a pattern identifier (pattern ID for short). Correspondingly, the foregoing matching module X023 is also called a pattern matching module, and the mapping relationship table for describing the pattern and the pattern identifier can be called a pattern table.
[0082] Optionally, the pattern descriptor includes a length field and an offset field. The length field is used to indicate the effective length of the check information. The offset field is used to indicate the offset of the check information in the object. When the effective length and the offset of the check information are defined by using the pattern descriptor, the storage position of the check information in the object can be determined according to the effective length and the offset. Since the object includes two parts of data and check information, after the storage position of the check information in the object is determined, the storage position of the data in the object can be determined. Optionally, the pattern descriptor further includes a write lock identifier field and an object release field. The write lock identifier field is used to indicate whether the data is added with the identifier of the write operation. The object release field is used to indicate whether the object has been released by another thread.
[0083] By using the description information to indicate the organization form of the object and maintaining the mapping relationship between the description information and the identifier in the network card, the network card can support one or more applications using objects with different organization forms, the adaptability of the network card is improved, and it is helpful to flexibly adjust the format of the check information according to the service attribute of the service node, so that the network card can support different service models.
[0084] It should be noted that the step 301 is an optional step, and whether the step 301 needs to be performed can be determined according to application requirements. For example, when the organization forms of the multiple check information required to be checked by the network card in the object are different, the step 301 needs to be performed. When the organization forms of the multiple check information required to be checked by the network card in the object are the same, the step 301 does not need to be performed.
[0085] In step 302, the network card of the destination receives the read request sent by the request end.
[0086] When the requestor needs to read data from the destination, the requestor needs to send a read request to the destination. The read request is used to indicate the data that the requestor needs to read from the destination. The read request carries the logical address of the data that the requestor needs to read, so as to indicate the data that the requestor needs to read by the logical address. In addition, since the destination stores data in the memory in the form of objects, the logical address is used to indicate the object (also referred to as a read object) that includes the data that the requestor needs to read.
[0087] In addition, the read request also carries the description information of the object or the identifier of the description information, so as to facilitate the destination to obtain the check information in the object according to the description information or the identifier. The requestor can determine the description information of the object or the identifier of the description information according to the requirement of the data that the requestor needs to read, and carry the description information or the identifier of the description information in the read request. In an implementation manner, the requestor and the destination can pre-agree the organization form of the check information of the data accessed by different threads in the object, and when a thread of the requestor needs to read data from the destination, the requestor can determine the organization form of the object that the thread needs to read according to the result of the agreement, and carry the identifier of the description information that describes the organization form in the read request, so as to facilitate the destination to determine the check information of the data according to the identifier. The read request can determine whether to carry the identifier of the description information of the object according to application requirements.
[0088] Meanwhile, in order to distinguish from the ordinary read request, the read request can also carry a check indication identifier, which is used to instruct the network card in the destination to perform consistency check on the data that the read request needs to read.
[0089] In an implementation manner, the implementation manner of the read request carrying the identifier of the description information and the check indication identifier includes: adding an operation code (OPCode) in the message area corresponding to the InfiniBand (IB) transmission layer in the read request, instructing the network card in the destination to perform consistency check on the data that the read request needs to read by the operation code, and adding the identifier of the description information in front of the load of the field corresponding to the IB transmission layer. The IB is a computer network communication standard for high-performance computing, which has extremely high throughput and extremely low delay, is used for data interconnection between computers, can carry the RDMA technology, and is also used as direct or exchange interconnection between servers and storage systems, and interconnection between storage systems.
[0090] In another implementation, the implementation of the read request carrying the identification of the description information and the identification of the check indication includes: embedding the identification of the description information and the identification of the check indication into the reserved field of the read request header by using the reserved field already existing in the read request.
[0091] Similarly, the implementation of the read request carrying the description information can be referred to the implementation of the read request carrying the identification of the description information, which will not be described herein.
[0092] Step 303: The network card of the destination obtains the object from the memory of the destination according to the read request.
[0093] After receiving the read request, the network card of the destination can obtain the object from the memory of the destination according to the logical address carried by the read request. The object carries the data requested by the request end to be read from the destination and the check information of the data.
[0094] Step 304: The network card of the destination obtains the description information of the object.
[0095] In an implementation, when the read request carries the identification of the description information, the network card of the destination obtains the description information of the object, including: the network card of the destination obtains the identification of the description information from the read request, and queries the mapping relationship between the description information and the identification established in the network card in step 301 based on the identification of the description information, to obtain the description information of the object. When the read request carries the description information, the network card of the destination can extract the description information from the read request according to the manner of the read request carrying the description information, to obtain the description information of the object.
[0096] Step 305: The network card of the destination obtains the check information from the object based on the description information.
[0097] Since the description information is used to indicate the organization form of the object, after obtaining the description information of the object, the network card of the destination can determine the storage position of the check information in the object according to the organization form indicated by the description information. Moreover, since the network card of the destination has obtained the object from the memory, the network card of the destination can know the storage position of the object, and accordingly, the network card of the destination can obtain the check information from the object in the storage position of the object.
[0098] It should be noted that when the organization forms of the check information of the data involved in the read-write operation supported by the network card are all the same, for example, in some fixed business scenarios, the organization forms of the objects involved in the read-write operation are all the same, the read request can not carry the identification of the description information of the object. At this time, the request end and the destination can pre-agree the organization form of the object, and the network card of the destination can obtain the check information from the object according to the pre-agreed organization form after receiving the read request. Accordingly, step 304 need not be performed.
[0099] Step 306, the network card of the destination performs consistency check on the data according to the check information.
[0100] The implementation of the consistency check on the data can include: judging whether the check information of the plurality of data blocks in the object is all the same, when the check information of the plurality of data blocks is all the same, determining that the data passes the consistency check, then executing step 307, when the check information of the plurality of data blocks is not all the same, determining that the data does not pass the consistency check, then executing step 308.
[0101] Optionally, the check information of the data block includes the version number of the data block, and the consistency check on the data according to the check information can be implemented by judging whether the version numbers of the plurality of data blocks of the data are all the same. Wherein, the version number is generated after each operation on the data. Different version numbers are used to identify different operations on the data. When the version numbers of any two data blocks in the object are different, it means that the operations on the two data blocks are different, then it can be determined that the data cannot pass the consistency check. And when judging whether the plurality of check information is all the same, any one of the plurality of check information can be taken as a reference, and the other check information in the plurality of check information is compared with the check information as the reference, which is not limited in the embodiments of the present application.
[0102] Step 307, when the consistency check passes, the network card of the destination provides the data to the memory of the requestor.
[0103] When the consistency check passes, it means that there is no concurrent conflict in the process of reading the data, and there is no inconsistent situation, then the destination can provide the data in the object to the requestor.
[0104] Since the data is stored in the object, and the description information is used to describe the organization form of the object, then the network card of the destination can obtain the data from the object according to the description information, and provide the data to the requestor. In an implementable manner, the implementation of the destination providing the data to the requestor includes: the network card of the destination performs the check information stripping operation on the object, obtains the data in the object, and provides the data to the memory of the requestor.
[0105] Optionally, since the check information of any data block can be located at the head or tail of the data block, or the check information can be placed in other manners in the plurality of data blocks in the object, the placement of the check information and the data block in the object indicated by the description information can be described, and the operation on the data block is performed to obtain the data block. In an implementation, when the check information of any data block is located at the head of the data block, since the data block is located behind the check information, the operation of left offsetting can be performed on the data block according to the description information, so that all bytes of the offset object from the first byte belong to the payload of the object, and the data after stripping the check information from the object is obtained. For example, when the object includes four data blocks, the check information of the data block is located at the head of the data block, and the description information of the object indicates that the valid length of the check information of each data block is 10 bytes, the four data blocks can be left offset by 10 bytes to obtain the data after stripping the head from the object. When the check information and the data block are placed in other manners in the object, the stripping operation of the check information can be performed according to similar operation logic to obtain the data block.
[0106] The network card of the destination provides the data to the memory of the requestor by sending the data to the network card of the requestor and sending the data to the memory of the requestor through the network card of the requestor. The network card of the requestor can write the data into the memory of the requestor in a direct memory access (DMA) mode. Before the network card of the destination sends the data to the network card of the requestor, the data needs to be encapsulated with a related message header to send the data to the network card of the requestor in a message mode.
[0107] It should be noted that the steps 304 to 307 can be executed in a streaming manner, that is, after the partial data blocks in the object are read from the memory of the destination to the network card of the destination, the steps 304 to 307 can be executed. By executing the steps 304 to 307 in the streaming manner, the consistency check operation on the data does not need to be performed until all the data blocks in the object are read to the network card of the destination. Moreover, the stripping operation can be performed on the data block when the data block passes the check, and then the data block obtained by the stripping operation is sent to the requestor, without waiting until the consistency check operation on all the data blocks in the object is completed, and then all the data blocks in the object are sent to the requestor. When the steps 304 to 307 are executed in the streaming manner, it can be seen that the destination can send part of the data to the requestor while performing the consistency check operation on another part of the data. It can be seen that by executing the steps 304 to 307 in the streaming manner, the concurrency of the memory of the requestor is improved, and the storage space of the network card can be effectively utilized.
[0108] When the consistency check is performed in a streaming manner, the consistency check is performed after at least two data blocks are read to the network card of the destination end. The consistency check performed in the streaming manner is implemented as follows: it is determined whether the check information of the at least two data blocks is all the same. When the check information of the at least two data blocks is all the same, it is determined that the at least two data blocks pass the consistency check. When the check information of the at least two data blocks is not all the same, it is determined that the at least two data blocks do not pass the consistency check.
[0109] When the consistency check does not pass, the network card of the destination end notifies the request end that the check does not pass, so that the request end stops writing the received part of the data to the memory of the request end, and the network card of the destination end stops performing the consistency check on the part of the data that has not been checked and stops sending the part of the data that has passed the check to the request end.
[0110] When the consistency check does not pass, it indicates that there is a concurrent conflict in the process of reading the data, which causes inconsistency. Therefore, the data in the object cannot be provided to the request end. At this time, the network card of the destination end can notify the request end that the check does not pass, so that the request end stops writing the received part of the data to the memory of the request end. In addition, when it is determined that the consistency check does not pass, the network card of the request end can also notify the application program that reads the data to perform conflict resolution processing, for example, to notify the application program to perform rollback retry or terminate the transaction. By timely notifying the request end that the consistency check does not pass, the overhead caused by processing invalid data can be effectively reduced.
[0111] The implementation manner in which the network card of the request end notifies the application program includes that the network card constructs a message for indicating that the consistency check fails, and puts the message into a queue for communication with the application program. The application program obtains the message from the queue, and learns that the consistency check fails according to the message.
[0112] In an implementation manner, the implementation manner in which the destination end notifies the request end includes that a read response for indicating that the consistency check fails is replied to the request end. Optionally, a flag bit can be added in the read response, and the value of the flag bit is used to indicate that the consistency check fails. Alternatively, an operation code can be added in the read response, and the operation code is used to indicate that the consistency check fails. For example, the read response can be a read response ABORT packet.
[0113] Furthermore, when executing steps 303 to 306 in streaming mode, if a consistency check fails, the destination network card can stop performing consistency checks on the unchecked portions of the data and stop sending the checked portions of the data to the requesting end. This reduces the resource and time overhead associated with consistency checks and transmission of invalid data, improving resource utilization and ensuring concurrency at the destination.
[0114] It should be noted that steps 301 to 308 above can be implemented through functional modules. For example, assume that the function of the network card in the destination end is achieved through... Figure 2 The functional modules shown are implemented as follows: Figure 6 As shown, step 301 can be achieved through... Figure 2 The initialization module X011 is used for initialization, step 302 is used for network card module X021, step 303 is used for first cache module X022, and the data read from memory can be stored in the first cache module X022. Step 304 is used for matching module X023, and steps 305 and 306 are used for verification module X024. When the verification is successful, verification module X024 sends a notification message to stripping module X025, so that stripping module X025 can access the verified pairs cached in the first cache module X022. The verification information stripping operation in step 307 is performed. After the stripping operation is completed, the network interface card (NIC) module X021 reads data from the first cache module X022 and performs the data sending operation to the requesting end's NIC in step 307. In step 308, the NIC module X021 notifies the requesting end that the verification failed. The verification module X024 stops performing consistency verification on the unverified portion of the data in step 308, and the NIC module X021 stops sending the verified portion of the data to the requesting end in step 308. Furthermore, to distinguish between verified and unverified objects, unverified objects can be stored in the first cache module X022, and the verification information of verified objects can be stored in the second cache module X026. After sending the data of an object to the requesting end, the object is deleted from the first cache module X022.
[0115] In the concurrency control method provided in this application embodiment, by using a network interface card (NIC) for consistency verification and stripping operations, the CPU in the server is not required to perform consistency verification and stripping operations. This effectively reduces the CPU overhead consumed by verification and memory movement while achieving concurrency control during the read process, thus lowering end-to-end latency. Furthermore, by implementing consistency verification and stripping operations in software during this concurrency control process, the dependence of concurrency control on hardware is reduced, thereby correspondingly lowering the implementation cost of concurrency control.
[0116] Figure 7A concurrent control method provided by an embodiment of the present application is a method flowchart executed by a request end. As shown in Figure 7 the concurrent control method comprises the following steps:
[0117] Step 701: An application program of the request end registers description information of an object.
[0118] The implementation process of the step 701 can refer to the implementation process of the registration of the description information of the object by the application program of the destination end in the step 301, which will not be repeated here. The difference between the step 701 and the step 301 is that, after the registration of the description information is completed, the application program of the request end does not need to send the identifier of the description information to the destination end.
[0119] Step 702: The network card of the request end sends a read request to the destination end.
[0120] The implementation process of the step 702 can refer to the implementation process of the sending of the read request by the request end in the step 302, which will not be repeated here. In the read request, the identifier of the description information of the object can also be determined according to the application requirement.
[0121] Step 703: The network card of the destination end acquires the object from the memory of the destination end according to the read request, and sends a read response to the request end.
[0122] The read response carries the object and the identifier of the description information of the object. The object includes the data requested by the request end to read from the destination end and the check information of the data. The identifier of the description information can be transmitted from the request end to the destination end by the read request and the read response in the form of a signal along the way, and then transmitted from the destination end to the request end, so that the destination end does not need to perceive the identifier of the description information. The implementation process of the acquisition of the object by the destination end can refer to the related description in the step 303, which will not be repeated here.
[0123] Step 704: The network card of the request end acquires the description information of the object according to the read response.
[0124] In one implementation manner, since the read response carries the identifier of the description information, the acquisition of the description information of the object by the network card of the request end comprises: the network card of the request end acquires the identifier of the description information from the read response, and queries the mapping relationship between the description information and the identifier established in the network card in the step 701 based on the identifier of the description information, to obtain the description information of the object.
[0125] Step 705: The network card of the request end acquires the check information from the object based on the description information.
[0126] Since the description information is used to indicate the storage location of the check information in the object, after obtaining the description information of the object, the network card of the request end can obtain the check information of the data requested to be read by the read request in the object according to the storage location indicated by the description information.
[0127] It should be noted that when the check information of the data involved in the read / write operation supported by the network card is in the same organization form in the object, for example, in some fixed business scenarios, the organization form of the object involved in the read / write operation is the same, the read request can not carry the identifier of the description information of the object. At this time, the organization form of the object can be pre-agreed between the request end and the destination, and the network card of the request end can obtain the check information from the object according to the pre-agreed organization form after receiving the read response. Correspondingly, the above step 704 need not be performed.
[0128] Step 706, the network card of the request end performs consistency check on the data according to the check information.
[0129] The implementation process of the step 706 is described in detail in the implementation process of the step 306, which will not be repeated here.
[0130] Step 707, when the consistency check passes, the network card of the request end sends the data to the memory of the request end.
[0131] The network card of the request end sends the data to the memory of the request end, which can be that the network card of the request end directly sends the obtained data to the memory of the request end. The implementation process of the step 707 is described in detail in the corresponding description in the step 307, which will not be repeated here.
[0132] Step 708, when the consistency check does not pass, the network card of the request end stops writing the part of the data that has passed the check into the memory of the request end, and the network card of the request end stops performing consistency check on the part of the data that has not been checked.
[0133] The implementation process of the step 708 is described in detail in the related description in the step 308, which will not be repeated here.
[0134] Similarly, at least part of the steps 701 to 708 can be implemented by functional modules. For example, it is assumed that the functions of the network card in the request end are implemented by the functional modules shown in the figure, and the step 701 can be implemented by the module shown in the figure, the step 702 can be implemented by the module shown in the figure, the step 703 can be implemented by the module shown in the figure, the step 704 can be implemented by the module shown in the figure, the step 705 can be implemented by the module shown in the figure, the step 706 can be implemented by the module shown in the figure, the step 707 can be implemented by the module shown in the figure, and the step 708 can be implemented by the module shown in the figure. Figure 2 Figure 8 Figure 2 The initialization module X011 in the step 702 is implemented by the network card module X021, the step 704 is implemented by the matching module X023, the steps 705 and 706 are implemented by the checking module X024, and when the checking is passed, the checking module X024 sends a notification to the stripping module X025, so that the stripping module X025 performs the stripping operation of the checking information in the step 707 on the object in the first cache module X022 which has passed the checking, and after the stripping operation is completed, the first cache module X022 performs the operation of sending the data in the step 707 to the memory of the request end, the step 708 of stopping writing the part of the data which has passed the checking into the memory of the request end is implemented by the first cache module X022, and the step 708 of stopping the consistency checking on the part of the data which has not passed the checking is implemented by the checking module X024. In addition, in order to distinguish the verified object and the unverified object, the unverified object can also be stored in the first cache module X022, the checking information of the verified object is stored in the second cache module X026, and after the data in the object is sent to the memory of the request end, the object is deleted from the first cache module X022. Wherein, after the network card module X021 receives the read response sent by the destination end, the object can be obtained from the read response, and the object is stored in the first cache module X022.
[0135] In summary, in the concurrent control method provided by the embodiment of the present application, the consistency checking and the stripping operation are performed by the network card, so that the CPU in the server is not required to perform the consistency checking and the stripping operation, the CPU overhead caused by the checking and the memory moving can be effectively reduced on the basis of realizing the concurrent control of the reading process, and the end-to-end delay is reduced. In the concurrent control process, the functions implemented by the network card can be implemented by software, so that the dependence of the concurrent control on the hardware is reduced, and the implementation cost of the concurrent control is correspondingly reduced.
[0136] It should be noted that the order of the steps of the concurrent control method provided by the embodiment of the present application can be appropriately adjusted, and the steps can be appropriately increased or decreased according to the situation. Any person skilled in the art can easily think of the changed method within the technical range disclosed by the present application, which should be covered in the protection range of the present application, and thus will not be described in detail.
[0137] The embodiment of the present application also provides a remote access device. As shown in the Figure 9 The network card 90 includes:
[0138] The acquisition unit 901 is configured to acquire an object, and the object carries data requested by a request end to read from a destination end and checking information of the data.
[0139] The checking unit 902 is configured to perform consistency checking on the data according to the checking information.
[0140] The interaction unit 903 is configured to provide the data to the memory of the requestor when the consistency checking is passed.
[0141] Optionally, as shown in Figure 10 The stripping unit 904 is configured to perform a stripping operation on the object according to the checking information to obtain the data when the consistency checking is passed.
[0142] Correspondingly, the interaction unit 903 is specifically configured to provide the data to the memory of the requestor.
[0143] Optionally, the network card is deployed in the destination, and the interaction unit 903 is further configured to notify the requestor that the consistency checking is failed when the consistency checking is failed.
[0144] Optionally, the network card is deployed in the destination, and the checking unit 902 is further configured to stop the consistency checking on the unchecked part of the data when the consistency checking is failed. The interaction unit 903 is further configured to stop sending the checked part of the data to the requestor when the consistency checking is failed.
[0145] Optionally, the network card is deployed in the requestor, and the interaction unit 903 is further configured to stop writing the checked part of the data into the memory of the requestor when the consistency checking is failed.
[0146] Optionally, the network card is deployed in the requestor, and the checking unit 902 is further configured to stop the consistency checking on the unchecked part of the data when the consistency checking is failed.
[0147] Optionally, the interaction unit 903 is further configured to receive a read request sent by the requestor, the read request being used to request reading the data. Correspondingly, the obtaining unit 901 is specifically configured to obtain the object from the memory of the destination according to the read request.
[0148] Optionally, the network card is deployed in the destination, and the interaction unit 903 is specifically configured to send the data to the network card of the requestor, so that the network card of the requestor sends the data to the memory of the requestor.
[0149] Optionally, the network card is deployed in the requestor, and the interaction unit 903 is further configured to send a read request to the destination, the read request being used to request reading the data. Correspondingly, the obtaining unit 901 is specifically configured to receive the object sent by the network card of the destination, the object being obtained in the destination by the network card of the destination based on the read request.
[0150] Optionally, the network card is deployed in the requestor, and the interaction unit 903 is specifically configured to directly send the data to the memory of the requestor.
[0151] Optionally, the obtaining unit 901 is further configured to obtain description information of the object, the description information being used to indicate an organization form of the object. Correspondingly, the checking unit 902 is further configured to obtain the checking information from the object based on the description information.
[0152] Optionally, the obtaining unit 901 is specifically configured to obtain an identifier of the description information, and obtain the description information based on the identifier of the description information and a mapping relationship, the mapping relationship reflecting a corresponding relationship between the description information and the identifier.
[0153] Optionally, the network card is deployed in the destination, and the interaction unit 903 is further configured to receive a read request sent by the request end, the read request carrying the identifier of the description information. Correspondingly, the obtaining unit 901 is specifically configured to obtain the identifier of the description information from the read request.
[0154] Optionally, the network card is deployed in the request end, and the interaction unit 903 is further configured to receive a read response sent by the destination based on the read request, the read response carrying the identifier of the description information, the identifier of the description information being sent to the destination through the read request. Correspondingly, the obtaining unit 901 is specifically configured to obtain the identifier of the description information from the read response.
[0155] To sum up, in the network card provided in the embodiments of the present application, the consistency check is performed by the checking unit in the network card, and the stripping operation is performed by the stripping unit, so that the CPU in the server is not required to perform the consistency check and the stripping operation, and on the basis of realizing the concurrent control of the reading process, the CPU overhead consumed by the check and the memory migration is effectively reduced, and the end-to-end delay is reduced. Moreover, the functions of part or all of the units in the network card can be realized by software, so that the dependence of the concurrent control on the hardware is reduced, and the implementation cost of the concurrent control is correspondingly reduced.
[0156] It should be noted that the division of the units in the network card described above is only an example, and is not used to limit the implementation mode of the network card provided in the embodiments of the present application. The division mode of the functional modules in the network card in the embodiments of the present application can be adjusted according to application requirements. For example, the network card can be further subdivided, and the division mode can refer to the division mode of the programmable network card in Figure 2 Figure 2 For example, as shown in FIG. 21, the network card module X021 realizes the function of the interaction unit in the foregoing embodiments, the checking module X024 realizes the function of the checking unit in the foregoing embodiments, the stripping module X025 realizes the function of the stripping unit in the foregoing embodiments, the matching module X023 realizes the function of the obtaining unit in the foregoing embodiments, and the first cache module X022 realizes the function of the obtaining unit in the foregoing embodiments.
[0157] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the apparatus, unit and module described above can refer to the corresponding content in the foregoing method embodiments, and will not be described here.
[0158] The embodiment of the present application provides a computer device. Figure 11 An exemplary possible architecture diagram of the computer device is provided. As shown in the figure, Figure 11 The computer device 110 can include a network card 1101, a memory 1102, a communication interface 1103 and a bus 1104. In the computer device, the number of network cards 1101 can be one or more, Figure 11 Only one network card 1101 is shown. Optionally, as shown in the figure, Figure 11 The computer device 110 can also include a processor 1105, which can be a central processing unit (CPU). If the computer device has multiple processors, the types of the multiple processors can be different or can be the same. Optionally, the multiple processors of the computer device can also be integrated into a multi-core processor.
[0159] The network card 1101 is used for data interaction with other computer devices. In the embodiment of the present application, the consistency checking process can be performed by the network card 1101. Optionally, the network card 1101 is also used to strip the check information of the data block in the object, to obtain the data requested to be read by the request end, and to provide the data to the memory of the request end. Moreover, the network card 1001 can support a plurality of different read-write scales of read-write operations, and the data and check information of the plurality of read-write scales of read-write operations are different in the organization form in the object.
[0160] In one implementation manner, the operations such as checking and stripping performed by the network card 1001 can be implemented through program code. Correspondingly, the network card 1001 for performing consistency checking can be a programmable network card. When the network card 1001 is a programmable network card, the behavior of the network card 1001 can be changed by modifying the program code such as firmware or microcode in the programmable network card, so that the network card 1001 has the above functions. Moreover, in order to further reduce the time delay of the CPU, the network card 1001 is configured with a remote direct memory access function.
[0161] The memory 1102 stores computer instructions and data. The memory 1102 can store computer instructions and data required to implement the concurrency control method provided in the present application. The memory 1102 can be any one or any combination of the following storage media: non-volatile memory (such as read-only memory (ROM), solid state disk (SSD), hard disk drive (HDD), optical disk, etc.), volatile memory.
[0162] The communication interface 1103 can be any one or any combination of the following devices: a network interface (such as an Ethernet interface), a device with network access function.
[0163] The communication interface 1103 is used for data communication between the computer device and other nodes or other computer devices.
[0164] Figure 11 The bus 1104 is also exemplarily drawn. The bus 1104 can connect the network card 1101 with the memory 1102 and the communication interface 1103. In this way, through the bus 1104, the network card 1101 can access the memory 1102 and also use the communication interface 1103 to interact with other nodes or other computer devices.
[0165] In the present application, the memory of the computer device stores a computer program, and the network card executes the computer program in the memory 1102, which can implement the concurrency control method provided in the present application.
[0166] The present application also provides a storage medium, which is a non-transitory computer readable storage medium. When the instructions in the storage medium are executed by the network card, the network card executes the concurrency control method provided in the present application.
[0167] The present application also provides a computer program product containing instructions, which, when the computer program product is run on the network card, causes the network card to execute the concurrency control method provided in the present application.
[0168] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by program instructions to instruct related hardware to complete, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a disk or an optical disk, etc.
[0169] In the present application, the terms "first", "second" and "third" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance. The term "at least one" means one or more, and the term "multiple" means two or more, unless otherwise explicitly limited.
[0170] The term "and / or", within the present application, merely describes an associated relationship with the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects.
[0171] The above is only an optional embodiment of the present application, and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the concept and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A concurrency control method characterized by comprising: The method comprises: The network card obtains an object, the object carries data requested by a request end to read from a destination end and check information of the data, and the network card is a programmable network card and is configured with a remote direct memory access (RDMA) function; The network card obtains an identifier of description information of the object, obtains the description information of the object based on the identifier of the description information and a mapping relationship stored by the network card, the mapping relationship reflects a corresponding relationship between the description information and the identifier, and the description information is used to indicate an organization form of the object; The network card obtains the check information from the object based on the description information, and performs consistency check on the data according to the check information; When the consistency check passes, the network card performs check information stripping operation on the object to obtain the data, and provides the data to a memory of the request end.
2. The method of claim 1, wherein, The network card is deployed in the destination end, and after the consistency check on the data according to the check information, the method further comprises: When the consistency check does not pass, the network card notifies the request end that the check does not pass.
3. The method according to claim 1 or 2, characterized in that, The network card is deployed in the destination end, and after the consistency check on the data according to the check information, the method further comprises: When the consistency check does not pass, the network card stops performing consistency check on an unverified part of the data and stops sending a part of the data that has passed the check to the request end.
4. The method of claim 1, wherein, The network card is deployed in the request end, and after the consistency check on the data according to the check information, the method further comprises: When the consistency check does not pass, the network card stops writing a part of the data that has passed the check into a memory of the request end.
5. The method according to claim 1 or 4, characterized in that, The network card is deployed in the request end, and after the consistency check on the data according to the check information, the method further comprises: When the consistency check does not pass, the network card stops performing consistency check on an unverified part of the data.
6. The method of claim 1 or 2, wherein, The network card is deployed in the destination end, and the network card obtains an object, comprising: The network card receives a read request sent by the request end, and the read request is used to request reading of the data; The network card obtains the object from a memory of the destination end according to the read request.
7. The method according to claim 1 or 2, characterized in that, The network card is deployed in the destination end, and the network card provides the data to a memory of the request end, comprising: The network card sends the data to a network card of the request end, so that the network card of the request end sends the data to the memory of the request end.
8. The method of claim 1 or 4, wherein, The network card is deployed in the request end, and before the network card obtains an object, the method further comprises: The network card sends a read request to the destination end, and the read request is used to request reading of the data; The network card receives the object sent by the network card of the destination end, and the object is obtained in the destination end by the network card of the destination end based on the read request. The network card is deployed in the request end, and the network card provides the data to a memory of the request end, comprising:
9. The method of claim 1 or 4, wherein, The network card directly sends the data to the memory of the requestor.
10. A network card, characterized by The network card is a programmable network card and is configured with a remote direct memory access (RDMA) function, and the network card comprises: An obtaining unit is configured to obtain an object, the object carrying data requested by a requestor to read from a destination and check information of the data; The obtaining unit is further configured to obtain an identifier of description information of the object, and obtain the description information of the object based on the identifier of the description information and a mapping relationship stored by the network card, the mapping relationship reflecting a corresponding relationship between the description information and the identifier, and the description information being used to indicate an organization form of the object; A checking unit is configured to obtain the check information from the object based on the description information, and perform consistency check on the data according to the check information; A stripping unit is configured to perform a check information stripping operation on the object when the consistency check passes, and obtain the data. An interaction unit is configured to provide the data to the memory of the requestor.
11. The network card of claim 10, wherein, The network card is deployed in the destination, and the interaction unit is further configured to notify the requestor that the consistency check fails when the consistency check fails.
12. The network card of claim 10 or 11, wherein, The network card is deployed in the destination, The checking unit is further configured to stop performing consistency check on an unverified part of the data when the consistency check fails. The interaction unit is further configured to stop sending a part of the data that has passed the check to the requestor when the consistency check fails.
13. The network card of claim 10, wherein, The network card is deployed in the requestor, and the interaction unit is further configured to stop writing a part of the data that has passed the check into the memory of the requestor when the consistency check fails.
14. The network card of claim 10 or 13, wherein, The network card is deployed in the requestor, and the checking unit is further configured to stop performing consistency check on an unverified part of the data when the consistency check fails.
15. The network card of claim 10 or 11, wherein, The interaction unit is further configured to receive a read request sent by the requestor, the read request being used to request reading of the data. The obtaining unit is specifically configured to obtain the object from the memory of the destination according to the read request.
16. The network card of claim 10 or 11, wherein, The network card is deployed in the destination, and the interaction unit is specifically configured to send the data to the network card of the requestor, so that the network card of the requestor sends the data to the memory of the requestor.
17. The network card of claim 10 or 13, wherein, The network card is deployed in the requestor, and the interaction unit is further configured to send a read request to the destination, the read request being used to request reading of the data. The obtaining unit is specifically configured to receive the object sent by the network card of the destination based on the read request in the destination.
18. The network card of claim 10 or 13, wherein, The network card is deployed in the requestor, and the interaction unit is specifically configured to directly send the data to the memory of the requestor.
19. A computer device, comprising: The computer device comprises a network card and a memory, and the memory stores a computer program; when the network card executes the computer program, the method in any one of claims 1 to 9 is implemented.
20. A non-transitory computer-readable storage medium, comprising: When the instructions in the computer readable storage medium are executed by the network card, the network card executes the method of any one of claims 1 to 9.
Citation Information
Patent Citations
Data read-and-write requesting method, client end and data read-and-write requesting system
CN104125303A
Reliability maintenance method, system and device for product information and storage medium
CN110956284A