EP-4102349-B1 - DATA PROCESSING METHOD AND DEVICE
Inventors
- SHEN, YONG
- HE, YI
- CHENG, TAO
- LI, LI
Dates
- Publication Date
- 20260506
- Application Date
- 20210302
Claims (7)
- A data processing method performed by a network interface card device, the method comprising the steps of: • receiving (step 301) a second write request of a second client, wherein the second write request is used to write data to a data block of a storage node, wherein the second write request comprises an access address of the data block of the storage node; • after having received the second write request, receiving (step 303) a first write request of a first client, wherein the first write request is used to write data to the data block of the storage node, wherein the first write request comprises the access address; • determining (step 304), based on the first write request and based on metadata, that a conflict between the first write request and the second write request exists, wherein the conflict is that the data block to which the data of the first write request need to be stored is the same as the data block to which the data of the second write request are currently written, wherein the metadata represent a status attribute of the access address, and the status attribute of the access address comprises a number identifying a client currently performing access, wherein the client currently performing access is the second client by means of the second write request; and • processing (step 305) the conflict according to a processing policy generated by the network interface card device, wherein the processing of the conflict according to the processing policy comprises a processing of the data of the first write request according to the processing policy.
- The method according to claim 1, wherein, after the processing the conflict according to the processing policy, the method further comprises: ∘ receiving a feedback result from a processor of the storage node, wherein the feedback result indicates that writing of data of the second write request is completed; and ∘ clearing the status attribute of the metadata based on the feedback result.
- The method according to any one of claims 1 to 2, wherein the status attribute of the metadata comprises furthermore at least one of: a version number and a conflict status.
- The method according to any one of claims 1 to 3, wherein the processing the data of the first write request according to the processing policy comprises: ∘ discarding the data of the first write request; and ∘ sending a conflict notification to the first client, wherein the conflict notification is used to indicate that the first write request conflicts with the second write request.
- A network interface card device, wherein the network interface card device is configured to perform any of the methods according to claims 1 - 4.
- A computer storage medium, wherein the computer storage medium stores instructions, and when the instructions are executed by a network interface card device, the network interface card device is caused to perform any of the methods according to claims 1 - 4.
- A computer program product, wherein the computer program product stores instructions, and when the instructions are executed by a network interface card device, the network interface card device is caused to perform any of the methods according to claims 1 - 4.
Description
TECHNICAL FIELD Embodiments of this application relate to the field of computer technologies, and in particular, to a data processing method and a device thereof. BACKGROUND In a computer application field, a shared volume of a storage system may be accessed by a plurality of users, and read and write may be performed on the shared volume by the plurality of users. When a plurality of users access a same shared volume, software corresponding to the shared volume may be used for conflict management, to avoid a multi-user access conflict. When the software corresponding to the shared volume is used for conflict management, a storage node corresponding to the shared volume needs to participate in the conflict management, that is, a processor resource of the storage node needs to be occupied. Further, US 2016/124880 A1 refers to methods and systems for processing input/output requests. A network interface card (NIC) is coupled to a storage device via a peripheral link and accessible to a processor of a computing device executing instructions out of a memory device. The NIC is configured to receive a read/write request to read/write data; translate the read/write request to a storage device protocol used by the storage device coupled to the NIC; notify the storage device of the read/write request, without using the processor of the computing device, where the storage device reads/writes the data and notifies the NIC; and then the NIC prepares a response to the read/write request without having to use the processor of the computing device. SUMMARY Embodiments of this application provide a data processing method, a network interface card device, a computer storage medium, and a computer program product as defined by the appended claims. It can be learned from the technical solutions that embodiments of this application have the following advantages: In the embodiments of this application, when a write conflict occurs, first data to be written to a same data block is processed according to the processing policy generated by the network interface card device. This avoids participation by the processor of the storage node, and saves a resource of the processor of the storage node. BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a schematic diagram of a storage system framework according to an embodiment of this application;FIG. 2 is another schematic diagram of a storage system framework according to an embodiment of this application;FIG. 3 is a schematic flowchart of a data processing method according to an embodiment of this application;FIG. 4 is a schematic diagram of a structure of a network interface card device according to an embodiment of this application;FIG. 5 is a schematic diagram of another structure of a network interface card device according to an embodiment of this application; andFIG. 6 is a schematic diagram of another structure of a network interface card device according to an embodiment of this application. DESCRIPTION OF EMBODIMENTS Embodiments of this application provide a data processing method, which is used in data storage. When an access conflict occurs, the conflict is processed according to a processing policy generated by a network interface card device. This avoids participation by a processor of a storage node, and saves a resource of the processor of the storage node. FIG. 1 is a schematic diagram of a storage system framework according to this application. An embodiment of this application provides a storage system framework. The storage system framework includes at least two clients: a first client 101 and a second client 102, and at least one storage node 103. The first client 101 and the second client 102 each include a network interface card (NIC) device, and the storage node 103 includes a network interface card (NIC) device. The storage node 103 further includes a processor, such as a central processing unit (CPU). The first client is configured to store data onto the storage node 103. Referring to FIG. 2, the network interface card device of the storage node in this embodiment of this application includes a conflict detector. Metadata is preset in the conflict detector. Different metadata Sn corresponds to a different data block block n in the storage node. It should be noted that, one piece of metadata may correspond to one data block. Alternatively, one piece of metadata may correspond to a plurality of data blocks. This is not specifically limited herein. The data block is an address at which a client accesses data, that is, an access address. It should be noted that, a size of one data block may be configured to be 4K or 64K. It can be understood that, another size may be configured, for example, 128K. This is not specifically limited herein. When the first client needs to write data to a corresponding data block block 1, metadata S1 corresponding to the conflict detector of the network interface card device is used for determining. When no other client is writing data to the dat