Method of writing data and storage device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU HUAWEI TECH CO LTD
- Filing Date
- 2023-08-31
- Publication Date
- 2026-07-03
Smart Images

Figure CN119536619B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method for writing data and a storage device. Background Technology
[0002] Storage Area Network (SAN) is a block-based storage network architecture that connects host servers to storage controllers via a network. A Logical Disk Unit (LUN) is a series of blocks configured through a shared storage pool within a SAN, presented to the host server as a logical hard drive. The host server partitions and formats these blocks using the storage controller, typically employing a file system, so that data can be stored on the LUN as if it were local hard drive storage. SAN design eliminates single points of failure, thus providing extremely high availability and fault recovery capabilities.
[0003] In storage network architectures such as SAN, data read / write commands are issued by the host server, and the storage controller performs read / write operations based on these commands. Therefore, in the current architecture, taking a write operation as an example, data and write requests need to be sent from the host server's network interface card (NIC) to the storage controller's NIC, and then from the storage controller's NIC to the storage controller's central processing unit (CPU) for processing. The storage software running on the CPU then writes the data to memory and / or hard drive. This process consumes significant CPU resources and data bandwidth, becoming a bottleneck for the storage controller's data write performance, resulting in low data write efficiency. Therefore, improving the data write efficiency of the storage controller in storage network architectures is a pressing technical problem that needs to be solved. Summary of the Invention
[0004] This application provides a method for writing data and a storage controller. By establishing a mapping relationship between the addresses of memory and / or hard disk and the network card in the network card, metadata index information of the data to be written can be directly generated in the network card, and the data can be directly written to the corresponding address in memory and / or hard disk according to the metadata index information. This way, the data to be written does not need to be processed by the CPU of the storage controller, thereby improving the data writing efficiency of the storage controller in the storage network architecture.
[0005] In a first aspect, a method for writing data is provided. The method is applied to a storage device, which includes a network interface card (NIC), a CPU, and a memory. The method includes: the NIC obtaining a write instruction via a network, the write instruction including first data to be written; the NIC generating metadata index information of the first data and sending it to the CPU, the metadata index information describing the address where the first data is written to the memory; the CPU writing the metadata index information to the memory; and the NIC writing the first data to the memory according to the metadata index information.
[0006] Write commands originate from outside the storage controller, such as from a client host.
[0007] Alternatively, the storage device can be a storage controller in a storage area network (SAN); the storage device can also be a storage server in distributed storage; or the storage device can be a standalone storage server.
[0008] Optionally, the memory includes internal memory and external memory. Internal memory includes, but is not limited to, random access memory (RAM) and read-only memory (ROM). External memory includes, but is not limited to, hard disk drive (HDD) and solid-state drive (SSD). External memory is located locally or remotely on the storage device. Local memory is located inside the storage device or connected to the storage device via a bus; remote memory is connected to the storage device via a network or provides storage space to the storage device via the cloud.
[0009] Optionally, the metadata index information includes, but is not limited to, at least one of the following: logical block address (LBA) and logical disk unit identity (LUNID).
[0010] According to the technical solution provided in this application, metadata index information for the data to be written is directly generated in the network interface card (NIC), and the NIC directly writes the data to the corresponding address in memory and / or hard disk based on the metadata index information. This allows the data to be written to be stored without going through the CPU processing of the storage controller after it arrives at the NIC from outside the storage device. Compared with the traditional solution where the storage software on the CPU generates the metadata index information for the data to be written, and both the data to be written and the metadata index information are written to memory by the CPU, this method saves some CPU resources and data bandwidth occupied by the data to be written during the data writing process, thereby improving the data writing efficiency of the storage device in the storage network architecture.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, generating metadata index information for the first data includes: generating metadata index information for the first data based on an address mapping table stored in the network card, wherein the address mapping table is used to indicate addresses in the memory that can be used to write data.
[0012] According to the above technical solution, by storing the addresses of memory and / or hard disk that can be used to write data in the network card in the form of an address mapping table, the mapping relationship between the addresses of memory and / or hard disk and the network card can be stored in the network card for a long time, thereby improving the efficiency of the network card in generating metadata index information.
[0013] In conjunction with the first aspect, in some implementations of the first aspect, the address mapping table includes a mapping relationship between the value of the identifier maintained by the network card and the address of the memory. Based on the address mapping table stored in the network card, metadata index information of the first data is generated, including: assigning a first identifier to the first data; determining the first address to which the first data is written to the memory based on the value of the first identifier and the address mapping table, wherein the address mapping table includes a mapping relationship between the value of the first identifier and the first address; and generating metadata index information based on the first address and the attributes of the first data.
[0014] According to the above technical solution, by storing the mapping relationship between the identifier assigned by the network card to the data to be written and the address of the memory and / or hard disk as an address mapping table in the network card, the network card can quickly determine the address to be written by looking up the table after assigning an identifier to the data to be written, thereby improving the efficiency of the network card in determining the address to be written to the memory.
[0015] In conjunction with the first aspect, before generating metadata index information for the first data based on the address mapping table stored in the network card, the method further includes: the network card acquiring the second data; the network card assigning a second identifier to the second data; the CPU writing the second data to a second address in memory; the network card establishing an address mapping table based on the value of the second identifier and the second address; and after the second address is in an idle state, the method further includes: the CPU sending indication information to the network card, the indication information being used to indicate that the second address is available.
[0016] According to the above technical solution, by first using the software system in the CPU to write data to memory and / or hard disk, and then determining the address mapping table based on the writing result, the mapping relationship between the identifier allocated by the network card for the data to be written and the address of the memory and / or hard disk in the address mapping table is consistent with the method of writing by CPU software. This ensures that the results obtained by writing data directly through the network card and writing data through the CPU are consistent, thereby improving the reliability of the system.
[0017] In conjunction with the first aspect, in some implementations of the first aspect, the CPU includes a first cache module and a second cache module, and writing metadata index information into memory includes: writing metadata index information into the first cache module; writing metadata information from the first cache module into memory; the method further includes: the CPU creating a mirror image of the metadata index information in the second cache module based on the metadata index information in the first cache module.
[0018] According to the above technical solution, since the cache can determine the corresponding data to be written from the network card based on the written metadata index information, when backing up the cache by mirroring, it is only necessary to transfer the metadata index information from the current cache to the cache of the mirror node, so that the mirror node can directly obtain the data to be written from the network card based on the metadata index information, avoiding the CPU resources and data bandwidth occupied by a large amount of data transfer between caches, thereby improving the efficiency of maintaining multiple replicas in the system.
[0019] In conjunction with the first aspect, in some implementations of the first aspect, writing the first data into the memory based on the metadata index information includes: writing the first data into the memory via Remote Direct Data Access (RDMA) based on the metadata index information.
[0020] According to the above technical solution, RDMA technology can directly transfer the data to be written from the network card to the memory and / or hard disk without affecting the operating system of the storage controller. It can improve the efficiency of data transfer from the network card to the memory and / or hard disk without occupying the CPU's processing power.
[0021] In conjunction with the first aspect, in some implementations of the first aspect, writing metadata index information into memory includes: writing metadata index information into memory according to the non-volatile memory standard NVMe.
[0022] According to the above technical solution, accessing flash memory and SSD via the NVMe protocol can improve the performance of CPU accessing memory and / or hard disk, thereby improving the efficiency of the CPU writing metadata index information to memory and / or hard disk.
[0023] In conjunction with the first aspect, in some implementations of the first aspect, before generating the metadata index information of the first data based on the address mapping table stored in the network card, the method further includes: establishing a write-ahead log (WAL) object corresponding to the write instruction, wherein the WAL corresponds to an identifier.
[0024] According to the above technical solution, by establishing and maintaining the WAL object corresponding to the write operation in the network card, all modifications are first written to the log and then applied to the system state, thereby ensuring the atomicity and orderliness of writing data and / or writing metadata index information.
[0025] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the network interface card (NIC) acquiring a read instruction, the read instruction being used to instruct the reading of first data; the NIC acquiring metadata index information of the first data according to the read instruction; and the NIC reading the first data from the memory according to the metadata index information.
[0026] According to the above technical solution, the network card can determine the address of the data to be read in memory and / or hard disk based on the metadata index information of the data to be read written in memory and / or hard disk, thereby directly reading the data to be read through the network card and improving the data reading efficiency of the storage controller.
[0027] In a second aspect, a storage device is provided, comprising a network interface card (NIC), a central processing unit (CPU), and a memory. The NIC is configured to acquire write instructions via a network, the write instructions including first data to be written. The NIC is also configured to generate metadata index information of the first data and send it to the CPU, the metadata index information describing the address at which the first data is written to the memory. The CPU is configured to write the metadata index information to the memory. The NIC is also configured to write the first data to the memory based on the metadata index information.
[0028] Alternatively, the storage device can be a storage controller in a storage area network (SAN); the storage device can also be a storage server in distributed storage; or the storage device can be a standalone storage server.
[0029] Optionally, the memory includes internal memory and external memory. Internal memory includes, but is not limited to, random access memory (RAM) and read-only memory (ROM). External memory includes, but is not limited to, hard disk drive (HDD) and solid-state drive (SSD). External memory is located locally or remotely on the storage device. Local memory is located inside the storage device or connected to the storage device via a bus; remote memory is connected to the storage device via a network or provides storage space to the storage device via the cloud.
[0030] Optionally, the metadata index information includes, but is not limited to, at least one of the following: logical block address (LBA) and logical disk unit identity (LUNID).
[0031] In conjunction with the second aspect, in some implementations of the second aspect, the network interface card (NIC) is used to: generate metadata index information of the first data based on the address mapping table stored in the NIC, wherein the address mapping table is used to indicate addresses in memory that can be used to write data.
[0032] In conjunction with the second aspect, in some implementations of the second aspect, the address mapping table includes a mapping relationship between the value of the identifier maintained by the network card and the address of the memory. The network card is used to: allocate a first identifier to the first data; determine the first address to which the first data is written to the memory according to the value of the first identifier and the address mapping table, wherein the address mapping table includes a mapping relationship between the value of the first identifier and the first address; and generate metadata index information according to the address to which the first data is written to the memory and the attributes of the first data.
[0033] In conjunction with the second aspect, in some implementations of the second aspect, before generating metadata index information for the first data based on the address mapping table stored in the network card, the network card is further configured to: acquire the second data; assign a second identifier to the second data; the CPU is further configured to: write the second data to a second address in memory; the network card is further configured to: establish an address mapping table based on the value of the second identifier and the second address; after the second address is idle, the CPU is further configured to: send indication information to the network card, the indication information being used to indicate that the second address is available.
[0034] In conjunction with the second aspect, in some implementations of the second aspect, the CPU includes a first cache module and a second cache module. The CPU is used to: write metadata index information into the first cache module; write metadata index information from the first cache module into memory; and the CPU is also used to: create a mirror image of the metadata index information in the second cache module based on the metadata index information in the first cache module.
[0035] In conjunction with the second aspect, in some implementations of the second aspect, the network card is used to: write first data into memory via Remote Direct Data Access (RDMA) based on metadata index information.
[0036] In conjunction with the second aspect, in some implementations of the second aspect, the CPU is used to: write metadata index information to memory according to the non-volatile memory standard NVMe.
[0037] In conjunction with the second aspect, in some implementations of the second aspect, before generating the metadata index information of the first data based on the address mapping table stored in the network card, the network card is also used to: establish a write-ahead log (WAL) object corresponding to the write instruction, with the WAL object corresponding to the identifier.
[0038] In conjunction with the second aspect, in some implementations of the second aspect, the network card is also used to: obtain a read instruction, which is used to instruct the reading of first data; obtain metadata index information of the first data according to the read instruction; and read the first data from the memory according to the metadata index information.
[0039] Thirdly, a computing device is provided, including a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call and execute the instructions from the memory, causing the computing device to perform the method of the first aspect or any possible implementation thereof.
[0040] Optionally, the processor can be a general-purpose processor, which can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc.; when implemented in software, the processor can be a general-purpose processor that reads software code stored in memory, which can be integrated into the processor or exist independently outside the processor.
[0041] Fourthly, a chip is provided that acquires and executes instructions to implement the method in the first aspect or any possible implementation of the first aspect.
[0042] Optionally, as one implementation, the chip includes a processor and a data interface, through which the processor reads instructions stored in the memory and executes the method in the first aspect or any possible implementation of the first aspect.
[0043] Optionally, as one implementation, the chip may further include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to perform the method in the first aspect or any possible implementation of the first aspect.
[0044] Fifthly, a computer program product containing instructions is provided, which, when executed by a computing device, causes the computing device to perform the method described in the first aspect or any possible implementation thereof.
[0045] In a sixth aspect, a computer-readable storage medium is provided, including computer program instructions that, when executed by a computing device, cause the computing device to perform the method described in the first aspect or any possible implementation thereof.
[0046] As examples, these computer-readable storage media include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), flash memory, electrically EPROM (EEPROM), and hard drive.
[0047] Alternatively, as one implementation method, the aforementioned storage medium can specifically be a non-volatile storage medium. Attached Figure Description
[0048] Figure 1 This is a schematic structural diagram of a storage network used in an embodiment of this application.
[0049] Figure 2 This is a schematic flowchart illustrating a method for writing data provided in an embodiment of this application.
[0050] Figure 3 This is a schematic flowchart illustrating how data to be written is written to memory via the CPU of a storage device in a traditional approach.
[0051] Figure 4 This is a schematic flowchart illustrating how data to be written is directly written to a memory via the network card of a storage device, according to an embodiment of this application.
[0052] Figure 5 This is a schematic flowchart illustrating how data to be written is written to memory via the network card of a storage device, according to an embodiment of this application.
[0053] Figure 6 This is a schematic flowchart illustrating how data to be written is written to a hard disk via the network card of a storage device, according to an embodiment of this application.
[0054] Figure 7 This is a schematic structural block diagram of a data writing device provided in an embodiment of this application.
[0055] Figure 8 This is a schematic structural block diagram of a computing device provided in an embodiment of this application. Detailed Implementation
[0056] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0057] This application will present various aspects, embodiments, or features relating to systems comprising multiple devices, components, modules, etc. It should be understood and appreciated that individual systems may include additional devices, components, modules, etc., and / or may not include all devices, components, modules, etc. discussed in conjunction with the accompanying drawings. Furthermore, combinations of these approaches are also possible.
[0058] Furthermore, in the embodiments of this application, the words "exemplary," "for example," etc., are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the term "exemplary" is intended to present the concept in a concrete manner.
[0059] In the embodiments of this application, "corresponding" and "corresponding" can sometimes be used interchangeably. It should be noted that when the distinction is not emphasized, their intended meanings are consistent.
[0060] The network architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0061] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0062] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0063] To facilitate understanding, the relevant terms and concepts that may be involved in the embodiments of this application will be introduced below.
[0064] 1. Storage Area Network (SAN): SAN is a block-based storage system that uses a high-speed architecture to connect servers to their logical disk units (LUNs). A LUN is a series of blocks configured through a shared storage pool, presented to the server as a logical hard drive. The server partitions and formats these blocks, typically using a file system, so that data can be stored on the LUN as if it were local hard drive storage. SAN design eliminates single points of failure, thus providing extremely high availability and fault recovery capabilities. SAN is the most commonly used storage network architecture for enterprises, characterized by low latency, high bandwidth, and high reliability. Critical enterprise applications such as databases and virtual machines often use this type of storage. The development trend of SAN is towards all-flash storage SANs, using flash memory and solid-state drives (SSDs) instead of hard disk drives (HDDs) for hard disks, thereby providing superior performance, stable and consistent low latency, lower power consumption, and lower total cost.
[0065] 2. Nonvolatile Memory Express (NVMe): NVMe is a new storage access and transfer protocol for flash memory and next-generation SSDs, providing the highest throughput and fastest response times for all types of enterprise workloads. Because NVMe is designed specifically for SSD performance, it offers significant performance advantages over traditional protocols such as Serial Attached Small Computer System Interface (SAS) and Serial Advanced Technology Attachment (SATA) for accessing SSDs, and is gradually becoming the mainstream protocol.
[0066] 3. Network-based NVMe (NVMe over Fabric, NoF): NoF technology is an application of the NVMe protocol in SANs. NVMe is a protocol that runs on storage devices, but SANs involve not only individual storage devices but also storage networks composed of multiple storage devices, as well as data read and write operations between servers and the storage network. Therefore, NoF technology uses network-based NVMe to facilitate data transmission between servers and the storage network. NoF has developed different technical approaches for implementing NVMe using different transport layer protocols, such as NVMe over FC using Fibre Channel (FC), NVMe over TCP using Transmission Control Protocol (TCP), and NVMe over RDMA using Remote Direct Memory Access (RDMA). Among these, the currently popular NVMe over RoCE using RDMA over Converged Ethernet (RoCE) is a type of NVMe over RDMA.
[0067] 4. Remote Direct Memory Access (RDMA): RDMA is a technology developed to address the latency of server-side data processing during network transmission. RDMA allows user-space applications to directly read from or write to remote memory over the network without operating system intervention. Therefore, there is no kernel intervention or memory copying, saving significant CPU resources, increasing system throughput, and reducing network communication latency.
[0068] The RDMA process is as follows: (1) When an application executes an RDMA read or write request, no data copying is performed. Without the need for any kernel memory involvement, the RDMA request is sent from the application running in user space to the local network interface card (NIC); (2) The local NIC reads the information from the local memory and transmits it to the remote NIC over the network. The transmitted information includes the target virtual address, the memory key, and the data itself; (3) After confirming the memory key, the remote NIC directly writes the data to the location in the remote memory indicated by the virtual address. Therefore, RDMA technology provides a way for a network card to directly read and write to memory.
[0069] 5. Write-ahead Logging (WAL): WAL was originally a series of technologies in database systems to provide atomicity and persistence of data. In systems using WAL, all modifications are first written to the log and then applied to the system state.
[0070] Storage network architectures, exemplified by SANs, connect host servers and storage controllers via a network. Read and write commands are issued by the host server, and the storage controller performs read and write operations based on these commands. Therefore, read and write commands are first sent from the host server's network interface card (NIC) to the storage controller's NIC. In existing storage network architectures (such as SANs), the read and write commands reaching the storage controller's NIC need to be executed by storage software running on the storage controller's CPU. Taking a write operation as an example, the data to be written and the write request need to be sent from the host server's NIC to the storage controller's NIC via the network, and then from the storage controller's NIC to the storage controller's CPU for processing. The storage software running on the CPU then writes the data to memory and / or hard drive. This process consumes significant CPU resources and data bandwidth, becoming a bottleneck for the storage controller's data write performance, resulting in low data write efficiency. Therefore, improving the data write efficiency of the storage controller in storage network architectures is a pressing technical problem that needs to be solved.
[0071] In view of this, embodiments of this application provide a method and apparatus for writing data. By establishing a mapping relationship between the addresses of memory and / or hard disk and the network card in the network card, the metadata index information of the data to be written can be directly determined in the network card, and the data can be directly written to the corresponding address in memory and / or hard disk according to the metadata index information. This makes the data to be written not need to be processed by the CPU of the storage controller, thereby improving the data writing efficiency of the storage controller in the storage network architecture.
[0072] Figure 1 A schematic block diagram of a storage network used in an embodiment of this application is shown. Figure 1 As shown, the SAN includes at least one host server 110 and multiple storage controllers 120. The network interface card (NIC) 111 of the host server 110 and the NIC 121 of the storage controllers 120 are connected via a network. Optionally, NICs 111 and 121 can exchange information based on NoF (NoF) or other protocols; this application does not specifically limit this. The host server 110 is responsible for generating data read / write commands and sending them through NIC 111. The storage controllers 120 receive the data read / write commands through NIC 121 and complete the data read / write operations.
[0073] Specifically, the network interface card 121 of the storage controller 120 is responsible for parsing NVMe protocol messages to extract specific data write operations from the received write instructions; the network interface card 121 is also responsible for data routing to extract the data to be written from the received write instructions.
[0074] The storage controller 120 also includes a CPU 122. The CPU 122 runs storage software used to write metadata index information of the data to be written to the storage controller 120's memory, and also to write the data to be written to the memory. The storage software includes, but is not limited to: a NoF driver, a block module, a cache module, and an index module. The NoF driver is responsible for the interaction between the network interface card 121 and the block in the CPU, including requesting pages, obtaining read / write commands, and preparing data. The block is responsible for processing logical disk unit (LUN) semantics, including issuing read / write commands to the cache based on the logical block address (LBA). The cache is responsible for writing data to internal memory and initiating requests to write data to external memory, issuing these requests to the index. The index is responsible for managing external memory resources and writing data to external memory according to requests issued by the cache. It should be understood that the data described above refers to the data written to memory by the CPU 122, and therefore can refer to different content in different scenarios. For example, when writing metadata index information, "data" can refer to the metadata index information; when writing data to be written, "data" can refer to the data to be written.
[0075] The storage controller 120 also includes a memory. Optionally, the memory includes internal memory and external memory. Internal memory includes, but is not limited to, random access memory (RAM) and read-only memory (ROM), such as... Figure 1The double data rate synchronous dynamic random access memory (DDR) 123 shown is an example. External storage includes, but is not limited to, hard disk drives (HDDs) and solid-state drives (SSDs), which are connected to the storage controller 120 via an interface card, for example... Figure 1 The SSD 124 shown is an example. It should be understood that in other possible implementations, internal memory may also be referred to simply as RAM, and external memory may also be referred to simply as hard disk. Therefore, the terms RAM and / or hard disk appearing below or in other technical solutions can be terms that have the same meaning as internal memory and / or external memory.
[0076] Figure 2 A schematic flowchart illustrating a method for writing data according to an embodiment of this application is shown. Optionally, this method can be executed by a storage device in a storage network architecture, including but not limited to a storage controller in a SAN, a storage server in distributed storage, a standalone storage server, etc. For example, the method can be performed by... Figure 1 The storage controller 120 shown performs this action. Figure 2 As shown, the method includes the following steps.
[0077] S210: The network card obtains write commands through the network.
[0078] For example, in step S210, the network interface card 121 of the storage controller 120 can obtain a write command. Specifically, the write command includes a write data request and first data, where the first data is data to be written to the memory, and the write data request instructs the storage controller 120 to write the first data to its memory. The write command may be generated by the host server 110 in the SAN and sent to the network interface card 121 of the storage controller 120 via the host server 110's network interface card 111.
[0079] S220: The network card generates metadata index information for the first data and sends it to the CPU.
[0080] For example, in step S220, the network interface card (NIC) 121 can determine the physical address of the memory and / or hard disk where the first data to be written will be written, based on the mapping relationship between the NIC 121 and the physical addresses of the memory and / or hard disk. Thus, the physical address of the first data written to the memory can be determined within the NIC. Furthermore, the NIC 121 can also generate metadata index information for the first data. This metadata index information describes the attributes of the first data, including but not limited to the physical address of the first data written to the memory, such as the logical block address (LBA) and logical disk unit identity (LUNID), thereby facilitating the retrieval of the first data from the memory based on the metadata index information after the first data has been written.
[0081] Specifically, the network interface card 121 can divide the storage space of the memory managed by the storage controller 120 into N smallest storage units. Each of the N storage units can be mapped to a different physical address in the memory, where N is a positive integer greater than or equal to 1. The network interface card 121 can record the usage of these N storage units. When a new write command is received, the network interface card 121 can allocate M storage units from the currently unused storage units among the N storage units to store the data to be written, based on the size of the data to be written, where M is a positive integer less than or equal to N and greater than or equal to 1. Therefore, the network interface card 121 can determine the address in the memory where the data to be written is written based on the physical addresses mapped to the M storage units.
[0082] Optionally, for each write command received, the network interface card 121 can also create a corresponding Write Allocation (WAL) object to distinguish each data write operation performed by the network interface card 121. By creating and maintaining the WAL object corresponding to the write operation in the network interface card, due to the write-ahead nature of WAL, all modifications are first written to the log and then applied to the system state, thereby ensuring the atomicity and orderliness of writing data and / or writing metadata index information.
[0083] In some possible implementations, the network interface card 121 stores an address mapping table, which indicates addresses in memory available for writing data. Specifically, the address mapping table may include a mapping relationship between identifier values and physical addresses in the memory. In this case, after receiving a write command, the network interface card 121 first assigns an identifier to the first data to be written, then determines the address in the memory to be written to based on the mapping relationship between the identifier values and physical addresses in the address mapping table, and generates metadata index information based on the address of the first data and the attributes of the first data. Optionally, the identifier may be in the form of an offset value. Specifically, the offset identifies the number of memory units that have been used out of the N memory units corresponding to the memory storage space. If the number of memory units required for the data to be written is M, then M is added to the current offset value as the new offset value. It should be understood that when the data stored in the memory unit is released, the network interface card 121 can allocate the offset value corresponding to that memory unit to other data to be written.
[0084] For example, assuming the memory has 10 storage units, the offset value in the address mapping table can be 0 to 9, mapping the physical addresses of the 1st to 10th storage units respectively. If the current offset value is 2, it means the physical addresses corresponding to the first two storage units are already occupied. If the first data needs to occupy 3 storage units, the offset value becomes 2 + 3 = 5. Simultaneously, the network card 121 queries the address mapping table, and the physical addresses corresponding to offset values of 2 to 4 are used as the addresses for writing the first data into the memory, indicating that the first data uses the physical addresses corresponding to the 3rd to 5th storage units.
[0085] The above scheme stores the mapping relationship between the identifier assigned by the network card to the data to be written and the address of the memory and / or hard disk as an address mapping table in the network card. This allows the network card to quickly determine the address to be written by looking up the table after assigning an identifier to the data to be written, thereby improving the efficiency of the network card in determining the address to be written to the memory.
[0086] Optionally, before the address mapping table is established, or if the identifier assigned to the data to be written cannot be found in the address mapping table, i.e., the mapping relationship between all or part of the memory addresses and the network card 121 has not yet been established, the storage controller 120 can first write the data to the memory through the CPU 122, thereby establishing the mapping relationship between the physical addresses of the network card 121 and the memory. Specifically, the network card 121 can obtain the second data and assign an identifier to the second data; after the CPU 122 writes the second data to the memory, the network card 121 establishes or updates the address mapping table according to the value of the identifier and the physical address of the second data written to the memory.
[0087] Optionally, the CPU 122 can also determine the storage status of data in the memory. After the second address is in an idle state, the CPU 122 can send an indication message to the network card 121, which indicates that the second address is available. The second address being in an idle state means that there is currently no data stored at that physical address in the memory, and therefore it can be used to write new data to that address. After receiving the indication message sent by the CPU 122, the network card 121 can reassign the identifier corresponding to the address indicated by the indication message to other data to be written.
[0088] The above scheme first uses the software system in the CPU to write data to memory and / or hard disk. Based on the writing result, the address mapping table is determined so that the mapping relationship between the identifier assigned by the network card to the data to be written and the address of the memory and / or hard disk in the address mapping table is consistent with the method of writing by CPU software. This makes the results obtained by writing data directly through the network card consistent with the results obtained by writing data through the CPU, thereby improving the reliability of the system.
[0089] It should be understood that the above solution only provides a method that enables compatibility between writing data via the CPU and writing data around the CPU, but it does not limit the mapping relationship between memory addresses and network cards to be established only based on the results of data writing by CPU software. For example, if it is not necessary to consider writing data to be written via CPU software, the mapping relationship can also be established in other ways, such as being preset manually. This application does not specifically limit this.
[0090] S230: The CPU writes metadata index information into memory.
[0091] For example, in step S230, CPU 122 can write the metadata index information generated by the network card in S220 to the memory. Optionally, CPU 122 can write the metadata index information to the memory according to the NVMe protocol. Specifically, the NoF driver running on CPU 122 obtains the metadata index information from the network card 121 and sends it to the block. The block organizes the metadata index information and sends it to the cache. The cache writes it to memory and initiates a request to write to the hard disk. The index writes the metadata index information to the hard disk according to the request to write to the hard disk.
[0092] S240: The network card writes the first data into the memory based on the metadata index information.
[0093] For example, in step S240, network card 121 can directly write the first data to be written to memory according to the metadata index information generated by the network card in S220. Optionally, network card 121 can write the first data to memory using RDMA. The following will refer to the appendix... Figures 3 to 6 The process of writing the first data and metadata index information into the storage will not be elaborated here.
[0094] Figure 3 This diagram illustrates a schematic flowchart of how data to be written is written to memory via the CPU of a storage device in a traditional manner. Figure 3 As shown, the network interface card (NIC) on the storage management device side receives protocol messages sent by the host server and parses them to obtain write commands. The NoF driver running on the CPU obtains the write command from the NIC and prepares the data to be written based on the write data request in the write command. The NoF driver sends the write data request and the data to be written to the block running on the CPU, and the block generates the index information required to write the data to be written to memory. The block sends the generated index information and the data to be written together to the cache running on the CPU, so that the cache writes the data to be written to the memory of the storage device according to the index information.
[0095] Optionally, the cache can also back up the data after writing it to memory. For example... Figure 3 As shown, the cache can organize the data to be written into a log format and write it to the linear space. Then, it can create copies of the data to be written in the caches of other nodes, which are called mirrors of the data to be written. These other nodes used to create the mirror can be called mirror nodes. When the currently working node fails, the services issued by the host server can be taken over by the mirror nodes, thereby ensuring uninterrupted service and providing disaster recovery capabilities for the system.
[0096] The above steps describe the process of writing the data to be written to internal storage such as RAM. Afterwards, the storage device can also write the data to external storage such as a hard disk. Figure 3 As shown, the cache assembles the data to be written in memory in a specific format through a background process. After being triggered by mechanisms such as buffer watermarks, it sends a write data request and the data to be written to the index running on the CPU. The index generates the metadata information required to write the data to be written to the hard disk based on the write data request, and writes the data to be written to the hard disk of the storage device based on the metadata information.
[0097] It should be understood that, in addition to providing mirroring and disaster recovery capabilities for the current working nodes, mirror nodes can also function as normal working nodes responsible for handling other business operations. Figure 3 Taking the scenario shown as an example, the data to be written 1 is written to memory 1 and hard disk 1 through node 1, and a mirror of the data to be written 1 is created in node 2. However, node 2 itself can also be used to receive other data to be written 2 and write the data to be written 2 to memory 2 and hard disk 2. The specific writing process can be referred to the workflow of node 1 mentioned above, and will not be repeated here.
[0098] Figure 4 This illustration shows a schematic flowchart of an embodiment of the present application, showing how data to be written is directly written to a memory via the network card of a storage device. Figure 3 The difference between the methods shown is that, Figure 4 After receiving protocol messages from the host server and parsing them to obtain write commands, the network interface card (NIC) of the storage device generates metadata index information for writing the data to be written to memory and hard disk. The data to be written and the metadata index information are written to memory and hard disk respectively through different paths. The metadata index information is still written to memory via the CPU, while the data to be written is written directly to memory via the NIC. The process of writing the metadata index information to memory and hard disk via the CPU is similar to... Figure 3 The process of writing data to memory and hard drive is the same, only the data content and amount differ. For details, please refer to [link / reference needed]. Figure 3 The corresponding descriptions in the text, or the previous descriptions of step S230, will not be repeated here. The following will combine... Figure 5 and Figure 6 This section details the process of writing the data to be written to memory and hard drive.
[0099] Figure 5 This illustration shows a schematic flowchart of how data to be written is written to memory via the network card of a storage device, according to an embodiment of this application. Figure 5As shown, the network interface card (NIC) of the storage device is responsible for allocating offset values 0 to N as identifiers for the data to be written, thereby generating metadata index information (meta) corresponding to the data to be written based on the mapping relationship. The NIC also establishes and maintains a Write-Ahead Log (WAL) object based on the write command to ensure the atomicity and ordering of the write operation. The metadata index information is processed by the CPU through blocks and cache, and then written to memory in the form of a metadata index information log (meta log). The data to be written in the NIC is directly written to memory in the form of a data log via one-way RDMA, based on the meta log, through an append-only write method. Here, data log values 1 to N correspond to offset values 1 to N allocated to the data to be written, respectively. Writing the data to be written directly to memory via the NIC saves CPU resources and data bandwidth compared to writing via the CPU.
[0100] It should be understood that one-sided RDMA refers to the application of a portion of RDMA technology in this scenario, where data is directly written to memory via the network interface card (NIC). As mentioned earlier, complete RDMA technology involves an application in the application space of one computing device sending instructions to the NIC of another computing device via the NIC of that computing device, and then directly accessing the memory of that other computing device via the NIC of that other computing device. The one-sided RDMA in this application only requires enabling the NIC of the storage device to directly access the memory of that storage device; more specifically, the NIC of the storage device directly writes data to the memory and hard disk of the storage device. Therefore, this step only involves a portion of the technology in the complete RDMA process, hence the name one-sided RDMA. One-sided RDMA utilizes RDMA technology to enable the NIC to directly write data to memory and hard disk, which is only one means of implementing step S240 in the data writing method provided in this application embodiment. However, this application is not limited to this; other technologies that enable the NIC to directly write data to memory can also be used to implement step S240, and this application will not specify them.
[0101] Optionally, after writing the metadata index information to memory in the form of a meta log, the cache can also create a mirror of the metadata index information on the mirror node. Specifically, the CPU can include a first cache module and a second cache module. After the CPU writes the metadata index information to the first cache module and writes the metadata information from the first cache module to the main memory, the CPU can also create a mirror of the metadata index information in the second cache module based on the metadata index information in the first cache module. Since the cache can determine the corresponding data to be written from the network card based on the written metadata index information, when backing up the cache through mirroring, it is only necessary to transfer the metadata index information from the current cache to the cache of the mirror node. Compared with the traditional solution of creating a mirror of the complete data to be written, the above solution avoids the CPU resources and data bandwidth occupied by large-scale data transfer between caches while maintaining the operation of multiple replicas within the system, thereby further saving CPU resources and data bandwidth while ensuring system disaster recovery capabilities.
[0102] Figure 6 This illustration shows a schematic flowchart of how data to be written is written to a hard disk via the network card of a storage device, according to an embodiment of this application. Figure 6 As shown, the meta log in memory is written to the hard drive of the storage device via the index module in the CPU. Data to be written in the network card is directly written to the corresponding physical address of the hard drive via one-way RDMA, based on the address indicated by the meta log being written to the hard drive. Similarly, writing data directly to the hard drive via the network card saves CPU resources and data bandwidth compared to writing via the CPU.
[0103] In summary, the technical solution of this application establishes a mapping relationship between memory and / or hard disk addresses and the network card in the network card of the storage device. This allows for the direct generation of metadata index information for the data to be written within the network card, and the direct writing of data to the corresponding addresses in memory and / or hard disk based on the metadata index information. This eliminates the need for the storage device's CPU to process the data to be written. Compared to traditional solutions where storage software on the CPU generates the metadata index information for the data to be written, and both the data to be written and the metadata index information are written to memory via the CPU, this approach saves some CPU resources and data bandwidth occupied by the data to be written during the writing process, thereby improving the data writing efficiency of the storage device in the storage network architecture.
[0104] Since the metadata index information generated by the network card in this embodiment can indicate the address where data is written to memory, in some possible implementations, the network card can also directly read the corresponding data from memory based on the acquired read instruction and the metadata index information stored in memory. Specifically, after writing the first data to memory, the above method may further include: the network card acquiring a read instruction, which indicates that the first data should be read; the network card acquiring the metadata index information of the first data based on the read instruction; and the network card reading the first data from memory based on the metadata index information. Through the above scheme, the network card can determine the address of the data to be read in memory and / or hard disk based on the metadata index information of the data to be read written to memory and / or hard disk, thereby directly reading the data to be read through the network card and improving the data reading efficiency of the storage device.
[0105] Furthermore, in some possible implementations, the network interface card (NIC) and the memory performing the above method can be located in different devices. That is, the host server's NIC generates metadata index information and writes the data directly to the storage device's memory. For example, an address mapping table can be stored in the host server's NIC. When the host server generates a write command and it reaches the host server's NIC, the host server's NIC can generate metadata information for the data to be written based on the address mapping table. The metadata information can still be sent via the traditional path—from the host server's NIC to the storage device's NIC and then written to memory by the storage device's CPU. However, based on technologies such as RDMA, the data to be written can be directly written from the host server's NIC to the storage device's memory based on the metadata index information, thereby reducing data exchange between NICs and further improving the efficiency of writing data.
[0106] The above text combined Figures 2 to 6 This application provides an embodiment of the method for writing data, which is illustrated below. Figures 7 to 8 The embodiments of the data writing device provided in this application will be described.
[0107] This application provides a storage device including a network interface card (NIC), a CPU, and a memory. The NIC is used to obtain a write command via a network, the write command including first data to be written; the NIC is also used to generate metadata index information of the first data and send it to the CPU, the metadata index information describing the attributes of the first data and the address where the first data is written to the memory; the CPU is used to write the metadata index information to the memory; the NIC is also used to write the first data to the memory according to the metadata index information.
[0108] Figure 7This diagram illustrates a schematic structural block diagram of a data writing device 700 provided in an embodiment of this application. The device 700 is disposed in a storage device within a storage network architecture, including but not limited to a storage controller in a SAN, a storage server in distributed storage, or a standalone storage server. The storage device includes a network interface card (NIC), a CPU, and memory.
[0109] Optionally, the memory includes internal memory and external memory. Internal memory includes, but is not limited to, random access memory (RAM) and read-only memory (ROM). External memory includes, but is not limited to, hard disk drive (HDD) and solid state drive (SSD).
[0110] like Figure 7 As shown, the device 700 includes: an acquisition module 710 disposed on the network card, a generation module 720 disposed on the network card, a first writing module 730 disposed on the CPU, and a second writing module 740 disposed on the network card.
[0111] Specifically, the acquisition module 710 is used to acquire a write instruction, which includes the first data to be written.
[0112] Optionally, the acquisition module 710 is further configured to establish a write-ahead log (WAL) object corresponding to the write instruction based on the write instruction, wherein the WAL object corresponds to an identifier.
[0113] Specifically, the generation module 720 is used to generate metadata index information for the first data, which describes the attributes of the first data and the address where the first data is written to the memory.
[0114] Optionally, the metadata index information includes, but is not limited to, at least one of the following: logical block address (LBA) and logical disk unit identity (LUNID).
[0115] Optionally, the generation module 720 is specifically used to generate metadata index information of the first data according to the address mapping table stored in the network card, wherein the address mapping table is used to indicate the address in the memory that can be used to write data.
[0116] Optionally, the address mapping table includes a mapping relationship between the value of the identifier maintained by the network card and the address of the memory. The generation module 720 is specifically used to allocate a first identifier to the first data; determine the first address of the first data to be written to the memory according to the value of the first identifier and the address mapping table, wherein the address mapping table includes a mapping relationship between the value of the first identifier and the first address; and generate metadata index information according to the address of the first data to be written to the memory and the attributes of the first data.
[0117] Specifically, the first write module 730 is used to write metadata index information into the memory.
[0118] Optionally, the first write module 730 is specifically used to write metadata index information to the storage according to the non-volatile memory standard NVMe.
[0119] Specifically, the second writing module 740 is used to write the first data into the memory based on the metadata index information.
[0120] Optionally, the second write module 740 is specifically used to write the first data into the memory via Remote Direct Data Access (RDMA) based on the metadata index information.
[0121] Optionally, before generating the metadata index information of the first data according to the address mapping table stored in the network card, the acquisition module 710 is further configured to acquire the second data; the generation module 720 is further configured to assign a second identifier to the second data; the first writing module 730 is further configured to write the second data to a second address in the memory; the generation module 720 is further configured to establish an address mapping table according to the value of the second identifier and the second address; after the second address is in an idle state, the first writing module 730 is further configured to: send indication information to the network card, the indication information being used to indicate that the second address is available.
[0122] Optionally, the CPU includes a first cache module and a second cache module. The first write module 730 is specifically used to write metadata index information into the first cache module; write metadata information from the first cache module into memory; and the first write module 730 is also used to create a mirror image of the metadata index information in the second cache module based on the metadata index information in the first cache module.
[0123] Optionally, the network card can also be used to obtain read instructions, which are used to instruct the reading of first data; according to the read instructions, obtain the metadata index information of the first data; and according to the metadata index information, read the first data from the memory.
[0124] All of the above modules can be implemented in software or hardware. For example, the implementation of generation module 720 will be described below. Similarly, the implementation of acquisition module 710, first writing module 730, and second writing module 740 can refer to the implementation of generation module 720.
[0125] As an example of a software functional unit, the generation module 720 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Further, the aforementioned computing instance may be one or more. For example, the generation module 720 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0126] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0127] As an example of a hardware functional unit, the generation module 720 may include at least one computing device, such as a server. Alternatively, the generation module 720 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0128] The multiple computing devices included in the generation module 720 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the generation module 720 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the generation module 720 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0129] It should be noted that, in other embodiments, the acquisition module 710, generation module 720, first writing module 730, and second writing module 740 can be used to execute any step in the above-described data writing method. The steps implemented by the acquisition module 710, generation module 720, first writing module 730, and second writing module 740 can be specified as needed. By implementing different steps in the above-described data writing method through the acquisition module 710, generation module 720, first writing module 730, and second writing module 740, all functions of the device 700 can be realized.
[0130] This application also provides a computing device 100. For example... Figure 8 As shown, the computing device 100 includes a bus 102, a processor 104, a memory 106, and a communication interface 108. The processor 104, the memory 106, and the communication interface 108 communicate with each other via the bus 102. The computing device 100 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 100.
[0131] Bus 102 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 8 The bus 102 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 102 may include a path for transmitting information between various components of the computing device 100 (e.g., memory 106, processor 104, communication interface 108).
[0132] The processor 104 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0133] Memory 106 may include volatile memory, such as random access memory (RAM). Memory 106 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0134] The memory 106 stores executable program code, and the processor 104 executes the executable program code to implement the functions of the aforementioned acquisition module, generation module, first writing module, and second writing module, thereby implementing the aforementioned data writing method. That is, the memory 106 stores instructions for executing the aforementioned data writing method.
[0135] The communication interface 108 uses a command distribution module, such as, but not limited to, a network interface card or a transceiver, to enable communication between the computing device 100 and other devices or communication networks.
[0136] This application also provides a chip, which includes a processor and a data interface. The processor reads instructions stored in the memory through the data interface to execute the above-described method of writing data.
[0137] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to perform the above-described method of writing data.
[0138] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform the aforementioned management. The various technical features can be combined in any way. For the sake of brevity, not all possible combinations of the various technical features in the above embodiments are described; however, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0139] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application.
Claims
1. A method for writing data, characterized in that, The method is applied to a storage device, the storage device including a network interface card (NIC), a central processing unit (CPU), and a memory, and the method includes: The network card obtains a write command through the network, and the write command includes first data to be written; The network card generates metadata index information for the first data and sends it to the CPU. The metadata index information is used to describe the address where the first data is written to the memory. The CPU writes the metadata index information into the memory; The network interface card writes the first data into the memory according to the metadata index information; Before generating the metadata index information of the first data, the method further includes: The network card acquires the second data; The network interface card assigns a second identifier to the second data; The CPU writes the second data to the second address of the memory; The network interface card (NIC) establishes or updates an address mapping table stored in the NIC based on the value of the second identifier and the second address, wherein the address mapping table is used to indicate addresses in the memory that can be used to write data.
2. The method according to claim 1, characterized in that, The metadata index information for generating the first data includes: Based on the address mapping table, the metadata index information of the first data is generated.
3. The method according to claim 2, characterized in that, The address mapping table includes the mapping relationship between the identifier value maintained by the network card and the address of the memory. Generating metadata index information for the first data based on the address mapping table stored in the network card includes: Assign a first identifier to the first data; Based on the value of the first identifier and the address mapping table, the first address where the first data is written to the memory is determined, wherein the address mapping table includes the mapping relationship between the value of the first identifier and the first address; The metadata index information is generated based on the attributes of the first address and the first data.
4. The method according to claim 3, characterized in that, After the second address is in an idle state, the method further includes: The CPU sends an indication message to the network card, the indication message being used to indicate that the second address is available.
5. The method according to any one of claims 1 to 4, characterized in that, The step of writing the first data into the memory according to the metadata index information includes: Based on the metadata index information, the first data is written to the memory via Remote Direct Data Access (RDMA).
6. The method according to any one of claims 1 to 4, characterized in that, The step of writing the metadata index information into the memory includes: The metadata index information is written to the memory according to the non-volatile memory standard NVMe.
7. The method according to any one of claims 1 to 4, characterized in that, Before generating the metadata index information of the first data based on the address mapping table stored in the network interface card, the method further includes: Based on the write instruction, a write-ahead log (WAL) object corresponding to the write instruction is created, and the WAL object corresponds to an identifier.
8. The method according to any one of claims 1 to 4, characterized in that, The metadata index information includes at least one of the following: Logical Block Address (LBA) and Logical Disk Unit Identifier (LUNID).
9. The method according to any one of claims 1 to 4, characterized in that, The method further includes: The network card acquires a read command, which is used to instruct the reading of the first data; The network interface card (NIC) obtains the metadata index information of the first data according to the read command; The network interface card reads the first data from the memory based on the metadata index information.
10. A storage device, characterized in that, The storage device includes a network interface card (NIC), a central processing unit (CPU), and a memory. The network card is used to obtain write instructions through the network, the write instructions including first data to be written; The network interface card is also used to generate metadata index information of the first data and send it to the CPU, wherein the metadata index information is used to describe the address where the first data is written to the memory; The CPU is used to write the metadata index information into the memory; The network interface card is also used to write the first data into the memory according to the metadata index information; Before generating the metadata index information of the first data, the network interface card is also used for: Obtain the second data; Assign a second identifier to the second data; The CPU is also configured to write the second data to a second address of the memory; The network interface card is further configured to establish or update an address mapping table stored in the network interface card based on the value of the second identifier and the second address, wherein the address mapping table is used to indicate addresses in the memory that can be used to write data.
11. The storage device according to claim 10, characterized in that, The network interface card is used for: Based on the address mapping table, the metadata index information of the first data is generated.
12. The storage device according to claim 11, characterized in that, The address mapping table includes the mapping relationship between the identifier value maintained by the network card and the address of the memory. The network card is used for: Assign a first identifier to the first data; Based on the value of the first identifier and the address mapping table, the first address where the first data is written to the memory is determined, wherein the address mapping table includes the mapping relationship between the value of the first identifier and the first address; The metadata index information is generated based on the address where the first data is written to the memory and the attributes of the first data.
13. The storage device according to claim 12, characterized in that, After the second address is in an idle state, the CPU is also used to: Send an indication message to the network card, the indication message being used to indicate that the second address is available.
14. The storage device according to any one of claims 10 to 13, characterized in that, The network interface card is used for: Based on the metadata index information, the first data is written to the memory via Remote Direct Data Access (RDMA).
15. The storage device according to any one of claims 10 to 13, characterized in that, The CPU is used for: The metadata index information is written to the memory according to the non-volatile memory standard NVMe.
16. The storage device according to any one of claims 10 to 13, characterized in that, Before generating the metadata index information of the first data based on the address mapping table stored in the network interface card (NIC), the NIC is also used for: Based on the write instruction, a write-ahead log (WAL) object corresponding to the write instruction is created, and the WAL object corresponds to an identifier.
17. The storage device according to any one of claims 10 to 13, characterized in that, The metadata index information includes at least one of the following: Logical Block Address (LBA) and Logical Disk Unit Identifier (LUNID).
18. The storage device according to any one of claims 10 to 13, characterized in that, The network interface card is also used for: Obtain a read instruction, the read instruction being used to instruct the reading of the first data; According to the read instruction, obtain the metadata index information of the first data; The first data is read from the memory based on the metadata index information.
19. A computing device, characterized in that, It includes a processor and a memory, the processor being configured to execute instructions stored in the memory to cause the computing device to perform the method as described in any one of claims 1 to 9.
20. A computer-readable storage medium, characterized in that, It includes computer program instructions that, when executed by a computing device, cause the computing device to perform the method as described in any one of claims 1 to 9.