Data storage method and device, intelligent network card and node equipment
By using the encapsulation and decapsulation mechanism of request identification and response identification between the computing node and the smart network card of the storage node, the problem of data loss caused by storage node failure in the separate storage architecture is solved, and the high reliability and simplified deployment process of data storage is achieved.
Patent Information
- Application Number
- CN202311825212.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2025-06-27
AI Technical Summary
In a separate storage architecture, the iSCSI protocol interaction between the computing node and the storage node cannot guarantee the reliability of storage, especially when the storage node fails, the arrived storage data may be lost.
By establishing a communication connection between the computing node and the intelligent network card of the storage node, generating and encapsulating request identification and response identification, ensuring the correct de-encapsulation and processing of storage requests and responses, determining that the request processing is normal or abnormal, thereby improving the reliability of data storage.
This enables improved reliability in data storage interaction between compute nodes and storage nodes, ensuring that data is not lost in the event of storage node failure, and simplifying deployment and reducing costs.
Smart Images

Figure CN120215809A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of data centers and data communication, and in particular, to a data storage method, apparatus, intelligent network card, and node device. Background Art
[0002] With the rapid development of data centers, the development speed of CPUs has been unable to meet the explosive growth of data, and the processing rate of CPUs can no longer meet the requirements of data processing. Therefore, data is gradually offloaded to network cards (network adapters) for processing, thereby reducing the burden on CPUs, which also promotes the rapid development of network cards. Currently, network cards can be divided into three categories: basic function network cards (also called standard network cards, abbreviated as standard cards), hardware offloading cards (also called traditional intelligent network cards), and DPU (Data Processing Unit) intelligent network cards. Standard cards have less offloading capabilities and are mainly used to provide higher bandwidth throughput; in addition to providing higher bandwidth throughput, traditional intelligent network cards also have more offloading capabilities, but they require server CPUs for management and will consume a large number of server CPU cores in high-capacity and high-rate data environments; DPU intelligent network cards also have independent CPUs on the basis of traditional intelligent network cards and do not rely on server CPUs for management, so the consumption of server CPUs is very small, and it is the most widely used DPU currently.
[0003] The rapid development of data centers not only requires high processing capabilities of CPUs but also high storage requirements. Under such requirements, distributed databases have emerged, which is also a relatively mature database deployment architecture currently. However, in the case of exponential growth of data volume and form, this "computing and storage integrated" distributed database has difficult-to-solve problems in terms of reliability, cost, resource utilization, etc. Therefore, a "computing and storage separated" separated storage architecture has emerged. The separated storage architecture is to separate the computing nodes and storage nodes on the basis of the distributed database and store the data in an independent storage system. The separated storage architecture has advantages such as higher reliability, better resource utilization, and lower deployment costs, and it is a relatively advanced database deployment architecture currently. The present invention is applied to the separated storage architecture.
[0004] In a separated storage architecture, the computing node and the storage node are separated. Communication between the computing node and the storage node relies on an external network. Currently, in widespread application, both the servers of the computing node and the storage node are equipped with standard cards and interact through the iSCSI (Internet Small Computer System Interface) protocol to store the data of the computing node onto the disk of the storage node server. However, the unloading capacity of the standard card is very limited and cannot reduce the CPU burden of the computing node server. Therefore, the computing node server is equipped with a DPU smart network card to reduce the CPU burden. Similarly, the storage node server can also be equipped with a DPU smart network card to reduce the CPU burden.
[0005] In such an environment, the computing node and the storage node still interact through the iSCSI protocol. However, the establishment and maintenance of the iSCSI connection are both undertaken by the DPU smart network card. The iSCSI protocol uses TCP (Transmission Control Protocol) for transmission, ensuring the network reliability between the computing node and the storage node, but unable to guarantee the reliability of storage. For example, when the storage node server fails, the stored data that has reached the storage node server and is waiting to be processed will be completely lost. Even if the storage node server recovers, this part of the stored data cannot be restored. Summary of the Invention
[0006] The purpose of the present invention is to provide a data storage method, device, smart network card, and node device, which can improve the reliability of data storage.
[0007] The embodiments of the present invention can be implemented as follows:
[0008] In a first aspect, the present invention provides a data storage method, which is applied to a smart network card installed on a computing node. The smart network card of the computing node is communicatively connected to the smart network card of the storage node. The method includes:
[0009] Receiving an original storage request sent by the computing node;
[0010] Generating a request identifier for the original storage request and encapsulating the request identifier and the original storage request into a storage request message;
[0011] Send the storage request message to the smart network card of the storage node to instruct the smart network card of the storage node to decompose and encapsulate the storage request message to obtain the original storage request and the request identifier, and send the original storage request to the storage node. When the smart network card of the storage node receives the original storage response returned by the storage node for the original storage request, generate a corresponding response identifier according to the request identifier and encapsulate the response identifier and the original storage response into a storage response message and then return it to the smart network card of the computing node;
[0012] Receive the storage response message returned by the smart network card of the storage node;
[0013] Decompose and encapsulate the storage response message to obtain the response identifier and the original storage response in the storage response message;
[0014] If the response identifier and the request identifier satisfy the preset corresponding relationship, it is determined that the storage request is processed normally, and the original storage response is returned to the computing node.
[0015] In an alternative embodiment, the method further includes:
[0016] If the response identifier and the preset corresponding relationship or the storage response message returned by the smart network card of the storage node for the storage request message is not received within the preset response duration, it is determined that the storage request is processed abnormally.
[0017] In an alternative embodiment, the method further includes:
[0018] If the storage request is processed abnormally, further determine whether the communication between this smart network card and the smart network card of the storage node is normal;
[0019] If the communication between this smart network card and the smart network card of the storage node is normal, resend the storage request message to the smart network card of the storage node, where the storage request message carries the request identifier.
[0020] In an alternative embodiment, the step of determining whether the communication between this smart network card and the smart network card of the storage node is normal includes:
[0021] Construct a keep-alive request message;
[0022] Perform keep-alive detection using the keep-alive request message to obtain a detection result;
[0023] If the detection results for a continuous preset number of times all indicate normal keep-alive, it is determined that the communication between this intelligent network card and the intelligent network card of the storage node is normal; otherwise, it is determined that the communication between this intelligent network card and the intelligent network card of the storage node is abnormal.
[0024] In an alternative embodiment, the step of using the keep-alive request message to perform a keep-alive detection and obtain a detection result includes:
[0025] Send the keep-alive request message to the intelligent network card of the storage node;
[0026] If a keep-alive response message returned by the intelligent network card of the storage node for the keep-alive request message is received within a preset keep-alive duration, a detection result indicating normal keep-alive is obtained; otherwise, a detection result indicating abnormal keep-alive is obtained.
[0027] In a second aspect, the present invention provides a data storage method applied to an intelligent network card mounted on a storage node, where the intelligent network card of the storage node is communicatively connected to the intelligent network card of a computing node. The method includes:
[0028] Receive a storage request message sent by the intelligent network card of the computing node. The storage request message is obtained by the intelligent network card of the computing node generating a request identifier for the original storage request and encapsulating the request identifier and the original storage request after receiving the original storage request sent by the computing node;
[0029] Unencapsulate the storage request message to obtain the original storage request and the request identifier in the storage request message, and send the original storage request to the storage node;
[0030] Receive the original storage response returned by the storage node for the original storage request;
[0031] Generate a corresponding response identifier according to the request identifier and encapsulate the response identifier and the original storage response into a storage response message;
[0032] Send the storage response message to the intelligent network card of the computing node, so that the intelligent network card of the computing node unencapsulates the received storage response message to obtain the response identifier and the original storage response, and determines that the storage request is processed normally when the response identifier and the request identifier satisfy a preset corresponding relationship, and returns the original storage response to the computing node.
[0033] In a third aspect, the present invention provides a data storage device applied to an intelligent network card mounted on a computing node, where the intelligent network card of the computing node is communicatively connected to the intelligent network card of a storage node. The device includes:
[0034] An original request receiving module, configured to receive an original storage request sent by the computing node;
[0035] A request encapsulation module, configured to generate a request identifier for the original storage request, and encapsulate the request identifier and the original storage request into a storage request message;
[0036] A request sending module, configured to send the storage request message to the smart network card of the storage node, so as to instruct the smart network card of the storage node to de-encapsulate the storage request message to obtain the original storage request and the request identifier, and send the original storage request to the storage node. When the smart network card of the storage node receives an original storage response returned by the storage node for the original storage request, generate a corresponding response identifier according to the request identifier, and encapsulate the response identifier and the original storage response into a storage response message and then return it to the smart network card of the computing node;
[0037] A message response receiving module, configured to receive the storage response message returned by the smart network card of the storage node;
[0038] A response de-encapsulation module, configured to de-encapsulate the storage response message to obtain the response identifier and the original storage response in the storage response message;
[0039] A determination module, configured to determine that the storage request is processed normally and return the original storage response to the computing node if the response identifier and the request identifier satisfy a preset corresponding relationship.
[0040] In a fourth aspect, the present invention provides a data storage device, which is applied to the smart network card carried on the storage node. The smart network card of the storage node is communicatively connected to the smart network card of the computing node. The device includes:
[0041] A message request receiving module, configured to receive a storage request message sent by the smart network card of the computing node. The storage request message is obtained by generating a request identifier for the original storage request and encapsulating the request identifier and the original storage request after the smart network card of the computing node receives the original storage request sent by the computing node;
[0042] A request de-encapsulation module, configured to de-encapsulate the storage request message to obtain the original storage request and the request identifier in the storage request message and send the original storage request to the storage node;
[0043] An original response receiving module, configured to receive an original storage response returned by the storage node for the original storage request;
[0044] A response encapsulation module, configured to generate a corresponding response identifier according to the request identifier and encapsulate the response identifier and the original storage response into a storage response message;
[0045] A response sending module, configured to send the storage response message to the smart network card of the computing node, so as to instruct the smart network card of the computing node to de-encapsulate the storage response message to obtain the response identifier and the original storage response, and determine that the storage request is processed normally when the response identifier and the request identifier meet a preset corresponding relationship, and return the original storage response to the computing node.
[0046] In a fifth aspect, the present invention provides a smart network card, including a processor and a memory, where the memory is used to store a program, and the processor is used to implement the data storage method described in the foregoing first aspect or the data storage method described in the foregoing second aspect when executing the program.
[0047] In a sixth aspect, the present invention provides a node device equipped with the smart network card described in the foregoing fifth aspect.
[0048] The embodiments of the present invention provide a data storage method, apparatus, smart network card, and node device. When the smart network card of a computing node encapsulates an original storage request into a storage request message, it adds a request identifier generated for it, and sends the storage request message encapsulated with the request identifier to the smart network card of a storage node. The smart network card of the storage node de-encapsulates the storage request message to obtain the original storage request and the request identifier, and sends the original storage request to the storage node. The storage node returns an original storage response for the original storage request. When the smart network card of the storage node encapsulates the original storage response into a storage response message, it generates and adds a response identifier according to the request identifier, and returns the storage response message carrying the response identifier to the smart network card of the computing node. The smart network card of the computing node de-encapsulates the response identifier in the storage response message, and compares the parsed response identifier with the request identifier added when it encapsulates the storage request message. If the two meet a preset corresponding relationship, it is determined that the storage request is processed normally, thereby improving the reliability of data storage. Description of the Drawings
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0050] Figure 1 It is an example diagram of the split storage architecture provided in this embodiment.
[0051] Figure 2 The block diagram example of the intelligent network card provided in this embodiment.
[0052] Figure 3 The flowchart example of the data storage method of the intelligent network card applied to the computing node provided in this embodiment.
[0053] Figure 4 The flowchart example of the data storage method of the intelligent network card applied to the storage node provided in this embodiment.
[0054] Figure 5 The interactive flowchart example of the data storage method provided in this embodiment.
[0055] Figure 6 The block diagram example of the first data storage device provided in this embodiment.
[0056] Figure 7 The block diagram example of the second data storage device provided in this embodiment.
[0057] Icons: 10 - intelligent network card; 11 - processor; 12 - memory; 13 - hardware logic firmware; 14 - bus; 20 - node device; 100 - first data storage device; 110 - original request receiving module; 120 - request encapsulation module; 130 - request sending module; 140 - message response receiving module; 150 - response de - encapsulation module; 160 - determination module; 170 - keep - alive module; 200 - second data storage device; 210 - message request receiving module; 220 - request de - encapsulation module; 230 - original response receiving module; 240 - response encapsulation module; 250 - response sending module. Detailed implementation manners
[0058] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and illustrated herein can be arranged and designed in various different configurations.
[0059] Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed present invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of the present invention.
[0060] It should be noted that similar reference numerals and letters indicate similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0061] In the description of the present invention, it should be noted that if terms such as "upper", "lower", "inner", "outer", etc. are used to indicate the orientation or positional relationship, it is based on the orientation or positional relationship shown in the figures, or the orientation or positional relationship in which the product of the present invention is usually placed during use. This is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the present invention.
[0062] In addition, terms such as "first", "second", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0063] It should be noted that, without conflict, the features in the embodiments of the present invention can be combined with each other.
[0064] Please refer to Figure 1 , Figure 1 , which is an example diagram of the distributed storage architecture provided for this embodiment. Figure 1 In, the computing node and the storage node are communicatively connected. One way of communication connection is that the two are directly connected through the intelligent network cards carried by each of them for communication. Another way of communication connection is that the two communicate through the intelligent network cards carried by each of them and an external network. The external network can be one or more switches or routers.
[0065] Figure 1 In the distributed storage architecture of, the computing node is a server that provides data computing and processing, and can be any node device in a single server or a server cluster. The storage node is a server that provides data storage services, and can be any storage node device in a single server or a storage cluster. The intelligent network card is a DPU intelligent network card. The computing node is not configured with a local disk. The data to be stored is transmitted to the storage node through the intelligent network card and stored in the disk of the storage node, and is managed and maintained by the storage node. The computing node and the storage node mainly interact through the iSCSI protocol, and the respective DPU intelligent network cards are responsible for the establishment and maintenance of the iSCSI connection.
[0066] Figure 1In the following, the principle of establishing an iSCSI connection between the computing node and the storage node is as follows: The storage node provides disks and acts as the iSCSI target side. The DPU smart network card of the storage node provides a network device interface for communication to the storage node through the virtio-net driver. The storage node can directly send data to the DPU smart network card of this node or send data to the DPU smart network card of this node through this network device interface; The DPU smart network card of the computing node acts as an iSCSI client and establishes an access connection with the iSCSI target side through the iSCSI protocol, thereby mounting the disks on the storage node and providing the mounted disks to the computing node through the virtio-blk driver. Thus, block devices such as / dev / vda, / dev / vdb, etc. can be seen on the computing node. The computing node only needs to store the stored data in these specified block devices. At this time, the stored data will be sent to the DPU smart network card of the computing node in the form of several storage requests through the virtio_blk driver, and then reach the disks of the storage node through the external network and the DPU smart network card of the storage node.
[0067] Both the DPU smart network card of the computing node and the DPU smart network card of the storage node include hardware logic firmware. Figure 1 The hardware logic firmware in is FPGA (Field Programmable Gate Array). The FPGA runs a network function set responsible for network communication and a storage function set responsible for data storage. The process of the computing node storing data to the storage node is as follows:
[0068] After the DPU smart network card of the computing node receives a storage request, it is first processed by the storage function set, mainly adding storage-related encapsulation, and then handed over to the network function set for processing, mainly encapsulating the storage request into a network packet conforming to the network frame format, and then sending the network packet to the DPU smart network card of the storage node through the external network.
[0069] After the DPU smart network card of the storage node receives the encapsulated network packet, it is first processed by the network function set to de-encapsulate the network packet into a storage request, and then handed over to the storage function set for processing, de-encapsulating the storage-related encapsulation to obtain the original storage request, and then sending the original storage request to the storage node through the virtio-net driver. After that, the storage node processes it and stores the data in the disk, and then the storage node returns a storage response for the original storage request to the DPU smart network card of the storage node.
[0070] The storage response processing flow is similar to the storage request processing flow, except that it is from the storage node to the computing node. After the computing node receives the storage response, it considers that the sent storage request has been processed normally. The storage response processing flow will not be repeated here.
[0071] based on Figure 1 This embodiment also provides a block diagram of an intelligent network card 10, please refer to Figure 2 , Figure 2 The block diagram of the smart network card provided in this embodiment is as follows. The smart network card 10 may be Figure 1 The DPU smart network card of the computing node can also be the DPU smart network card of the storage node. Figure 2 In the figure, the smart network card 10 includes a processor 11, a memory 12, hardware logic firmware 13 and a bus 14.
[0072] The processor 11 may be an integrated circuit chip having signal processing capability. In the implementation process, each step of the virtual machine backup method may be completed by an integrated logic circuit of hardware in the processor 11 or by instructions in the form of software. The above-mentioned processor 11 may be a general-purpose processor, including a CPU (Central Processing Unit), a NP (Network Processor), etc.; it may also be a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0073] As another implementation, the memory 12 is used to store programs, such as the data storage device of the smart network card applied to the computing node or the data storage device of the smart network card applied to the storage node in this embodiment. The data storage device of the smart network card applied to the computing node or the data storage device of the smart network card applied to the storage node includes at least one software function module that can be stored in the memory 12 in the form of software or firmware or fixed in the smart network card 10. After receiving the execution instruction, the processor 11 executes the program to implement the data storage method of the smart network card applied to the computing node or the data storage method of the smart network card applied to the storage node disclosed in this embodiment.
[0074] As another implementation, the hardware logic firmware 13 can be an FPGA, an ASIC, etc. The data storage device of the intelligent network card applied to the computing node or the data storage device of the intelligent network card applied to the storage node in this embodiment can also be stored in the software function module of the hardware logic firmware 13, and the hardware logic firmware 13 executes the software function module to implement the data storage method of the intelligent network card applied to the computing node or the data storage method of the intelligent network card applied to the storage node disclosed in this embodiment. This implementation method belongs to the logical code modification at the hardware level, does not involve software modification, and does not consume the CPU resources of the intelligent network card or the node device 20.
[0075] The intelligent network card 10 is communicatively connected to the node device 20 through the bus 14, and the node device 20 can be Figure 1 the computing node or the storage node in
[0076] Based on Figure 1 and Figure 2 the above, this embodiment further provides a data storage method for an intelligent network card applied to a computing node. Please refer to Figure 3 Figure 3 FIG.
[0077] Step S101: Receive the original storage request sent by the computing node.
[0078] In this embodiment, the original storage request is a storage request sent when the computing node needs to store data. The original storage request is first sent to the intelligent network card of the computing node.
[0079] Step S102: Generate a request identifier for the original storage request, and encapsulate the request identifier and the original storage request into a storage request message.
[0080] In this embodiment, the request identifier is used to uniquely represent the corresponding original storage request. As an implementation method, the request identifier can start from 0x0, one request identifier corresponds to one original storage request, and the request identifier increases sequentially as the number of original storage requests increases. For example, the request identifier of the first original storage request is 0x0, the request identifier of the second original storage request is 0x1, and the maximum value of the request identifier is 0xFE. When the maximum value is reached, the request identifier starts from 0x0 again. In decimal representation, the range of the request identifier is 0 to 254, a total of 255. The request identifier in the embodiment of the present invention occupies 1 byte. Merely as an example, the present application does not impose any restrictions on the specific settings of the request identifier and the response identifier.
[0081] In this embodiment, a method of encapsulating a request identifier and an original storage request into a storage request message is as follows: The storage request message is obtained by successively performing storage encapsulation and network encapsulation on the original storage request. When performing storage encapsulation, in addition to adding storage-related information, a request identifier is also added. Network encapsulation is the encapsulation performed to add network transmission information to the original storage request after storage encapsulation to make it conform to the network frame format of the network message.
[0082] Step S103: Send the storage request message to the smart network card of the storage node to instruct the smart network card of the storage node to perform decapsulation on the storage request message to obtain the original storage request and the request identifier, and send the original storage request to the storage node. When the smart network card of the storage node receives the original storage response returned by the storage node for the original storage request, generate a corresponding response identifier according to the request identifier, and encapsulate the response identifier and the original storage response into a storage response message and then return it to the smart network card of the computing node.
[0083] In this embodiment, the response identifier is generated according to the request identifier. As an example of an implementation method, response identifier = request identifier + 1. When the request identifier is 0x0, the corresponding response identifier is 0x1. The above is only an embodiment, and the specific correspondence relationship between the request identifier and the response identifier is not limited in this application.
[0084] Step S104: Receive the storage response message returned by the smart network card of the storage node.
[0085] Step S105: Perform decapsulation on the storage response message to obtain the response identifier and the original storage response in the storage response message.
[0086] In this embodiment, the process of the smart network card of the storage node encapsulating the original storage response to obtain the storage response message is similar to the process of the smart network card of the computing node encapsulating the original storage request to obtain the storage request message, which will not be elaborated here. The process of the smart network card of the computing node performing decapsulation on the storage response message is the reverse process of the smart network card of the storage node encapsulating the original storage response to obtain the storage response message. One decapsulation method is as follows: First, perform network decapsulation on the storage response message. Network decapsulation can remove the network transmission information in the storage response message. Then, perform storage decapsulation on the storage response message after network decapsulation to obtain the original storage response and the response identifier.
[0087] Step S106: If the response identifier and the request identifier satisfy the preset correspondence relationship, it is determined that the storage request is processed normally, and the original storage response is returned to the computing node.
[0088] In this embodiment, for the original storage request and its corresponding original response request, since the response identifier is generated based on the request identifier, when the storage request is processed normally, there is a preset correspondence between them. For example, the preset correspondence is that the response identifier is 1 greater than the request identifier.
[0089] The above method provided in this embodiment improves the reliability of data storage by adding a request identifier to the original storage request, then adding a response identifier determined according to the request identifier to the original response request, and determining that the storage request is processed normally when the request identifier and the response identifier satisfy the preset correspondence.
[0090] In this embodiment, in order to be able to timely determine that the storage request is processed abnormally, so as to timely process the abnormal storage request to improve the reliability of data storage in case of abnormality, this embodiment also provides a method for determining that the storage request is processed abnormally:
[0091] If the response identifier and the request identifier do not satisfy the preset correspondence or the storage response message returned by the smart network card of the storage node for the storage request message is not received within the preset response duration, it is determined that the storage request is processed abnormally.
[0092] In this embodiment, the preset response duration can be set according to the actual network communication quality and network environment. For example, the preset response duration is 2ms.
[0093] In this embodiment, when the storage request is processed abnormally, in order to ensure the reliability of data storage as much as possible, this embodiment also provides a method for retransmitting the storage request message:
[0094] If the storage request is processed abnormally, further determine whether the communication between the smart network card of this device and the smart network card of the storage node is normal;
[0095] If the communication between the smart network card of this device and the smart network card of the storage node is normal, re - send the storage request message to the smart network card of the storage node, where the storage request message carries the request identifier.
[0096] The re - transmission method provided in this embodiment increases the possibility of successful re - transmission because it is carried out on the premise of ensuring the normal communication between the smart network card of this device and the smart network card of the storage node.
[0097] In an alternative embodiment, in order to accurately determine whether the communication between the smart network card of this device and the smart network card of the storage node is normal, one implementation method is:
[0098] First, construct a keep - alive request message;
[0099] In this embodiment, the keep-alive request message can be a network request message constructed by the intelligent network card of the computing node and conforming to the format of a layer-2 Ethernet frame.
[0100] Secondly, perform keep-alive detection using the keep-alive request message to obtain a detection result;
[0101] In this embodiment, the keep-alive detection can be that the intelligent network card of the computing node periodically sends a keep-alive request message to the intelligent network card of the storage node at a preset period, and determines the detection result according to the response feedback by the intelligent network card of the storage node. The detection result includes normal keep-alive and abnormal keep-alive. The preset period can be set according to the requirements of the actual application scenario. For example, the preset period is set to 1 ms. As an implementation manner of obtaining the detection result, it can be:
[0102] Send a keep-alive request message to the intelligent network card of the storage node;
[0103] If a keep-alive response message returned by the intelligent network card of the storage node for the keep-alive request message is received within the preset keep-alive duration, a detection result indicating normal keep-alive is obtained; otherwise, a detection result indicating abnormal keep-alive is obtained.
[0104] In this embodiment, the preset keep-alive duration can be set according to the actual network communication quality and network environment. For example, the preset keep-alive duration is 2 ms.
[0105] Finally, if the detection results of consecutive preset times all indicate normal keep-alive, it is determined that the communication between the intelligent network card of this node and the intelligent network card of the storage node is normal; otherwise, it is determined that the communication between the intelligent network card of this node and the intelligent network card of the storage node is abnormal.
[0106] In this embodiment, the preset number of times can be set according to the level of reliability requirements. If the reliability requirements are high, the preset number of times is set to be more; conversely, it is set to be less. For example, the preset number of times is set to 3.
[0107] To cooperate with the data storage of the intelligent network card of the computing node, this embodiment is based on Figure 1 and Figure 2 , and also provides a data storage method for the intelligent network card of the storage node. Please refer to Figure 4 , Figure 4 is a flowchart example of the data storage method for the intelligent network card of the storage node provided in this embodiment. The method includes the following steps:
[0108] Step S201: Receive a storage request message sent by the intelligent network card of the computing node. The storage request message is obtained after the intelligent network card of the computing node generates a request identifier for the original storage request and encapsulates the request identifier and the original storage request after receiving the original storage request sent by the computing node;
[0109] Step S202: Unencapsulate the storage request message to obtain the original storage request and the request identifier in the storage request message, and send the original storage request to the storage node;
[0110] Step S203: Receive the original storage response returned by the storage node for the original storage request;
[0111] Step S204: Generate a corresponding response identifier according to the request identifier, and encapsulate the response identifier and the original storage response into a storage response message;
[0112] In this embodiment, as an implementation manner, first encapsulate the original storage response into a response message according to the request identifier, then perform storage encapsulation on the response message to obtain a storage response, and then perform network encapsulation on the storage response to obtain a storage response message.
[0113] Step S205: Send the storage response message to the smart network card of the computing node to instruct the smart network card of the computing node to unencapsulate the storage response message to obtain the response identifier and the original storage response, and determine that the storage request is processed normally when the response identifier and the request identifier meet the preset corresponding relationship, and return the original storage response to the computing node.
[0114] The above method provided in this embodiment achieves the purpose of improving the reliability of data storage by cooperating with the data storage of the smart network card of the computing node.
[0115] In this embodiment, in order to more clearly illustrate the whole process of data storage, this embodiment also gives the interaction process between the computing node and the storage node in the data storage method. Please refer to Figure 5 , Figure 5 which is the interaction process example diagram of the data storage method provided in this embodiment. Figure 5 The interaction process in
[0116] S1: The computing node sends an original storage request to the smart network card of the computing node;
[0117] S2: The smart network card of the computing node generates a request identifier and sequentially performs storage encapsulation and network encapsulation on the original storage request to obtain a storage request message;
[0118] S3: The smart network card of the computing node sends the storage request message to the smart network card of the storage node;
[0119] S4: The smart network card of the storage node sequentially performs network unencapsulation and storage unencapsulation on the storage request message to obtain the request identifier and the original storage request;
[0120] S5: The smart network card of the storage node sends the original storage request to the storage node;
[0121] S6: The storage node returns the original storage response for the original storage request to the smart network card of the storage node.
[0122] S7: The smart network card of the storage node generates a response identifier according to the request identifier.
[0123] S8: The smart network card of the storage node performs storage encapsulation and network encapsulation on the original storage response in sequence to obtain a storage response message.
[0124] S9: The smart network card of the storage node sends the storage response message to the smart network card of the computing node.
[0125] S10: The smart network card of the computing node performs network de-encapsulation and storage de-encapsulation on the storage response message in sequence to obtain the response identifier and the original storage response.
[0126] S11: The smart network card of the computing node determines whether the request is processed normally according to whether the request identifier and the response identifier satisfy the corresponding relationship.
[0127] To execute the corresponding steps in the above embodiments and various possible implementation manners, the implementation manner of the first data storage device 100 is given below. Please refer to Figure 6 , Figure 6 The block diagram of the first data storage device 100 provided in the embodiment of the present invention is shown. It should be noted that the basic principle and the technical effects generated by the first data storage device 100 provided in this embodiment are the same as those in the above embodiments. For the sake of brief description, some parts of this embodiment are not mentioned.
[0128] The first data storage device 100 is applied to Figure 1 the smart network card mounted on the computing node. The smart network card of the computing node is communicatively connected to the smart network card of the storage node. The first data storage device 100 includes an original request receiving module 110, a request encapsulation module 120, a request sending module 130, a message response receiving module 140, a response de-encapsulation module 150, a determination module 160, and a keep-alive module 170.
[0129] The original request receiving module 110 is configured to receive the original storage request sent by the computing node.
[0130] The request encapsulation module 120 is configured to generate a request identifier for the original storage request and encapsulate the request identifier and the original storage request into a storage request message.
[0131] A request sending module 130, configured to send the storage request message to the smart network card of the storage node, so as to instruct the smart network card of the storage node to decapsulate the storage request message to obtain the original storage request and the request identifier, and send the original storage request to the storage node. When the smart network card of the storage node receives the original storage response returned by the storage node for the original storage request, generate a corresponding response identifier according to the request identifier, encapsulate the response identifier and the original storage response into a storage response message, and then return it to the smart network card of the computing node;
[0132] A message response receiving module 140, configured to receive the storage response message returned by the smart network card of the storage node;
[0133] A response decapsulation module 150, configured to decapsulate the storage response message to obtain the response identifier and the original storage response in the storage response message;
[0134] A determination module 160, configured to determine that the storage request is processed normally and return the original storage response to the computing node if the response identifier and the request identifier satisfy a preset corresponding relationship.
[0135] In an alternative embodiment, the determination module 160 is further configured to: determine that the storage request is processed abnormally if the response identifier and the request identifier do not satisfy the preset corresponding relationship or the storage response message returned by the smart network card of the storage node for the storage request message is not received within a preset response duration.
[0136] In an alternative embodiment, a keep-alive module 170 is configured to: further determine whether the communication between this smart network card and the smart network card of the storage node is normal if the storage request is processed abnormally; if the communication between this smart network card and the smart network card of the storage node is normal, resend the storage request message to the smart network card of the storage node, where the storage request message carries the request identifier.
[0137] In an alternative embodiment, when the keep-alive module 170 is configured to determine whether the communication between this smart network card and the smart network card of the storage node is normal, it is specifically configured to: construct a keep-alive request message; perform a keep-alive detection using the keep-alive request message to obtain a detection result; if the detection results of a preset number of consecutive times all indicate normal keep-alive, determine that the communication between this smart network card and the smart network card of the storage node is normal, otherwise, determine that the communication between this smart network card and the smart network card of the storage node is abnormal.
[0138] In an alternative embodiment, when the keep-alive module 170 is used to perform keep-alive detection using a keep-alive request message and obtain a detection result, it is specifically configured to: send a keep-alive request message to the smart network card of the storage node; if a keep-alive response message returned by the smart network card of the storage node for the keep-alive request message is received within a preset keep-alive duration, a detection result indicating normal keep-alive is obtained, otherwise a detection result indicating abnormal keep-alive is obtained.
[0139] To execute the corresponding steps in the above embodiments and each possible implementation manner, the implementation manner of the second data storage device 200 is given below. Please refer to Figure 7 , Figure 7 FIG. shows a block diagram of the second data storage device 200 provided by the embodiments of the present invention. It should be noted that the second data storage device 200 provided in this embodiment has the same basic principle and technical effects as those in the above embodiments. For the sake of brief description, some parts of this embodiment are not mentioned.
[0140] The second data storage device 200 is applied to Figure 1 the smart network card mounted on the storage node in, and the smart network card of the storage node is communicatively connected to the smart network card of the computing node. The second data storage device 200 includes a message request receiving module 210, a request de-encapsulation module 220, an original response receiving module 230, a response encapsulation module 240, and a response sending module 250.
[0141] The message request receiving module 210 is configured to receive a storage request message sent by the smart network card of the computing node. The storage request message is obtained by the smart network card of the computing node generating a request identifier for the original storage request and encapsulating the request identifier and the original storage request after receiving the original storage request sent by the computing node.
[0142] The request de-encapsulation module 220 is configured to de-encapsulate the storage request message to obtain the original storage request and the request identifier in the storage request message and send the original storage request to the storage node.
[0143] The original response receiving module 230 is configured to receive the original storage response returned by the storage node for the original storage request.
[0144] The response encapsulation module 240 is configured to generate a corresponding response identifier according to the request identifier and encapsulate the response identifier and the original storage response into a storage response message.
[0145] A response sending module 250 is configured to send the stored response message to the smart network card of the computing node, so as to instruct the smart network card of the computing node to decapsulate the stored response message to obtain a response identifier and an original stored response, and determine that the storage request is processed normally when the response identifier and the request identifier meet a preset corresponding relationship, and return the original stored response to the computing node.
[0146] An embodiment of the present invention provides a node device, which is a smart network card mounted on a computing node or a storage node to implement the data storage method in the foregoing embodiment.
[0147] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the data storage method applied to the smart network card mounted on the computing node in the foregoing embodiment, or implements the data storage method applied to the smart network card mounted on the storage node in the foregoing embodiment.
[0148] In summary, an embodiment of the present invention provides a data storage method, apparatus, smart network card, and node device, which are applied to the smart network card mounted on the computing node. The smart network card of the computing node is communicatively connected to the smart network card of the storage node. The method includes: receiving an original storage request sent by the computing node; generating a request identifier for the original storage request, and encapsulating the request identifier and the original storage request into a storage request message; sending the storage request message to the smart network card of the storage node, so as to instruct the smart network card of the storage node to decapsulate the storage request message to obtain the original storage request and the request identifier, and send the original storage request to the storage node. When the smart network card of the storage node receives the original stored response returned by the storage node for the original storage request, a corresponding response identifier is generated according to the request identifier, and the response identifier and the original stored response are encapsulated into a stored response message and then returned to the smart network card of the computing node. Compared with the prior art, this embodiment has at least the following advantages: (1) By adding a request identifier to the original storage request, and then adding a response identifier determined according to the request identifier to the original response request, it is determined that the storage request is processed normally when it is determined that the request identifier and the response identifier meet a preset corresponding relationship, thereby improving the reliability of data storage; (2) The implementation manner of executing the data storage method in this embodiment by the hardware logic firmware 13 belongs to the logical code modification at the hardware level, does not involve software modification, and does not consume the CPU resources of the smart network card or the node device 20; (3) Before retransmitting the storage request, a network keep-alive detection is first performed, and the retransmission is performed when the communication is normal, avoiding repeatedly retransmitting the storage request when the network itself is not connected, and reducing resource consumption; (4) The data storage method provided in this embodiment can achieve the reliability of data storage in a simple environment of one computing node and one storage node, without adding backup computing nodes and storage nodes to ensure the reliability of data storage, simplifying the environment deployment and reducing the deployment cost.
[0149] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A data storage method, characterized in that, Applied to the intelligent network card mounted on the computing node, the intelligent network card of the computing node is communicatively connected to the intelligent network card of the storage node. The method includes: Receiving an original storage request sent by the computing node; Generating a request identifier for the original storage request, and encapsulating the request identifier and the original storage request into a storage request message; Sending the storage request message to the intelligent network card of the storage node, to instruct the intelligent network card of the storage node to de-encapsulate the storage request message to obtain the original storage request and the request identifier, and send the original storage request to the storage node. When the intelligent network card of the storage node receives an original storage response returned by the storage node for the original storage request, generating a corresponding response identifier according to the request identifier, and encapsulating the response identifier and the original storage response into a storage response message and then returning it to the intelligent network card of the computing node; Receiving the storage response message returned by the intelligent network card of the storage node; De-encapsulating the storage response message to obtain the response identifier and the original storage response in the storage response message; If the response identifier and the request identifier satisfy a preset corresponding relationship, it is determined that the storage request is processed normally, and the original storage response is returned to the computing node.
2. The data storage method according to claim 1, wherein The method further includes: If the response identifier and the request identifier do not satisfy the preset corresponding relationship or the intelligent network card of the storage node does not return a storage response message for the storage request message within a preset response duration, it is determined that the storage request is processed abnormally.
3. The data storage method according to claim 2, wherein The method further includes: If the storage request is processed abnormally, further determining whether the communication between this intelligent network card and the intelligent network card of the storage node is normal; If the communication between this intelligent network card and the intelligent network card of the storage node is normal, resending the storage request message to the intelligent network card of the storage node, where the storage request message carries the request identifier.
4. The data storage method according to claim 3, characterized in that, The step of determining whether the communication between this intelligent network card and the intelligent network card of the storage node is normal includes: Constructing a keep-alive request message; Performing a keep-alive detection using the keep-alive request message to obtain a detection result; If the detection results of a preset number of consecutive times all indicate normal keep-alive, it is determined that the communication between this intelligent network card and the intelligent network card of the storage node is normal, otherwise, it is determined that the communication between this intelligent network card and the intelligent network card of the storage node is abnormal.
5. The data storage method according to claim 4, wherein The step of performing a keep-alive detection using the keep-alive request message to obtain a detection result includes: Sending the keep-alive request message to the intelligent network card of the storage node; If a keep-alive response message returned by the intelligent network card of the storage node for the keep-alive request message is received within a preset keep-alive duration, a detection result indicating normal keep-alive is obtained, otherwise a detection result indicating abnormal keep-alive is obtained.
6. A data storage method, characterized in that, Applied to the intelligent network card mounted on the storage node, the intelligent network card of the storage node is communicatively connected to the intelligent network card of the computing node. The method includes: Receive a storage request message sent by the smart network card of the computing node. The storage request message is obtained by the smart network card of the computing node generating a request identifier for the original storage request and encapsulating the request identifier and the original storage request after receiving the original storage request sent by the computing node; Decapsulate the storage request message to obtain the original storage request and the request identifier in the storage request message, and send the original storage request to the storage node; Receive the original storage response returned by the storage node for the original storage request; Generate a corresponding response identifier according to the request identifier and encapsulate the response identifier and the original storage response into a storage response message; Send the storage response message to the smart network card of the computing node to instruct the smart network card of the computing node to decapsulate the storage response message to obtain the response identifier and the original storage response, and determine that the storage request is processed normally when the response identifier and the request identifier meet a preset correspondence relationship, and return the original storage response to the computing node.
7. A data storage device, characterized in that, Applied to the smart network card carried on the computing node, the smart network card of the computing node is communicatively connected to the smart network card of the storage node. The device includes: An original request receiving module, configured to receive the original storage request sent by the computing node; A request encapsulation module, configured to generate a request identifier for the original storage request and encapsulate the request identifier and the original storage request into a storage request message; A request sending module, configured to send the storage request message to the smart network card of the storage node to instruct the smart network card of the storage node to decapsulate the storage request message to obtain the original storage request and the request identifier, send the original storage request to the storage node, and when the smart network card of the storage node receives the original storage response returned by the storage node for the original storage request, generate a corresponding response identifier according to the request identifier and encapsulate the response identifier and the original storage response into a storage response message and then return it to the smart network card of the computing node; A message response receiving module, configured to receive the storage response message returned by the smart network card of the storage node; A response decapsulation module, configured to decapsulate the storage response message to obtain the response identifier and the original storage response in the storage response message; A determination module, configured to determine that the storage request is processed normally if the response identifier and the request identifier meet a preset correspondence relationship, and return the original storage response to the computing node.
8. A data storage device, characterized in that, Applied to the smart network card carried on the storage node, the smart network card of the storage node is communicatively connected to the smart network card of the computing node. The device includes: A message request receiving module, configured to receive the storage request message sent by the smart network card of the computing node. The storage request message is obtained by the smart network card of the computing node generating a request identifier for the original storage request and encapsulating the request identifier and the original storage request after receiving the original storage request sent by the computing node; A request decapsulation module, used to decapsulate the storage request message, obtain the original storage request and request identifier in the storage request message, and send the original storage request to the storage node; An original response receiving module, used for receiving an original storage response returned by the storage node in response to the original storage request; A response encapsulation module, used to generate a corresponding response identifier according to the request identifier and encapsulate the response identifier and the original storage response into a storage response message; A response sending module is used to send the storage response message to the smart network card of the computing node to instruct the smart network card of the computing node to decapsulate the storage response message, obtain the response identifier and the original storage response, and determine that the storage request processing is normal when the response identifier and the request identifier meet a preset correspondence, and return the original storage response to the computing node.
9. An intelligent network card, characterized in that, The method comprises a processor and a memory, wherein the memory is used to store a program, and the processor is used to implement the data storage method described in any one of claims 1 to 5, or implement the data storage method described in claim 6 when executing the program.
10. A node device, characterized in that, The smart network card as claimed in claim 9 is mounted therein.